"- fixed wrong languague in notifications, because translation->userlang was changed to a static class-var

- fixed sometimes wrong prefs for to notified user were used (because more then one user got notified)"
This commit is contained in:
Ralf Becker 2009-11-03 10:19:48 +00:00
parent c5453aa3f9
commit 90f91bc9c7

View File

@ -443,9 +443,9 @@ abstract class bo_tracking
// restore the user enviroment // restore the user enviroment
if ($this->save_prefs) $GLOBALS['egw_info']['user'] = $this->save_prefs; unset($this->save_prefs); if ($this->save_prefs) $GLOBALS['egw_info']['user'] = $this->save_prefs; unset($this->save_prefs);
if ($GLOBALS['egw_info']['user']['preferences']['common']['lang'] != $GLOBALS['egw']->translation->userlang) if ($GLOBALS['egw_info']['user']['preferences']['common']['lang'] != translation::$userlang)
{ {
$GLOBALS['egw']->translation->init(); translation::init();
} }
return !count($this->errors); return !count($this->errors);
} }
@ -472,11 +472,9 @@ abstract class bo_tracking
if (is_numeric($user_or_lang)) // user --> read everything from his prefs if (is_numeric($user_or_lang)) // user --> read everything from his prefs
{ {
if ($user_or_lang != $this->user) $GLOBALS['egw']->preferences->__construct($user_or_lang);
{ $GLOBALS['egw_info']['user']['preferences'] = $GLOBALS['egw']->preferences->read_repository();
$GLOBALS['egw']->preferences->preferences($user_or_lang);
$GLOBALS['egw_info']['user']['preferences'] = $GLOBALS['egw']->preferences->read_repository();
}
if ($check && $this->check2pref) $check = $this->check2pref[$check]; if ($check && $this->check2pref) $check = $this->check2pref[$check];
if ($check && !$GLOBALS['egw_info']['user']['preferences'][$this->app][$check]) if ($check && !$GLOBALS['egw_info']['user']['preferences'][$this->app][$check])
{ {
@ -497,9 +495,9 @@ abstract class bo_tracking
$GLOBALS['egw_info']['user']['preferences'] = $GLOBALS['egw']->preferences->default; $GLOBALS['egw_info']['user']['preferences'] = $GLOBALS['egw']->preferences->default;
$GLOBALS['egw_info']['user']['preferences']['common']['lang'] = $user_or_lang; $GLOBALS['egw_info']['user']['preferences']['common']['lang'] = $user_or_lang;
} }
if ($lang != $GLOBALS['egw']->translation->userlang) // load the right language if needed if ($lang != translation::$userlang) // load the right language if needed
{ {
$GLOBALS['egw']->translation->init(); translation::init();
} }
// send over notification_app // send over notification_app