0001438: Remplacement de HtmlInput par HttpInput

This commit is contained in:
Dany De Bontridder 2017-06-12 21:11:05 +02:00
parent a28aea8f82
commit a5f02370cc
13 changed files with 44 additions and 28 deletions

View file

@ -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", "");
?>
<form method="get">
Choisissez une table
@ -70,7 +72,7 @@ $select_table->selected = HtmlInput::default_value_request("table", "");
///////////////////////////////////////////////////////////////////////////////
// if a table is select , generate file
//////////////////////////////////////////////////////////////////////////////
$table=HtmlInput::default_value_request("table", "");
$table=$http->request("table","string", "");
if ( $table != "") {
$table_sql=new Table_SQL($cn,$table);
$table_sql->create_class();

View file

@ -200,11 +200,12 @@ $order
/**
* Check needed info
*/
$p_nom_mod = HtmlInput::default_value('nom_mod', "", $array);
$p_fd_description = HtmlInput::default_value('fd_description', "", $array);
$p_class_base= HtmlInput::default_value('class_base', "", $array);
$p_fiche_def= HtmlInput::default_value('FICHE_REF', "", $array);
$p_create= HtmlInput::default_value('create', "off", $array);
$http=new HttpInput();
$p_nom_mod = $http->extract($array,'nom_mod',"string","");
$p_fd_description = $http->extract($array,'fd_description',"string", "");
$p_class_base=$http->extract($array,'class_base',"string", "");
$p_fiche_def= $http->extract($array,'FICHE_REF',"string", "");
$p_create= $http->extract($array,'create',"string", "off");
// If there is no description then add a empty one
if ( ! isset ($p_fd_description)) {

View file

@ -38,12 +38,12 @@ class Pre_Op_Advanced extends Pre_operation_detail
function get_post()
{
parent::get_post();
$http=new HttpInput();
for ($i=0;$i<$this->operation->nb_item;$i++)
{
$poste=HtmlInput::default_value_post("poste".$i, null);
$qcode=HtmlInput::default_value_post("qc_".$i, null);
$poste=$http->post("poste".$i,"string", null);
$qcode=$http->post("qc_".$i,"string", null);
if ( $poste == null && $qcode == null ) continue;

View file

@ -51,6 +51,10 @@ class HttpInput
}
}
if( $p_type=="array" && !is_array($this->array[$p_name]) ) {
throw new Exception(_("Type invalide")."[ $p_name ] = {$this->array[$p_name]}"
,EXC_PARAM_TYPE);
}
}
catch (Exception $ex)
{

View file

@ -36,9 +36,10 @@
$objet->set_callback("ajax.php");
// Build the json object for JS
$plugin_code=HtmlInput::default_value_request("plugin_code","");
$ac=HtmlInput::default_value_request("ac","");
$sa=HtmlInput::default_value_request("sa","");
$http=new HttpInput();
$plugin_code=$http->request("plugin_code");
$ac=$http->request("ac");
$sa=$http->request("sa");
$aJson=array("gDossier"=>Dossier::id(),
"ac"=>$ac,
"plugin_code"=>$plugin_code,

View file

@ -163,7 +163,8 @@ class Sendmail
// Increment email amount
$repo =new Database();
$date=date('Ymd');
$dossier=HtmlInput::default_value_request("gDossier", -1);
$http=new HttpInput();
$dossier=$http->request("gDossier","string", -1);
$this->increment_mail($repo,$dossier,$date);
}
/**
@ -175,7 +176,8 @@ class Sendmail
* if send from a dossier , then check limit of this dossier
* otherwise send true
*/
$dossier=HtmlInput::default_value_request("gDossier", -1);
$http=new HttpInput();
$dossier=$http->request("gDossier","string", -1);
if ($dossier == -1 ) return true;
/**

View file

@ -63,7 +63,8 @@ if ( $sb=='change')
//
if ( $sb=='save')
{
$delete=HtmlInput::default_value_post("delete_ck", 0);
$http=new HttpInput();
$delete=$http->post("delete_ck","string", 0);
if ( $delete == 0 )
{
$row=new Acc_Payment($cn,$_POST ['id']);

View file

@ -60,7 +60,8 @@ echo '</form>';
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();

View file

@ -136,7 +136,8 @@ EOF;
L\'email a été envoyé avec un lien et le nouveau mot de passe, vérifiez vos spams</p>';
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);

View file

@ -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'));
?>
<div class="content">
<div style="width:30%;display:inline-block;min-height: 75px">
@ -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);
?>
<table id="jrn_def_tb" class="result">
<?php for ($i=0; $i<count($jrn); $i++): ?>

View file

@ -27,7 +27,8 @@
?>
<div class="content" id="user_cal" style="width:100%">
<?php
$short=HtmlInput::default_value_get('from', 0);
$http=new HttpInput();
$short=$http->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}\"") ;

View file

@ -9,7 +9,7 @@
<div class="name">
<?php
$http=new HtmlInput();
if ( $cn->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 '<div id="calc">';
@ -22,7 +22,7 @@ if ( $cn->get_value("select count(*) from profile join profile_user using (p_id)
?>
<div id="direct">
<form method="get">
<?php echo HtmlInput::default_value('ac', '', $_REQUEST)?>
<?php echo $http->request('ac',"string", '')?>
<?php echo Dossier::hidden()?>
<?php

View file

@ -23,12 +23,13 @@
* @brief display the module, used to setup the module and menu, included from
* Profile_Menu
*/
$http=new HttpInput();
?>
<div id="module_setting" class="content">
<table class="result">
<tr>
<?php
$dep=HtmlInput::default_value_post("dep", 0);
$dep=$http->post("dep","string", 0);
foreach ($ap_module as $row):
$js="";
$style="";