fixed timezone alias update always reports one timezone update, event if it updated nothing

This commit is contained in:
Ralf Becker 2011-10-11 16:12:40 +00:00
parent db60005691
commit 5cd27bea86

View File

@ -284,7 +284,7 @@ class calendar_timezones
} }
include($path); // sets $tz_aliases include($path); // sets $tz_aliases
$updated = 0; $updates = 0;
foreach($tz_aliases as $alias => $tzid) foreach($tz_aliases as $alias => $tzid)
{ {
if ((!($alias_id=self::tz2id($alias, 'alias')) || self::id2tz($alias_id, 'tzid') !== $tzid) && // not in DB or different if ((!($alias_id=self::tz2id($alias, 'alias')) || self::id2tz($alias_id, 'tzid') !== $tzid) && // not in DB or different
@ -295,7 +295,7 @@ class calendar_timezones
),array( ),array(
'tz_tzid' => $alias, 'tz_tzid' => $alias,
),__LINE__,__FILE__,'calendar'); ),__LINE__,__FILE__,'calendar');
++$updated; ++$updates;
} }
//error_log(__METHOD__."() alias=$alias, tzid=$tzid --> self::tz2id('$alias', 'alias') = ".array2string($alias_id).", self::tz2id('$tzid')=".array2string($tz_id)); //error_log(__METHOD__."() alias=$alias, tzid=$tzid --> self::tz2id('$alias', 'alias') = ".array2string($alias_id).", self::tz2id('$tzid')=".array2string($tz_id));
} }
@ -303,7 +303,7 @@ class calendar_timezones
//_debug_array($tz2id); //_debug_array($tz2id);
$updated = true; $updated = true;
return lang('Timezones aliases updated to version %1 (%2 records updated).', $tz_aliases_mtime, $updated); return lang('Timezones aliases updated to version %1 (%2 records updated).', $tz_aliases_mtime, $updates);
} }
/** /**