force re-import of etemplates if app-version changes

This commit is contained in:
Ralf Becker 2014-02-17 14:28:05 +00:00
parent 1c013e92f0
commit 639fd82199

View File

@ -969,12 +969,15 @@ class boetemplate extends soetemplate
if (($time = @filemtime($path)))
{
$templ = new boetemplate(array('name' => '.'.$app,'lang' => '##'));
if ($templ->lang != '##' || $templ->modified < $time) // need to import
if ($templ->lang != '##' || $templ->version != $GLOBALS['egw_info']['apps'][$app]['version'] ||
$templ->modified < $time) // need to import
{
$templ->delete(); // delete old timestamp
//echo "<p>".__METHOD__."($app) import necessary, as app-modified=$templ->modified < filemtime($path)=$time test-tpl=".array2string($templ->as_array(1))."</p>\n";
$ret = self::import_dump($app);
$templ->modified = $time;
$templ->save('.'.$app,'','##');
// store new timestamp incl. app version
$templ->save('.'.$app,'','##',0,$GLOBALS['egw_info']['apps'][$app]['version']);
}
}
return $ret;