noalyss-commit
[Top][All Lists]
Advanced

[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 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]