|
|
|
@ -14,10 +14,8 @@ $language_file = array ('course_description', 'pedaSuggest', 'userInfo', 'admin' |
|
|
|
|
// including files |
|
|
|
|
require_once '../inc/global.inc.php'; |
|
|
|
|
require_once api_get_path(LIBRARY_PATH).'attendance.lib.php'; |
|
|
|
|
require_once api_get_path(LIBRARY_PATH).'thematic.lib.php'; |
|
|
|
|
require_once api_get_path(LIBRARY_PATH).'app_view.php'; |
|
|
|
|
require_once 'attendance_controller.php'; |
|
|
|
|
require_once 'thematic_controller.php'; |
|
|
|
|
require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php'; |
|
|
|
|
require_once api_get_path(LIBRARY_PATH).'course.lib.php'; |
|
|
|
|
require_once api_get_path(LIBRARY_PATH).'sortabletable.class.php'; |
|
|
|
@ -30,93 +28,52 @@ $this_section = SECTION_COURSES; |
|
|
|
|
// protect a course script |
|
|
|
|
api_protect_course_script(true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// defining constants |
|
|
|
|
define('ADD_THEMATIC_PLAN', 6); |
|
|
|
|
|
|
|
|
|
$calendar_id = ''; |
|
|
|
|
if (isset($_GET['calendar_id'])) { |
|
|
|
|
$calendar_id = intval($_GET['calendar_id']); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// get actions |
|
|
|
|
$actions = array('attendance_list', 'attendance_sheet_list', 'attendance_sheet_add', 'attendance_add', 'attendance_edit', 'attendance_delete', 'attendance_delete_select'); |
|
|
|
|
$actions_calendar = array('calendar_list', 'calendar_add', 'calendar_edit', 'calendar_delete', 'calendar_all_delete'); |
|
|
|
|
$actions_thematic = array('thematic_details', 'thematic_list', 'thematic_add', 'thematic_edit', 'thematic_delete', 'moveup', 'movedown', |
|
|
|
|
'thematic_plan_list', 'thematic_plan_add', 'thematic_plan_edit', 'thematic_plan_delete', |
|
|
|
|
'thematic_advance_list', 'thematic_advance_add', 'thematic_advance_edit', 'thematic_advance_delete'); |
|
|
|
|
|
|
|
|
|
$action = 'attendance_list'; |
|
|
|
|
if (isset($_GET['action']) && (in_array($_GET['action'],$actions) || in_array($_GET['action'],$actions_calendar) || in_array($_GET['action'],$actions_thematic))) { |
|
|
|
|
if (isset($_GET['action']) && (in_array($_GET['action'],$actions) || in_array($_GET['action'],$actions_calendar))) { |
|
|
|
|
$action = $_GET['action']; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (isset($_POST['action']) && $_POST['action'] == 'thematic_delete_select') { |
|
|
|
|
$action = 'thematic_delete_select'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (isset($_GET['isStudentView']) && $_GET['isStudentView'] == 'true') { |
|
|
|
|
$action = 'attendance_list'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($action == 'thematic_details' || $action == 'thematic_list') { |
|
|
|
|
$_SESSION['thematic_control'] = $action; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// get attendance id |
|
|
|
|
$attendance_id = 0; |
|
|
|
|
$attendance_id = 0; |
|
|
|
|
if (isset($_GET['attendance_id'])) { |
|
|
|
|
$attendance_id = intval($_GET['attendance_id']); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// get thematic id |
|
|
|
|
if (isset($_GET['thematic_id'])) { |
|
|
|
|
$thematic_id = intval($_GET['thematic_id']); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// get thematic plan description type |
|
|
|
|
if (isset($_GET['description_type'])) { |
|
|
|
|
$description_type = intval($_GET['description_type']); |
|
|
|
|
// get calendar id |
|
|
|
|
$calendar_id = ''; |
|
|
|
|
if (isset($_GET['calendar_id'])) { |
|
|
|
|
$calendar_id = intval($_GET['calendar_id']); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// instance attendance object for using like library here |
|
|
|
|
$attendance = new Attendance(); |
|
|
|
|
|
|
|
|
|
// instance thematic object for using like library here |
|
|
|
|
$thematic = new Thematic(); |
|
|
|
|
|
|
|
|
|
// attendance controller object |
|
|
|
|
$attendance_controller = new AttendanceController(); |
|
|
|
|
|
|
|
|
|
// thematic controller object |
|
|
|
|
$thematic_controller = new ThematicController(); |
|
|
|
|
|
|
|
|
|
// get attendance data |
|
|
|
|
if (!empty($attendance_id)) { |
|
|
|
|
// attendance data by id |
|
|
|
|
$attendance_data = $attendance->get_attendance_by_id($attendance_id); |
|
|
|
|
} |
|
|
|
|
if (!empty($thematic_id)) { |
|
|
|
|
// thematic data by id |
|
|
|
|
$thematic_data = $thematic->get_thematic_list($thematic_id); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// get default thematic plan title |
|
|
|
|
$default_thematic_plan_title = $thematic->get_default_thematic_plan_title(); |
|
|
|
|
|
|
|
|
|
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.js" type="text/javascript" language="javascript"></script>'; |
|
|
|
|
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/thickbox.js" type="text/javascript" language="javascript"></script>'; |
|
|
|
|
$htmlHeadXtra[] = '<link rel="stylesheet" href="'.api_get_path(WEB_LIBRARY_PATH).'javascript/thickbox.css" type="text/css" media="projection, screen">'; |
|
|
|
|
$htmlHeadXtra[] = '<script language="javascript"> |
|
|
|
|
|
|
|
|
|
$(function() { |
|
|
|
|
|
|
|
|
|
$("table th img").click(function() { |
|
|
|
|
|
|
|
|
|
$(function() { |
|
|
|
|
$("table th img").click(function() { |
|
|
|
|
var col_id = this.id; |
|
|
|
|
var col_split = col_id.split("_"); |
|
|
|
|
var calendar_id = col_split[2]; |
|
|
|
|
var class_img = $(this).attr("class"); |
|
|
|
|
|
|
|
|
|
var class_img = $(this).attr("class"); |
|
|
|
|
if (class_img == "img_unlock") { |
|
|
|
|
$("#checkbox_head_"+calendar_id).attr("disabled",true); |
|
|
|
|
$(".row_odd td.checkboxes_col_"+calendar_id).css({"background-color":"#F2F2F2"}); |
|
|
|
@ -136,10 +93,8 @@ $htmlHeadXtra[] = '<script language="javascript"> |
|
|
|
|
$("#hidden_input_"+calendar_id).attr("disabled",false); |
|
|
|
|
$("#hidden_input_"+calendar_id).attr("value",calendar_id); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
$("table th input:checkbox").click(function() { |
|
|
|
|
var col_id = this.id; |
|
|
|
|
var col_split = col_id.split("_"); |
|
|
|
@ -149,8 +104,7 @@ $htmlHeadXtra[] = '<script language="javascript"> |
|
|
|
|
} 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":"#F2F2F2"}); |
|
|
|
|
$(".row_even").css({"background-color":"#FFF"}); |
|
|
|
@ -158,8 +112,7 @@ $htmlHeadXtra[] = '<script language="javascript"> |
|
|
|
|
$(".attendance-sheet-content .row_odd, .attendance-sheet-content .row_even").mouseout(function() { |
|
|
|
|
$(".row_odd").css({"background-color":"#F2F2F2"}); |
|
|
|
|
$(".row_even").css({"background-color":"#FFF"}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
$(".advanced_parameters").click(function() { |
|
|
|
|
if ($("#id_qualify").css("display") == "none") { |
|
|
|
|
$("#id_qualify").css("display","block"); |
|
|
|
@ -171,73 +124,8 @@ $htmlHeadXtra[] = '<script language="javascript"> |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function datetime_by_attendance(selected_value) { |
|
|
|
|
$.ajax({ |
|
|
|
|
contentType: "application/x-www-form-urlencoded", |
|
|
|
|
beforeSend: function(objeto) {}, |
|
|
|
|
type: "POST", |
|
|
|
|
url: "'.api_get_path(WEB_AJAX_PATH).'thematic.ajax.php?a=get_datetime_by_attendance", |
|
|
|
|
data: "attendance_id="+selected_value, |
|
|
|
|
success: function(datos) { |
|
|
|
|
$("#div_datetime_attendance").html(datos); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function update_done_thematic_advance(selected_value) { |
|
|
|
|
$.ajax({ |
|
|
|
|
contentType: "application/x-www-form-urlencoded", |
|
|
|
|
beforeSend: function(objeto) {}, |
|
|
|
|
type: "GET", |
|
|
|
|
url: "'.api_get_path(WEB_AJAX_PATH).'thematic.ajax.php?a=update_done_thematic_advance&thematic_advance_id="+selected_value, |
|
|
|
|
data: "thematic_advance_id="+selected_value, |
|
|
|
|
success: function(datos) { |
|
|
|
|
$("#div_result").html(datos); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// clean all radios |
|
|
|
|
for (var i=0; i<$("input[@name=\'done_thematic\']").length;i++) { |
|
|
|
|
var id_radio_thematic = $("input[@name=\'done_thematic\']").get(i).id; |
|
|
|
|
$("#td_"+id_radio_thematic).css({"background-color":"#FFF"}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// set background to previous radios |
|
|
|
|
for (var i=0; i<$("input[@name=\'done_thematic\']").length;i++) { |
|
|
|
|
var id_radio_thematic = $("input[@name=\'done_thematic\']").get(i).id; |
|
|
|
|
$("#td_"+id_radio_thematic).css({"background-color":"#E5EDF9"}); |
|
|
|
|
if ($("input[@name=\'done_thematic\']").get(i).value == selected_value) { |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function check_per_attendance(obj) { |
|
|
|
|
if (obj.checked == true) { |
|
|
|
|
document.getElementById(\'div_datetime_by_attendance\').style.display=\'block\'; |
|
|
|
|
document.getElementById(\'div_custom_datetime\').style.display=\'none\'; |
|
|
|
|
} else { |
|
|
|
|
document.getElementById(\'div_datetime_by_attendance\').style.display=\'none\'; |
|
|
|
|
document.getElementById(\'div_custom_datetime\').style.display=\'block\'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function check_per_custom_date(obj) { |
|
|
|
|
if (obj.checked == true) { |
|
|
|
|
document.getElementById(\'div_custom_datetime\').style.display=\'block\'; |
|
|
|
|
document.getElementById(\'div_datetime_by_attendance\').style.display=\'none\'; |
|
|
|
|
} else { |
|
|
|
|
document.getElementById(\'div_custom_datetime\').style.display=\'none\'; |
|
|
|
|
document.getElementById(\'div_datetime_by_attendance\').style.display=\'block\'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
</script>'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// interbreadcrumbs |
|
|
|
|
if (!empty($_GET['gradebook']) && $_GET['gradebook']=='view' ) { |
|
|
|
|
$_SESSION['gradebook']=Security::remove_XSS($_GET['gradebook']); |
|
|
|
@ -246,12 +134,10 @@ if (!empty($_GET['gradebook']) && $_GET['gradebook']=='view' ) { |
|
|
|
|
unset($_SESSION['gradebook']); |
|
|
|
|
$gradebook= ''; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$param_gradebook = ''; |
|
|
|
|
if (isset($_SESSION['gradebook'])) { |
|
|
|
|
$param_gradebook = '&gradebook='.$gradebook; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$student_param = ''; |
|
|
|
|
if (api_is_drh() && isset($_GET['student_id'])) { |
|
|
|
|
$student_id = intval($_GET['student_id']); |
|
|
|
@ -260,7 +146,6 @@ if (api_is_drh() && isset($_GET['student_id'])) { |
|
|
|
|
$student_name = api_get_person_name($student_info['firstname'],$student_info['lastname']); |
|
|
|
|
$interbreadcrumb[] = array ('url' => '/main/mySpace/myStudents.php?student='.$student_id, 'name' => $student_name); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!empty($gradebook)) { |
|
|
|
|
$interbreadcrumb[] = array ('url' => '/main/gradebook/index.php', 'name' => get_lang('ToolGradebook')); |
|
|
|
|
} |
|
|
|
@ -268,42 +153,6 @@ $interbreadcrumb[] = array ('url' => 'index.php?'.api_get_cidreq().'&action=atte |
|
|
|
|
if ($action == 'attendance_add') { |
|
|
|
|
$interbreadcrumb[] = array ('url' => '#', 'name' => get_lang('CreateANewAttendance')); |
|
|
|
|
} |
|
|
|
|
if ($action == 'thematic_list') { |
|
|
|
|
$interbreadcrumb[] = array ('url' => '#', 'name' => get_lang('ThematicControl')); |
|
|
|
|
} |
|
|
|
|
if ($action == 'thematic_add') { |
|
|
|
|
$interbreadcrumb[] = array ('url' => 'index.php?'.api_get_cidreq().'&action='.$_SESSION['thematic_control'], 'name' => get_lang('ThematicControl')); |
|
|
|
|
$interbreadcrumb[] = array ('url' => '#', 'name' => get_lang('NewThematicSection')); |
|
|
|
|
} |
|
|
|
|
if ($action == 'thematic_edit') { |
|
|
|
|
$interbreadcrumb[] = array ('url' => 'index.php?'.api_get_cidreq().'&action='.$_SESSION['thematic_control'], 'name' => get_lang('ThematicControl')); |
|
|
|
|
$interbreadcrumb[] = array ('url' => '#', 'name' => get_lang('EditThematicSection')); |
|
|
|
|
} |
|
|
|
|
if ($action == 'thematic_details') { |
|
|
|
|
$interbreadcrumb[] = array ('url' => '#', 'name' => get_lang('ThematicControl')); |
|
|
|
|
} |
|
|
|
|
if ($action == 'thematic_plan_list' || $action == 'thematic_plan_delete') { |
|
|
|
|
$interbreadcrumb[] = array ('url' => 'index.php?'.api_get_cidreq().'&action='.$_SESSION['thematic_control'], 'name' => get_lang('ThematicControl')); |
|
|
|
|
$interbreadcrumb[] = array ('url' => '#', 'name' => $thematic_data['title'].':'.get_lang('ThematicPlan')); |
|
|
|
|
} |
|
|
|
|
if ($action == 'thematic_plan_add' || $action == 'thematic_plan_edit') { |
|
|
|
|
$interbreadcrumb[] = array ('url' => 'index.php?'.api_get_cidreq().'&action='.$_SESSION['thematic_control'], 'name' => get_lang('ThematicControl')); |
|
|
|
|
$interbreadcrumb[] = array ('url' => 'index.php?'.api_get_cidreq().'&action=thematic_plan_list&thematic_id='.$thematic_id, 'name' => $thematic_data['title'].':'.get_lang('ThematicPlan')); |
|
|
|
|
if ($description_type >= ADD_THEMATIC_PLAN) { |
|
|
|
|
$interbreadcrumb[] = array ('url' => '#', 'name' => get_lang('NewBloc')); |
|
|
|
|
} else { |
|
|
|
|
$interbreadcrumb[] = array ('url' => '#', 'name' => $default_thematic_plan_title[$description_type]); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if ($action == 'thematic_advance_list') { |
|
|
|
|
$interbreadcrumb[] = array ('url' => 'index.php?'.api_get_cidreq().'&action='.$_SESSION['thematic_control'], 'name' => get_lang('ThematicControl')); |
|
|
|
|
$interbreadcrumb[] = array ('url' => '#', 'name' => $thematic_data['title'].':'.get_lang('ThematicAdvance')); |
|
|
|
|
} |
|
|
|
|
if ($action == 'thematic_advance_add' || $action == 'thematic_advance_edit') { |
|
|
|
|
$interbreadcrumb[] = array ('url' => 'index.php?'.api_get_cidreq().'&action='.$_SESSION['thematic_control'], 'name' => get_lang('ThematicControl')); |
|
|
|
|
$interbreadcrumb[] = array ('url' => 'index.php?'.api_get_cidreq().'&action=thematic_advance_list&thematic_id='.$thematic_id, 'name' => $thematic_data['title'].':'.get_lang('ThematicAdvance')); |
|
|
|
|
$interbreadcrumb[] = array ('url' => '#', 'name' => get_lang('NewThematicAdvance')); |
|
|
|
|
} |
|
|
|
|
if ($action == 'attendance_edit') { |
|
|
|
|
$interbreadcrumb[] = array ('url' => '#', 'name' => get_lang('Edit')); |
|
|
|
|
} |
|
|
|
@ -344,27 +193,6 @@ switch ($action) { |
|
|
|
|
case 'calendar_all_delete' : |
|
|
|
|
case 'calendar_delete' : $attendance_controller->attendance_calendar($action, $attendance_id, $calendar_id); |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case 'thematic_add' : |
|
|
|
|
case 'thematic_edit' : |
|
|
|
|
case 'thematic_delete' : |
|
|
|
|
case 'thematic_delete_select' : |
|
|
|
|
case 'thematic_details' : |
|
|
|
|
case 'moveup' : |
|
|
|
|
case 'movedown' : |
|
|
|
|
case 'thematic_list' : $thematic_controller->thematic($action); |
|
|
|
|
break; |
|
|
|
|
case 'thematic_plan_list' : |
|
|
|
|
case 'thematic_plan_add' : |
|
|
|
|
case 'thematic_plan_edit' : |
|
|
|
|
case 'thematic_plan_delete' : $thematic_controller->thematic_plan($action); |
|
|
|
|
break; |
|
|
|
|
case 'thematic_advance_list' : |
|
|
|
|
case 'thematic_advance_add' : |
|
|
|
|
case 'thematic_advance_edit' : |
|
|
|
|
case 'thematic_advance_delete' : $thematic_controller->thematic_advance($action); |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
default : $attendance_controller->attendance_list(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|