Use Gnumeric for Excel conversion
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 19 Feb 2009 06:48:18 +0000 (23:48 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 19 Feb 2009 06:48:18 +0000 (23:48 -0700)
framework/Mime/lib/Horde/Mime/Viewer/msexcel.php
framework/Mime/package.xml

index 28e9c51..c57df8c 100644 (file)
@@ -39,20 +39,17 @@ class Horde_Mime_Viewer_msexcel extends Horde_Mime_Viewer_Driver
             return array();
         }
 
-        $data = '';
         $tmp_xls = Horde::getTempFile('horde_msexcel');
+        $tmp_out = Horde::getTempFile('horde_msexcel');
 
         file_put_contents($tmp_xls, $this->_mimepart->getContents());
+        $args = ' -E Gnumeric_Excel:excel_dsf -T Gnumeric_html:html40 ' . $tmp_xls . ' ' . $tmp_out;
 
-        $fh = popen($this->_conf['location'] . " -nh $tmp_xls 2>&1", 'r');
-        while (($rc = fgets($fh, 8192))) {
-            $data .= $rc;
-        }
-        pclose($fh);
+        exec($this->_conf['location'] . $args);
 
         return array(
             $this->_mimepart->getMimeId() => array(
-                'data' => $data,
+                'data' => file_get_contents($tmp_out),
                 'status' => array(),
                 'type' => 'text/html; charset=' . NLS::getCharset()
             )
index ff06f03..fcd8d3a 100644 (file)
@@ -31,7 +31,9 @@ http://pear.php.net/dtd/package-2.0.xsd">
   <api>alpha</api>
  </stability>
  <license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
- <notes>* Add support for decoding IDN (RFC 3490) names (Request #5836).
+ <notes> * Use Gnumeric to display MS Excel documents.
+ * Use AbiWord to display MS Word documents (Request #8011).
+ * Add support for decoding IDN (RFC 3490) names (Request #5836).
  * Initial package.</notes>
  <contents>
   <dir name="/">