diff --git a/html/do.php b/html/do.php index ad1eb3b5a..552c6a56a 100644 --- a/html/do.php +++ b/html/do.php @@ -121,9 +121,6 @@ if ($oPeriode->load() == -1) $g_user->set_periode($periode); } -// Display available menu in the right order -load_all_script(); - $module_selected = -1; /* diff --git a/include/ac_common.php b/include/ac_common.php index 31fd29e07..28a49fbb8 100644 --- a/include/ac_common.php +++ b/include/ac_common.php @@ -27,6 +27,8 @@ require_once NOALYSS_INCLUDE.'/class_database.php'; require_once NOALYSS_INCLUDE.'/class_periode.php'; +require_once NOALYSS_INCLUDE.'/class_html_input.php'; +require_once NOALYSS_INCLUDE.'/function_javascript.php'; /**\brief to protect again bad characters which can lead to a cross scripting attack the string to be diplayed must be protected @@ -256,7 +258,6 @@ function isDate($p_date) function html_page_start($p_theme="", $p_script="", $p_script2="") { - require_once 'class_html_input.php'; // check not called twiced static $already_call=0; if ( $already_call==1)return; @@ -323,7 +324,7 @@ function html_page_start($p_theme="", $p_script="", $p_script2="") '; - + echo load_all_script(); echo ' '; echo ""; diff --git a/include/adm.inc.php b/include/adm.inc.php index 7889443bf..6e32b3bd7 100644 --- a/include/adm.inc.php +++ b/include/adm.inc.php @@ -45,20 +45,23 @@ if ( $low_action == "" ) //----------------------------------------------------- // Remove a card //----------------------------------------------------- -if ( isset($_POST['delete_card'] ) ) +if ( isset($_POST['action_fiche'] ) ) { - if ( $g_user->check_action(FICADD) == 0 ) + if ( $_POST['action_fiche'] == 'delete_card') { - alert('Vous ne pouvez pas enlever de fiche'); - return; + if ( $g_user->check_action(FICADD) == 0 ) + { + alert(_('Vous ne pouvez pas enlever de fiche')); + return; + } + + $f_id=$_REQUEST['f_id']; + + $fiche=new Admin($cn,$f_id); + $fiche->remove(); + $low_action="list"; } - $f_id=$_REQUEST['f_id']; - - $fiche=new Admin($cn,$f_id); - $fiche->remove(); - $low_action="list"; - } //----------------------------------------------------- diff --git a/include/category_detail.inc.php b/include/category_detail.inc.php index ed87960c2..9b27f9075 100644 --- a/include/category_detail.inc.php +++ b/include/category_detail.inc.php @@ -63,11 +63,12 @@ echo $w->input(); $w->name="f_id"; $w->value=$f_id; echo $w->input(); +echo HtmlInput::hidden('action_fiche',''); if ( ! $p_readonly) { - echo HtmlInput::submit('mod',_('Sauver les modifications')); + echo HtmlInput::submit('mod',_('Sauver les modifications'),' onclick="$(\'action_fiche\').value=\'mod\';"'); echo HtmlInput::reset(_("Annuler")); - echo HtmlInput::submit('delete_card',_('Effacer cette fiche'),'onclick="return confirm_form(\'catergory_detail_frm\',\''.('Confirmer effacement ?').'\');"'); + echo HtmlInput::submit('delete_card',_('Effacer cette fiche'),'onclick="$(\'action_fiche\').value=\'delete_card\';return confirm_form(\'catergory_detail_frm\',\''.('Confirmer effacement ?').'\');"'); echo ''; } echo ''; diff --git a/include/contact.inc.php b/include/contact.inc.php index 1fb201300..832fe003b 100644 --- a/include/contact.inc.php +++ b/include/contact.inc.php @@ -43,19 +43,23 @@ if ($low_action == "") //----------------------------------------------------- // Remove a card //----------------------------------------------------- -if (isset($_POST['delete_card'])) +if (isset($_POST['action_fiche'])) { - if ($g_user->check_action(FICADD) == 0) + + if ( $_POST['action_fiche'] == 'delete_card') { - alert(j(_('Vous ne pouvez pas enlever de fiche'))); - return; + if ( $g_user->check_action(FICADD) == 0 ) + { + alert(_('Vous ne pouvez pas enlever de fiche')); + return; + } + + $f_id = $_REQUEST['f_id']; + + $fiche = new Contact($cn, $f_id); + $fiche->remove(); + $low_action = "list"; } - - $f_id = $_REQUEST['f_id']; - - $fiche = new Contact($cn, $f_id); - $fiche->remove(); - $low_action = "list"; } //----------------------------------------------------- diff --git a/include/customer.inc.php b/include/customer.inc.php index c8b6d785e..66beaed74 100644 --- a/include/customer.inc.php +++ b/include/customer.inc.php @@ -44,19 +44,22 @@ if ($low_action == "") //----------------------------------------------------- // Remove a card //----------------------------------------------------- -if (isset($_POST['delete_card'])) +if (isset($_POST['action_fiche'])) { - if ($g_user->check_action(FICADD) == 0) + if ( $_POST['action_fiche'] == 'delete_card') { - alert(j(_('Vous ne pouvez pas enlever de fiche'))); - return; + if ($g_user->check_action(FICADD) == 0) + { + alert(j(_('Vous ne pouvez pas enlever de fiche'))); + return; + } + + $f_id = $_REQUEST['f_id']; + + $fiche = new Customer($cn, $f_id); + $fiche->remove(); + $low_action = "list"; } - - $f_id = $_REQUEST['f_id']; - - $fiche = new Customer($cn, $f_id); - $fiche->remove(); - $low_action = "list"; } //----------------------------------------------------- diff --git a/include/manager.inc.php b/include/manager.inc.php index 084d03892..f3ca9fd3a 100644 --- a/include/manager.inc.php +++ b/include/manager.inc.php @@ -47,19 +47,22 @@ if ($low_action == "") //----------------------------------------------------- // Remove a card //----------------------------------------------------- -if (isset($_POST['delete_card'])) +if (isset($_POST['action_fiche'])) { - if ($g_user->check_action(FICADD) == 0) + if ( $_POST['action_fiche'] == 'delete_card') { - alert('Vous ne pouvez pas enlever de fiche'); - return; + if ($g_user->check_action(FICADD) == 0) + { + alert(_('Vous ne pouvez pas enlever de fiche')); + return; + } + + $f_id = $_REQUEST['f_id']; + + $fiche = new Manager($cn, $f_id); + $fiche->remove(); + $low_action = "list"; } - - $f_id = $_REQUEST['f_id']; - - $fiche = new Manager($cn, $f_id); - $fiche->remove(); - $low_action = "list"; } //----------------------------------------------------- diff --git a/include/supplier.inc.php b/include/supplier.inc.php index d4913af9f..4472e968a 100644 --- a/include/supplier.inc.php +++ b/include/supplier.inc.php @@ -46,20 +46,22 @@ if ( $low_action == "" ) //----------------------------------------------------- // Remove a card //----------------------------------------------------- -if ( isset($_POST['delete_card'] ) ) +if ( isset($_POST['action_fiche'] ) ) { - if ( $g_user->check_action(FICADD) == 0 ) + if ( $_POST['action_fiche'] == 'delete_card') { - alert('Vous ne pouvez pas enlever de fiche'); - return; + if ( $g_user->check_action(FICADD) == 0 ) + { + alert(_('Vous ne pouvez pas enlever de fiche')); + return; + } + + $f_id=$_REQUEST['f_id']; + + $fiche=new Supplier($cn,$f_id); + $fiche->remove(); + $low_action="list"; } - - $f_id=$_REQUEST['f_id']; - - $fiche=new Supplier($cn,$f_id); - $fiche->remove(); - $low_action="list"; - } //-----------------------------------------------------