From d85d6f8c77083fb997441a672d222bb10836af3e Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sat, 1 Dec 2018 17:57:15 +0100 Subject: [PATCH 01/81] replace tempname with sys_get_temp_dir --- include/class/document_export.class.php | 9 +++++---- include/constant.php | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/class/document_export.class.php b/include/class/document_export.class.php index fea8edc71..f491ab11a 100644 --- a/include/class/document_export.class.php +++ b/include/class/document_export.class.php @@ -38,13 +38,13 @@ class Document_Export // Create 2 temporary folders 1. convert to PDF + stamp // 2. store result $this->feedback = array(); - $this->store_convert = tempnam($_ENV['TMP'], 'convert_'); - $this->store_pdf = tempnam($_ENV['TMP'], 'pdf_'); + $this->store_convert = tempnam(sys_get_temp_dir(), 'convert_'); + $this->store_pdf = tempnam(sys_get_temp_dir(), 'pdf_'); unlink($this->store_convert); unlink($this->store_pdf); umask(0); - mkdir($this->store_convert); - mkdir($this->store_pdf); + if ( mkdir($this->store_convert) == FALSE ) throw new Exception(sprintf("Create %s failed",$this->store_onvert)); + if ( mkdir($this->store_pdf)== FALSE ) throw new Exception(sprintf("Create %s failed",$this->store_pdf)); } /** * @brief concatenate all PDF into a single one and save it into the @@ -177,6 +177,7 @@ class Document_Export $cnt_feedback++; continue; } + $progress->increment($step); // diff --git a/include/constant.php b/include/constant.php index 34489ca5d..0e361d09a 100644 --- a/include/constant.php +++ b/include/constant.php @@ -271,7 +271,7 @@ if ( ! file_exists($ps2pdf) ) /** * Outil pour manipuler les PDF */ -$pdftk='/usr/bin/pdftk'; +$pdftk='/snap/bin/pdftk'; if (file_exists($pdftk)) { define ('PDFTK',$pdftk); From 865f656ed67cf44b1556164a4e4a9653e9eef089 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Fri, 28 Dec 2018 10:00:06 +0100 Subject: [PATCH 02/81] Translation + use of httpInput --- include/compta_ods.inc.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/compta_ods.inc.php b/include/compta_ods.inc.php index cab936d30..0c15d15ff 100644 --- a/include/compta_ods.inc.php +++ b/include/compta_ods.inc.php @@ -40,8 +40,10 @@ global $g_user,$http; $cn = Dossier::connect(); -$id_predef = (isset($_REQUEST['p_jrn_predef'])) ? $_REQUEST['p_jrn_predef'] : -1; -$id_ledger = (isset($_REQUEST['p_jrn'])) ? $_REQUEST['p_jrn'] : $id_predef; + +$id_predef = $http->request('p_jrn_predef','number',-1); +$id_ledger = $http->request('p_jrn','number',$id_predef); + $ledger = new Acc_Ledger($cn, $id_ledger); $first_ledger = $ledger->get_first('ODS'); if ( empty ($first_ledger)) @@ -91,7 +93,7 @@ elseif (isset($_POST['save'])) $ledger->save($array); $jr_id = $cn->get_value('select jr_id from jrn where jr_internal=$1', array($ledger->internal)); - echo '

Opération enregistrée Piece ' . h($ledger->pj) . '

'; + echo '

'._("Opération enregistrée")._("Piece") . h($ledger->pj) . '

'; if (strcmp($ledger->pj, $_POST['e_pj']) != 0) { echo '

' . _('Attention numéro pièce existante, elle a du être adaptée') . '

'; From 0eb8ae2fb3b735dc585faa9dc5b7ade62528e159 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Fri, 28 Dec 2018 10:01:29 +0100 Subject: [PATCH 03/81] Translation --- include/compta_ods.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/compta_ods.inc.php b/include/compta_ods.inc.php index 0c15d15ff..cbdabcb98 100644 --- a/include/compta_ods.inc.php +++ b/include/compta_ods.inc.php @@ -48,7 +48,7 @@ $ledger = new Acc_Ledger($cn, $id_ledger); $first_ledger = $ledger->get_first('ODS'); if ( empty ($first_ledger)) { - exit('Pas de journal disponible'); + exit(_('Pas de journal disponible')); } $ledger->id = ($ledger->id == -1) ? $first_ledger['jrn_def_id'] : $id_ledger; From 1971f32b9bcd7f98d0a46ddc151f46dfeac6d472 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Fri, 28 Dec 2018 10:19:26 +0100 Subject: [PATCH 04/81] Translation --- include/operation_ods_new.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/operation_ods_new.inc.php b/include/operation_ods_new.inc.php index 4dbeca255..8e97df638 100644 --- a/include/operation_ods_new.inc.php +++ b/include/operation_ods_new.inc.php @@ -88,7 +88,7 @@ echo ''; $iconcerned=new IConcerned('jrn_concerned'); $iconcerned->amount_id="totalDeb"; -echo "Opération rapprochée : ".$iconcerned->input(); +printf (_("Opération rapprochée : %s"),$iconcerned->input()); echo '

