diff --git a/html/ajax_todo_list.php b/html/ajax_todo_list.php index df23aa5c1..0dd7e2070 100644 --- a/html/ajax_todo_list.php +++ b/html/ajax_todo_list.php @@ -131,9 +131,9 @@ if ($ac == 'save') //////////////////////////////////////////////////////////////////////////////// if ($ac=='shared_note') { - $id=HtmlInput::default_value_get("todo_id", 0); + $id=HtmlInput::default_value_get("todo_id", -1); // If note_id is not correct then give an error - if ($id==0||isNumber($id)==0) + if ($id==-1||isNumber($id)==0) { header('Content-type: text/xml; charset=UTF-8'); $dom=new DOMDocument('1.0', 'UTF-8'); @@ -142,6 +142,26 @@ if ($ac=='shared_note') echo $dom->saveXML(); return; } + if ($id==0) + { + ob_start(); + echo HtmlInput::title_box(_('Liste utilisateurs'), "shared_{$id}"); + echo '

'; + echo _("Vous devez d'abord sauver"); + echo '

'; + echo '

'; + echo HtmlInput::submit('close'.$id, 'Ferme'," onclick=\"\$('shared_{$id}').remove();\""); + echo '

'; + $result=ob_get_clean(); + // + // output the XML + header('Content-type: text/xml; charset=UTF-8'); + $dom=new DOMDocument('1.0', 'UTF-8'); + $tl_id=$dom->createElement('content', escape_xml($result)); + $dom->appendChild($tl_id); + echo $dom->saveXML(); + return; + } $todo=new Todo_List($cn); $todo->set_parameter("id", $id); $todo->load();