2
0
forked from Wavyzz/dolibarr

Ask to use temp dir inside documents directory

This commit is contained in:
Laurent Destailleur
2009-02-11 01:39:14 +00:00
parent 33dac25ce4
commit e7fa358d27

View File

@@ -112,16 +112,17 @@ class ExportExcel extends ModeleExports
*/ */
function open_file($file,$outputlangs) function open_file($file,$outputlangs)
{ {
global $langs; global $conf,$langs;
$outputlangs->charset_output='ISO-8859-1'; // Because Excel 5 format is ISO $outputlangs->charset_output='ISO-8859-1'; // Because Excel 5 format is ISO
dolibarr_syslog("ExportExcel::open_file file=".$file); dolibarr_syslog("ExportExcel::open_file file=".$file);
$ret=1; $ret=1;
$outputlangs->load("exports"); $outputlangs->load("exports");
$this->workbook = &new writeexcel_workbookbig($file); $this->workbook = &new writeexcel_workbookbig($file);
$this->workbook->set_tempdir($conf->export->dir_temp); // Set temporary directory
$this->workbook->set_sheetname($outputlangs->trans("Sheet")); $this->workbook->set_sheetname($outputlangs->trans("Sheet"));
$this->worksheet = &$this->workbook->addworksheet(); $this->worksheet = &$this->workbook->addworksheet();
@@ -136,7 +137,7 @@ class ExportExcel extends ModeleExports
function write_header($outputlangs) function write_header($outputlangs)
{ {
$outputlangs->charset_output='ISO-8859-1'; // Because Excel 5 format is ISO $outputlangs->charset_output='ISO-8859-1'; // Because Excel 5 format is ISO
return 0; return 0;
} }
@@ -147,7 +148,7 @@ class ExportExcel extends ModeleExports
function write_title($array_export_fields_label,$array_selected_sorted,$outputlangs) function write_title($array_export_fields_label,$array_selected_sorted,$outputlangs)
{ {
$outputlangs->charset_output='ISO-8859-1'; // Because Excel 5 format is ISO $outputlangs->charset_output='ISO-8859-1'; // Because Excel 5 format is ISO
// Create a format for the column headings // Create a format for the column headings
$formatheader =$this->workbook->addformat(); $formatheader =$this->workbook->addformat();
$formatheader->set_bold(); $formatheader->set_bold();
@@ -155,7 +156,7 @@ class ExportExcel extends ModeleExports
//$formatheader->set_size(12); //$formatheader->set_size(12);
//$formatheader->set_font("Courier New"); //$formatheader->set_font("Courier New");
//$formatheader->set_align('center'); //$formatheader->set_align('center');
//$this->worksheet->insert_bitmap('A1', 'php.bmp', 16, 8); //$this->worksheet->insert_bitmap('A1', 'php.bmp', 16, 8);
$this->col=0; $this->col=0;
@@ -177,7 +178,7 @@ class ExportExcel extends ModeleExports
function write_record($array_alias,$array_selected_sorted,$objp,$outputlangs) function write_record($array_alias,$array_selected_sorted,$objp,$outputlangs)
{ {
$outputlangs->charset_output='ISO-8859-1'; // Because Excel 5 format is ISO $outputlangs->charset_output='ISO-8859-1'; // Because Excel 5 format is ISO
$formatdate=$this->workbook->addformat(); $formatdate=$this->workbook->addformat();
$formatdate->set_num_format('yyyy-mm-dd'); $formatdate->set_num_format('yyyy-mm-dd');
//$formatdate->set_num_format(0x0f); //$formatdate->set_num_format(0x0f);
@@ -185,8 +186,8 @@ class ExportExcel extends ModeleExports
$formatdatehour=$this->workbook->addformat(); $formatdatehour=$this->workbook->addformat();
$formatdatehour->set_num_format('yyyy-mm-dd hh:mm:ss'); $formatdatehour->set_num_format('yyyy-mm-dd hh:mm:ss');
//$formatdatehour->set_num_format(0x0f); //$formatdatehour->set_num_format(0x0f);
$this->col=0; $this->col=0;
foreach($array_selected_sorted as $code => $value) foreach($array_selected_sorted as $code => $value)
{ {
@@ -242,7 +243,7 @@ class ExportExcel extends ModeleExports
return 0; return 0;
} }
/** /**
* Clean a cell to respect rules of Excel file cells * Clean a cell to respect rules of Excel file cells
* @param newvalue String to clean * @param newvalue String to clean
@@ -252,7 +253,7 @@ class ExportExcel extends ModeleExports
{ {
// Rule Dolibarr: No HTML // Rule Dolibarr: No HTML
$newvalue=dol_string_nohtmltag($newvalue); $newvalue=dol_string_nohtmltag($newvalue);
return $newvalue; return $newvalue;
} }
} }