From e6d041e81418bdcc1bbc3e125b4474ddc215d4e2 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 31 Oct 2006 10:17:42 +0000 Subject: [PATCH] Fixed excel export function for ldap_manager git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4972 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_ldap.inc | 2 +- .../class.writeexcel_workbook.inc.php | 31 ++++++++++--------- .../class.writeexcel_workbookbig.inc.php | 2 +- .../class.writeexcel_worksheet.inc.php | 16 +++++----- .../addons/ldapmanager/class_exportxls.inc | 2 +- 5 files changed, 27 insertions(+), 26 deletions(-) diff --git a/include/class_ldap.inc b/include/class_ldap.inc index e5809d720..7abac71be 100644 --- a/include/class_ldap.inc +++ b/include/class_ldap.inc @@ -826,7 +826,7 @@ class LDAP{ function gen_xls ($dn, $filter= "(objectClass=*)", $attributes= array('*'), $recursive= TRUE,$r_array=0) { - $display= ""; + $display= array(); $this->cd($dn); $this->search("$filter"); diff --git a/include/php_writeexcel/class.writeexcel_workbook.inc.php b/include/php_writeexcel/class.writeexcel_workbook.inc.php index c175c43dc..cdaac1557 100644 --- a/include/php_writeexcel/class.writeexcel_workbook.inc.php +++ b/include/php_writeexcel/class.writeexcel_workbook.inc.php @@ -83,7 +83,7 @@ function writeexcel_workbook($filename) { $this->_palette = array(); # Add the default format for hyperlinks - $this->_url_format =& $this->addformat(array('color' => 'blue', 'underline' => 1)); + $this->_url_format = $this->addformat(array('color' => 'blue', 'underline' => 1)); # Check for a filename if ($this->_filename == '') { @@ -128,7 +128,7 @@ function close() { # # Returns: a list of the worksheet objects in a workbook # -function &sheets() { +function sheets() { return $this->_worksheets; } @@ -144,7 +144,7 @@ function &sheets() { # # Returns: reference to a worksheet object # -function &addworksheet($name="") { +function addworksheet($name="") { # Check that sheetname is <= 31 chars (Excel limit). if (strlen($name) > 31) { @@ -170,7 +170,7 @@ function &addworksheet($name="") { $this->_url_format, $this->_parser, $this->_tempdir); - $this->_worksheets[$index] = &$worksheet; # Store ref for iterator + $this->_worksheets[$index] = $worksheet; # Store ref for iterator $this->_sheetnames[$index] = $name; # Store EXTERNSHEET names $this->_parser->set_ext_sheet($name, $index); # Store names in Formula.pm return $worksheet; @@ -183,7 +183,7 @@ function &addworksheet($name="") { # Add a new format to the Excel workbook. This adds an XF record and # a FONT record. Also, pass any properties to the Format::new(). # -function &addformat($para=false) { +function addformat($para=false) { if($para===false) { $format = new writeexcel_format($this->_xf_index); } else { @@ -192,7 +192,7 @@ function &addformat($para=false) { $this->_xf_index += 1; # Store format reference - $this->_formats[]=&$format; + $this->_formats[]=$format; return $format; } @@ -232,7 +232,7 @@ function set_custom_color($index, $red, $green, $blue) { } */ - $aref = &$this->_palette; + $aref = $this->_palette; # Check that the colour index is the right range if ($index < 8 or $index > 64) { @@ -428,10 +428,11 @@ function _store_workbook() { # Calculate the number of selected worksheet tabs and call the finalization # methods for each worksheet for ($c=0;$c_worksheets);$c++) { - $sheet=&$this->_worksheets[$c]; + $sheet=$this->_worksheets[$c]; if ($sheet->_selected) { $this->_selected++; - } + + } $sheet->_close($this->_sheetnames); } @@ -460,7 +461,7 @@ function _store_workbook() { # Add BOUNDSHEET records for ($c=0;$c_worksheets);$c++) { - $sheet=&$this->_worksheets[$c]; + $sheet=$this->_worksheets[$c]; $this->_store_boundsheet($sheet->_name, $sheet->_offset); } @@ -495,7 +496,7 @@ function _store_OLE_file() { $OLE->write($this->_data); for ($c=0;$c_worksheets);$c++) { - $sheet=&$this->_worksheets[$c]; + $sheet=$this->_worksheets[$c]; while ($tmp = $sheet->get_data()) { $OLE->write($tmp); } @@ -524,7 +525,7 @@ function _calc_sheet_offsets() { $offset += $EOF; for ($c=0;$c_worksheets);$c++) { - $sheet=&$this->_worksheets[$c]; + $sheet=$this->_worksheets[$c]; $sheet->_offset = $offset; $offset += $sheet->_datasize; } @@ -559,7 +560,7 @@ function _store_all_fonts() { $fonts[$key] = 0; # Index of the default font for ($c=0;$c_formats);$c++) { - $format=&$this->_formats[$c]; + $format=$this->_formats[$c]; $key = $format->get_font_key(); @@ -594,7 +595,7 @@ function _store_all_num_formats() { # for ($c=0;$c_formats);$c++) { - $format=&$this->_formats[$c]; + $format=$this->_formats[$c]; $num_format = $format->_num_format; @@ -1086,7 +1087,7 @@ function _store_name_long($par0, $par1, $par2, $par3, $par4, $par5) { # Stores the PALETTE biff record. # function _store_palette() { - $aref = &$this->_palette; + $aref = $this->_palette; $record = 0x0092; # Record identifier $length = 2 + 4 * sizeof($aref); # Number of bytes to follow diff --git a/include/php_writeexcel/class.writeexcel_workbookbig.inc.php b/include/php_writeexcel/class.writeexcel_workbookbig.inc.php index bc0ba40ba..8f0c752fd 100644 --- a/include/php_writeexcel/class.writeexcel_workbookbig.inc.php +++ b/include/php_writeexcel/class.writeexcel_workbookbig.inc.php @@ -39,7 +39,7 @@ class writeexcel_workbookbig extends writeexcel_workbook { $file->append($this->_data); for ($c=0;$c_worksheets);$c++) { - $worksheet=&$this->_worksheets[$c]; + $worksheet=$this->_worksheets[$c]; while ($data=$worksheet->get_data()) { $file->append($data); } diff --git a/include/php_writeexcel/class.writeexcel_worksheet.inc.php b/include/php_writeexcel/class.writeexcel_worksheet.inc.php index c21097235..6db3f5dbe 100644 --- a/include/php_writeexcel/class.writeexcel_worksheet.inc.php +++ b/include/php_writeexcel/class.writeexcel_worksheet.inc.php @@ -103,8 +103,8 @@ class writeexcel_worksheet extends writeexcel_biffwriter { /* * Constructor. Creates a new Worksheet object from a BIFFwriter object */ - function writeexcel_worksheet($name, $index, &$activesheet, &$firstsheet, - &$url_format, &$parser, $tempdir) { + function writeexcel_worksheet($name, $index, $activesheet, $firstsheet, + $url_format, $parser, $tempdir) { $this->writeexcel_biffwriter(); @@ -114,10 +114,10 @@ class writeexcel_worksheet extends writeexcel_biffwriter { $this->_name = $name; $this->_index = $index; - $this->_activesheet = &$activesheet; - $this->_firstsheet = &$firstsheet; - $this->_url_format = &$url_format; - $this->_parser = &$parser; + $this->_activesheet = $activesheet; + $this->_firstsheet = $firstsheet; + $this->_url_format = $url_format; + $this->_parser = $parser; $this->_tempdir = $tempdir; $this->_ext_sheets = array(); @@ -1071,7 +1071,7 @@ function _cell_to_rowcol($cell) { $count=sizeof($chars); for ($c=0;$c_parser; + $parser = $this->_parser; $formula = $parser->parse_formula($formula); $formlen = strlen($formula); # Length of the binary string diff --git a/plugins/addons/ldapmanager/class_exportxls.inc b/plugins/addons/ldapmanager/class_exportxls.inc index 78e77cbb7..ae27875db 100644 --- a/plugins/addons/ldapmanager/class_exportxls.inc +++ b/plugins/addons/ldapmanager/class_exportxls.inc @@ -67,7 +67,7 @@ class xlsexport extends plugin $smarty->assign("deplist", $bases); $smarty->assign("choicelist",array( get_people_ou() =>"users" , "ou=groups," =>"groups" , - "ou=computers,ou=systems," =>"computers", + "ou=systems," =>"computers", "ou=servers,ou=systems," =>"servers", "dc=addressbook," =>"addressbook")); -- 2.30.2