Fixing attendance select by default is today + other fixes in the table see BT#4751

skala
Julio Montoya 12 years ago
parent 02b64be214
commit 002207c915
  1. 20
      main/attendance/attendance_sheet.php

@ -65,7 +65,7 @@ if (api_is_allowed_to_edit(null, true)) {
$default_filter = $_REQUEST['filter']; $default_filter = $_REQUEST['filter'];
} }
} else { } else {
$default_filter = 'all'; $default_filter = 'today';
} }
$form->setDefaults(array('filter'=>$default_filter)); $form->setDefaults(array('filter'=>$default_filter));
$param_filter = '&filter='.Security::remove_XSS($default_filter); $param_filter = '&filter='.Security::remove_XSS($default_filter);
@ -175,11 +175,8 @@ if (api_is_allowed_to_edit(null, true)) {
<td><span title="<?php echo $username ?>"><?php echo $data['lastname'] ?></span></td> <td><span title="<?php echo $username ?>"><?php echo $data['lastname'] ?></span></td>
<td><?php echo $data['firstname'] ?></td> <td><?php echo $data['firstname'] ?></td>
<td> <td>
<div style="height:28px">
<center>
<div class="attendance-faults-bar" style="background-color:<?php echo (!empty($data['result_color_bar'])?$data['result_color_bar']:'none') ?>"> <div class="attendance-faults-bar" style="background-color:<?php echo (!empty($data['result_color_bar'])?$data['result_color_bar']:'none') ?>">
<?php echo $data['attendance_result'] ?></div> <?php echo $data['attendance_result'] ?>
</center>
</div> </div>
</td> </td>
</tr> </tr>
@ -202,6 +199,7 @@ if (api_is_allowed_to_edit(null, true)) {
$datetime = $date.'<br />'.$time; $datetime = $date.'<br />'.$time;
$img_lock = Display::return_icon('lock.gif',get_lang('DateUnLock'),array('class'=>'img_lock','id'=>'datetime_column_'.$calendar['id'])); $img_lock = Display::return_icon('lock.gif',get_lang('DateUnLock'),array('class'=>'img_lock','id'=>'datetime_column_'.$calendar['id']));
if (!empty($calendar['done_attendance'])){ if (!empty($calendar['done_attendance'])){
$datetime = '<font color="blue">'.$date.'<br />'.$time.'</font>'; $datetime = '<font color="blue">'.$date.'<br />'.$time.'</font>';
} }
@ -213,8 +211,8 @@ if (api_is_allowed_to_edit(null, true)) {
$img_lock = Display::return_icon('unlock.gif',get_lang('DateLock'),array('class'=>'img_unlock','id'=>'datetime_column_'.$calendar['id'])); $img_lock = Display::return_icon('unlock.gif',get_lang('DateLock'),array('class'=>'img_unlock','id'=>'datetime_column_'.$calendar['id']));
} }
$result .= '<th height="80px" width="800px">'; $result .= '<th width="800px">';
$result .= '<center><div style="font-size:10px;width:80px;">'.$datetime.'&nbsp;'; $result .= '<center><div style="font-size:10px;width:100px;">'.$datetime.'&nbsp;';
$result .= '<span id="attendance_lock" style="cursor:pointer">'.(!$is_locked_attendance || api_is_platform_admin()?$img_lock:'').'</span>'; $result .= '<span id="attendance_lock" style="cursor:pointer">'.(!$is_locked_attendance || api_is_platform_admin()?$img_lock:'').'</span>';
if ($is_locked_attendance == false) { if ($is_locked_attendance == false) {
@ -240,8 +238,11 @@ if (api_is_allowed_to_edit(null, true)) {
$i = 0; $i = 0;
foreach ($users_in_course as $user) { foreach ($users_in_course as $user) {
$class = ''; $class = '';
if ($i%2==0) {$class = 'row_even';} if ($i%2==0) {
else {$class = 'row_odd';} $class = 'row_even';
} else {
$class = 'row_odd';
}
?> ?>
<tr class="<?php echo $class ?>"> <tr class="<?php echo $class ?>">
<?php <?php
@ -266,6 +267,7 @@ if (api_is_allowed_to_edit(null, true)) {
} }
$disabled = 'disabled'; $disabled = 'disabled';
$style_td = ''; $style_td = '';
if ($next_attendance_calendar_id == $calendar['id']) { if ($next_attendance_calendar_id == $calendar['id']) {
if ($i%2==0) if ($i%2==0)
$style_td = 'background-color:#eee;'; $style_td = 'background-color:#eee;';

Loading…
Cancel
Save