Minor cosmetic fixes

skala
Julio Montoya 12 years ago
parent 7c999dfb6a
commit 1f468b9056
  1. 7
      main/attendance/attendance_controller.php
  2. 4
      main/attendance/attendance_list.php
  3. 13
      main/attendance/index.php
  4. 12
      main/inc/lib/attendance.lib.php
  5. 4
      main/inc/lib/tracking.lib.php

@ -34,10 +34,9 @@
* @param boolean true for listing history (optional)
* @param array message for showing by action['edit','add','delete'] (optional)
*/
public function attendance_list($history=false,$messages=array()) {
$attendance = new Attendance();
$data = array();
public function attendance_list($history=false,$messages=array()) {
$attendance = new Attendance();
$data = array();
// render to the view
$this->view->set_data($data);

@ -10,7 +10,7 @@
// protect a course script
api_protect_course_script(true);
if (api_is_allowed_to_edit(null, true)) {
if (api_is_allowed_to_edit(null, true)) {
$param_gradebook = '';
if (isset($_SESSION['gradebook'])) {
$param_gradebook = '&gradebook='.Security::remove_XSS($_SESSION['gradebook']);
@ -19,7 +19,7 @@ if (api_is_allowed_to_edit(null, true)) {
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 '</div>';
}
$table = new SortableTable('attendance_list', array('Attendance', 'get_number_of_attendances'), array('Attendance', 'get_attendance_data'), $default_column);
$table->set_additional_parameters($parameters);
$table->set_header(0, '', false, array('style'=>'width:20px;'));

@ -40,9 +40,9 @@ $actions = array(
'attendance_delete',
'attendance_delete_select',
'attendance_restore',
'attendance_sheet_export_to_pdf',
'attendance_sheet_export_to_pdf'
);
$actions_calendar = array('calendar_list', 'calendar_add', 'calendar_edit', 'calendar_delete', 'calendar_all_delete');
$action = 'attendance_list';
@ -114,7 +114,6 @@ $(function() {
$(".row_odd td.checkboxes_col_"+calendar_id).css({"opacity":"1","background-color":"#dcdcdc", "border-left":"1px #bbb solid", "border-right":"1px #bbb solid", "z-index":"1" });
$(".row_even td.checkboxes_col_"+calendar_id).css({"opacity":"1","background-color":"#eee", "border-left":"1px #bbb solid", "border-right":"1px #bbb solid", "z-index":"1" });
$(".checkboxes_col_"+calendar_id).mouseover(function() {
//$(".checkbox_head_"+calendar_id).removeAttr("opacity");
//$("row_even td.checkboxes_col_"+calendar_id).css({"opacity":"1","background-color":"red", "border-left":"1px #EEEE00 solid", "border-right":"1px #EEEE00 solid" , "border-bottom":"1px #ccc solid" });
@ -122,9 +121,8 @@ $(function() {
});
$(".checkboxes_col_"+calendar_id).mouseout(function() {
// $("row_even td.checkboxes_col_"+calendar_id).css({"opacity":"1","background-color":"#F9F9F9", "border-left":"1px #EEEE00 solid", "border-right":"1px #EEEE00 solid" , "border-bottom":"1px #ccc solid" });
// $("row_odd td.checkboxes_col_"+calendar_id).css({"opacity":"1","background-color":"#FFF", "border-left":"1px #EEEE00 solid", "border-right":"1px #EEEE00 solid" , "border-bottom":"1px #ccc solid" });
// $("row_even td.checkboxes_col_"+calendar_id).css({"opacity":"1","background-color":"#F9F9F9", "border-left":"1px #EEEE00 solid", "border-right":"1px #EEEE00 solid" , "border-bottom":"1px #ccc solid" });
// $("row_odd td.checkboxes_col_"+calendar_id).css({"opacity":"1","background-color":"#FFF", "border-left":"1px #EEEE00 solid", "border-right":"1px #EEEE00 solid" , "border-bottom":"1px #ccc solid" });
});
$(".checkboxes_col_"+calendar_id+" input:checkbox").attr("disabled",false);
@ -148,7 +146,7 @@ $(function() {
} else {
$(".checkboxes_col_"+calendar_id+" input:checkbox").attr("checked",false);
}
});
});
$(".attendance-sheet-content .row_odd, .attendance-sheet-content .row_even").mouseover(function() {
$(".row_odd").css({"background-color":"#F9F9F9"});
@ -218,7 +216,6 @@ if ($action == 'calendar_add') {
if (isset($_POST['action']) && $_POST['action'] == 'attendance_delete_select') {
$attendance_controller->attendance_delete($_POST['id']);
}
// distpacher actions to controller
switch ($action) {
case 'attendance_list':

@ -98,11 +98,17 @@ class Attendance
$column = intval($column);
$from = intval($from);
$number_of_items = intval($number_of_items);
if (!in_array($direction, array('ASC','DESC'))) {
if (!in_array($direction, array('ASC','DESC'))) {
$direction = 'ASC';
}
$active_plus = 'att.active = 1';
if (api_is_platform_admin()) { $active_plus = ' 1=1 ';}
if (api_is_platform_admin()) {
$active_plus = ' 1=1 ';
}
$sql = "SELECT
att.id AS col0,
att.name AS col1,
@ -113,7 +119,7 @@ class Attendance
att.session_id
FROM $tbl_attendance att
WHERE c_id = $course_id AND $active_plus $condition_session
ORDER BY col$column $direction LIMIT $from,$number_of_items ";
ORDER BY col$column $direction LIMIT $from,$number_of_items ";
$res = Database::query($sql);
$attendances = array ();

@ -2117,7 +2117,7 @@ class Tracking {
* @param int user id
* @return string html code
*/
function show_user_progress($user_id, $session_id = 0, $extra_params = '', $show_courses = true) {
static function show_user_progress($user_id, $session_id = 0, $extra_params = '', $show_courses = true) {
global $_configuration;
$tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION);
@ -2557,7 +2557,7 @@ class Tracking {
* @param int session id
* @return string html code
*/
function show_course_detail($user_id, $course_code, $session_id) {
static function show_course_detail($user_id, $course_code, $session_id) {
$html = '';
if (isset($course_code)) {

Loading…
Cancel
Save