0001438: Remplacement de HtmlInput par Http_Input
This commit is contained in:
parent
48c3fe5809
commit
aa55ed6894
79 changed files with 1303 additions and 878 deletions
|
|
@ -21,7 +21,7 @@
|
|||
if (!defined('ALLOWED'))
|
||||
die('Appel direct ne sont pas permis');
|
||||
require_once NOALYSS_INCLUDE.'/database/class_profile_sql.php';
|
||||
global $cn;
|
||||
global $cn,$http;
|
||||
|
||||
//**********************************************
|
||||
// Save avail. profiles
|
||||
|
|
@ -145,12 +145,9 @@ if (isset($_POST['save_name']))
|
|||
//************************************
|
||||
if (isset($_POST['clone']))
|
||||
{
|
||||
$p_id = HtmlInput::default_value_post("p_id", 0);
|
||||
if ( $p_id == 0 || isNumber($p_id) == 0) {
|
||||
throw new Exception (_('Argument'));
|
||||
}
|
||||
try
|
||||
{
|
||||
$p_id = $http->post("p_id","number", 0);
|
||||
$cn->start();
|
||||
$new_id=$cn->get_value("insert into profile(p_name,p_desc,with_calc,
|
||||
with_direct_form)
|
||||
|
|
@ -210,26 +207,20 @@ if (isset($_POST['delete_profil']))
|
|||
//************************************
|
||||
if (isset($_POST['mod']))
|
||||
{
|
||||
// pm_id of the menu to modify
|
||||
$pm_id=HtmlInput::default_value_post("pm_id", 0);
|
||||
// profile id
|
||||
$p_id=HtmlInput::default_value_post("p_id", "");
|
||||
// display order
|
||||
$p_order=HtmlInput::default_value_post("p_order", 0);
|
||||
// code to add
|
||||
$me_code=HtmlInput::default_value_post("me_code", "");
|
||||
// tab
|
||||
$tab=HtmlInput::default_value_post("tab", "");
|
||||
// set Default
|
||||
$pm_default=HtmlInput::default_value_post('pm_default', 0);
|
||||
try
|
||||
{
|
||||
if ($pm_id==""||
|
||||
$p_id==""||
|
||||
$p_order==""||
|
||||
$me_code==""
|
||||
)
|
||||
throw new Exception('Argument');
|
||||
// pm_id of the menu to modify
|
||||
$pm_id=$http->post("pm_id", "number");
|
||||
// profile id
|
||||
$p_id=$http->post("p_id", "number");
|
||||
// display order
|
||||
$p_order=$http->post("p_order", "number");
|
||||
// code to add
|
||||
$me_code=$http->post("me_code");
|
||||
// tab
|
||||
$tab=$http->post("tab");
|
||||
// set Default
|
||||
$pm_default=$http->post('pm_default', "string", 0);
|
||||
/**
|
||||
* Printing cannot be a menu and do not depend of anything
|
||||
*/
|
||||
|
|
@ -267,22 +258,22 @@ if (isset($_POST['mod']))
|
|||
//****************************************************
|
||||
if (isset($_POST['add_menu'])||isset($_POST['add_impress']))
|
||||
{
|
||||
// type of menu me or pr
|
||||
$p_type=HtmlInput::default_value_post("type", "");
|
||||
// level
|
||||
$p_level=HtmlInput::default_value_post("p_level", "");
|
||||
// pm_id of menu parent
|
||||
$p_dep=HtmlInput::default_value_post("dep", "");
|
||||
// profile id
|
||||
$p_id=HtmlInput::default_value_post("p_id", "");
|
||||
// display order
|
||||
$p_order=HtmlInput::default_value_post("p_order", 0);
|
||||
// code to add
|
||||
$me_code=HtmlInput::default_value_post("me_code", "");
|
||||
// tab
|
||||
$tab=HtmlInput::default_value_post("tab", "");
|
||||
try
|
||||
{
|
||||
// type of menu me or pr
|
||||
$p_type=$http->post("type");
|
||||
// level
|
||||
$p_level=$http->post("p_level");
|
||||
// pm_id of menu parent
|
||||
$p_dep=$http->post("dep");
|
||||
// profile id
|
||||
$p_id=$http->post("p_id", "number");
|
||||
// display order
|
||||
$p_order=$http->post("p_order");
|
||||
// code to add
|
||||
$me_code=$http->post("me_code");
|
||||
// tab
|
||||
$tab=$http->post("tab");
|
||||
$cn->start();
|
||||
|
||||
|
||||
|
|
@ -302,16 +293,6 @@ if (isset($_POST['add_menu'])||isset($_POST['add_impress']))
|
|||
// Module never depends of anything
|
||||
if ($p_type=='me')
|
||||
{
|
||||
/*
|
||||
* Check variable
|
||||
*/
|
||||
if ($p_type==""||
|
||||
$p_level==""||
|
||||
$p_dep==""||
|
||||
$p_id==""||
|
||||
$me_code==""
|
||||
)
|
||||
throw new Exception('Argument');
|
||||
if ($p_level==0)
|
||||
{
|
||||
$me_code_dep=null;
|
||||
|
|
@ -333,12 +314,12 @@ if (isset($_POST['add_menu'])||isset($_POST['add_impress']))
|
|||
where p_id=$1 and me_code_dep=$2 and me_code=$3",
|
||||
array($p_id, $me_code, $me_code_dep));
|
||||
if ($inf>0)
|
||||
throw new Exception("Boucle infinie");
|
||||
throw new Exception(_("Boucle infinie"));
|
||||
/**
|
||||
* Check if we don't add a menu depending on itself
|
||||
*/
|
||||
if ($me_code==$me_code_dep)
|
||||
throw new Exception("Un menu ne peut pas dépendre de lui-même");
|
||||
throw new Exception(_("Un menu ne peut pas dépendre de lui-même"));
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -367,6 +348,7 @@ if (isset($_POST['add_menu'])||isset($_POST['add_impress']))
|
|||
catch (Exception $exc)
|
||||
{
|
||||
alert($exc->getMessage());
|
||||
$cn->rollback;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -444,7 +426,7 @@ if (isset($_POST['delete_profil']))
|
|||
<?php
|
||||
|
||||
}
|
||||
$dep=HtmlInput::default_value_post("dep", 0);
|
||||
$dep=$http->post("dep");
|
||||
?>
|
||||
<script>
|
||||
var selected_menu="<?php echo $dep;?>";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue