diff --git a/html/js/admin.js b/html/js/admin.js index d700aae5e..7d5649386 100644 --- a/html/js/admin.js +++ b/html/js/admin.js @@ -76,16 +76,23 @@ function folder_display(p_user) */ function folder_remove(p_user,p_dossier ) { - if ( ! confirm('Confirmer')) return; - waiting_box(); - new Ajax.Request('ajax_misc.php', { - method: "get", - parameters: {"p_user": p_user, 'p_dossier': p_dossier, "op": "folder_remove", 'gDossier': 0}, - onSuccess: function (p_xml) { - // table id = database_list - new Effect.Opacity('row'+p_dossier, { from: 1.0, to: 0.0, duration: 0.2 }); - remove_waiting_box(); - } + smoke.confirm ('Confirmer', + function (e) { + if (e ) { + waiting_box(); + new Ajax.Request('ajax_misc.php', { + method: "get", + parameters: {"p_user": p_user, 'p_dossier': p_dossier, "op": "folder_remove", 'gDossier': 0}, + onSuccess: function (p_xml) { + // table id = database_list + new Effect.Opacity('row'+p_dossier, { from: 1.0, to: 0.0, duration: 0.2 }); + remove_waiting_box(); + } + + }); + } else { + return ; + } }); } diff --git a/html/js/anc_script.js b/html/js/anc_script.js index 0b1ed5e3c..2530d49bd 100644 --- a/html/js/anc_script.js +++ b/html/js/anc_script.js @@ -322,17 +322,23 @@ function caod_checkTotal() */ function anc_remove_operation(p_dossier, p_oa_group) { - var a = confirm("Etes-vous sur de vouloir effacer cette operation ?\n"); - if (a == false) - return; - var obj = {"oa": - p_oa_group, "gDossier": - p_dossier, "op": "remove_anc"}; - var queryString = encodeJSON(obj); - g(p_oa_group).style.display = 'none'; - var e = new Ajax.Request("ajax_misc.php", - {method: 'get', parameters: queryString}); - + smoke.confirm("Etes-vous sur de vouloir effacer cette operation ?\n", + function (a) + { + if ( a) { + var obj = {"oa": + p_oa_group, "gDossier": + p_dossier, "op": "remove_anc"}; + var queryString = encodeJSON(obj); + g(p_oa_group).style.display = 'none'; + var e = new Ajax.Request("ajax_misc.php", + {method: 'get', parameters: queryString}); + + } else + { + return; + } + }); } /** * add a row in misc operation for ANC diff --git a/html/js/gestion.js b/html/js/gestion.js index 231a2e895..408700bd3 100644 --- a/html/js/gestion.js +++ b/html/js/gestion.js @@ -221,22 +221,26 @@ function check_hour(p_ctl) function removeStock(s_id,p_dossier) { - if ( ! confirm("Confirmez-vous l'effacement de cette entrée dans le stock?") ) - { - return; - } - queryString="gDossier="+p_dossier+"&op=rm_stock&s_id="+s_id; - var action=new Ajax.Request ( - "ajax_misc.php", - { - method:'get', - parameters:queryString, - onFailure:errorRemoveStock, - onSuccess:successRemoveStock - } - + smoke.confirm("Confirmez-vous l'effacement de cette entrée dans le stock?", + function (a) { + if (a) + { + queryString="gDossier="+p_dossier+"&op=rm_stock&s_id="+s_id; + var action=new Ajax.Request ( + "ajax_misc.php", + { + method:'get', + parameters:queryString, + onFailure:errorRemoveStock, + onSuccess:successRemoveStock + } ); - + + } + else { + return ; + } + }); } /** *@brief error if a document if removed diff --git a/html/js/scripts.js b/html/js/scripts.js index d2e9c8bbf..ca0f0c0b7 100644 --- a/html/js/scripts.js +++ b/html/js/scripts.js @@ -69,13 +69,18 @@ function infodiv(req, json) */ function deleteRow(tb, obj) { - if (confirm('Confirmez effacement')) + smoke.confirm('Confirmez effacement',function (e) { - var td = obj.parentNode; - var tr = td.parentNode; - var lidx = tr.rowIndex; - g(tb).deleteRow(lidx); - } + if (e) { + var td = obj.parentNode; + var tr = td.parentNode; + var lidx = tr.rowIndex; + g(tb).deleteRow(lidx); + + } else { + return ; + } + }); } function deleteRowRec(tb, obj) { @@ -1508,27 +1513,33 @@ function display_sub_menu(p_dossier,p_profile,p_dep,p_level) function remove_sub_menu(p_dossier,profile_menu_id) { if ( ! confirm ('Confirm ?')) return; - waiting_box(); - new Ajax.Request('ajax_misc.php', - { - method:'get', - parameters: { op:'remove_submenu',gDossier:p_dossier, - p_profile_menu_id:profile_menu_id}, - onSuccess:function (req) { - try { - remove_waiting_box(); - if ( $('menu_table').rows.length > 1 ) { - $('menu_table').rows[1].remove(); - } - $('sub'+profile_menu_id).remove(); - } catch(e) - { - alert_box(e.message); - } - } - } - - ); + smoke.confirm('Confirme ?', + function (e) { + if (e) { + waiting_box(); + new Ajax.Request('ajax_misc.php', + { + method:'get', + parameters: { op:'remove_submenu',gDossier:p_dossier, + p_profile_menu_id:profile_menu_id}, + onSuccess:function (req) { + try { + remove_waiting_box(); + if ( $('menu_table').rows.length > 1 ) { + $('menu_table').rows[1].remove(); + } + $('sub'+profile_menu_id).remove(); + } catch(e) + { + alert_box(e.message); + } + } + } + ); + } else { + return; + } + }); } /** * @brief add a menu to a profile, propose only the available menu @@ -2871,8 +2882,7 @@ function confirm_form(p_obj, p_message) var newdiv = document.createElement('DIV'); newdiv.id = 'confirm_12'; - newdiv.addClassName("inner_box"); - newdiv.setStyle('z-index:101;width:50%;left:25%;'); + newdiv.addClassName("inner_box confirm_box"); //newdiv.innerHTML="
"; newdiv.innerHTML += ''; newdiv.innerHTML += p_message; diff --git a/html/js/todo_list.js b/html/js/todo_list.js index f2a94c94c..c44c58825 100644 --- a/html/js/todo_list.js +++ b/html/js/todo_list.js @@ -98,27 +98,21 @@ function add_todo() } function todo_list_remove(p_ctl) { - if (confirm('Effacer ?') == false) - { - return; - } - $("tr" + p_ctl).hide(); - var gDossier = $('gDossier').value; - - var action = new Ajax.Request( - 'ajax_todo_list.php', - { - method: 'get', - parameters: - {'del': - 1, 'id': - p_ctl, 'gDossier': - gDossier - } - } - ); - return false; + smoke.confirm('Effacer ?', + function (e) { + if ( !e ) {return;} + $("tr" + p_ctl).hide(); + var gDossier = $('gDossier').value; + var action = new Ajax.Request( + 'ajax_todo_list.php', + { + method: 'get', + parameters:{'del':1, 'id':p_ctl, 'gDossier':gDossier} + } + ); + return false; + }); } function todo_list_save(p_form) { diff --git a/html/style-classic.css b/html/style-classic.css index 11d0716d2..da131ff78 100644 --- a/html/style-classic.css +++ b/html/style-classic.css @@ -674,7 +674,7 @@ span.action a.action:hover { color:#000000; } div.popup_back{ - position:absolute; + position:fixed; top:0px; left:0px; opacity:0.30; @@ -1964,4 +1964,16 @@ td.cut { } td.box { border-left: #9999ff solid 1px; +} +/*************************************************************************** + * Confirm dialog box + ***************************************************************************/ +div.confirm_box { + position:fixed; + top:100px; + left:0px; + right:0px; + z-index:101; + width:50%; + left:25%; } \ No newline at end of file diff --git a/html/style-mandarine.css b/html/style-mandarine.css index c847d41ec..4fc559032 100644 --- a/html/style-mandarine.css +++ b/html/style-mandarine.css @@ -634,14 +634,15 @@ span.action a.action:hover { color:#000000; } div.popup_back{ - position:absolute; + position:fixed; top:0px; left:0px; - opacity:0.6; + opacity:0.2; width:100%; height:100%; z-index:1; - display:none; + display:block; + background: #F93; } div.popup_border_title { @@ -1881,4 +1882,16 @@ td.cut { } td.box { border-left : #C76626 solid 1px; +} +/*************************************************************************** + * Confirm dialog box + ***************************************************************************/ +div.confirm_box { + position:fixed; + top:100px; + left:0px; + right:0px; + z-index:101; + width:50%; + left:25%; } \ No newline at end of file diff --git a/html/style-mobile.css b/html/style-mobile.css index a7d025f61..e093ac667 100644 --- a/html/style-mobile.css +++ b/html/style-mobile.css @@ -661,14 +661,15 @@ span.action a.action:hover { color:#000000; } div.popup_back{ - position:absolute; + position:fixed; top:0px; left:0px; - opacity:0.6; + opacity:0.2; width:100%; height:100%; z-index:1; - display:none; + display:block; + background: #3f4c6b; } div.popup_border_title { @@ -1945,4 +1946,16 @@ td.cut { } td.box { border-left : #3f4c6b solid 1px; +} +/*************************************************************************** + * Confirm dialog box + ***************************************************************************/ +div.confirm_box { + position:fixed; + top:100px; + left:0px; + right:0px; + z-index:101; + width:50%; + left:25%; } \ No newline at end of file diff --git a/html/style-test.css b/html/style-test.css index fe76636cb..5bccfbce8 100644 --- a/html/style-test.css +++ b/html/style-test.css @@ -71,4 +71,16 @@ table.sortable td,table.result td position: absolute; top:0; left:0; +} +/*************************************************************************** + * Confirm dialog box + ***************************************************************************/ +div.confirm_box { + position:fixed; + top:100px; + left:0px; + right:0px; + z-index:101; + width:50%; + left:25%; } \ No newline at end of file diff --git a/include/fiche.inc.php b/include/fiche.inc.php index cc855c25e..36b97cbd3 100644 --- a/include/fiche.inc.php +++ b/include/fiche.inc.php @@ -154,7 +154,7 @@ if ($_GET['histo'] == -1) /** * Move */ - if (isset($_POST['move'])) + if (isset($_POST['move'])&& $_POST['move'] == 1) { for ($i = 0; $i < count($ack); $i++) { @@ -165,7 +165,7 @@ if ($_GET['histo'] == -1) /** * Delete */ - if (isset($_POST['delete'])) + if (isset($_POST['delete'])&& $_POST['delete']==1) { $msg=""; for ($i = 0; $i < count($ack); $i++) diff --git a/include/template/fiche_list.php b/include/template/fiche_list.php index 957189341..bd7566c79 100644 --- a/include/template/fiche_list.php +++ b/include/template/fiche_list.php @@ -27,7 +27,7 @@ */ ?> -