diff --git a/html/ajax_misc.php b/html/ajax_misc.php index eddbb9471..4b6263cac 100644 --- a/html/ajax_misc.php +++ b/html/ajax_misc.php @@ -63,6 +63,10 @@ $user->check_dossier($gDossier,true); $html=var_export($_REQUEST,true); switch($op) { + case "remove_anc": + if ($user->check_action(CAOD)) + $cn->exec_sql("delete from operation_analytique where oa_group=$1",array($_GET['oa'])); + break; case "rm_stock": require_once('constant.security.php'); if ( $user->check_action(GESTOCK) == 0 ) diff --git a/html/js/anc_script.js b/html/js/anc_script.js index 8bc01c973..935e4bd2b 100644 --- a/html/js/anc_script.js +++ b/html/js/anc_script.js @@ -251,16 +251,16 @@ function caod_checkTotal() *@param p_dossier is the folder *@param p_oa_group is the group of the analytic operation */ -function op_remove(p_dossier,p_oa_group) +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}; - queryString=encodeJSON(obj); + p_dossier,"op":"remove_anc"}; + var queryString=encodeJSON(obj); g(p_oa_group).style.display='none'; - var e=new Ajax.Request("remove_op.php", + var e=new Ajax.Request("ajax_misc.php", {method:'get',parameters:queryString}); } diff --git a/html/remove_op.php b/html/remove_op.php deleted file mode 100644 index 3dc0f4203..000000000 --- a/html/remove_op.php +++ /dev/null @@ -1,41 +0,0 @@ -Check(); -if ($User->check_action(CAOD)) - $cn->exec_sql("delete from operation_analytique where oa_group=$1",array($_GET['oa'])); -?> diff --git a/include/class_anc_operation.php b/include/class_anc_operation.php index 733c00c2d..d9bfae3d6 100644 --- a/include/class_anc_operation.php +++ b/include/class_anc_operation.php @@ -210,7 +210,7 @@ class Anc_Operation { $efface=new IButton(); - $efface->javascript="op_remove(".$gDossier.",".$oldgroup.")"; + $efface->javascript="anc_remove_operation(".$gDossier.",".$oldgroup.")"; $efface->name="Efface"; $efface->label="Efface"; $ret.="