mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-07 14:39:56 +01:00
* EventMgr: fixed fatal error eventmgr_merge::number_format() is not defined
This commit is contained in:
parent
a69151c7f8
commit
fd9d3315cd
@ -676,7 +676,7 @@ abstract class bo_merge
|
|||||||
if (isset($archive))
|
if (isset($archive))
|
||||||
{
|
{
|
||||||
$zip = new ZipArchive;
|
$zip = new ZipArchive;
|
||||||
if ($zip->open($archive,ZIPARCHIVE::CHECKCONS) !== true)
|
if ($zip->open($archive,ZIPARCHIVE::CHECKCONS) !== true)
|
||||||
{
|
{
|
||||||
error_log(__METHOD__.__LINE__." !ZipArchive::open('$archive',ZIPARCHIVE::CHECKCONS) failed. Trying open without validating");
|
error_log(__METHOD__.__LINE__." !ZipArchive::open('$archive',ZIPARCHIVE::CHECKCONS) failed. Trying open without validating");
|
||||||
if ($zip->open($archive) !== true) throw new Exception("!ZipArchive::open('$archive',|ZIPARCHIVE::CHECKCONS)");
|
if ($zip->open($archive) !== true) throw new Exception("!ZipArchive::open('$archive',|ZIPARCHIVE::CHECKCONS)");
|
||||||
@ -711,4 +711,27 @@ abstract class bo_merge
|
|||||||
}
|
}
|
||||||
common::egw_exit();
|
common::egw_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format a number according to user prefs with decimal and thousands separator
|
||||||
|
*
|
||||||
|
* Reimplemented from etemplate to NOT use user prefs for Excel 2003, which gives an xml error
|
||||||
|
*
|
||||||
|
* @param int|float|string $number
|
||||||
|
* @param int $num_decimal_places=2
|
||||||
|
* @param string $_mimetype=''
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
static public function number_format($number,$num_decimal_places=2,$_mimetype='')
|
||||||
|
{
|
||||||
|
if ((string)$number === '') return '';
|
||||||
|
//error_log(__METHOD__.$_mimetype);
|
||||||
|
switch($_mimetype)
|
||||||
|
{
|
||||||
|
case 'application/xml': // Excel 2003
|
||||||
|
case 'application/vnd.oasis.opendocument.spreadsheet': // OO.o spreadsheet
|
||||||
|
return number_format(str_replace(' ','',$number),$num_decimal_places,'.','');
|
||||||
|
}
|
||||||
|
return etemplate::number_format($number,$num_decimal_places);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user