Code Duplication    Length = 5-6 lines in 2 locations

calendar/inc/class.calendar_boupdate.inc.php 2 locations

@@ 933-937 (lines=5) @@
930
			$user = $temp_user['account_id'];
931
		}
932
		$lang = $GLOBALS['egw_info']['user']['preferences']['common']['lang'];
933
		if ($GLOBALS['egw']->preferences->account_id != $user)
934
		{
935
			$GLOBALS['egw']->preferences->__construct($user);
936
			$GLOBALS['egw_info']['user']['preferences'] = $GLOBALS['egw']->preferences->read_repository();
937
		}
938
		$senderid = $this->user;
939
		$event = $msg_type == MSG_ADDED || $msg_type == MSG_MODIFIED ? $new_event : $old_event;
940
@@ 1174-1179 (lines=6) @@
1171
		}
1172
		// restore the enviroment (preferences->read_repository() sets the timezone!)
1173
		$GLOBALS['egw_info']['user'] = $temp_user;
1174
		if ($GLOBALS['egw']->preferences->account_id != $temp_user['account_id'])
1175
		{
1176
			$GLOBALS['egw']->preferences->__construct($temp_user['account_id']);
1177
			$GLOBALS['egw_info']['user']['preferences'] = $GLOBALS['egw']->preferences->read_repository();
1178
			//echo "<p>".__METHOD__."() restored enviroment of #$temp_user[account_id] $temp_user[account_fullname]: tz={$GLOBALS['egw_info']['user']['preferences']['common']['tz']}</p>\n";
1179
		}
1180
		if ($lang !== $GLOBALS['egw_info']['user']['preferences']['common']['lang'])
1181
		{
1182
			translation::init();