Code

Fixed excel export function for ldap_manager
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 31 Oct 2006 10:17:42 +0000 (10:17 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 31 Oct 2006 10:17:42 +0000 (10:17 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4972 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_ldap.inc
include/php_writeexcel/class.writeexcel_workbook.inc.php
include/php_writeexcel/class.writeexcel_workbookbig.inc.php
include/php_writeexcel/class.writeexcel_worksheet.inc.php
plugins/addons/ldapmanager/class_exportxls.inc

index e5809d72099e075eb69c1fdbd23d80e1c098f6b7..7abac71be2ce929979d77759fee04156c60f6fae 100644 (file)
@@ -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");
index c175c43dc17896022fd5ac94e501a4fe7012b678..cdaac1557224f63c56876113e14c5f154b4073c8 100644 (file)
@@ -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<sizeof($this->_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<sizeof($this->_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<sizeof($this->_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<sizeof($this->_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<sizeof($this->_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<sizeof($this->_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
index bc0ba40ba9433f8db7dba74fdf67fb3b53fe811b..8f0c752fd363d86e0687456a874fa057fc8efa10 100644 (file)
@@ -39,7 +39,7 @@ class writeexcel_workbookbig extends writeexcel_workbook {
         $file->append($this->_data);
 
         for ($c=0;$c<sizeof($this->_worksheets);$c++) {
-            $worksheet=&$this->_worksheets[$c];
+            $worksheet=$this->_worksheets[$c];
             while ($data=$worksheet->get_data()) {
                 $file->append($data);
             }
index c2109723521c97a533831cc871da46a47e6b1782..6db3f5dbeca26412ba80dbadb5395363bbcd4b78 100644 (file)
@@ -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<sizeof($chars);$c++) {
-            $char=&$chars[$c];
+            $char=$chars[$c];
             $char    = ord($char) << ++$i;
             $low_15  = $char & 0x7fff;
             $high_15 = $char & 0x7fff << 15;
@@ -1329,7 +1329,7 @@ function write_formula() {
     $formula = preg_replace('/^=/', "", $formula);
 
     # Parse the formula using the parser in Formula.pm
-    $parser =& $this->_parser;
+    $parser = $this->_parser;
     $formula   = $parser->parse_formula($formula);
 
     $formlen = strlen($formula); # Length of the binary string
index 78e77cbb7d3b352314a145a4dbfc8fba62bc7b04..ae27875db37ad070f01d5397be9291c71403eec9 100644 (file)
@@ -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"));