From: vincent@cubedesigners.com Date: Wed, 12 May 2021 17:11:32 +0000 (+0000) Subject: wait #4466 @1.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=0d3f795013289c450d5a9b651909168b036e2c13;p=cubeextranet.git wait #4466 @1.5 --- diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index 67e909f03..c6c2199bc 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -1046,15 +1046,19 @@ html.tall{height:150%}' . "\n"; $book_id = $args[1]; $time = $args[2]; - wsLinks::getLinksAndRulersFromFile($book_id, $links, $rulers, $time); - $xls = wsLinks::linksToExcel($links, $rulers); + $file = WS_BOOKS . '/links/' . $book_id . '/' . $time . '.xlsx'; + + if (!file_exists($file) || filesize($file) === 0) { + wsLinks::getLinksAndRulersFromFile($book_id, $links, $rulers, $time); + $xls = wsLinks::linksToExcel($links, $rulers); + $writer = new PHPExcel_Writer_Excel2007($xls); + $writer->save($file); + } ob_end_clean(); files::registerMimeTypes(array('xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')); cubeHTTP::forceDownload('links_' . $book_id . '_' . $time . '.xlsx', false); - - $writer = new PHPExcel_Writer_Excel2007($xls); - $writer->save('php://output'); + echo file_get_contents($file); exit; }