[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 125/219: Rewriting : Use of Noalyss_CSV
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 125/219: Rewriting : Use of Noalyss_CSV |
Date: |
Mon, 18 Dec 2017 13:22:49 -0500 (EST) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 4c64f8a50ff642b55a1bc95d48a9a074c49f1986
Author: Dany De Bontridder <address@hidden>
Date: Wed Nov 1 17:43:20 2017 +0100
Rewriting : Use of Noalyss_CSV
---
include/lib/impress.class.php | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)
diff --git a/include/lib/impress.class.php b/include/lib/impress.class.php
index 42f3905..d9f59b6 100644
--- a/include/lib/impress.class.php
+++ b/include/lib/impress.class.php
@@ -22,6 +22,7 @@
* \brief contains function for the printing
*/
require_once NOALYSS_INCLUDE.'/class/periode.class.php';
+require_once NOALYSS_INCLUDE.'/lib/noalyss_csv.class.php';
class Impress
@@ -250,23 +251,20 @@ class Impress
* @param type $aheader double array, each item of the array contains
* a key type (num) and a key title
*/
- static function array_to_csv($array,$aheader)
+ static function array_to_csv($array,$aheader,$p_filename)
{
- $seq="";
+ $file_csv=new Noalyss_Csv($p_filename);
for ($i=0;$i<count($aheader);$i++)
{
- echo $seq.'"'.$aheader[$i]['title'].'"';
- $seq=";";
+ $file_csv->add($aheader[$i]['title']);
}
- printf("\r");
+ $file_csv->write();
- $seq="";
// fetch all the rows
for ($i=0;$i<count($array);$i++)
{
$row=$array[$i];
- $sep2="";
- $e=0;
+ $e=0;
// for each rows, for each value
foreach ($array[$i] as $key=>$value)
{
@@ -277,17 +275,17 @@ class Impress
switch ($aheader[$e]['type'])
{
case 'num':
- echo $sep2.nb($value);
+ $file_csv->add($value,
"number");
break;
default:
- echo
$sep2.'"'.$value.'"';
+ $file_csv->add($value);
}
} else {
- echo '"'.$value.'"'.$sep2;
+ $file->add($value);
}
- $sep2=";";$e++;
}
- printf("\r");
+ $file_csv->write();
+ $e++;
}
}
}
\ No newline at end of file
- [Noalyss-commit] [noalyss] 43/219: Add the icon for modify, (continued)
- [Noalyss-commit] [noalyss] 43/219: Add the icon for modify, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 12/219: Infobulle : warning : esthetic, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 126/219: Esthetic : align text, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 113/219: Améliore esthétique, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 106/219: task #0001272: Rendre possible l'appel de la calculatrice depuis le fin fond d'une page., Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 59/219: ManageTable : Correct bug for the sort, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 76/219: Extourne : correct reverse operation for autoliquidation, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 135/219: Template operation : message if there is no template, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 192/219: Select_box : add a new type of value and fix a problem with the position of the div, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 112/219: Task #0001481: Encodage Vente, Achat, Fin ou OD Task #0001485: possibilité de clouer une fenetre, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 125/219: Rewriting : Use of Noalyss_CSV,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 175/219: Change autocomplete and adapt Icard setWidth is false + indicator icon for ICard, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 81/219: PRINTPOSTE : esthetic, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 121/219: correct js : getMessage instead of message, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 78/219: InPlace_Switch : add a supplemental javascript command, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 10/219: GESTION -> CUST, MANAGER, ADM ... esthetic move the name of the tiers to the right, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 50/219: task #0001467: Journaux VENTES - inversion D/C dans liste de catégorie de fiches, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 169/219: For MSIE, force to unicode (still problem with MSIE11) !, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 94/219: Fix background color for button 'modele operation', Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 139/219: Javascript : small error, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 42/219: SQL : protection injection, Dany De Bontridder, 2017/12/18