|
|
|
@ -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> '; |
|
|
|
|
$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> '; |
|
|
|
|
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')).' '; |
|
|
|
|
$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> '; |
|
|
|
|
$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> '; |
|
|
|
|
$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 .= ' <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 .= ' <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 .= ' <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 .= ' <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 .= ' '.Display::return_icon('locked_na.png', get_lang('LockedAttendance')); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
/*if (api_is_allowed_to_edit(null, true)) { |
|
|
|
|
$message_alert = get_lang('AreYouSureToDelete'); |
|
|
|
|
$actions .= ' <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); |
|
|
|
|