$status = $status ? $status : -2; $tooltip_key = array(2 => 'STATIC_SIGNOFF_CLEAR', -2 => 'STATIC_SIGNOFF'); $template->assign_block_vars('raiders.days', array('DAY' => isset($user->lang['DAY_' . $day]) ? $user->lang['DAY_' . $day] : $day, 'DAY_KEY' => $day, 'STATUS' => $statusses[$status], 'TOOLTIP' => sprintf($user->lang[$tooltip_key[$status]], $user->lang['DAY_LONG_' . $day]), 'S_FIRST_DAY_IN_WEEK' => $raid_day_number % $num_days == 0)); $raid_day_number++; } $raid_day_number = 0; $last_future = false; foreach ($raids as $raid) { $future = $raid > $today || $raid == $today && strcmp($now, $raid_time) < 0; $status = $attendance[$raider->name][$raid]['status']; $status = isset($status) ? $status : ($future ? 0 : -1); if (!is_array($raid_sums[$raid])) { $raid_sums[$raid] = array(STATUS_OFF => 0, STATUS_NOSHOW => 0); } $raid_sums[$raid][$status] = $raid_sums[$raid][$status] + 1; $day_name = get_raiding_day_name($raid); $comment_time = $attendance[$raider->name][$raid]['time']; $game_time_comment = $comment_time; $game_time_comment += 60 * 60 * $config['raidattendance_timezone']; $comment_day = strftime('%Y%m%d', $game_time_comment); $comment_hour = strftime('%H:%M', $game_time_comment); if ($comment_day == $raid && $comment_hour > $signoff_time && $status == STATUS_OFF) { $status = STATUS_LATE_SIGNOFF; } $difftime = $tnow - $comment_time; $difftime = round($difftime / 60); $diffcomment = ''; $comment_time += 60 * 60 * $user->data['user_timezone']; if ($difftime < 60) { $diffcomment = sprintf($user->lang['COMMENT_TIME_HOUR'], $difftime); } else {
/** * Merges the two attendance arrays. **/ function add_static_attendance($raids, &$attendance, $raider_day_attendance) { global $error; foreach ($raider_day_attendance as $raider => $days) { if (!is_array($attendance[$raider])) { $attendance[$raider] = array(); } foreach ($raids as $raid) { $day_name = get_raiding_day_name($raid); // Note: the below code will "remove" the static-signoffs if an officer has STARRED the raider if (!isset($attendance[$raider][$raid]) and array_key_exists($day_name, $days) and strftime('%Y%m%d', $days[$day_name]['time']) <= $raid) { $attendance[$raider][$raid] = $days[$day_name]; } } } }