From 62ab35ef609656fd3f912e5e667a10ce14e20504 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sat, 2 Nov 2019 17:47:29 +0100 Subject: [PATCH] Facility improve page_start --- include/class/acc_ledger_history_generic.class.php | 3 --- unit-test/facility.class.php | 14 ++++++++------ .../acc_ledger_history_financialTest.class.php | 4 ++-- .../class/acc_ledger_history_genericTest.class.php | 8 ++++---- .../acc_ledger_history_purchaseTest.class.php | 8 ++++---- .../class/acc_ledger_history_saleTest.class.php | 8 ++++---- 6 files changed, 22 insertions(+), 23 deletions(-) diff --git a/include/class/acc_ledger_history_generic.class.php b/include/class/acc_ledger_history_generic.class.php index 8770f8219..8014b7cd9 100644 --- a/include/class/acc_ledger_history_generic.class.php +++ b/include/class/acc_ledger_history_generic.class.php @@ -777,9 +777,6 @@ class Acc_Ledger_History_Generic extends Acc_Ledger_History if (count($this->data)==0) exit; $old_id=""; - /** - * @todo add table headers - */ foreach ($this->data[0] as $idx=>$op) { // should clean description : remove tag and '; char diff --git a/unit-test/facility.class.php b/unit-test/facility.class.php index 25afcd0cc..b38c39639 100644 --- a/unit-test/facility.class.php +++ b/unit-test/facility.class.php @@ -34,7 +34,7 @@ class Facility static function page_start() { $noalyss_home=NOALYSS_HOME; - echo << PRINTJRN NOALYSS @@ -50,16 +50,18 @@ class Facility
EOF; + return $ret; } + /** * Create a file with the content - * @param type $p_dir - * @param type $p_file - * @param type $p_content + * @param string $p_dir usually __DIR__ + * @param string $p_file name of the file + * @param string $p_content content */ - static function save_file($p_dir,$p_file,$p_content) + static function save_file($p_dir, $p_file, $p_content) { - $hFile=fopen($p_dir."/".$p_name,"w+"); + $hFile=fopen($p_dir."/".$p_name, "w+"); fwrite($hFile, $content); fclose($hFile); } diff --git a/unit-test/include/class/acc_ledger_history_financialTest.class.php b/unit-test/include/class/acc_ledger_history_financialTest.class.php index 67e6ac50f..058b89fd3 100644 --- a/unit-test/include/class/acc_ledger_history_financialTest.class.php +++ b/unit-test/include/class/acc_ledger_history_financialTest.class.php @@ -74,7 +74,7 @@ class Acc_Ledger_History_FinancialTest extends TestCase $name="acc_ledger_history_export_listing.html"; $this->object->set_m_mode("L"); ob_start(); - \Noalyss\Facility::page_start(); + echo \Noalyss\Facility::page_start(); $this->object->export_html(); $content=ob_get_contents(); @@ -85,7 +85,7 @@ class Acc_Ledger_History_FinancialTest extends TestCase $name="acc_ledger_history_export_accounting.html"; $this->object->set_m_mode("E"); ob_start(); - \Noalyss\Facility::page_start(); + echo \Noalyss\Facility::page_start(); $this->object->export_html(); $content=ob_get_contents(); diff --git a/unit-test/include/class/acc_ledger_history_genericTest.class.php b/unit-test/include/class/acc_ledger_history_genericTest.class.php index b412cc433..c9b3f4605 100644 --- a/unit-test/include/class/acc_ledger_history_genericTest.class.php +++ b/unit-test/include/class/acc_ledger_history_genericTest.class.php @@ -73,7 +73,7 @@ class Acc_Ledger_History_GenericTest extends TestCase $name="acc_ledger_history_Generic_export_listing.html"; $this->object->set_m_mode("L"); ob_start(); - \Noalyss\Facility::page_start(); + echo \Noalyss\Facility::page_start(); $this->object->export_html(); $content=ob_get_contents(); @@ -84,7 +84,7 @@ class Acc_Ledger_History_GenericTest extends TestCase $name="acc_ledger_history_Generic_export_extended.html"; $this->object->set_m_mode("E"); ob_start(); - \Noalyss\Facility::page_start(); + echo \Noalyss\Facility::page_start(); $this->object->export_html(); $content=ob_get_contents(); @@ -95,7 +95,7 @@ class Acc_Ledger_History_GenericTest extends TestCase $name="acc_ledger_history_Generic_export_detail.html"; $this->object->set_m_mode("D"); ob_start(); - \Noalyss\Facility::page_start(); + echo \Noalyss\Facility::page_start(); $this->object->export_html(); $content=ob_get_contents(); @@ -106,7 +106,7 @@ class Acc_Ledger_History_GenericTest extends TestCase $name="acc_ledger_history_Generic_export_accounting.html"; $this->object->set_m_mode("D"); ob_start(); - \Noalyss\Facility::page_start(); + echo \Noalyss\Facility::page_start(); $this->object->export_html(); $content=ob_get_contents(); diff --git a/unit-test/include/class/acc_ledger_history_purchaseTest.class.php b/unit-test/include/class/acc_ledger_history_purchaseTest.class.php index b6dd9ede8..de8485e96 100644 --- a/unit-test/include/class/acc_ledger_history_purchaseTest.class.php +++ b/unit-test/include/class/acc_ledger_history_purchaseTest.class.php @@ -72,7 +72,7 @@ class Acc_Ledger_History_PurchaseTest extends TestCase $name="acc_ledger_history_purchase_export_listing.html"; $this->object->set_m_mode("L"); ob_start(); - \Noalyss\Facility::page_start(); + echo \Noalyss\Facility::page_start(); $this->object->export_html(); $content=ob_get_contents(); @@ -83,7 +83,7 @@ class Acc_Ledger_History_PurchaseTest extends TestCase $name="acc_ledger_history_purchase_export_extended.html"; $this->object->set_m_mode("E"); ob_start(); - \Noalyss\Facility::page_start(); + echo \Noalyss\Facility::page_start(); $this->object->export_html(); $content=ob_get_contents(); @@ -94,7 +94,7 @@ class Acc_Ledger_History_PurchaseTest extends TestCase $name="acc_ledger_history_purchase_export_detail.html"; $this->object->set_m_mode("D"); ob_start(); - \Noalyss\Facility::page_start(); + echo \Noalyss\Facility::page_start(); $this->object->export_html(); $content=ob_get_contents(); @@ -105,7 +105,7 @@ class Acc_Ledger_History_PurchaseTest extends TestCase $name="acc_ledger_history_purchase_export_accounting.html"; $this->object->set_m_mode("D"); ob_start(); - \Noalyss\Facility::page_start(); + echo \Noalyss\Facility::page_start(); $this->object->export_html(); $content=ob_get_contents(); diff --git a/unit-test/include/class/acc_ledger_history_saleTest.class.php b/unit-test/include/class/acc_ledger_history_saleTest.class.php index d76263b0c..01cc92402 100644 --- a/unit-test/include/class/acc_ledger_history_saleTest.class.php +++ b/unit-test/include/class/acc_ledger_history_saleTest.class.php @@ -70,7 +70,7 @@ class Acc_Ledger_History_SaleTest extends TestCase $name="acc_ledger_history_sale_export_listing.html"; $this->object->set_m_mode("L"); ob_start(); - \Noalyss\Facility::page_start(); + echo \Noalyss\Facility::page_start(); $this->object->export_html(); $content=ob_get_contents(); @@ -81,7 +81,7 @@ class Acc_Ledger_History_SaleTest extends TestCase $name="acc_ledger_history_sale_export_extended.html"; $this->object->set_m_mode("E"); ob_start(); - \Noalyss\Facility::page_start(); + echo \Noalyss\Facility::page_start(); $this->object->export_html(); $content=ob_get_contents(); @@ -92,7 +92,7 @@ class Acc_Ledger_History_SaleTest extends TestCase $name="acc_ledger_history_sale_export_detail.html"; $this->object->set_m_mode("D"); ob_start(); - \Noalyss\Facility::page_start(); + echo \Noalyss\Facility::page_start(); $this->object->export_html(); $content=ob_get_contents(); @@ -103,7 +103,7 @@ class Acc_Ledger_History_SaleTest extends TestCase $name="acc_ledger_history_sale_export_accounting.html"; $this->object->set_m_mode("D"); ob_start(); - \Noalyss\Facility::page_start(); + echo \Noalyss\Facility::page_start(); $this->object->export_html(); $content=ob_get_contents();