[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 08/08: fix small bugs
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 08/08: fix small bugs |
Date: |
Fri, 28 Aug 2015 07:47:10 +0000 |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 5e4dcdd209599182d31bf1e909e3edca76415700
Author: Dany De Bontridder <address@hidden>
Date: Thu Aug 27 22:01:25 2015 +0200
fix small bugs
---
html/do.php | 3 ---
include/ac_common.php | 5 +++--
include/adm.inc.php | 21 ++++++++++++---------
include/category_detail.inc.php | 5 +++--
include/contact.inc.php | 22 +++++++++++++---------
include/customer.inc.php | 21 ++++++++++++---------
include/manager.inc.php | 21 ++++++++++++---------
include/supplier.inc.php | 22 ++++++++++++----------
8 files changed, 67 insertions(+), 53 deletions(-)
diff --git a/html/do.php b/html/do.php
index ad1eb3b..552c6a5 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 31fd29e..28a49fb 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="")
<script language="javascript" src="js/calendar-setup.js"></script>
<LINK REL="stylesheet" type="text/css" href="./calendar-blue.css"
media="screen">
';
-
+ echo load_all_script();
echo ' </HEAD> ';
echo "<BODY $p_script>";
diff --git a/include/adm.inc.php b/include/adm.inc.php
index 7889443..6e32b3b 100644
--- a/include/adm.inc.php
+++ b/include/adm.inc.php
@@ -45,19 +45,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'];
+ $f_id=$_REQUEST['f_id'];
- $fiche=new Admin($cn,$f_id);
- $fiche->remove();
- $low_action="list";
+ $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 ed87960..9b27f90 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 '</form>';
}
echo '</div>';
diff --git a/include/contact.inc.php b/include/contact.inc.php
index 1fb2013..832fe00 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'];
+ $f_id = $_REQUEST['f_id'];
- $fiche = new Contact($cn, $f_id);
- $fiche->remove();
- $low_action = "list";
+ $fiche = new Contact($cn, $f_id);
+ $fiche->remove();
+ $low_action = "list";
+ }
}
//-----------------------------------------------------
diff --git a/include/customer.inc.php b/include/customer.inc.php
index c8b6d78..66beaed 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'];
+ $f_id = $_REQUEST['f_id'];
- $fiche = new Customer($cn, $f_id);
- $fiche->remove();
- $low_action = "list";
+ $fiche = new Customer($cn, $f_id);
+ $fiche->remove();
+ $low_action = "list";
+ }
}
//-----------------------------------------------------
diff --git a/include/manager.inc.php b/include/manager.inc.php
index 084d038..f3ca9fd 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'];
+ $f_id = $_REQUEST['f_id'];
- $fiche = new Manager($cn, $f_id);
- $fiche->remove();
- $low_action = "list";
+ $fiche = new Manager($cn, $f_id);
+ $fiche->remove();
+ $low_action = "list";
+ }
}
//-----------------------------------------------------
diff --git a/include/supplier.inc.php b/include/supplier.inc.php
index d4913af..4472e96 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;
- }
-
- $f_id=$_REQUEST['f_id'];
+ if ( $g_user->check_action(FICADD) == 0 )
+ {
+ alert(_('Vous ne pouvez pas enlever de fiche'));
+ return;
+ }
- $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";
+ }
}
//-----------------------------------------------------
- [Noalyss-commit] [noalyss] branch master updated (44ecba2 -> 5e4dcdd), Dany De Bontridder, 2015/08/28
- [Noalyss-commit] [noalyss] 02/08: indent code, Dany De Bontridder, 2015/08/28
- [Noalyss-commit] [noalyss] 01/08: Add missing semicolon, Dany De Bontridder, 2015/08/28
- [Noalyss-commit] [noalyss] 03/08: Link to CFGCARD when cat doesn't exist, Dany De Bontridder, 2015/08/28
- [Noalyss-commit] [noalyss] 04/08: Task #1153 - Boite de dialogue modale #1153 alert box from ajax, Dany De Bontridder, 2015/08/28
- [Noalyss-commit] [noalyss] 06/08: esthetic, Dany De Bontridder, 2015/08/28
- [Noalyss-commit] [noalyss] 08/08: fix small bugs,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 05/08: esthetic, Dany De Bontridder, 2015/08/28
- [Noalyss-commit] [noalyss] 07/08: esthetic, Dany De Bontridder, 2015/08/28