From: Alan Knowles Date: Fri, 5 Jun 2020 04:26:21 +0000 (+0800) Subject: Changed GnumericToExcel.php X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=12488538d66af7f2653aff8f87d2ddfdc3426fd6 Changed GnumericToExcel.php --- diff --git a/GnumericToExcel.php b/GnumericToExcel.php index cae40372..a5d0d0b9 100644 --- a/GnumericToExcel.php +++ b/GnumericToExcel.php @@ -55,7 +55,7 @@ class Pman_Core_GnumericToExcel extends Pman //$this->addEvent("DOWNLOAD", false, isset($_REQUEST['title']) ? $_REQUEST['title'] : '???'); - if (!empty($_POST['format']) && $_POST['format']=='gnumeric') { + if (!empty($_POST['format']) && $_POST['format']=='gnumeric') { if (empty($_POST['debug'])) { header('Content-type: application/x-gnumeric'); header('Content-Disposition: attachment; filename="' .addslashes($fname). '.gnumeric"'); @@ -65,6 +65,18 @@ class Pman_Core_GnumericToExcel extends Pman echo $xml; exit; } + + $ext = '.xls'; + $outfmt = 'Gnumeric_Excel:excel_biff8'; + $mime = 'application/vnd.ms-excel'; + if (!empty($_POST['format']) && $_POST['format']=='xlsx') { + $outfmt = 'Gnumeric_Excel:xlsx'; + $ext = '.xlsx'; + $mime = 'aapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; + } + + + $srcTmp = ini_get('session.save_path') . '/' .uniqid('gnumeric_').'.gnumeric'; $targetTmp = ini_get('session.save_path') . '/' .uniqid('gnumeric_').'.xls'; // write the gnumeric file...