fix small bugs

This commit is contained in:
Dany De Bontridder 2015-08-27 22:01:25 +02:00
parent 6a5f443f28
commit 5e4dcdd209
8 changed files with 72 additions and 58 deletions

View file

@ -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;
/*

View file

@ -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>";

View file

@ -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";
}
//-----------------------------------------------------

View file

@ -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>';

View file

@ -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";
}
//-----------------------------------------------------

View file

@ -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";
}
//-----------------------------------------------------

View file

@ -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";
}
//-----------------------------------------------------

View file

@ -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";
}
//-----------------------------------------------------