[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 151/219: HttpInput: Exception if the type is
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 151/219: HttpInput: Exception if the type is not known, correct the use of numeric instead of number |
Date: |
Mon, 18 Dec 2017 13:22:55 -0500 (EST) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 10938941877638e7e0eccaaf88bae93c4f9d4476
Author: Dany De Bontridder <address@hidden>
Date: Wed Nov 15 20:07:08 2017 +0100
HttpInput: Exception if the type is not known,
correct the use of numeric instead of number
---
html/ajax_test.php | 2 +-
include/ajax/ajax_accounting.php | 2 +-
include/ajax/ajax_anc_accounting.php | 2 +-
include/ajax/ajax_anc_plan.php | 2 +-
include/ajax/ajax_user_security.php | 18 +++++++++---------
include/anc_od.inc.php | 3 ++-
include/anc_pa.inc.php | 6 +++---
include/class/anc_operation.class.php | 25 +++++++++++++------------
include/impress_jrn.inc.php | 8 ++++----
include/param_pcmn.inc.php | 2 +-
include/param_sec.inc.php | 2 +-
scenario/ajax_acc_plan_mtable.php | 2 +-
scenario/ajax_manage_table_sql.php | 2 +-
13 files changed, 39 insertions(+), 37 deletions(-)
diff --git a/html/ajax_test.php b/html/ajax_test.php
index 3ee7ad9..ea444dc 100644
--- a/html/ajax_test.php
+++ b/html/ajax_test.php
@@ -38,7 +38,7 @@ require_once NOALYSS_INCLUDE."/lib/http_input.class.php";
require_once NOALYSS_INCLUDE."/lib/function_javascript.php";
require_once NOALYSS_INCLUDE."/class/user.class.php";
$http=new HttpInput();
-$gDossier=$http->request('gDossier', "numeric",-1);
+$gDossier=$http->request('gDossier', "number",-1);
if ($gDossier==-1)
{
echo " Vous devez donner le dossier avec paramètre gDossier dans l'url,
exemple http://localhost/noalyss/html/test.php?gDossier=25";
diff --git a/include/ajax/ajax_accounting.php b/include/ajax/ajax_accounting.php
index 932a2f5..066ed3d 100644
--- a/include/ajax/ajax_accounting.php
+++ b/include/ajax/ajax_accounting.php
@@ -29,7 +29,7 @@ $http=new HttpInput();
try {
$table=$http->request('table');
$action=$http->request('action');
- $p_id=$http->request('p_id', "numeric");
+ $p_id=$http->request('p_id', "number");
$ctl_id=$http->request('ctl');
} catch(Exception $e) {
diff --git a/include/ajax/ajax_anc_accounting.php
b/include/ajax/ajax_anc_accounting.php
index e9b2a2a..35f25d3 100644
--- a/include/ajax/ajax_anc_accounting.php
+++ b/include/ajax/ajax_anc_accounting.php
@@ -31,7 +31,7 @@ $http=new HttpInput();
$cn=Dossier::connect();
$action=$http->request("action");
-$p_id=$http->request("p_id", "numeric");
+$p_id=$http->request("p_id", "number");
$ctl_id=$http->request("ctl");
$pa_id=$http->request("pa_id");
diff --git a/include/ajax/ajax_anc_plan.php b/include/ajax/ajax_anc_plan.php
index 12e2848..b73a692 100644
--- a/include/ajax/ajax_anc_plan.php
+++ b/include/ajax/ajax_anc_plan.php
@@ -29,7 +29,7 @@ if ( $g_user->check_module("PLANANC ") ) die("forbidden");
$input = $http->request("input");
$action = $http->request("ieaction", "string", "display");
-$pa_id=$http->post("id","numeric");
+$pa_id=$http->post("id","number");
$answer = Inplace_Edit::build($input);
$answer->add_json_param("gDossier", Dossier::id());
$answer->set_callback("ajax_misc.php");
diff --git a/include/ajax/ajax_user_security.php
b/include/ajax/ajax_user_security.php
index 2c515b1..5ec53ca 100644
--- a/include/ajax/ajax_user_security.php
+++ b/include/ajax/ajax_user_security.php
@@ -42,8 +42,8 @@ if ($op=="ledger_access")
{
$input=$http->request("input");
$action=$http->request("ieaction", "string", "display");
- $user_id=$http->post("user_id", "numeric");
- $jrn_def_id=$http->post("jrn_def_id", "numeric");
+ $user_id=$http->post("user_id", "number");
+ $jrn_def_id=$http->post("jrn_def_id", "number");
if ($action=="display")
{
$ie_input=Inplace_Edit::build($input);
@@ -101,8 +101,8 @@ if ($op=="profile")
{
$input=$http->request("input");
$action=$http->request("ieaction", "string", "display");
- $user_id=$http->post("user_id", "numeric");
- $profile_id=$http->post("profile_id", "numeric");
+ $user_id=$http->post("user_id", "number");
+ $profile_id=$http->post("profile_id", "number");
if ($action=="display")
{
$ie_input=Inplace_Edit::build($input);
@@ -148,7 +148,7 @@ if ($op=="profile")
if ($op=='ledger_access_all')
{
// Find the login
- $user_id=$http->post("user_id", "numeric");
+ $user_id=$http->post("user_id", "number");
$access=$http->post("access");
if ($access!="W"&&$access!="X"&&$access!="R")
die("Invalid access");
@@ -179,8 +179,8 @@ if ($op=='ledger_access_all')
//------------------------------------------------------------------------------
if ($op=="action_access")
{
- $action_id=$http->get("ac_id", "numeric");
- $user_id=$http->get("user_id","numeric");
+ $action_id=$http->get("ac_id", "number");
+ $user_id=$http->get("user_id","number");
$sec_User=new User($cn, $user_id);
$right=$sec_User->check_action($action_id);
@@ -205,8 +205,8 @@ if ($op=="action_access")
//----------------------------------------------------------------------------
if ($op=="action_access_all")
{
- $user_id=$http->get("user_id","numeric");
- $access=$http->get("access","numeric");
+ $user_id=$http->get("user_id","number");
+ $access=$http->get("access","number");
$sec_User=new User($cn, $user_id);
if ( $access==0) {
$cn->exec_sql("delete from user_sec_act where
ua_login=$1",array($sec_User->login));
diff --git a/include/anc_od.inc.php b/include/anc_od.inc.php
index 0b028a2..e07482d 100644
--- a/include/anc_od.inc.php
+++ b/include/anc_od.inc.php
@@ -33,6 +33,7 @@ require_once NOALYSS_INCLUDE.'/class/anc_plan.class.php';
require_once NOALYSS_INCLUDE.'/class/anc_group_operation.class.php';
global $g_user;
+$http=new HttpInput();
$str_dossier=Dossier::get();
$pa=new Anc_Plan($cn);
@@ -102,7 +103,7 @@ if ( isset($_GET['see']))
$periode_start=$cn->make_array("select p_id,to_char(p_start,'DD-MM-YYYY')
from parm_periode $filter_year order by p_start,p_end",1);
$g_user=new User($cn);
-
$current=(isset($_GET['p_periode']))?$_GET['p_periode']:$g_user->get_periode();
+ $current=$http->get("p_periode","number",$g_user->get_periode());
$w->value=$periode_start;
$w->selected=$current;
echo _('Filtrer par
période').":".$w->input().HtmlInput::submit('gl_submit','Valider').'</form>';
diff --git a/include/anc_pa.inc.php b/include/anc_pa.inc.php
index 1822757..0048df4 100644
--- a/include/anc_pa.inc.php
+++ b/include/anc_pa.inc.php
@@ -93,7 +93,7 @@ if ($sa=="pa_write")
// Update the PA
if ($sa=="pa_update")
{
- $pa_id=$http->get("pa_id","numeric");
+ $pa_id=$http->get("pa_id","number");
$new=new Anc_Plan($cn, $pa_id);
$new->name=$_POST['pa_name'];
@@ -105,7 +105,7 @@ if ($sa=="pa_update")
/* delete pa */
if ($sa=="pa_delete")
{
- $pa_id=$http->get("pa_id","numeric");
+ $pa_id=$http->get("pa_id","number");
$delete=new Anc_Plan($cn, $pa_id);
$delete->delete();
@@ -116,7 +116,7 @@ if ($sa=="pa_delete")
if ($sa=="pa_detail")
{
- $pa_id=$http->get("pa_id","numeric");
+ $pa_id=$http->get("pa_id","number");
$new=new Anc_Plan($cn, $pa_id);
$wSa=HtmlInput::hidden("sa", "pa_update");
diff --git a/include/class/anc_operation.class.php
b/include/class/anc_operation.class.php
index 3fc2dd6..eda986e 100644
--- a/include/class/anc_operation.class.php
+++ b/include/class/anc_operation.class.php
@@ -239,7 +239,7 @@ class Anc_Operation
$array=$this->get_list($from,$to);
if ( empty($array) )
- return "Pas d'enregistrement trouvé";
+ return _("Pas d'enregistrement trouvé");
// navigation_bar
$step=$_SESSION['g_pagesize'];
@@ -266,13 +266,14 @@ class Anc_Operation
$group=$row['oa_group'];
if ( $group !=$oldgroup )
{
+
if ( $oldgroup!=0 )
{
$efface=new IButton();
$efface->javascript="anc_remove_operation(".$gDossier.",".$oldgroup.")";
- $efface->name="Efface";
- $efface->label="Efface";
+ $efface->name=_("Efface");
+ $efface->label=_("Efface");
$ret.="<td>".$efface->input()."</td>";
$this->oa_group=$oldgroup;
@@ -283,24 +284,24 @@ class Anc_Operation
// get the old jr_id
$detail=new IButton();
$detail->javascript="viewOperation($jr_id,$gDossier)";
- $detail->name="Detail";
- $detail->label="Detail";
+ $detail->name=_("Detail");
+ $detail->label=_("Detail");
$ret.="<td>".$detail->input()."</td>";
}
$ret.='</table>';
}
$ret.='<table id="'.$row['oa_group'].'" class="result">';
-
+ $operation_detail= ($row['jr_id'] !=
0)?HtmlInput::detail_op($row['jr_id'], h($row['oa_description']."
".$row['jr_pj_number'])):h($row['oa_description']);
$ret.="<tr class=\"highlight\">".
td($row['oa_date']).
"<td>".
- HtmlInput::detail_op($row['jr_id'],
h($row['oa_description']." ".$row['jr_pj_number'])).
+ $operation_detail.
"</td>".
td();
$ret.="<td>".
- "Groupe id : ".$row['oa_group'].
+ _("Groupe id : ").$row['oa_group'].
"</td>".
$oldgroup=$group;
@@ -329,8 +330,8 @@ class Anc_Operation
$efface=new IButton();
$efface->javascript="anc_remove_operation("."$gDossier,".$oldgroup.")";
- $efface->name="Efface";
- $efface->label="Efface";
+ $efface->name=_("Efface");
+ $efface->label=_("Efface");
$ret.="<td>".$efface->input()."</td>";
// get the old jr_id
$this->oa_group=$oldgroup;
@@ -339,8 +340,8 @@ class Anc_Operation
{
$detail=new IButton();
$detail->javascript="modifyOperation($jr_id,'".$gDossier."')";
- $detail->name="Detail";
- $detail->label="Detail";
+ $detail->name=_("Detail");
+ $detail->label=_("Detail");
$ret.="<td>".$detail->input()."</td>";
}
$ret.='</table>';
diff --git a/include/impress_jrn.inc.php b/include/impress_jrn.inc.php
index e0e5cee..12b690d 100644
--- a/include/impress_jrn.inc.php
+++ b/include/impress_jrn.inc.php
@@ -109,8 +109,8 @@ print '<TR>';
// filter on the current year
$filter_year = " where p_exercice='" . sql_string($exercice) . "'";
// Get the from_periode and to_periode
-$from_periode=$http->get("from_periode","numeric","");
-$to_periode=$http->get("to_periode","numeric","");
+$from_periode=$http->get("from_periode","number","");
+$to_periode=$http->get("to_periode","number","");
$periode_start = $cn->make_array("select p_id,to_char(p_start,'DD-MM-YYYY')
from parm_periode $filter_year order by p_start,p_end");
$w->selected = $from_periode ;
@@ -157,9 +157,9 @@ echo '<hr>';
if (isset($_REQUEST['bt_html']))
{
// Type of report : listing=1 , Accounting writing=0, detail =2
- $simple=$http->get("p_simple","numeric");
+ $simple=$http->get("p_simple","number");
- $jrn_id=$http->get("jrn_id","numeric");
+ $jrn_id=$http->get("jrn_id","number");
require_once NOALYSS_INCLUDE.'/class/acc_ledger.class.php';
$Jrn = new Acc_Ledger($cn, $jrn_id);
diff --git a/include/param_pcmn.inc.php b/include/param_pcmn.inc.php
index 9a056e9..496a49a 100644
--- a/include/param_pcmn.inc.php
+++ b/include/param_pcmn.inc.php
@@ -41,7 +41,7 @@ echo '<div id="acc_update" class="inner_box"
style="display:none;position:absolu
/* Store the p_start parameter */
-$g_start=$http->get('p_start',"numeric",1);
+$g_start=$http->get('p_start',"number",1);
?>
<a id="top"></a>
diff --git a/include/param_sec.inc.php b/include/param_sec.inc.php
index 00ddcd7..42ad171 100644
--- a/include/param_sec.inc.php
+++ b/include/param_sec.inc.php
@@ -135,7 +135,7 @@ if ( $action == "view" )
$return= HtmlInput::button_anchor(_('Retour à la
liste'),'?&ac='.$_REQUEST['ac'].'&'.dossier::get(),_('retour'),"",'smallbutton');
$repo=new Database();
- $user_id=$http->get('user_id',"numeric");
+ $user_id=$http->get('user_id',"number");
$User=new User($repo,$user_id);
$admin=0;
$access=$User->get_folder_access($gDossier);
diff --git a/scenario/ajax_acc_plan_mtable.php
b/scenario/ajax_acc_plan_mtable.php
index 16d6407..03413f2 100644
--- a/scenario/ajax_acc_plan_mtable.php
+++ b/scenario/ajax_acc_plan_mtable.php
@@ -33,7 +33,7 @@ $http=new HttpInput();
try {
$table=$http->request('table');
$action=$http->request('action');
-$p_id=$http->request('p_id', "numeric");
+$p_id=$http->request('p_id', "number");
$ctl_id=$http->request('ctl');
} catch(Exception $e) {
diff --git a/scenario/ajax_manage_table_sql.php
b/scenario/ajax_manage_table_sql.php
index 22c0e64..ef49b82 100644
--- a/scenario/ajax_manage_table_sql.php
+++ b/scenario/ajax_manage_table_sql.php
@@ -33,7 +33,7 @@ $http=new HttpInput();
try {
$table=$http->request('table');
$action=$http->request('action');
-$p_id=$http->request('p_id', "numeric");
+$p_id=$http->request('p_id', "number");
$ctl_id=$http->request('ctl');
} catch(Exception $e) {
- [Noalyss-commit] [noalyss] 109/219: Add button to pin the box, (continued)
- [Noalyss-commit] [noalyss] 109/219: Add button to pin the box, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 134/219: #0001414: LETTRAGE - montants différents non indiqués Apparation d'une bulle d'info avec la différence, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 147/219: ANC : ANC_TABLE replace PGPLSQL procedure by Php functions : Anc_Table:create_temp_account Anc_Table:create_temp_card, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 20/219: Add new theme and modify tmp_pcmn, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 180/219: Fix ID problem, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 89/219: Cosmetic : cache certaines colonnes pour petit écran, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 22/219: Esthetic change icon edit, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 165/219: Task #1476 : add an new column to TMP_PCMN Adapt the add and update for CFGPCMN Code cleaning : rewrite of Acc_Account + PhpUnit test, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 177/219: Repository add unique constraint for jnt_use_doc, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 159/219: INSTALL : check PHP version minimum 5.5, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 151/219: HttpInput: Exception if the type is not known, correct the use of numeric instead of number,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 218/219: Task #1506 : improve error message when adding a card, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 214/219: Esthetic CSS : add cursor pointer, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 210/219: Task #1381 Favori de filtre dans recherche, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 205/219: Accounting : error message if accounting is too large # Conflicts: # html/js/card.js, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 194/219: Select_box : fix position, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 176/219: Change autocomplete and adapt Icard setWidth is false + indicator icon for ICard, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 202/219: ManageTable.js : change Manage.delete by Manage.remove, because delete is a reserved keyword, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 181/219: Fix ID problem, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 163/219: Code cleaning, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 213/219: Code rewrite : move the function HtmlInput::select_ledger into Acc_Ledger_Search::select_ledger, Dany De Bontridder, 2017/12/18