Minor - format code.

1.10.x
Julio Montoya 10 years ago
parent 1a96e056a1
commit aff2995745
  1. 4
      main/attendance/attendance_list.php
  2. 30
      main/inc/lib/attendance.lib.php

@ -18,10 +18,6 @@ if (api_is_allowed_to_edit(null, true)) {
echo '<div class="actions">';
echo '<a href="index.php?'.api_get_cidreq().$param_gradebook.'&action=attendance_add">'.
Display::return_icon('new_attendance_list.png',get_lang('CreateANewAttendance'),'',ICON_SIZE_MEDIUM).'</a>';
/*echo '<a href="index.php?'.api_get_cidreq().$param_gradebook.'&action=calendar_logins">'.
Display::return_icon('attendance_list.png',get_lang('Logins'),'',ICON_SIZE_MEDIUM).'</a>';*/
echo '</div>';
}
$attendance = new Attendance();

@ -182,11 +182,14 @@ class Attendance
$actions .= '<center>';
if (api_is_platform_admin()) {
$actions .= '<a href="index.php?'.api_get_cidreq().'&action=attendance_edit&attendance_id='.$attendance[0].$param_gradebook.'">'.Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>&nbsp;';
$actions .= '<a href="index.php?'.api_get_cidreq().'&action=attendance_edit&attendance_id='.$attendance[0].$param_gradebook.'">'.
Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>&nbsp;';
if ($attendance[5] == 1) {
$actions .= '<a href="index.php?'.api_get_cidreq().'&action=attendance_delete&attendance_id='.$attendance[0].$param_gradebook.'">'.Display::return_icon('visible.png', get_lang('Hide'), array(), ICON_SIZE_SMALL).'</a>';
$actions .= '<a href="index.php?'.api_get_cidreq().'&action=attendance_delete&attendance_id='.$attendance[0].$param_gradebook.'">'.
Display::return_icon('visible.png', get_lang('Hide'), array(), ICON_SIZE_SMALL).'</a>';
} else {
$actions .= '<a href="index.php?'.api_get_cidreq().'&action=attendance_restore&attendance_id='.$attendance[0].$param_gradebook.'">'.Display::return_icon('invisible.png', get_lang('Show'), array(), ICON_SIZE_SMALL).'</a>';
$actions .= '<a href="index.php?'.api_get_cidreq().'&action=attendance_restore&attendance_id='.$attendance[0].$param_gradebook.'">'.
Display::return_icon('invisible.png', get_lang('Show'), array(), ICON_SIZE_SMALL).'</a>';
$attendance[2] = '<span class="muted">'.$attendance[2].'</span>';
}
} else {
@ -195,8 +198,10 @@ class Attendance
$actions .= Display::return_icon('edit_na.png', get_lang('Edit')).'&nbsp;';
$actions .= Display::return_icon('visible.png', get_lang('Hide'));
} else {
$actions .= '<a href="index.php?'.api_get_cidreq().'&action=attendance_edit&attendance_id='.$attendance[0].$param_gradebook.'">'.Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>&nbsp;';
$actions .= '<a href="index.php?'.api_get_cidreq().'&action=attendance_delete&attendance_id='.$attendance[0].$param_gradebook.'">'.Display::return_icon('visible.png', get_lang('Hide'), array(), ICON_SIZE_SMALL).'</a>';
$actions .= '<a href="index.php?'.api_get_cidreq().'&action=attendance_edit&attendance_id='.$attendance[0].$param_gradebook.'">'.
Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>&nbsp;';
$actions .= '<a href="index.php?'.api_get_cidreq().'&action=attendance_delete&attendance_id='.$attendance[0].$param_gradebook.'">'.
Display::return_icon('visible.png', get_lang('Hide'), array(), ICON_SIZE_SMALL).'</a>';
}
}
@ -204,22 +209,31 @@ class Attendance
$is_done_all_calendar = self::is_all_attendance_calendar_done($attendance[0]);
if ($is_done_all_calendar) {
$locked = $attendance[4];
$locked = $attendance[4];
if ($locked == 0) {
if (api_is_platform_admin()) {
$message_alert = get_lang('AreYouSureToLockTheAttendance');
} else {
$message_alert = get_lang('UnlockMessageInformation');
}
$actions .= '&nbsp;<a onclick="javascript:if(!confirm(\''.$message_alert.'\')) return false;" href="index.php?'.api_get_cidreq().'&action=lock_attendance&attendance_id='.$attendance[0].$param_gradebook.'">'.Display::return_icon('unlock.png', get_lang('LockAttendance')).'</a>';
$actions .= '&nbsp;<a onclick="javascript:if(!confirm(\''.$message_alert.'\')) return false;" href="index.php?'.api_get_cidreq().'&action=lock_attendance&attendance_id='.$attendance[0].$param_gradebook.'">'.
Display::return_icon('unlock.png', get_lang('LockAttendance')).'</a>';
} else {
if (api_is_platform_admin()) {
$actions .= '&nbsp;<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToUnlockTheAttendance').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=unlock_attendance&attendance_id='.$attendance[0].$param_gradebook.'">'.Display::return_icon('locked.png', get_lang('UnlockAttendance')).'</a>';
$actions .= '&nbsp;<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToUnlockTheAttendance').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=unlock_attendance&attendance_id='.$attendance[0].$param_gradebook.'">'.
Display::return_icon('locked.png', get_lang('UnlockAttendance')).'</a>';
} else {
$actions .= '&nbsp;'.Display::return_icon('locked_na.png', get_lang('LockedAttendance'));
}
}
}
/*if (api_is_allowed_to_edit(null, true)) {
$message_alert = get_lang('AreYouSureToDelete');
$actions .= '&nbsp;<a onclick="javascript:if(!confirm(\'' . $message_alert . '\')) return false;" href="index.php?' . api_get_cidreq() . '&action=delete_attendance&attendance_id=' . $attendance[0] . $param_gradebook . '">' .
Display::return_icon('delete.png',
get_lang('DeleteAttendance')) . '</a>';
}*/
$actions .= '</center>';
$attendances[] = array($attendance[0], $attendance[1], $attendance[2], $attendance[3],$actions);

Loading…
Cancel
Save