[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 06/27: Code Cleaning : remove direct access t
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 06/27: Code Cleaning : remove direct access to global , add Exception |
Date: |
Sat, 2 Nov 2019 18:12:13 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 5bcea2bf57d62497421ebd6876df7f52c7ef6e6c
Author: Dany De Bontridder <address@hidden>
Date: Sat Nov 2 00:54:35 2019 +0100
Code Cleaning : remove direct access to global , add Exception
---
include/class/acc_balance.class.php | 11 +----------
include/class/acc_ledger.class.php | 8 ++++++--
include/class/acc_ledger_info.class.php | 16 ----------------
include/lib/pdf_core.class.php | 2 +-
4 files changed, 8 insertions(+), 29 deletions(-)
diff --git a/include/class/acc_balance.class.php
b/include/class/acc_balance.class.php
index 446b2ef..d2ecc88 100644
--- a/include/class/acc_balance.class.php
+++ b/include/class/acc_balance.class.php
@@ -448,14 +448,5 @@ class Acc_Balance
$p_pdf->write_cell(10,6,$side);
$p_pdf->line_new();
}
- static function test_me ()
- {
- require 'class/user.class.php';
- global $g_user;
- $cn=Dossier::connect();
- $g_user=new User($cn);
- $a=new Acc_Balance($cn);
- $a->get_row(163, 175, 1);
- var_dump($a);
- }
+
}
diff --git a/include/class/acc_ledger.class.php
b/include/class/acc_ledger.class.php
index c217540..3fe53f6 100644
--- a/include/class/acc_ledger.class.php
+++ b/include/class/acc_ledger.class.php
@@ -1047,7 +1047,11 @@ class Acc_Ledger extends jrn_def_sql
*/
if ($this->check_periode()==false||!isset($p_array['period']))
{
- $periode->find_periode($e_date);
+ try {
+ $periode->find_periode($e_date);
+ } catch (Exception $e) {
+ throw new Exception(_("PĂ©riode inexistante"), 6, $e);
+ }
}
else
{
@@ -2531,7 +2535,7 @@ class Acc_Ledger extends jrn_def_sql
/* Numbering (only FIN) */
$num_op=new ICheckBox('numb_operation');
echo dossier::hidden();
- echo HtmlInput::hidden('ac', $_REQUEST['ac']);
+ echo HtmlInput::hidden('ac', $http->request('ac'));
echo $hidden;
$cn=$this->db;
diff --git a/include/class/acc_ledger_info.class.php
b/include/class/acc_ledger_info.class.php
index 689879b..44efb7f 100644
--- a/include/class/acc_ledger_info.class.php
+++ b/include/class/acc_ledger_info.class.php
@@ -199,20 +199,4 @@ class Acc_Ledger_Info
$this->insert();
}
}
- static function test_me()
- {
- echo "Dossier = ".Dossier::id();
- $cn=Dossier::connect();
- $a=new Acc_Ledger_Info($cn);
- $a->jr_id=3;
- $a->id_type='BON_COMMANDE';
- $a->ji_value='BON';
- var_dump($a);
- $a->insert();
-
- $a->set_jrn_id(7);
- $a->set_type('OTHER');
- $a->set_value('Autre test');
- $a->insert();
- }
}
diff --git a/include/lib/pdf_core.class.php b/include/lib/pdf_core.class.php
index f85fcd2..4664cf4 100644
--- a/include/lib/pdf_core.class.php
+++ b/include/lib/pdf_core.class.php
@@ -253,7 +253,7 @@ class PDF_Core extends TFPDF
parent::Ln($this->bigger);
$this->bigger=0;
}
- /**
+ /**
* If the step is even then return 1 and set the backgroup color to blue ,
otherwise
* returns 0, and set the background color to white
* It is use to compute alternated colored row , it the parameter fill in
write_cell and
- [Noalyss-commit] [noalyss] branch master updated (9e55774 -> a56f8cc), Dany De Bontridder, 2019/11/02
- [Noalyss-commit] [noalyss] 02/27: Bug : fix problem with reformating number in Sales and Purchase Ledger, Dany De Bontridder, 2019/11/02
- [Noalyss-commit] [noalyss] 04/27: Merge branch 'dev7103', Dany De Bontridder, 2019/11/02
- [Noalyss-commit] [noalyss] 05/27: Code Cleaning : remove funciton getDefLine, Dany De Bontridder, 2019/11/02
- [Noalyss-commit] [noalyss] 10/27: Acc_Ledger_History add documentation, Dany De Bontridder, 2019/11/02
- [Noalyss-commit] [noalyss] 08/27: Acc_Ledger_FIN Remove DeadCode : show_ledger, Dany De Bontridder, 2019/11/02
- [Noalyss-commit] [noalyss] 09/27: Test : Acc_Ledger_FIN, Dany De Bontridder, 2019/11/02
- [Noalyss-commit] [noalyss] 12/27: Test : Acc_Ledger_History_Financial Test : Acc_Ledger_History_Purchase Add function phpunit_page_start, Dany De Bontridder, 2019/11/02
- [Noalyss-commit] [noalyss] 03/27: Merge branch 'v7110-stable', Dany De Bontridder, 2019/11/02
- [Noalyss-commit] [noalyss] 01/27: documentation, Dany De Bontridder, 2019/11/02
- [Noalyss-commit] [noalyss] 06/27: Code Cleaning : remove direct access to global , add Exception,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 25/27: TEST fix bug in acc_balanceTest, Dany De Bontridder, 2019/11/02
- [Noalyss-commit] [noalyss] 13/27: TEST : Acc_Ledger_History*, Dany De Bontridder, 2019/11/02
- [Noalyss-commit] [noalyss] 14/27: Facility : new function to help with phpunit, Dany De Bontridder, 2019/11/02
- [Noalyss-commit] [noalyss] 26/27: Documentation, Dany De Bontridder, 2019/11/02
- [Noalyss-commit] [noalyss] 15/27: Facility improve page_start, Dany De Bontridder, 2019/11/02
- [Noalyss-commit] [noalyss] 22/27: Merge branch 'dev-7200', Dany De Bontridder, 2019/11/02
- [Noalyss-commit] [noalyss] 21/27: Bug : export PDF for PRINTTVA doesn't print all the ledgers, Dany De Bontridder, 2019/11/02
- [Noalyss-commit] [noalyss] 17/27: Documentation, Dany De Bontridder, 2019/11/02
- [Noalyss-commit] [noalyss] 07/27: TEST : add new files, Dany De Bontridder, 2019/11/02
- [Noalyss-commit] [noalyss] 19/27: PRINTTVA : cosmetic bug, Dany De Bontridder, 2019/11/02