From 48c7d365189437919acecf909cd9c352eff70708 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 9 Sep 2007 16:30:01 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20bug=20sur=20le=20nombre=20de=20colonne?= =?UTF-8?q?=20enregistr=E9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/exports/export.php | 2 +- .../modules/export/export_excel.modules.php | 35 +++++++++---------- .../class.writeexcel_worksheet.inc.php | 4 +-- htdocs/lib/functions.inc.php | 4 +-- 4 files changed, 22 insertions(+), 23 deletions(-) diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index c26c5b570b4..fc4fd2010d4 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -622,7 +622,7 @@ if ($step == 4 && $datatoexport) // test d'affichage du tableau excel /* print '
'; - viewExcelFileContent($conf->export->dir_temp.'/1/export_commande_1.xls'); + viewExcelFileContent($conf->export->dir_temp.'/1/export_commande_1.xls',5); print '
'; */ } diff --git a/htdocs/includes/modules/export/export_excel.modules.php b/htdocs/includes/modules/export/export_excel.modules.php index 2814a9f1f75..49e4961c0bc 100644 --- a/htdocs/includes/modules/export/export_excel.modules.php +++ b/htdocs/includes/modules/export/export_excel.modules.php @@ -146,26 +146,25 @@ class ExportExcel extends ModeleExports function write_record($array_alias,$array_selected_sorted,$objp) { - global $langs; + global $langs; - $this->col=0; - foreach($array_selected_sorted as $code => $value) + $this->col=0; + foreach($array_selected_sorted as $code => $value) + { + $alias=$array_alias[$code]; + $newvalue=$objp->$alias; + // Nettoyage newvalue + $newvalue=clean_html($newvalue); + // Traduction newvalue + if (eregi('^\((.*)\)$',$newvalue,$reg)) { - $alias=$array_alias[$code]; - $newvalue=$objp->$alias; - // Nettoyage newvalue - $newvalue=clean_html($newvalue); - // Traduction newvalue - if (eregi('^\((.*)\)$',$newvalue,$reg)) - { - $newvalue=$langs->transnoentities($reg[1]); - } - - $this->worksheet->write($this->row, $this->col, $newvalue); - $this->col++; - } - $this->row++; - return 0; + $newvalue=$langs->transnoentities($reg[1]); + } + $this->worksheet->write($this->row, $this->col, $newvalue); + $this->col++; + } + $this->row++; + return 0; } diff --git a/htdocs/includes/php_writeexcel/class.writeexcel_worksheet.inc.php b/htdocs/includes/php_writeexcel/class.writeexcel_worksheet.inc.php index f323608eae4..18cf9f09be0 100644 --- a/htdocs/includes/php_writeexcel/class.writeexcel_worksheet.inc.php +++ b/htdocs/includes/php_writeexcel/class.writeexcel_worksheet.inc.php @@ -1904,9 +1904,9 @@ function set_row() { $record = 0x0200; // Record identifier $length = 0x000A; // Number of bytes to follow $row_min = $this->_dim_rowmin; // First row - $row_max = $this->_dim_rowmax; // Last row plus 1 + $row_max = $this->_dim_rowmax + 1; // Last row plus 1 $col_min = $this->_dim_colmin; // First column - $col_max = $this->_dim_colmax; // Last column plus 1 + $col_max = $this->_dim_colmax + 1; // Last column plus 1 $reserved = 0x0000; // Reserved by Excel $header = pack("vv", $record, $length); diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php index 00b1e18c8ab..b651db96017 100644 --- a/htdocs/lib/functions.inc.php +++ b/htdocs/lib/functions.inc.php @@ -3355,7 +3355,7 @@ function viewExcelFileContent($file_to_include='',$max_rows=0,$max_cols=0) $data->setOutputEncoding('CPa25a'); $data->read($file_to_include); error_reporting(E_ALL ^ E_NOTICE); - + echo "