diff --git a/etemplate/inc/class.bo_merge.inc.php b/etemplate/inc/class.bo_merge.inc.php index f41b11428d..49d39c61c0 100644 --- a/etemplate/inc/class.bo_merge.inc.php +++ b/etemplate/inc/class.bo_merge.inc.php @@ -87,8 +87,10 @@ abstract class bo_merge case 'application/vnd.oasis.opendocument.spreadsheet': // oo spreadsheet if (!$zip_available) break; return true; // open office write xml files - case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': + case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': // ms word 2007 xml format case 'application/vnd.openxmlformats-officedocument.wordprocessingml.d': // mimetypes in vfs are limited to 64 chars + case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': // ms excel 2007 xml format + case 'application/vnd.openxmlformats-officedocument.spreadsheetml.shee': if (!$zip_available) break; return true; // ms word xml format default: @@ -315,7 +317,7 @@ abstract class bo_merge // remove not existing replacements (eg. from calendar array) if (strpos($content,'$$') !== null) { - $content = preg_replace('/\$\$[a-z0-9_]+\$\$/i','',$content); + $content = preg_replace('/\$\$[a-z0-9_\/]+\$\$/i','',$content); } if ($contentrepeat) $contentrep[$id] = $content; } @@ -350,6 +352,8 @@ abstract class bo_merge break; case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': case 'application/vnd.openxmlformats-officedocument.wordprocessingml.d': // mimetypes in vfs are limited to 64 chars + case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': + case 'application/vnd.openxmlformats-officedocument.spreadsheetml.shee': // todo ms word xml files break; } @@ -372,6 +376,8 @@ abstract class bo_merge break; case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': case 'application/vnd.openxmlformats-officedocument.wordprocessingml.d': // mimetypes in vfs are limited to 64 chars + case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': + case 'application/vnd.openxmlformats-officedocument.spreadsheetml.shee': // todo ms word xml files break; } @@ -429,6 +435,13 @@ abstract class bo_merge '([a-z]{2}-[A-Z]{2})'.preg_quote('"/>$$','/').'/i' => '$$\\2$$', ); break; + case 'application/vnd.openxmlformats-officedocument.spreadsheetml.shee': + $mime_type = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; + case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': + $archive = tempnam($GLOBALS['egw_info']['server']['temp_dir'], basename($document,'.xlsx').'-').'.xlsx'; + copy($content_url,$archive); + $content_url = 'zip://'.$archive.'#'.($content_file = 'xl/sharedStrings.xml'); + break; } if (!($merged =& $this->merge($content_url,$ids,$err,$mime_type,$fix))) { diff --git a/etemplate/templates/default/images/mime16_application_vnd.openxmlformats-officedocument.spreadsheetml.sheet.gif b/etemplate/templates/default/images/mime16_application_vnd.openxmlformats-officedocument.spreadsheetml.sheet.gif new file mode 100644 index 0000000000..347c0c36cd Binary files /dev/null and b/etemplate/templates/default/images/mime16_application_vnd.openxmlformats-officedocument.spreadsheetml.sheet.gif differ diff --git a/phpgwapi/inc/class.mime_magic.inc.php b/phpgwapi/inc/class.mime_magic.inc.php index f40c0589ab..657fc8c1c8 100644 --- a/phpgwapi/inc/class.mime_magic.inc.php +++ b/phpgwapi/inc/class.mime_magic.inc.php @@ -415,6 +415,7 @@ class mime_magic 'xht' => 'application/xhtml+xml', 'xhtml' => 'application/xhtml+xml', 'xls' => 'application/vnd.ms-excel', + 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', // excel xml format 'xlt' => 'application/vnd.ms-excel', 'xml' => 'application/xml', 'xpm' => 'image/x-xpixmap',