From a5f02370cc1259abb6b4c6c7139e5d47ecd84787 Mon Sep 17 00:00:00 2001
From: Dany De Bontridder
Date: Mon, 12 Jun 2017 21:11:05 +0200
Subject: [PATCH] 0001438: Remplacement de HtmlInput par HttpInput
---
dev/SQL/index.php | 8 +++++---
include/class/class_fiche_def.php | 11 ++++++-----
include/class/class_pre_op_advanced.php | 6 +++---
include/lib/class_http_input.php | 4 ++++
include/lib/class_manage_table_sql.php | 7 ++++---
include/lib/class_sendmail.php | 6 ++++--
include/payment_middle.inc.php | 3 ++-
include/preod.inc.php | 3 ++-
include/recover.php | 3 ++-
include/template/anc_key_input.php | 11 ++++++-----
include/template/calendar-list.php | 3 ++-
include/template/module.php | 4 ++--
include/template/profile_menu_display_module.php | 3 ++-
13 files changed, 44 insertions(+), 28 deletions(-)
diff --git a/dev/SQL/index.php b/dev/SQL/index.php
index e3c24d2b9..ded83e800 100644
--- a/dev/SQL/index.php
+++ b/dev/SQL/index.php
@@ -11,11 +11,13 @@ const ACCOUNT_DB=2;
require NOALYSS_INCLUDE."/lib/class_database.php";
require NOALYSS_INCLUDE."/lib/class_iselect.php";
+require NOALYSS_INCLUDE."/lib/class_http_input.php";
require './table_sql.class.php';
// Show a db connection
-$gDossier=HtmlInput::default_value_request('gDossier',-1);
+
+$gDossier=$http->request('gDossier',"string",-1);
$select = new ISelect('gDossier');
$select->row=20;
$acc=new Database();
@@ -57,7 +59,7 @@ $table_sql = "select schemaname ||','||tablename,tablename||','||schemaname from
$select_table = new ISelect('table');
$select_table->row=20;
$select_table->value=$cn->make_array($table_sql);
-$select_table->selected = HtmlInput::default_value_request("table", "");
+$select_table->selected = $http->request("table","string", "");
?>
';
if ( $request_sa == 'del')
{
$op=new Pre_operation($cn);
- $op->od_id=HtmlInput::default_value_request('od_id',-1);
+ $http=new HttpInput();
+ $op->od_id=$http->request('od_id',"string",-1);
if (isNumber($op->od_id)==1 && $op->od_id != -1 )
{
$op->delete();
diff --git a/include/recover.php b/include/recover.php
index e3e413cbc..d197edb91 100644
--- a/include/recover.php
+++ b/include/recover.php
@@ -136,7 +136,8 @@ EOF;
L\'email a été envoyé avec un lien et le nouveau mot de passe, vérifiez vos spams
';
endif;
elseif ($action=="req") :
- $request_id=HtmlInput::default_value_request("req", "");
+ $http=new HttpInput();
+ $request_id=$http->request("req","string", "");
if (strlen(trim($request_id))==SIZE_REQUEST) :
require_once NOALYSS_INCLUDE.'/lib/class_database.php';
$cn=new Database(0);
diff --git a/include/template/anc_key_input.php b/include/template/anc_key_input.php
index a4916dbf4..b1f71cb08 100644
--- a/include/template/anc_key_input.php
+++ b/include/template/anc_key_input.php
@@ -27,8 +27,9 @@
echo HtmlInput::request_to_hidden(array('gDossier', 'ac'));
echo HtmlInput::hidden('op','consult');
echo HtmlInput::hidden('key', $this->key->getp('id'));
- $name=HtmlInput::default_value_post("name_key",$this->key->getp('name'));
- $description_text=HtmlInput::default_value_post("description_key",$this->key->getp('description'));
+ $http=new HttpInput();
+ $name=$http->post("name_key","string",$this->key->getp('name'));
+ $description_text=$http->post("description_key","string",$this->key->getp('description'));
?>
@@ -107,9 +108,9 @@
}
if (isset($_POST['po_id']))
{
- $a_po_id=HtmlInput::default_value_post('po_id', array());
+ $a_po_id=$http->post('po_id', "array",array());
$selected=$a_po_id[$j][$i];
- $a_percent=HtmlInput::default_value_post('percent', array());
+ $a_percent=$http->post('percent',"array", array());
$percent=$a_percent[$j];
}
$select->selected=$selected;
@@ -170,7 +171,7 @@
where kd_id=$1 or kd_id is null
order by jrn_def_name ', array($this->key->getp('id')));
}
- $post_jrn=HtmlInput::default_value_post("jrn",-1);
+ $post_jrn=$http->post("jrn","string",-1);
?>
diff --git a/include/template/calendar-list.php b/include/template/calendar-list.php
index 965853e02..cf2e656b3 100644
--- a/include/template/calendar-list.php
+++ b/include/template/calendar-list.php
@@ -27,7 +27,8 @@
?>
get('from',"string", 0);
$js=sprintf("calendar_zoom({gDossier:%d,invalue:'%s',outvalue:'%s',distype:'%s','notitle':%d})",
dossier::id(),'per_div','calendar_zoom_div','cal',$notitle);
echo HtmlInput::anchor(_('Calendrier'),''," onclick=\"{$js}\"") ;
diff --git a/include/template/module.php b/include/template/module.php
index 775467196..6a71d1859 100644
--- a/include/template/module.php
+++ b/include/template/module.php
@@ -9,7 +9,7 @@
get_value("select count(*) from profile join profile_user using (p_id)
where user_name=$1 and with_calc=true",array($_SESSION['g_user'])) ==1):
echo '
';
@@ -22,7 +22,7 @@ if ( $cn->get_value("select count(*) from profile join profile_user using (p_id)
?>