'; echo HtmlInput::button('add', _('Ajout d\'une ligne'), 'onClick="quick_writing_add_row()"'); From 5dd6bcf44cc5423d165f279d7465f8d75cdf1e39 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Fri, 28 Dec 2018 10:22:23 +0100 Subject: [PATCH 05/81] use of httpInput --- include/operation_ods_new.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/operation_ods_new.inc.php b/include/operation_ods_new.inc.php index 8e97df638..1c6f96f3d 100644 --- a/include/operation_ods_new.inc.php +++ b/include/operation_ods_new.inc.php @@ -31,8 +31,9 @@ require_once NOALYSS_INCLUDE.'/lib/iconcerned.class.php'; global $g_user,$g_parameter; $cn=Dossier::connect(); -$id_predef = (isset($_REQUEST['p_jrn_predef'])) ? $_REQUEST['p_jrn_predef'] : -1; -$id_ledger = (isset($_REQUEST['p_jrn'])) ? $_REQUEST['p_jrn'] : $id_predef; +$id_predef = $http->request('p_jrn_predef','number',-1); +$id_ledger = $http->request('p_jrn','number',$id_predef); + $ledger = new Acc_Ledger($cn, $id_ledger); $first_ledger=$ledger->get_first('ODS'); $ledger->id = ($ledger->id == -1) ? $first_ledger['jrn_def_id'] : $id_ledger; From f078217f790cdc6cf9ee9642b247b919e87c02ba Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Fri, 28 Dec 2018 10:40:48 +0100 Subject: [PATCH 06/81] Translation --- include/class/acc_ledger.class.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/include/class/acc_ledger.class.php b/include/class/acc_ledger.class.php index faf46e419..440c593c6 100644 --- a/include/class/acc_ledger.class.php +++ b/include/class/acc_ledger.class.php @@ -746,6 +746,7 @@ class Acc_Ledger extends jrn_def_sql function input($p_array=null, $p_readonly=0) { global $g_parameter, $g_user; + $http=new HttpInput(); $this->nb=$this->get_min_row(); if ($p_readonly==1) return $this->confirm($p_array); @@ -771,7 +772,8 @@ class Acc_Ledger extends jrn_def_sql $wLedger=$this->select_ledger('ODS', 2,FALSE); if ($wLedger==null) throw new Exception(_('Pas de journal disponible')); - $wLedger->javascript="onChange='update_name();update_predef(\"ods\",\"t\",\"".$_REQUEST['ac']."\");$add_js'"; + $ac=$http->request("ac"); + $wLedger->javascript="onChange='update_name();update_predef(\"ods\",\"t\",\"".$ac."\");$add_js'"; $label=" Journal ".Icon_Action::infobulle(2); $ret.=""; @@ -787,8 +789,11 @@ class Acc_Ledger extends jrn_def_sql $op->set('ledger', $this->id); $op->set('ledger_type', "ODS"); $op->set('direct', 't'); - $url=http_build_query(array('action'=>'use_opd', 'p_jrn_predef'=>$this->id, - 'ac'=>$_REQUEST['ac'], 'gDossier'=>dossier::id())); + $url=http_build_query( + array('action'=>'use_opd', + 'p_jrn_predef'=>$this->id, + 'ac'=>$ac, + 'gDossier'=>dossier::id())); echo $op->form_get('do.php?'.$url); echo ''; @@ -1031,12 +1036,12 @@ class Acc_Ledger extends jrn_def_sql /* check for a double reload */ if (isset($mt)&&$this->db->count_sql('select jr_mt from jrn where jr_mt=$1', array($mt))!=0) - throw new Exception('Double Encodage', 5); + throw new Exception(_('Double Encodage'), 5); // Check the periode and the date if (isDate($e_date)==null) { - throw new Exception('Date invalide', 2); + throw new Exception(_('Date invalide'), 2); } $periode=new Periode($this->db); /* find the periode if we have enabled the check_periode @@ -1060,7 +1065,7 @@ class Acc_Ledger extends jrn_def_sql // Periode ferme if ($this->is_closed($periode->p_id)==1) { - throw new Exception('Periode fermee', 6); + throw new Exception(_('Periode fermee'), 6); } /* check if we are using the strict mode */ if ($this->check_strict()==true) From bbe1b068dcde077f939e05a66ec535bd69db6213 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Fri, 28 Dec 2018 10:47:25 +0100 Subject: [PATCH 07/81] Translation --- include/class/acc_ledger.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/class/acc_ledger.class.php b/include/class/acc_ledger.class.php index 440c593c6..ff58aa403 100644 --- a/include/class/acc_ledger.class.php +++ b/include/class/acc_ledger.class.php @@ -1074,8 +1074,10 @@ class Acc_Ledger extends jrn_def_sql operation */ $last_date=$this->get_last_date(); if ($last_date!=null&&cmpDate($e_date, $last_date)<0) - throw new Exception(_('Vous utilisez le mode strict la dernière operation est la date du ') - .$last_date.' '._('vous ne pouvez pas encoder à une date antérieure'), + throw new Exception( + sprintf ( + _('Vous utilisez le mode strict la dernière operation est la date du %s + vous ne pouvez pas encoder à une date antérieure',$last_date)), 15); } From c5d11e7459e34b3e03dc178b41f51e3b56640519 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Fri, 28 Dec 2018 10:49:51 +0100 Subject: [PATCH 08/81] Translation --- include/class/acc_ledger.class.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/class/acc_ledger.class.php b/include/class/acc_ledger.class.php index ff58aa403..f2f1fca82 100644 --- a/include/class/acc_ledger.class.php +++ b/include/class/acc_ledger.class.php @@ -1102,7 +1102,7 @@ class Acc_Ledger extends jrn_def_sql throw new Exception("La fiche quick_code = ". $f->quick_code." n'est pas dans ce journal", 4); if (strlen(trim(${'qc_'.$i}))!=0&&isNumber(${'amount'.$i})==0) - throw new Exception('Montant invalide', 3); + throw new Exception(_('Montant invalide'), 3); $strPoste=$f->strAttribut(ATTR_DEF_ACCOUNT); if ($strPoste=='') @@ -1119,9 +1119,11 @@ class Acc_Ledger extends jrn_def_sql if (isset(${'poste'.$i})&&strlen(trim(${'poste'.$i}))!=0) { $p=new Acc_Account_Ledger($this->db, ${'poste'.$i}); - if ($p->belong_ledger($p_jrn)<0) - throw new Exception(_("Le poste")." ".$p->id." "._("n'est pas dans ce journal"), + if ($p->belong_ledger($p_jrn)<0) { + throw new Exception(sprintf ( + _("Le poste %s n'est pas dans ce journal",$p->id)), 5); + } if (strlen(trim(${'poste'.$i}))!=0&&isNumber(${'amount'.$i})==0) throw new Exception(_('Poste invalide ['.${'poste'.$i}.']'), 3); @@ -1131,7 +1133,7 @@ class Acc_Ledger extends jrn_def_sql $card_id=$p->find_card(); if (!empty($card_id)) { - $str_msg=" Le poste ".$p->id." appartient à ".count($card_id)." fiche(s) dont :"; + $str_msg=sprintf(_(" Le poste %s appartient à fiche(s) dont :"),$str_msg,count($card_id)); $max=(count($card_id)>MAX_COMPTE_CARD)?MAX_COMPTE_CARD:count($card_id); for ($x=0; $x<$max; $x++) { From 4d9930adb908042fc50308994272ffa0a3946b72 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Fri, 28 Dec 2018 15:35:32 +0100 Subject: [PATCH 09/81] Translation --- include/class/acc_ledger.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/class/acc_ledger.class.php b/include/class/acc_ledger.class.php index f2f1fca82..90c613973 100644 --- a/include/class/acc_ledger.class.php +++ b/include/class/acc_ledger.class.php @@ -1133,7 +1133,7 @@ class Acc_Ledger extends jrn_def_sql $card_id=$p->find_card(); if (!empty($card_id)) { - $str_msg=sprintf(_(" Le poste %s appartient à fiche(s) dont :"),$str_msg,count($card_id)); + $str_msg=sprintf(_(" Le poste %s appartient à fiche(s) dont : %s"),$str_msg,count($card_id)); $max=(count($card_id)>MAX_COMPTE_CARD)?MAX_COMPTE_CARD:count($card_id); for ($x=0; $x<$max; $x++) { From a5911754163b694a91ca72b55962009ec8be718d Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Fri, 28 Dec 2018 15:36:17 +0100 Subject: [PATCH 10/81] Translation --- include/class/acc_ledger.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/class/acc_ledger.class.php b/include/class/acc_ledger.class.php index 90c613973..1e4b70455 100644 --- a/include/class/acc_ledger.class.php +++ b/include/class/acc_ledger.class.php @@ -1147,7 +1147,7 @@ class Acc_Ledger extends jrn_def_sql } $account=new Acc_Account($this->db,${"poste".$i}); if ( $account->get_parameter("pcm_direct_use") == "N") { - throw new Exception(_("Utilisation directe interdite du poste comptable ${"poste".$i}")); + throw new Exception(sprinff (_("Utilisation directe interdite du poste comptable %s"), ${"poste".$i})); } } } From da53fe654eb833d166e978879b98c3b8638c3e8b Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sat, 29 Dec 2018 18:53:47 +0100 Subject: [PATCH 11/81] Misc. Operation : input : Missing tag TR --- include/operation_ods_new.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/operation_ods_new.inc.php b/include/operation_ods_new.inc.php index 1c6f96f3d..f3dcacdc7 100644 --- a/include/operation_ods_new.inc.php +++ b/include/operation_ods_new.inc.php @@ -83,7 +83,9 @@ echo '
'; echo '
'. ''.td(_('Débit')) . '' . td(_('Crédit')) . ' ' . - td(_('Difference')) . ' '; + td(_('Difference')) . ' '. + ''; + echo '
'; echo ''; From ed44d713a157f2d6e6f09c476b5b4c9062d8e3f4 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sun, 6 Jan 2019 15:10:08 +0100 Subject: [PATCH 12/81] remove commented code --- html/js/anc_script.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/html/js/anc_script.js b/html/js/anc_script.js index 50d255705..97e524de2 100644 --- a/html/js/anc_script.js +++ b/html/js/anc_script.js @@ -108,8 +108,6 @@ function anc_refresh_remain(p_table, p_seq) var tot_table = compute_total_table(p_table, p_seq); var remain = tot_line - tot_table; remain = Math.round(remain * 100) / 100; - // var popup_table = p_table.toString(); -// p_table = popup_table.replace("popup", ""); $('remain' + p_table).innerHTML = remain; if (remain == 0) { From 9a034b1113933e7d1a2208c6f30618f92f4ca9b9 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sat, 12 Jan 2019 13:40:12 +0100 Subject: [PATCH 13/81] PHP 7.2 incomptability : sizeof of not array --- include/class/follow_up.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/class/follow_up.class.php b/include/class/follow_up.class.php index 471b7ebd0..39d9a004f 100644 --- a/include/class/follow_up.class.php +++ b/include/class/follow_up.class.php @@ -769,7 +769,7 @@ class Follow_Up // if there are no records return a message - if (sizeof($a_row)==0 or $a_row==false) + if ($a_row==false || sizeof($a_row)==0 ) { $r='

'; $r.='
Aucun enregistrement trouvé'; From 5037baf305ebb0a35f8194a65cd7207143d5378f Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sat, 12 Jan 2019 14:33:48 +0100 Subject: [PATCH 14/81] PHP 7.2 mistyped command --- include/class/acc_ledger.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/class/acc_ledger.class.php b/include/class/acc_ledger.class.php index 1e4b70455..47738a27c 100644 --- a/include/class/acc_ledger.class.php +++ b/include/class/acc_ledger.class.php @@ -1147,7 +1147,7 @@ class Acc_Ledger extends jrn_def_sql } $account=new Acc_Account($this->db,${"poste".$i}); if ( $account->get_parameter("pcm_direct_use") == "N") { - throw new Exception(sprinff (_("Utilisation directe interdite du poste comptable %s"), ${"poste".$i})); + throw new Exception(sprintf (_("Utilisation directe interdite du poste comptable %s"), ${"poste".$i})); } } } From 8b8e45c521ea93e7392841f21b93b6bb9b04792f Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sat, 12 Jan 2019 15:11:35 +0100 Subject: [PATCH 15/81] Database upgrade --- include/constant.php | 2 +- include/sql/patch/upgrade132.sql | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 include/sql/patch/upgrade132.sql diff --git a/include/constant.php b/include/constant.php index 2eb6dafff..d9a458d41 100644 --- a/include/constant.php +++ b/include/constant.php @@ -108,7 +108,7 @@ if ( !defined ("NOALYSS_PACKAGE_REPOSITORY")) { if ( ! defined ("SYSINFO_DISPLAY")) { define ("SYSINFO_DISPLAY",TRUE); } -define ("DBVERSION",132); +define ("DBVERSION",133); define ("MONO_DATABASE",25); define ("DBVERSIONREPO",18); define ('NOTFOUND','--not found--'); diff --git a/include/sql/patch/upgrade132.sql b/include/sql/patch/upgrade132.sql new file mode 100644 index 000000000..4565200de --- /dev/null +++ b/include/sql/patch/upgrade132.sql @@ -0,0 +1,15 @@ +begin; +insert into "parameter" (pr_id ) values ('MY_DEFAULT_ROUND_ERROR_DEB'); +insert into "parameter" (pr_id ) values ('MY_DEFAULT_ROUND_ERROR_CRED'); +drop view if exists v_all_card_currency; + +create or replace view v_all_card_currency as +select sum(oc_amount) as sum_oc_amount,sum(oc_vat_amount) as sum_oc_vat_amount,f_id,j_id +from +operation_currency +join jrnx using (j_id) +group by f_id,j_id; + +commit ; +insert into version (val,v_description) values (133,'Currency : default accounting for currency difference '); +commit ; \ No newline at end of file From a79348542b22500e1acbfa0da1e63e04d29f1f93 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sat, 12 Jan 2019 15:11:54 +0100 Subject: [PATCH 16/81] Typo --- include/class/acc_ledger.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/class/acc_ledger.class.php b/include/class/acc_ledger.class.php index 47738a27c..6d38964ea 100644 --- a/include/class/acc_ledger.class.php +++ b/include/class/acc_ledger.class.php @@ -1133,7 +1133,7 @@ class Acc_Ledger extends jrn_def_sql $card_id=$p->find_card(); if (!empty($card_id)) { - $str_msg=sprintf(_(" Le poste %s appartient à fiche(s) dont : %s"),$str_msg,count($card_id)); + $str_msg=sprintf(_(" Le poste %s appartient à fiche(s) dont : %s"),$p->id,count($card_id)); $max=(count($card_id)>MAX_COMPTE_CARD)?MAX_COMPTE_CARD:count($card_id); for ($x=0; $x<$max; $x++) { From ffb025527a43afb58d4d67919869af0940431bab Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sat, 12 Jan 2019 13:39:48 +0100 Subject: [PATCH 17/81] Protect parameters --- html/fid_card.php | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/html/fid_card.php b/html/fid_card.php index 1ee5d07ac..57577bb18 100644 --- a/html/fid_card.php +++ b/html/fid_card.php @@ -27,6 +27,7 @@ require_once '../include/constant.php'; require_once NOALYSS_INCLUDE.'/lib/database.class.php'; +require_once NOALYSS_INCLUDE.'/lib/http_input.class.php'; require_once NOALYSS_INCLUDE.'/class/dossier.class.php'; /*!\brief * Received parameters are @@ -41,11 +42,12 @@ require_once NOALYSS_INCLUDE.'/class/dossier.class.php'; * - list of fd_id * */ +$http=new HttpInput(); -$jrn= ( ! isset($_REQUEST['j']))?-1:$_REQUEST['j']; +$jrn= $http->request("j","number",-1); $filter_card=""; $cn=Dossier::connect(); -$d=$_REQUEST['e']; +$d=$http->request('e'); $filter_card=''; require_once('class/user.class.php'); @@ -107,8 +109,8 @@ else { $get_cred='jrn_def_fiche_cred'; $get_deb='jrn_def_fiche_deb'; - - $filter_jrn=$cn->make_list("select $get_cred||','||$get_deb as fiche from jrn_def where jrn_def_type=$1",array($_REQUEST['type'])); + $type=$http->request("type"); + $filter_jrn=$cn->make_list("select $get_cred||','||$get_deb as fiche from jrn_def where jrn_def_type=$1",array($type)); $filter_card=($filter_jrn != "")?" and fd_id in ($filter_jrn)":' and false '; } @@ -125,9 +127,12 @@ else $sql_str="select distinct f_id from fiche join fiche_detail using (f_id) where ad_id in (9,1,23) and ad_value ilike '%'||$1||'%' ".$filter_card.' limit 12'; -$sql=$cn->get_array($sql_str ,array($_REQUEST['FID'])); -if (sizeof($sql) != 0 ) +$fid=$http->request("FID"); + +$sql=$cn->get_array($sql_str ,array($fid)); + +if ($sql != false && sizeof($sql) != 0 ) { echo "
    "; $sql_get=$cn->prepare('get_name',"select ad_value from fiche_detail where f_id = $1 and ad_id=$2"); @@ -146,12 +151,12 @@ if (sizeof($sql) != 0 ) $sql_name=$cn->execute('get_name',array($sql[$i]['f_id'],23)); if (Database::num_row($sql_name) == 1) $quick_code=Database::fetch_result($sql_name,0,0); - $fid=htmlentities($_REQUEST['FID']); + $fid=htmlentities($fid); /* Highlight the found pattern with bold format */ - $name=str_ireplace($_REQUEST['FID'],''.$fid.'',h($name)); - $qcode=str_ireplace($_REQUEST['FID'],''.$fid.'',h($quick_code)); - $desc=str_ireplace($_REQUEST['FID'],''.$fid.'',h($desc)); + $name=str_ireplace($fid,''.$fid.'',h($name)); + $qcode=str_ireplace($fid,''.$fid.'',h($quick_code)); + $desc=str_ireplace($fid,''.$fid.'',h($desc)); printf('
  • %s %s %s
  • ', $quick_code, $quick_code, From 02721a4d9e11c9574a533d450ddbf288cf256ecf Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Mon, 21 Jan 2019 19:15:58 +0100 Subject: [PATCH 18/81] Bug : Exception are not correctly thrown --- html/do.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/html/do.php b/html/do.php index 71f687dca..1ee017012 100644 --- a/html/do.php +++ b/html/do.php @@ -346,8 +346,9 @@ else catch (Exception $exc) { echo $exc->getMessage(); + record_log("No user profile "); record_log($exc->getTraceAsString()); - throw $e; + throw $exc; } } From ed6a23fa4c44457690e5af92a90db9671852b0d5 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Mon, 21 Jan 2019 19:22:08 +0100 Subject: [PATCH 19/81] Bug : Exception are not correctly thrown --- html/do.php | 1 + 1 file changed, 1 insertion(+) diff --git a/html/do.php b/html/do.php index 1ee017012..be778611a 100644 --- a/html/do.php +++ b/html/do.php @@ -347,6 +347,7 @@ else { echo $exc->getMessage(); record_log("No user profile "); + record_log($exc->getMessage()); record_log($exc->getTraceAsString()); throw $exc; } From 6956783b7559336241c6d882dc37dabb3116b3a0 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Tue, 22 Jan 2019 10:16:29 +0100 Subject: [PATCH 20/81] Bug : cfgcard indent --- include/cfgfiche.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/cfgfiche.inc.php b/include/cfgfiche.inc.php index 89aef1f81..1e87e9f3b 100644 --- a/include/cfgfiche.inc.php +++ b/include/cfgfiche.inc.php @@ -63,7 +63,8 @@ if ( $action == 'remove_line' ) catch (Exception $exc) { throw new Exception(_("Vous devez choisir au moins une ligne")); - } finally + } + finally { echo $fiche_def->input_detail(); echo $retour; From a2decaaeb5c158bd16ac9ccf7b5f47fe87659431 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Wed, 23 Jan 2019 20:30:13 +0100 Subject: [PATCH 21/81] translation --- include/compta_fin.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/compta_fin.inc.php b/include/compta_fin.inc.php index 54fe66ca7..080916d1a 100644 --- a/include/compta_fin.inc.php +++ b/include/compta_fin.inc.php @@ -46,7 +46,7 @@ else $def_ledger=$Ledger->get_first('fin'); if ( empty ($def_ledger)) { - exit('Pas de journal disponible'); + exit(_('Pas de journal disponible')); } $Ledger->id=$def_ledger['jrn_def_id']; } From 381086a4193446b63f83833fae5f58bfeb03f74d Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Wed, 23 Jan 2019 20:40:44 +0100 Subject: [PATCH 22/81] =?UTF-8?q?Mantis=20#0001688:=20Affichage=20centime?= =?UTF-8?q?=20dans=20l'=C3=A9cran=20de=20confirmation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/class/acc_ledger_fin.class.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/include/class/acc_ledger_fin.class.php b/include/class/acc_ledger_fin.class.php index 4c2ab45c8..d361faa72 100644 --- a/include/class/acc_ledger_fin.class.php +++ b/include/class/acc_ledger_fin.class.php @@ -631,10 +631,21 @@ class Acc_Ledger_Fin extends Acc_Ledger $r.=""; // saldo - $r.='
    '.sprintf(_("Ancien solde = %d"), $solde); + $r.=""; + $r.=tr( + td(_("Ancien solde")). + td(nbm($solde),'class="num"') + ); $new_solde+=$tot_amount; - $r.='
    '.sprintf(_("Nouveau solde = %d"),$new_solde); - $r.='
    '.sprintf(_("Difference = %d"), $tot_amount); + $r.=tr( + td(_("Nouveau solde")). + td(nbm($new_solde),' class="num"') + ); + $r.=tr( + td(_("Difference")). + td(nbm($tot_amount),' class="num"') + ); + $r.='
    '; // check for upload piece $file = new IFile(); @@ -939,11 +950,11 @@ class Acc_Ledger_Fin extends Acc_Ledger // for each item, insert into operation_analytique */ $op = new Anc_Operation($this->db); $op->oa_group = $this->db->get_next_seq("s_oa_group"); /* for analytic */ - $op->j_id = $j_id; + $op->j_id = $j_id_other; $op->oa_date = $e_date; $op->oa_debit = 'f'; $op->oa_description = sql_string($comment); - $op->save_form_plan($_POST, $i, $j_id); + $op->save_form_plan($_POST, $i, $j_id_other); } From 73c60dd49506eaf42ef5031a10901cb39b4d86e6 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Thu, 24 Jan 2019 17:27:21 +0100 Subject: [PATCH 23/81] Mantis #0001666: Export CSV depuis histo ne filtre pas par journal --- include/history_operation.inc.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/include/history_operation.inc.php b/include/history_operation.inc.php index 20113ba9f..3a0ceb77d 100644 --- a/include/history_operation.inc.php +++ b/include/history_operation.inc.php @@ -94,7 +94,7 @@ if (!isset($p_array['date_start'])) list($date_start, $date_end) = $per->get_date_limit(); $p_array['date_start'] = $date_start; $p_array['date_end'] = $date_end; - $msg='

    '._("Période ").$date_start._(" au ").$date_end.'

    '; + $msg='

    '.sprintf(_("Période %s au %s "),$date_start,$date_end).'

    '; } else { @@ -138,11 +138,17 @@ $r = HtmlInput::get_to_hidden(array('search_opnb_jrn', 'unpaid', 'gDossier', 'ledger_type', - 'p_action')); + 'p_action', + 'search_opr_jrn')); if (isset($_GET['r_jrn'])) { - foreach ($_GET['r_jrn'] as $k => $v) - $r.=HtmlInput::hidden('r_jrn[' . $k . ']', $v); + foreach ($_GET['r_jrn'] as $k => $v) + $r.=HtmlInput::hidden('r_jrn[' . $k . ']', $v); +} +if (isset($_GET['search_opr_jrn'])) +{ + foreach ($_GET['search_opr_jrn'] as $k => $v) + $r.=HtmlInput::hidden('r_jrn[' . $k . ']', $v); } echo $r; @@ -156,6 +162,11 @@ echo ''; $r = HtmlInput::get_to_hidden(array('l', 'date_paid_start','date_paid_end', 'date_start', 'date_end', 'desc', 'amount_min', 'amount_max', 'qcode', 'accounting', 'unpaid', 'gDossier', 'ledger_type', 'p_action')); +if (isset($_GET['search_opr_jrn'])) +{ + foreach ($_GET['search_opr_jrn'] as $k => $v) + $r.=HtmlInput::hidden('r_jrn[' . $k . ']', $v); +} if (isset($_GET['r_jrn'])) { foreach ($_GET['r_jrn'] as $k => $v) From 0d0ce3647f170a22463b1639efa15ab767336c95 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Fri, 25 Jan 2019 21:33:41 +0100 Subject: [PATCH 24/81] =?UTF-8?q?Mantis=20#0001682:=20CA=20-=20ajouter=20p?= =?UTF-8?q?ossibilit=C3=A9=20d'exporter=20le=20plan=20analytique,=20add=20?= =?UTF-8?q?action=20CSV:Analytic=5FAxis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/anc_pa.inc.php | 31 +++++++++++++------------------ include/constant.php | 2 +- include/sql/patch/upgrade132.sql | 2 +- include/sql/patch/upgrade133.sql | 13 +++++++++++++ 4 files changed, 28 insertions(+), 20 deletions(-) create mode 100644 include/sql/patch/upgrade133.sql diff --git a/include/anc_pa.inc.php b/include/anc_pa.inc.php index a5461e083..a795c35fd 100644 --- a/include/anc_pa.inc.php +++ b/include/anc_pa.inc.php @@ -83,24 +83,13 @@ if ($sa=="pa_write") else { $new=new Anc_Plan($cn); - $new->name=$_POST['pa_name']; - $new->description=$_POST['pa_description']; + $new->name=$http->post("pa_name"); + $new->description=$http->post("pa_description"); $new->add(); } $sa="anc_menu"; } -// Update the PA -if ($sa=="pa_update") -{ - $pa_id=$http->get("pa_id","number"); - - $new=new Anc_Plan($cn, $pa_id); - $new->name=$_POST['pa_name']; - $new->description=$_POST['pa_description']; - $new->update(); - $sa="anc_menu"; -} /* delete pa */ if ($sa=="pa_delete") @@ -120,19 +109,25 @@ if ($sa=="pa_detail") $pa_id=$http->get("pa_id","number"); $new=new Anc_Plan($cn, $pa_id); - $wSa=HtmlInput::hidden("sa", "pa_update"); $new->get(); $ret.= '
    '; $ret.= $new->form(); - $ret.= $wSa; - $ret.="

    "; + // Export in CSV + $ret.='

    '; + $ret.=Dossier::hidden(); + $ret.=HtmlInput::hidden("act",'CSV:Analytic_Axis'); + $ret.=HtmlInput::hidden("pa_id",$pa_id); + $ret.=HtmlInput::submit('export_analytic_axis',_("Export CSV")); + $ret.='
    '; $ret.=HtmlInput::button_anchor(_('Efface ce plan'), '', 'remove_analytic_plan', 'onclick="return confirm_box(\'remove_analytic_plan\',\'Effacer ?\',function () {window.location=\'do.php?ac='.$_REQUEST['ac'].'&pa_id='.$_GET['pa_id'].'&sa=pa_delete&'.$str_dossier.'\';})"', 'smallbutton'); - $ret.="

    "; + + $ret.='
    '; + //--------------------------------------------------------------------- // Detail now // Use Manage_Table @@ -141,7 +136,7 @@ if ($sa=="pa_detail") $new=new Anc_Plan($cn, $pa_id); $new->get(); - $ret.='
    '; + $ret.='
    '; $anc=new Poste_analytique_SQL($cn); $anc->pa_id=$pa_id; $accounting=new Anc_Account_Table($anc); diff --git a/include/constant.php b/include/constant.php index d9a458d41..b1615f17d 100644 --- a/include/constant.php +++ b/include/constant.php @@ -108,7 +108,7 @@ if ( !defined ("NOALYSS_PACKAGE_REPOSITORY")) { if ( ! defined ("SYSINFO_DISPLAY")) { define ("SYSINFO_DISPLAY",TRUE); } -define ("DBVERSION",133); +define ("DBVERSION",134); define ("MONO_DATABASE",25); define ("DBVERSIONREPO",18); define ('NOTFOUND','--not found--'); diff --git a/include/sql/patch/upgrade132.sql b/include/sql/patch/upgrade132.sql index 4565200de..255c7a2d6 100644 --- a/include/sql/patch/upgrade132.sql +++ b/include/sql/patch/upgrade132.sql @@ -10,6 +10,6 @@ operation_currency join jrnx using (j_id) group by f_id,j_id; -commit ; + insert into version (val,v_description) values (133,'Currency : default accounting for currency difference '); commit ; \ No newline at end of file diff --git a/include/sql/patch/upgrade133.sql b/include/sql/patch/upgrade133.sql new file mode 100644 index 000000000..fc756c694 --- /dev/null +++ b/include/sql/patch/upgrade133.sql @@ -0,0 +1,13 @@ +begin; + +INSERT INTO public.menu_ref +(me_code, me_menu, me_file, me_url, me_description, me_parameter, me_javascript, me_type, me_description_etendue) +VALUES('CSV:Analytic_Axis', 'Export ANC', 'export_anc_axis_csv.php', NULL, 'Export ANC Liste comptes', NULL, NULL, 'PR', NULL); + + +insert into profile_menu (me_code,p_id,p_type_display) select distinct 'CSV:Analytic_Axis', p_id, 'P' from profile_menu +where + p_id in (select distinct p_id from profile_menu where me_code='PLANANC'); + +insert into version (val,v_description) values (134,'Export CSV:Analytic_Axis'); +commit ; \ No newline at end of file From a7ab86adc327ade448e984717f41f97bed75f152 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Fri, 25 Jan 2019 21:41:44 +0100 Subject: [PATCH 25/81] =?UTF-8?q?Mantis=20#0001682:=20CA=20-=20ajouter=20p?= =?UTF-8?q?ossibilit=C3=A9=20d'exporter=20le=20plan=20analytique,=20add=20?= =?UTF-8?q?action=20CSV:Analytic=5FAxis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/export/export_anc_axis_csv.php | 60 ++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 include/export/export_anc_axis_csv.php diff --git a/include/export/export_anc_axis_csv.php b/include/export/export_anc_axis_csv.php new file mode 100644 index 000000000..81dfd8b44 --- /dev/null +++ b/include/export/export_anc_axis_csv.php @@ -0,0 +1,60 @@ +get("pa_id","number"); +$name=$cn->get_value("select pa_name from plan_analytique where pa_id=$1", + [$pa_id]); +$array=$cn->get_array(" select + po_name, + po_amount, + po_description, + ga_description + from + poste_analytique + left join groupe_analytique using (ga_id) + where poste_analytique.pa_id=$1 order by po_name asc ",[$pa_id]); +$output=new Noalyss_Csv($name); +$output->send_header(); +$output->write_header([ + _("Nom"), + _("Description"), + _("Montant"), + _("Groupe"), +]); +if ($array != FALSE ) +{ + $nb_array=count($array); + for ($i=0;$i<$nb_array;$i++) { + $output->add($array[$i]['po_name']); + $output->add($array[$i]['po_description']); + $output->add($array[$i]['po_amount'],"number"); + $output->add($array[$i]['ga_description']); + $output->write(); + } + +} \ No newline at end of file From 1fb36ba6914353300d6293b0cec5184eec82d025 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sun, 27 Jan 2019 21:04:52 +0100 Subject: [PATCH 26/81] mantis #1690: Bug : impossible d'utiliser < dans Inplace_Edit Use base64_decode to protect the string in serialize --- include/ajax/ajax_anc_plan.php | 1 + include/lib/inplace_edit.class.php | 15 +++++++-------- scenario/inplace_edit.test.php | 1 + 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/include/ajax/ajax_anc_plan.php b/include/ajax/ajax_anc_plan.php index 88115cbb4..d839be06b 100644 --- a/include/ajax/ajax_anc_plan.php +++ b/include/ajax/ajax_anc_plan.php @@ -33,6 +33,7 @@ if ( $g_user->check_module("PLANANC ") ) die("forbidden"); $input = $http->request("input"); $action = $http->request("ieaction", "string", "display"); $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/lib/inplace_edit.class.php b/include/lib/inplace_edit.class.php index 5d869cae3..391375744 100644 --- a/include/lib/inplace_edit.class.php +++ b/include/lib/inplace_edit.class.php @@ -53,16 +53,15 @@ class Inplace_Edit */ function __construct(HtmlInput $p_input) { $this->input=$p_input; - $x["input"]=serialize($p_input); - $this->json=json_encode($x, JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES|JSON_NUMERIC_CHECK); + $x["input"]=base64_encode(serialize($p_input)); + $this->json=json_encode($x, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP |JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES|JSON_NUMERIC_CHECK); $this->message=_("Cliquez pour éditer"); } ///@brief build a Inplace_Edit object from /// a serialized string (ajax json parameter = input) static function build($p_serialize) { - - $input= unserialize($p_serialize); + $input= unserialize(base64_decode($p_serialize)); $obj=new Inplace_Edit($input); return $obj; } @@ -170,7 +169,7 @@ EOF; function add_json_param($p_attribute,$p_value) { $x=json_decode($this->json,TRUE); $x[$p_attribute]=$p_value; - $this->json=json_encode($x, JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES|JSON_NUMERIC_CHECK); + $this->json=json_encode($x, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP |JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES|JSON_NUMERIC_CHECK); } /** * \brief return the HtmlObject , var input @@ -187,8 +186,8 @@ EOF; function set_input(HtmlInput $p_input) { $this->input = $p_input; $x=json_decode($this->json,TRUE); - $x["input"]=serialize($p_input); - $this->json=json_encode($x, JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES|JSON_NUMERIC_CHECK); + $x["input"]=base64_encode(serialize($p_input)); + $this->json=json_encode($x, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP |JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES|JSON_NUMERIC_CHECK); } /** * Set the value of the HtmlInput object $input @@ -196,7 +195,7 @@ EOF; */ function set_value($p_value) { $input=$this->get_input(); - $this->input->set_value(strip_tags($p_value)); + $this->input->set_value($p_value); $this->set_input($input); } /** diff --git a/scenario/inplace_edit.test.php b/scenario/inplace_edit.test.php index c3d3a8387..aa5261aae 100644 --- a/scenario/inplace_edit.test.php +++ b/scenario/inplace_edit.test.php @@ -29,6 +29,7 @@ require_once NOALYSS_INCLUDE . '/lib/itext.class.php'; require_once NOALYSS_INCLUDE . '/lib/inum.class.php'; require_once NOALYSS_INCLUDE . '/lib/inplace_edit.class.php'; if (!isset($_REQUEST["TestAjaxFile"])) { + html_page_start(); echo h1(_("Test Inplace_Edit")); /*********************************************** * If TestAjaxFile is not set it is not a ajax call From d698dd1335fc515ab7d46593992258c9b923ab9c Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Mon, 28 Jan 2019 19:04:19 +0100 Subject: [PATCH 27/81] =?UTF-8?q?Mantis=20#1626:=20AFFICHAGE=20BALANCE=20F?= =?UTF-8?q?ICHE=20-=20soldes=20nuls=20au=20d=C3=A9bit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/fiche.inc.php | 46 ++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/include/fiche.inc.php b/include/fiche.inc.php index 66e8a3f1c..28e4724ec 100644 --- a/include/fiche.inc.php +++ b/include/fiche.inc.php @@ -28,8 +28,9 @@ require_once NOALYSS_INCLUDE.'/class/lettering.class.php'; $gDossier = dossier::id(); $cn = Dossier::connect(); +$http=new HttpInput(); global $g_user, $g_failed; -; + /** * Show first the form @@ -37,9 +38,9 @@ global $g_user, $g_failed; /* category */ $categorie = new ISelect('cat'); $categorie->value = $cn->make_array("select fd_id,fd_label||'('||(select count(*) from fiche where fiche.fd_id=fiche_def.fd_id)::text||')' from fiche_def order by fd_label"); -$categorie->selected = (isset($_GET['cat'])) ? $_GET['cat'] : 0; +$categorie->selected = $http->get('cat','number',0); $str_categorie = $categorie->input(); - +$ac = $http->request('ac'); $icall = new ICheckBox("allcard", 1); $icall->selected = (isset($_GET['allcard'])) ? 1 : 0; $str_icall = $icall->input(); @@ -51,8 +52,8 @@ list ($first, $last) = $iperiode->get_limit($exercice); $periode_start = new IDate('start'); $periode_end = new IDate('end'); -$periode_start->value = (isset($_GET['start'])) ? $_GET['start'] : $first->first_day(); -$periode_end->value = (isset($_GET['end'])) ? $_GET['end'] : $last->last_day(); +$periode_start->value = $http->get('start',"date",$first->first_day()); +$periode_end->value = $http->get('end','date', $last->last_day()); $str_start = $periode_start->input(); $str_end = $periode_end->input(); @@ -75,12 +76,12 @@ $histo->javascript = 'onchange="if (this.value==3 || this.value==-1) { g("trstart").style.display="none";g("trend").style.display="none";g("allcard").style.display="none";} else {g("trstart").style.display="";g("trend").style.display="";g("allcard").style.display="";}"'; -$histo->selected = (isset($_GET['histo'])) ? $_GET['histo'] : -1; +$histo->selected = $http->get('histo',"number", -1); $str_histo = $histo->input(); echo '
    '; echo '
    '; echo dossier::hidden(); -echo HtmlInput::hidden('ac', $_GET['ac']); +echo HtmlInput::hidden('ac', $ac); require_once NOALYSS_TEMPLATE.'/impress_cat_card.php'; echo HtmlInput::submit('cat_display', _('Recherche')); echo '
    '; @@ -107,9 +108,9 @@ echo '
    '; if (!isset($_GET['cat_display'])) return; -$fd_id = $_GET['cat']; +$fd_id =$categorie->selected ; -$array = Fiche::get_fiche_def($cn, $_GET['cat'], 'name_asc'); +$array = Fiche::get_fiche_def($cn,$categorie->selected , 'name_asc'); $h_add_card_b = new IButton('add_card'); $h_add_card_b->label = _('Créer une nouvelle fiche'); @@ -122,7 +123,7 @@ $str_add_card = ($g_user->check_action(FICADD) == 1) ? $h_add_card_b->input() : $allcard = (isset($_GET['allcard'])) ? 1 : 0; if ( $allcard == 0 ){ - $fiche_def=new Fiche_Def($cn,$_GET['cat']); + $fiche_def=new Fiche_Def($cn,$categorie->selected ); $fiche_def->get(); echo h1($fiche_def->label,""); echo h2($fiche_def->fd_description,""); @@ -141,7 +142,7 @@ echo '
    '; * Liste * * ******************************************************************************************************************************** */ -if ($_GET['histo'] == -1) +if ($histo->selected == -1) { $write = $g_user->check_action(FICADD); /** @@ -227,7 +228,7 @@ if ($_GET['histo'] == -1) * Summary * * ******************************************************************************************************************************** */ -if ($_GET['histo'] == 3) +if ($histo->selected == 3) { $cat_card = new Fiche_Def($cn); $cat_card->id = $_GET['cat']; @@ -281,7 +282,7 @@ if (isDate($_REQUEST['start']) == null || isDate($_REQUEST['end']) == null) /*************************************************************************************************************************/ // Balance agée tous /*************************************************************************************************************************/ -if ( $_GET['histo'] == 8) +if ( $histo->selected == 8) { require_once NOALYSS_INCLUDE.'/class/balance_age.class.php'; $bal=new Balance_Age($cn); @@ -317,7 +318,7 @@ if ( $_GET['histo'] == 8) /*************************************************************************************************************************/ // Balance en-cours /*************************************************************************************************************************/ -if ( $_GET['histo'] == 7) +if ( $histo->selected == 7) { require_once NOALYSS_INCLUDE.'/class/balance_age.class.php'; $bal=new Balance_Age($cn); @@ -354,14 +355,14 @@ if ( $_GET['histo'] == 7) * Balance * **********************************************************************************************************************************/ -if ($_GET['histo'] == 4 || $_GET['histo'] == 5) +if ($histo->selected == 4 || $histo->selected == 5) { if ( $allcard == 0 ) echo $str_add_card; echo $export_pdf; echo $export_csv; echo $export_print; - $fd = new Fiche_Def($cn, $_REQUEST['cat']); + $fd = new Fiche_Def($cn, $categorie->selected ); if ($allcard == 0 && $fd->hasAttribute(ATTR_DEF_ACCOUNT) == false) { echo alert(_("Cette catégorie n'ayant pas de poste comptable n'a pas de balance")); @@ -374,7 +375,7 @@ if ($_GET['histo'] == 4 || $_GET['histo'] == 5) } else { - $afiche[0] = array('fd_id' => $_REQUEST['cat']); + $afiche[0] = array('fd_id' => $categorie->selected ); } for ($e = 0; $e < count($afiche); $e++) @@ -427,7 +428,7 @@ if ($_GET['histo'] == 4 || $_GET['histo'] == 5) td(nbm($solde['debit']), 'class="sorttable_numeric" sorttable_customkey="'.$solde['debit'].'" style="text-align:right"') . td(nbm($solde['credit']), 'class="sorttable_numeric" sorttable_customkey="'.$solde['debit'].'" style="text-align:right"') . td(nbm(abs($solde['solde'])), 'class="sorttable_numeric" sorttable_customkey="'.$solde['solde'].'" style="text-align:right"') . - td((($solde['debit'] < $solde['credit']) ? 'C' : 'D'), 'style="text-align:right"'), $class + td(findSide($solde['debit'] - $solde['credit']), 'style="text-align:right"'), $class ); @@ -441,7 +442,8 @@ if ($_GET['histo'] == 4 || $_GET['histo'] == 5) td(nbm($sum_deb), 'style="text-align:right"'). td(nbm($sum_cred), 'style="text-align:right"'). td(nbm(abs($sum_solde)), 'style="text-align:right"'). - td((($sum_deb < $sum_cred) ? 'C' : 'D'), 'style="text-align:right"'),' class="highlight"'); + td(findSide($sum_deb - $sum_cred) , 'style="text-align:right"'), + ' class="highlight"'); echo ''; echo ''; } @@ -582,12 +584,12 @@ for ($e = 0; $e < count($afiche); $e++) $solde=abs(round($amount_cred - $amount_deb, 2)); if ( $solde == 0) { - $s='solde'; + $s=_('solde'); } else if ($amount_deb > $amount_cred) - $s = 'solde débiteur'; + $s = _('solde débiteur'); else - $s = 'solde crediteur'; + $s = _('solde crediteur'); echo td($s); echo td(nbm($solde), ' style="font-weight:bold;text-align:right"'); echo ''; From e8c2f577658d06914028b738dc0ccf5b2063bb53 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Mon, 28 Jan 2019 19:37:22 +0100 Subject: [PATCH 28/81] =?UTF-8?q?Mantis=20#1643:=20D=C3=A9placement=20du?= =?UTF-8?q?=20"bouton"=20=C2=ABretour=20en-haut/calculatrice=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- html/js/scripts.js | 2 +- include/param_pcmn.inc.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/html/js/scripts.js b/html/js/scripts.js index d4e8290c7..59575a8c0 100644 --- a/html/js/scripts.js +++ b/html/js/scripts.js @@ -2905,7 +2905,7 @@ function create_anchor_up() function init_scroll() { var up=new Element('div',{"class":"inner_box", - "style":"padding:5px;left:auto;width:auto;height: auto;display:none;position:fixed;bottom:105px;right:50px;text-align:center;font-size:20px", + "style":"padding:5px;left:auto;width:auto;height: auto;display:none;position:fixed;bottom:30%;right:50px;text-align:center;font-size:20px", id:"go_up" }); up.innerHTML=' '; diff --git a/include/param_pcmn.inc.php b/include/param_pcmn.inc.php index fdb03237c..73b2a442e 100644 --- a/include/param_pcmn.inc.php +++ b/include/param_pcmn.inc.php @@ -76,7 +76,7 @@ echo $mtable->display_table(" where pcm_val::text like '{$g_start}%' order by pc */ ?> -