From: vincent@cubedesigners.com Date: Mon, 30 Sep 2019 10:00:31 +0000 (+0000) Subject: fix #3089 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=a19ea12a93d7f0d3bae7bc36768b9e3db0e1d900;p=cubeextranet.git fix #3089 @0.25 --- diff --git a/inc/ws/Util/class.ws.links.php b/inc/ws/Util/class.ws.links.php index 7f1c09158..38b6ead43 100644 --- a/inc/ws/Util/class.ws.links.php +++ b/inc/ws/Util/class.ws.links.php @@ -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++;