]> _ Git - cubeextranet.git/commitdiff
fix #3089 @0.25
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 30 Sep 2019 10:00:31 +0000 (10:00 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 30 Sep 2019 10:00:31 +0000 (10:00 +0000)
inc/ws/Util/class.ws.links.php

index 7f1c09158407c258ffee68d18a356ff354779e29..38b6ead433bdd40cc6a2556706d8b71909fb0f22 100644 (file)
@@ -36,14 +36,6 @@ class wsLinks
             'group' => __('Groupe'),
         );
 
-        /* $cacheMethod = PHPExcel_CachedObjectStorageFactory::cache_to_memcache;
-          $cacheSettings = array('memcacheServer' => 'localhost',
-          'memcachePort' => 11211,
-          'cacheTime' => 600
-          );
-          PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings); */
-
-
         $comments = array();
 
         $xls = new PHPExcel();
@@ -77,12 +69,12 @@ class wsLinks
                         if (is_bool($l[$id])) {
                             $l[$id] = $l[$id] ? 1 : 0;
                         }
-                        if ($id == 'numerotation') {
-                            if ($l[$id] == 'false') {
+                        if ($id === 'numerotation') {
+                            if ($l[$id] === 'false') {
                                 $l[$id] = 'physical';
                             }
                         }
-                        if ($id == 'to' && in_array($l['type'], array(2))) {
+                        if ($id === 'to' && $l['type'] == 2) {
                             $comment = false;
                             if (!Zend_Uri_Http::check($l[$id])) {
                                 $comment = 'Invalid URI';
@@ -92,7 +84,9 @@ class wsLinks
                             if ($comment) {
                                 $s->getComment(PHPExcel_Cell::stringFromColumnIndex($j - 1) . $i)->getText()->createTextRun($comment);
                             }
-
+                        }
+                        if ($id === 'to') {
+                            $s->getCellByColumnAndRow($i, $j)->setDataType(PHPExcel_Cell_DataType::TYPE_STRING)->getStyle()->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_TEXT);
                         }
                         $value = $l[$id];
                     } else {
@@ -100,7 +94,7 @@ class wsLinks
                     }
                 }
                 if ($value != '') {
-                    $s->setCellValueByColumnAndRow($i, $j, $value);
+                    $s->setCellValueExplicitByColumnAndRow($i, $j, $value);
                     //$s->getStyleByColumnAndRow($i, $j)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);
                 }
                 $i++;