diff --git a/calendar.js b/calendar.js new file mode 100644 index 0000000..eb32974 --- /dev/null +++ b/calendar.js @@ -0,0 +1,96 @@ +document.body.className += ' yui-skin-sam'; + +YAHOO.util.Event.onDOMReady(function(){ + + var Event = YAHOO.util.Event, + Dom = YAHOO.util.Dom, + dialog, calendar; + + var showBtn = Dom.get("show"); + + Event.on(showBtn, "click", function() { + + // Lazy Dialog Creation - Wait to create the Dialog, and setup document click listeners, until the first time the button is clicked. + if (!dialog) { + + // Hide Calendar if we click anywhere in the document other than the calendar + Event.on(document, "click", function(e) { + var el = Event.getTarget(e); + var dialogEl = dialog.element; + if (el != dialogEl && !Dom.isAncestor(dialogEl, el) && el != showBtn && !Dom.isAncestor(showBtn, el)) { + dialog.hide(); + } + }); + + function resetHandler() { + calendar.cfg.setProperty("pagedate", calendar.today); + calendar.render(); + } + + function closeHandler() { + dialog.hide(); + } + + dialog = new YAHOO.widget.Dialog("container", { + visible:false, + context:["show", "tl", "bl"], + buttons:[{text: cal_today, handler: resetHandler, isDefault:true}, {text: cal_close, handler: closeHandler}], + draggable:false, + close:false + }); + dialog.setHeader(''); + dialog.setBody('
'); + dialog.render(document.body); + + dialog.showEvent.subscribe(function() { + if (YAHOO.env.ua.ie) { + // Since we're hiding the table using yui-overlay-hidden, we + // want to let the dialog know that the content size has changed, when + // shown + dialog.fireEvent("changeContent"); + } + }); + } + + // Lazy Calendar Creation - Wait to create the Calendar until the first time the button is clicked. + if (!calendar) { + + calendar = new YAHOO.widget.Calendar("cal", { + iframe:false, // Turn iframe off, since container has iframe support. + hide_blank_weeks:true // Enable, to demonstrate how we handle changing height, using changeContent + }); + + calendar.cfg.setProperty("start_weekday", cal_start_weekday); + calendar.cfg.setProperty("MONTHS_LONG", cal_months); + calendar.cfg.setProperty("WEEKDAYS_SHORT", cal_week_days); + calendar.select(new Date(cal_cur_date*1000)); + calendar.render(); + + calendar.selectEvent.subscribe(function() { + if (calendar.getSelectedDates().length > 0) { + + Dom.get("current").value = calendar.getSelectedDates()[0] / 1000; + + Dom.get("currentdate").submit(); + } + dialog.hide(); + }); + + calendar.renderEvent.subscribe(function() { + // Tell Dialog it's contents have changed, which allows + // container to redraw the underlay (for IE6/Safari2) + dialog.fireEvent("changeContent"); + }); + } + + var seldate = calendar.getSelectedDates(); + + if (seldate.length > 0) { + // Set the pagedate to show the selected date if it exists + calendar.cfg.setProperty("pagedate", seldate[0]); + calendar.render(); + } + + dialog.show(); + }); +}); diff --git a/lang/en_utf8/attforblock.php b/lang/en_utf8/attforblock.php index c693e6b..eb4c0b6 100644 --- a/lang/en_utf8/attforblock.php +++ b/lang/en_utf8/attforblock.php @@ -15,6 +15,7 @@ $string['add'] = 'Add'; $string['addmultiplesessions'] = 'Add multiple sessions'; $string['addsession'] = 'Add session'; $string['allcourses'] = 'All courses'; +$string['all'] = 'All'; $string['alltaken'] = 'All taken'; $string['attendanceforthecourse'] = 'Attendance for the course'; $string['attendancegrade'] = 'Attendance grade'; @@ -37,6 +38,7 @@ $string['commonsession'] = 'Common'; $string['countofselected'] = 'Count of selected'; $string['createmultiplesessions'] = 'Create multiple sessions'; $string['createonesession'] = 'Create one session for the course'; +$string['days'] = 'Day'; $string['defaults'] = 'Defaults'; $string['delete'] = 'Delete'; $string['deletelogs'] = 'Delete attendance data'; diff --git a/lang/ru_utf8/attforblock.php b/lang/ru_utf8/attforblock.php index 4d07759..1e90c91 100644 --- a/lang/ru_utf8/attforblock.php +++ b/lang/ru_utf8/attforblock.php @@ -14,6 +14,7 @@ $string['acronym'] = 'Сокращ.'; $string['add'] = 'Добавить'; $string['addmultiplesessions'] = 'Добавить несколько занятий'; $string['addsession'] = 'Добавить занятие'; +$string['all'] = 'Все'; $string['alltaken'] = 'Все прошедшие'; $string['attendanceforthecourse'] = 'Посещаемость для курса'; $string['attendancegrade'] = 'Оценка за посещаемость'; @@ -30,12 +31,18 @@ $string['attforblock:takeattendances'] = 'Отметка посещаемост $string['attforblock:view'] = 'Просмотр посещаемости'; $string['attforblock:viewreports'] = 'Просмотр отчетов'; $string['attrecords'] = 'Отметок о посещаемости'; +$string['calclose'] = 'Закрыть'; +$string['calmonths'] = '\"Январь\", \"Февраль\", \"Март\", \"Апрель\", \"Май\", \"Июнь\", \"Июль\", \"Август\", \"Сентябрь\", \"Октябрь\", \"Ноябрь\", \"Декабрь\"'; +$string['calshow'] = 'Выбрать дату'; +$string['caltoday'] = 'Сегодня'; +$string['calweekdays'] = ' \"Вс\", \"Пн\", \"Вт\", \"Ср\", \"Чт\", \"Пт\", \"Сб\"'; $string['changeduration'] = 'Изменить продолжительность'; $string['changesession'] = 'Изменить занятие'; $string['commonsession'] = 'Общее'; $string['countofselected'] = 'Выбрано занятий'; $string['createmultiplesessions'] = 'Создать несколько занятий'; $string['createonesession'] = 'Создать одно занятие для курса'; +$string['days'] = 'День'; $string['defaults'] = 'По умолчанию'; $string['delete'] = 'Удалить'; $string['deleteselected'] = 'Удалить выбранные'; @@ -61,7 +68,7 @@ $string['indetail'] = 'Подробнее...'; $string['moduledescription'] = 'Вы можете добавить только один данный модуль в каждый курс.
Удаление этого модуля не повлечет удаление данных о посещаемости!'; $string['modulename'] = 'Посещаемость'; $string['modulenameplural'] = 'Посещаемость'; -$string['months'] = 'По месяцам'; +$string['months'] = 'Месяц'; $string['myvariables'] = 'Мои переменные'; $string['newdate'] = 'Новая дата'; $string['newduration'] = 'New duration'; @@ -113,7 +120,7 @@ $string['variable'] = 'переменную'; $string['variablesupdated'] = 'Переменные успешно обновлены'; $string['versionforprinting'] = 'версия для печати'; $string['week'] = 'неделя(и)'; -$string['weeks'] = 'По неделям'; +$string['weeks'] = 'Неделя'; $string['youcantdo'] = 'Вы ничего не можете сделать'; ?> diff --git a/locallib.php b/locallib.php index f452ab0..40310bb 100644 --- a/locallib.php +++ b/locallib.php @@ -184,13 +184,28 @@ function set_current_view($courseid, $view) { return $SESSION->currentattview[$courseid] = $view; } -function get_current_view($courseid) { +function get_current_view($courseid, $defaultview='weeks') { global $SESSION; if (isset($SESSION->currentattview[$courseid])) return $SESSION->currentattview[$courseid]; else - return 'all'; + return $defaultview; +} + +function set_current_date($courseid, $date) { + global $SESSION; + + return $SESSION->currentattdate[$courseid] = $date; +} + +function get_current_date($courseid) { + global $SESSION; + + if (isset($SESSION->currentattdate[$courseid])) + return $SESSION->currentattdate[$courseid]; + else + return time(); } function print_row($left, $right) { @@ -220,7 +235,7 @@ function print_attendance_table($user, $course, $attforblock) { } function print_user_attendaces($user, $cm, $attforblock, $course = 0, $printing = null) { - global $CFG, $COURSE, $mode; + global $CFG, $COURSE, $mode, $current, $view, $id; echo ''; if (!$printing) { @@ -248,7 +263,7 @@ function print_user_attendaces($user, $cm, $attforblock, $course = 0, $printing echo get_string('attendancenotstarted','attforblock'); } } else { - $stqry = "SELECT ats.id,ats.courseid + $stqry = "SELECT ats.id,ats.courseid FROM {$CFG->prefix}attendance_log al JOIN {$CFG->prefix}attendance_sessions ats ON al.sessionid = ats.id @@ -275,44 +290,158 @@ function print_user_attendaces($user, $cm, $attforblock, $course = 0, $printing if ($course) { + if ($current == 0) + $current = get_current_date($course->id); + else + set_current_date ($course->id, $current); + + list($startdate, $enddate) = + print_filter_controls("view.php", $id); + + if ($startdate && $enddate) { + $where = "ats.courseid={$course->id} AND al.studentid = {$user->id} AND ats.sessdate >= $startdate AND ats.sessdate < $enddate"; + } else { + $where = "ats.courseid={$course->id} AND al.studentid = {$user->id}"; + } + $stqry = "SELECT ats.sessdate,ats.description,al.statusid,al.remarks FROM {$CFG->prefix}attendance_log al JOIN {$CFG->prefix}attendance_sessions ats - ON al.sessionid = ats.id - WHERE ats.courseid = {$course->id} AND al.studentid = {$user->id} - ORDER BY ats.sessdate asc"; + ON al.sessionid = ats.id"; + $stqry .= " WHERE " . $where; + $stqry .= " ORDER BY ats.sessdate asc"; + if ($sessions = get_records_sql($stqry)) { $statuses = get_statuses($course->id); - ?> -
-
- - - - - - - - - $session) + + $i = 0; + $table->head = array('#', get_string('date'), get_string('time'), get_string('description','attforblock'), get_string('status','attforblock'), get_string('remarks','attforblock')); + $table->align = array('', '', 'left', 'left', 'center', 'left'); + $table->size = array('1px', '1px', '1px', '*', '1px', '1px'); + $table->class = 'generaltable attwidth'; + foreach($sessions as $key=>$sessdata) { - ?> - - - - - - - - - '; + $i++; + $table->data[$sessdata->id][] = $i; + $table->data[$sessdata->id][] = userdate($sessdata->sessdate, get_string('strftimedmyw', 'attforblock')); + $table->data[$sessdata->id][] = userdate($sessdata->sessdate, get_string('strftimehm', 'attforblock')); + $table->data[$sessdata->id][] = empty($sessdata->description) ? get_string('nodescription', 'attforblock') : $sessdata->description; + $table->data[$sessdata->id][] = $statuses[$sessdata->statusid]->description; + $table->data[$sessdata->id][] = $sessdata->remarks; + } + print_table($table); } } echo '
#
sessdate, get_string('strftimedmyw', 'attforblock')); //userdate($students->sessdate,'%d.%m.%y (%a)', 99, false);?>sessdate, get_string('strftimehm', 'attforblock')); ?>description) ? get_string('nodescription', 'attforblock') : $session->description; ?>statusid]->description ?>remarks;?>
 
'; } + +function print_filter_controls($url, $id, $sort=NULL, $printgroupselector=false) { + + global $current, $view, $cm; + + list(,,,$mday, $wday, $month, $year) = array_values(usergetdate($current)); + $currentdatecontrols = ''; + switch ($view) { + case 'days': + $format = get_string('strftimedm', 'attforblock'); + $startdate = make_timestamp($year, $month, $mday); + $enddate = make_timestamp($year, $month, $mday + 1); + $prevcur = make_timestamp($year, $month, $mday - 1); + $nextcur = make_timestamp($year, $month, $mday + 1); + $curdatetxt = userdate($startdate, $format); + break; + case 'weeks': + $format = get_string('strftimedm', 'attforblock'); + $startdate = make_timestamp($year, $month, $mday - $wday + 1); + $enddate = make_timestamp($year, $month, $mday + 7 - $wday); + $prevcur = $startdate - WEEKSECS; + $nextcur = $startdate + WEEKSECS; + $curdatetxt = userdate($startdate, $format)." - ".userdate($enddate, $format); + break; + case 'months': + $format = '%B'; + $startdate = make_timestamp($year, $month); + $enddate = make_timestamp($year, $month + 1); + $prevcur = make_timestamp($year, $month - 1); + $nextcur = make_timestamp($year, $month + 1); + $curdatetxt = userdate($startdate, $format); + break; + case 'alltaken': + $startdate = 1; + $enddate = $current; + break; + case 'all': + $startdate = 0; + $enddate = 0; + break; + } + + $link = $url . "?id=$id" . ($sort ? "&sort=$sort" : ""); + + if ($printgroupselector) { + $groupmode = groups_get_activity_groupmode($cm); + $currentgroup = groups_get_activity_group($cm, true); + $groupselector = ''; + $context = get_context_instance(CONTEXT_MODULE, $cm->id); + if ($groupmode == VISIBLEGROUPS || + ($groupmode && has_capability('moodle/site:accessallgroups', $context))) { + $groupselector = groups_print_activity_menu($cm, $link, true); + } + } + + $views['all'] = get_string('all','attforblock'); + $views['alltaken'] = get_string('alltaken','attforblock'); + $views['months'] = get_string('months','attforblock'); + $views['weeks'] = get_string('weeks','attforblock'); + $views['days'] = get_string('days','attforblock'); + $viewcontrols = ''; + foreach ($views as $key => $sview) { + if ($key != $view) + $viewcontrols .= "$sview"; + else + $viewcontrols .= "$sview"; + } + $viewcontrols .= ''; + + echo "
"; + echo ""; + echo ""; + + if ($curdatetxt) { + $curdatecontrols = ""; + $curdatecontrols .= ""; + $curdatecontrols .= " "; + $curdatecontrols .= ""; + if ($sort) + $curdatecontrols .= ""; + $curdatecontrols .= ""; + $curdatecontrols .= ""; + $curdatecontrols .= ""; + plug_yui_calendar($current); + } + echo ""; + echo "
$groupselector
$curdatecontrols$viewcontrols
"; + + echo "
"; + + return array($startdate, $enddate, $currentgroup); +} + +function plug_yui_calendar($current) { + global $CFG; + + require_js(array('yui_dom-event', 'yui_dragdrop', 'yui_element', 'yui_button', 'yui_container', 'yui_calendar')); + + echo "\n"; + + require_js($CFG->wwwroot . '/mod/attforblock/calendar.js'); +} ?> diff --git a/manage.php b/manage.php index 916a608..4a28fc6 100644 --- a/manage.php +++ b/manage.php @@ -6,8 +6,10 @@ require_once('../../config.php'); require_once('locallib.php'); - $id = required_param('id', PARAM_INT); // Course Module ID, or - $from = optional_param('from', PARAM_ACTION); + $id = required_param('id', PARAM_INT); // Course Module ID, or + $from = optional_param('from', PARAM_ACTION); + $view = optional_param('view', NULL, PARAM_ALPHA); // which page to show + $current = optional_param('current', 0, PARAM_INT); if (! $cm = get_record('course_modules', 'id', $id)) { error('Course Module ID was incorrect'); @@ -30,6 +32,11 @@ if (!$context = get_context_instance(CONTEXT_MODULE, $cm->id)) { print_error('badcontext'); } + + if ($view) + set_current_view($course->id, $_GET['view']); + else + $view = get_current_view($course->id); if (!has_capability('mod/attforblock:manageattendances', $context) AND !has_capability('mod/attforblock:takeattendances', $context) AND @@ -78,12 +85,26 @@ function print_sessions_list($course) { - global $CFG, $context, $cm; + global $CFG, $context, $cm, $current, $view, $id; $strhours = get_string('hours'); $strmins = get_string('min'); - $qry = get_records_select('attendance_sessions', "courseid = $course->id AND sessdate >= $course->startdate", 'sessdate asc'); + if ($current == 0) + $current = get_current_date($course->id); + else + set_current_date ($course->id, $current); + + list($startdate, $enddate) = + print_filter_controls("manage.php", $id); + + if ($startdate && $enddate) { + $where = "courseid={$course->id} AND sessdate >= $course->startdate AND sessdate >= $startdate AND sessdate < $enddate"; + } else { + $where = "courseid={$course->id} AND sessdate >= $course->startdate"; + } + + $qry = get_records_select('attendance_sessions', $where/*"courseid = $course->id AND sessdate >= $course->startdate"*/, 'sessdate asc'); $i = 0; $table->width = '100%'; //$table->tablealign = 'center'; @@ -140,7 +161,7 @@ function print_sessions_list($course) { $table->data[$sessdata->id][] = ''; unset($desc, $actions); } - echo '
'; + echo '
'; echo "
id}\">"; //&sessionid={$sessdata->id} print_table($table); $hiddensess = count_records_select('attendance_sessions', "courseid = $course->id AND sessdate < $course->startdate"); diff --git a/report.php b/report.php index 02d17c3..6d2fb8d 100644 --- a/report.php +++ b/report.php @@ -12,7 +12,7 @@ $id = required_param('id', PARAM_INT); $group = optional_param('group', -1, PARAM_INT); // Group to show - $view = optional_param('view', 'weeks', PARAM_ALPHA); // which page to show + $view = optional_param('view', NULL, PARAM_ALPHA); // which page to show $current = optional_param('current', 0, PARAM_INT); $sort = optional_param('sort', 'lastname', PARAM_ALPHA); @@ -37,6 +37,12 @@ if (!$context = get_context_instance(CONTEXT_MODULE, $cm->id)) { print_error('badcontext'); } + + if ($view) + set_current_view($course->id, $_GET['view']); + else + $view = get_current_view($course->id); + require_capability('mod/attforblock:viewreports', $context); @@ -56,87 +62,32 @@ if(!count_records('attendance_sessions', 'courseid', $course->id)) { // no session exists for this course redirect("sessions.php?id=$cm->id&action=add"); - } else { // display attendance report - /// find out current groups mode - $groupmode = groups_get_activity_groupmode($cm); - $currentgroup = groups_get_activity_group($cm, true); - if ($groupmode == VISIBLEGROUPS || - ($groupmode && has_capability('moodle/site:accessallgroups', $context))) { - groups_print_activity_menu($cm, "report.php?id=$id&sort=$sort"); - } + } else { + if ($current == 0) + $current = get_current_date($course->id); + else + set_current_date ($course->id, $current); - echo '
'.helpbutton ('report', get_string('help'), 'attforblock', true, true, '', true).'
'; + list($startdate, $enddate, $currentgroup) = + print_filter_controls("report.php", $id, $sort, true); + + if ($startdate && $enddate) { + $where = "courseid={$course->id} AND sessdate >= $course->startdate AND sessdate >= $startdate AND sessdate < $enddate"; + } else { + $where = "courseid={$course->id} AND sessdate >= $course->startdate"; + } if ($currentgroup) { + $where .= " AND (groupid=0 OR groupid=".$currentgroup.")"; $students = get_users_by_capability($context, 'moodle/legacy:student', '', "u.$sort ASC", '', '', $currentgroup, '', false); } else { $students = get_users_by_capability($context, 'moodle/legacy:student', '', "u.$sort ASC", '', '', '', '', false); } - - // display date interval selector - $rec = get_record_sql("SELECT MIN(sessdate) AS min, MAX(sessdate) AS max - FROM {$CFG->prefix}attendance_sessions - WHERE courseid=$course->id AND sessdate >= $course->startdate"); - $firstdate = $rec->min; - $lastdate = $rec->max; - $now = time(); - $current = $current == 0 ? $now : $current; - list(,,,$wday, $syear, $smonth, $sday) = array_values(usergetdate($firstdate)); - $wday = $wday == 0 ? 7 : $wday; //////////////////////////////////////////////////// Нужна проверка настройки календаря - $startdate = make_timestamp($syear, $smonth, $sday-$wday+1); //GMT timestamp but for local midnight of monday - - $options['all'] = get_string('alltaken','attforblock'); - $options['weeks'] = get_string('weeks','attforblock'); - $options['months'] = get_string('months','attforblock'); - echo '
'.helpbutton ('display', get_string('display','attforblock'), 'attforblock', true, false, '', true).get_string('display','attforblock').': '; - if (isset($_GET['view'])) //{ - set_current_view($course->id, $_GET['view']); - $view = get_current_view($course->id); - popup_form("report.php?id=$id&sort=$sort&view=", $options, 'viewmenu', $view, ''); - - $out = ''; - $list = array(); - if ($view === 'weeks') { - $format = get_string('strftimedm', 'attforblock'); - for ($i = 0, $monday = $startdate; $monday <= $lastdate; $i++, $monday += ONE_WEEK) { - if (count_records_select('attendance_sessions', "courseid={$course->id} AND sessdate >= ".$monday." AND sessdate < ".($monday + ONE_WEEK))) { - $list[] = $monday; - } - } - } elseif ($view === 'months') { - $startdate = make_timestamp($syear, $smonth, 1); - $format = '%B'; - for ($i = 0, $month = $startdate; $month <= $lastdate; $i++, $month = make_timestamp($syear, $smonth+$i, 1)) { - if (count_records_select('attendance_sessions', "courseid={$course->id} AND sessdate >= ".$month." AND sessdate < ".make_timestamp($syear, $smonth+$i+1, 1))) { - $list[] = $month; - } - } - } - $found = false; - for ($i = count($list)-1; $i >= 0; $i--) { - if ($list[$i] <= $current && !$found) { - $found = true; - $current = $list[$i]; - $out = ''.userdate($list[$i], $format).' / '.$out; - } else { - $out = "\n".userdate($list[$i], $format)." / ".$out; - } - } - echo substr($out, 0, -2)."
\n"; $statuses = get_statuses($course->id); $allstatuses = get_statuses($course->id, false); - - if ($view === 'weeks') { - $where = "courseid={$course->id} AND sessdate >= $course->startdate AND sessdate >= $current AND sessdate < ".($current + ONE_WEEK); - } elseif ($view === 'months') { - list(,,,, $syear, $smonth, $sday) = array_values(usergetdate($current)); - $where = "courseid={$course->id} AND sessdate >= $course->startdate AND sessdate >= $current AND sessdate < ".make_timestamp($syear, $smonth+1, 1); - } else { - $where = "courseid={$course->id} AND sessdate >= $course->startdate AND sessdate <= ".time(); - } - if ($currentgroup) - $where .= " AND (groupid=0 OR groupid=".$currentgroup.")"; + + if ($students and ($course_sess = get_records_select('attendance_sessions', $where, 'sessdate ASC'))) { @@ -154,6 +105,7 @@ $table->head[] = $fullnamehead; $table->align[] = 'left'; $table->size[] = ''; + $table->class = 'generaltable attwidth'; $allowtake = has_capability('mod/attforblock:takeattendances', $context); $allowchange = has_capability('mod/attforblock:changeattendances', $context); $groups = groups_get_all_groups($course->id); @@ -225,7 +177,6 @@ $table->data[$student->id][] = get_percent($student->id, $course).'%'; } } - echo '
'; print_table($table); } else { print_heading(get_string('nothingtodisplay'), 'center'); diff --git a/sessions.php b/sessions.php index e33ed48..79d11fb 100644 --- a/sessions.php +++ b/sessions.php @@ -95,7 +95,7 @@ $rec->duration = $duration; $rec->description = $fromform->sdescription; $rec->timemodified = $now; - if ($fromform->sessiontype === COMMONSESSION) { + if ($fromform->sessiontype == COMMONSESSION) { if(!insert_record('attendance_sessions', $rec)) error(get_string('erroringeneratingsessions','attforblock'), "sessions.php?id=$id&action=add"); } else { diff --git a/styles.php b/styles.php new file mode 100644 index 0000000..a9ed2aa --- /dev/null +++ b/styles.php @@ -0,0 +1,47 @@ +.attbtn { + border:1px solid #AAAAAA; + margin-left: 2px; + margin-right: 2px; + padding: 5px; + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + -opera-border-radius: 5px; + -khtml-border-radius: 5px; +} + +.attcurbtn { + margin-left: 2px; + margin-right: 2px; + padding: 5px; +} + +.attfiltercontrols { + margin-bottom: 10px; + margin-right:auto; + margin-left:auto; +} + +.attwidth { + width:90%; +} + +/* for IE7*/ +.attfiltercontrols td { + padding:6px; +} + +wwwroot}/lib/yui" +?> +/* +Copyright (c) 2010, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.8.1 +*/ +body{font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}select,input,button,textarea,button{font:99% arial,helvetica,clean,sans-serif;}table{font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:100%;} +.yui-button{display:-moz-inline-box;display:inline-block;vertical-align:text-bottom;}.yui-button .first-child{display:block;*display:inline-block;}.yui-button button,.yui-button a{display:block;*display:inline-block;border:none;margin:0;}.yui-button button{background-color:transparent;*overflow:visible;cursor:pointer;}.yui-button a{text-decoration:none;}.yui-skin-sam .yui-button{border-width:1px 0;border-style:solid;border-color:#808080;background:url(http://yui.yahooapis.com/2.8.1/build/assets/skins/sam/sprite.png) repeat-x 0 0;margin:auto .25em;}.yui-skin-sam .yui-button .first-child{border-width:0 1px;border-style:solid;border-color:#808080;margin:0 -1px;_margin:0;}.yui-skin-sam .yui-button button,.yui-skin-sam .yui-button a,.yui-skin-sam .yui-button a:visited{padding:0 10px;font-size:93%;line-height:2;*line-height:1.7;min-height:2em;*min-height:auto;color:#000;}.yui-skin-sam .yui-button a{*line-height:1.875;*padding-bottom:1px;}.yui-skin-sam .yui-split-button button,.yui-skin-sam .yui-menu-button button{padding-right:20px;background-position:right center;background-repeat:no-repeat;}.yui-skin-sam .yui-menu-button button{background-image:url(/assets/skins/sam/menu-button-arrow.png);}.yui-skin-sam .yui-split-button button{background-image:url(/assets/skins/sam/split-button-arrow.png);}.yui-skin-sam .yui-button-focus{border-color:#7D98B8;background-position:0 -1300px;}.yui-skin-sam .yui-button-focus .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-split-button-focus button{background-image:url(/assets/skins/sam/split-button-arrow-focus.png);}.yui-skin-sam .yui-button-hover{border-color:#7D98B8;background-position:0 -1300px;}.yui-skin-sam .yui-button-hover .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-split-button-hover button{background-image:url(/assets/skins/sam/split-button-arrow-hover.png);}.yui-skin-sam .yui-button-active{border-color:#7D98B8;background-position:0 -1700px;}.yui-skin-sam .yui-button-active .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-split-button-activeoption{border-color:#808080;background-position:0 0;}.yui-skin-sam .yui-split-button-activeoption .first-child{border-color:#808080;}.yui-skin-sam .yui-split-button-activeoption button{background-image:url(/assets/skins/sam/split-button-arrow-active.png);}.yui-skin-sam .yui-radio-button-checked,.yui-skin-sam .yui-checkbox-button-checked{border-color:#304369;background-position:0 -1400px;}.yui-skin-sam .yui-radio-button-checked .first-child,.yui-skin-sam .yui-checkbox-button-checked .first-child{border-color:#304369;}.yui-skin-sam .yui-radio-button-checked button,.yui-skin-sam .yui-checkbox-button-checked button{color:#fff;}.yui-skin-sam .yui-button-disabled{border-color:#ccc;background-position:0 -1500px;}.yui-skin-sam .yui-button-disabled .first-child{border-color:#ccc;}.yui-skin-sam .yui-button-disabled button,.yui-skin-sam .yui-button-disabled a,.yui-skin-sam .yui-button-disabled a:visited{color:#A6A6A6;cursor:default;}.yui-skin-sam .yui-menu-button-disabled button{background-image:url(/assets/skins/sam/menu-button-arrow-disabled.png);}.yui-skin-sam .yui-split-button-disabled button{background-image:url(/assets/skins/sam/split-button-arrow-disabled.png);} +.yui-overlay,.yui-panel-container{visibility:hidden;position:absolute;z-index:2;}.yui-panel{position:relative;}.yui-panel-container form{margin:0;}.mask{z-index:1;display:none;position:absolute;top:0;left:0;right:0;bottom:0;}.mask.block-scrollbars{overflow:auto;}.masked select,.drag select,.hide-select select{_visibility:hidden;}.yui-panel-container select{_visibility:inherit;}.hide-scrollbars,.hide-scrollbars *{overflow:hidden;}.hide-scrollbars select{display:none;}.show-scrollbars{overflow:auto;}.yui-panel-container.show-scrollbars,.yui-tt.show-scrollbars{overflow:visible;}.yui-panel-container.show-scrollbars .underlay,.yui-tt.show-scrollbars .yui-tt-shadow{overflow:auto;}.yui-panel-container.shadow .underlay.yui-force-redraw{padding-bottom:1px;}.yui-effect-fade .underlay,.yui-effect-fade .yui-tt-shadow{display:none;}.yui-tt-shadow{position:absolute;}.yui-override-padding{padding:0!important;}.yui-panel-container .container-close{overflow:hidden;text-indent:-10000em;text-decoration:none;}.yui-overlay.yui-force-redraw,.yui-panel-container.yui-force-redraw{margin-bottom:1px;}.yui-skin-sam .mask{background-color:#000;opacity:.25;filter:alpha(opacity=25);}.yui-skin-sam .yui-panel-container{padding:0 1px;*padding:2px;}.yui-skin-sam .yui-panel{position:relative;left:0;top:0;border-style:solid;border-width:1px 0;border-color:#808080;z-index:1;*border-width:1px;*zoom:1;_zoom:normal;}.yui-skin-sam .yui-panel .hd,.yui-skin-sam .yui-panel .bd,.yui-skin-sam .yui-panel .ft{border-style:solid;border-width:0 1px;border-color:#808080;margin:0 -1px;*margin:0;*border:0;}.yui-skin-sam .yui-panel .hd{border-bottom:solid 1px #ccc;}.yui-skin-sam .yui-panel .bd,.yui-skin-sam .yui-panel .ft{background-color:#F2F2F2;}.yui-skin-sam .yui-panel .hd{padding:0 10px;font-size:93%;line-height:2;*line-height:1.9;font-weight:bold;color:#000;background:url(http://yui.yahooapis.com/2.8.1/build/assets/skins/sam/sprite.png) repeat-x 0 -200px;}.yui-skin-sam .yui-panel .bd{padding:10px;}.yui-skin-sam .yui-panel .ft{border-top:solid 1px #808080;padding:5px 10px;font-size:77%;}.yui-skin-sam .container-close{position:absolute;top:5px;right:6px;width:25px;height:15px;background:url(http://yui.yahooapis.com/2.8.1/build/assets/skins/sam/sprite.png) no-repeat 0 -300px;cursor:pointer;}.yui-skin-sam .yui-panel-container .underlay{right:-1px;left:-1px;}.yui-skin-sam .yui-panel-container.matte{padding:9px 10px;background-color:#fff;}.yui-skin-sam .yui-panel-container.shadow{_padding:2px 4px 0 2px;}.yui-skin-sam .yui-panel-container.shadow .underlay{position:absolute;top:2px;left:-3px;right:-3px;bottom:-3px;*top:4px;*left:-1px;*right:-1px;*bottom:-1px;_top:0;_left:0;_right:0;_bottom:0;_margin-top:3px;_margin-left:-1px;background-color:#000;opacity:.12;filter:alpha(opacity=12);}.yui-skin-sam .yui-dialog .ft{border-top:none;padding:0 10px 10px 10px;font-size:100%;}.yui-skin-sam .yui-dialog .ft .button-group{display:block;text-align:right;}.yui-skin-sam .yui-dialog .ft button.default{font-weight:bold;}.yui-skin-sam .yui-dialog .ft span.default{border-color:#304369;background-position:0 -1400px;}.yui-skin-sam .yui-dialog .ft span.default .first-child{border-color:#304369;}.yui-skin-sam .yui-dialog .ft span.default button{color:#fff;}.yui-skin-sam .yui-dialog .ft span.yui-button-disabled{background-position:0 -1500px;border-color:#ccc;}.yui-skin-sam .yui-dialog .ft span.yui-button-disabled .first-child{border-color:#ccc;}.yui-skin-sam .yui-dialog .ft span.yui-button-disabled button{color:#a6a6a6;}.yui-skin-sam .yui-simple-dialog .bd .yui-icon{background:url(http://yui.yahooapis.com/2.8.1/build/assets/skins/sam/sprite.png) no-repeat 0 0;width:16px;height:16px;margin-right:10px;float:left;}.yui-skin-sam .yui-simple-dialog .bd span.blckicon{background-position:0 -1100px;}.yui-skin-sam .yui-simple-dialog .bd span.alrticon{background-position:0 -1050px;}.yui-skin-sam .yui-simple-dialog .bd span.hlpicon{background-position:0 -1150px;}.yui-skin-sam .yui-simple-dialog .bd span.infoicon{background-position:0 -1200px;}.yui-skin-sam .yui-simple-dialog .bd span.warnicon{background-position:0 -1900px;}.yui-skin-sam .yui-simple-dialog .bd span.tipicon{background-position:0 -1250px;}.yui-skin-sam .yui-tt .bd{position:relative;top:0;left:0;z-index:1;color:#000;padding:2px 5px;border-color:#D4C237 #A6982B #A6982B #A6982B;border-width:1px;border-style:solid;background-color:#FFEE69;}.yui-skin-sam .yui-tt.show-scrollbars .bd{overflow:auto;}.yui-skin-sam .yui-tt-shadow{top:2px;right:-3px;left:-3px;bottom:-3px;background-color:#000;}.yui-skin-sam .yui-tt-shadow-visible{opacity:.12;filter:alpha(opacity=12);} +.yui-calcontainer{position:relative;float:left;_overflow:hidden;}.yui-calcontainer iframe{position:absolute;border:none;margin:0;padding:0;z-index:0;width:100%;height:100%;left:0;top:0;}.yui-calcontainer iframe.fixedsize{width:50em;height:50em;top:-1px;left:-1px;}.yui-calcontainer.multi .groupcal{z-index:1;float:left;position:relative;}.yui-calcontainer .title{position:relative;z-index:1;}.yui-calcontainer .close-icon{position:absolute;z-index:1;text-indent:-10000em;overflow:hidden;}.yui-calendar{position:relative;}.yui-calendar .calnavleft{position:absolute;z-index:1;text-indent:-10000em;overflow:hidden;}.yui-calendar .calnavright{position:absolute;z-index:1;text-indent:-10000em;overflow:hidden;}.yui-calendar .calheader{position:relative;width:100%;text-align:center;}.yui-calcontainer .yui-cal-nav-mask{position:absolute;z-index:2;margin:0;padding:0;width:100%;height:100%;_width:0;_height:0;left:0;top:0;display:none;}.yui-calcontainer .yui-cal-nav{position:absolute;z-index:3;top:0;display:none;}.yui-calcontainer .yui-cal-nav .yui-cal-nav-btn{display:-moz-inline-box;display:inline-block;}.yui-calcontainer .yui-cal-nav .yui-cal-nav-btn button{display:block;*display:inline-block;*overflow:visible;border:none;background-color:transparent;cursor:pointer;}.yui-calendar .calbody a:hover{background:inherit;}p#clear{clear:left;padding-top:10px;}.yui-skin-sam .yui-calcontainer{background-color:#f2f2f2;border:1px solid #808080;padding:10px;}.yui-skin-sam .yui-calcontainer.multi{padding:0 5px 0 5px;}.yui-skin-sam .yui-calcontainer.multi .groupcal{background-color:transparent;border:none;padding:10px 5px 10px 5px;margin:0;}.yui-skin-sam .yui-calcontainer .title{background:url(http://yui.yahooapis.com/2.8.1/build/assets/skins/sam/sprite.png) repeat-x 0 0;border-bottom:1px solid #ccc;font:100% sans-serif;color:#000;font-weight:bold;height:auto;padding:.4em;margin:0 -10px 10px -10px;top:0;left:0;text-align:left;}.yui-skin-sam .yui-calcontainer.multi .title{margin:0 -5px 0 -5px;}.yui-skin-sam .yui-calcontainer.withtitle{padding-top:0;}.yui-skin-sam .yui-calcontainer .calclose{background:url(http://yui.yahooapis.com/2.8.1/build/assets/skins/sam/sprite.png) no-repeat 0 -300px;width:25px;height:15px;top:.4em;right:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar{border-spacing:0;border-collapse:collapse;font:100% sans-serif;text-align:center;margin:0;}.yui-skin-sam .yui-calendar .calhead{background:transparent;border:none;vertical-align:middle;padding:0;}.yui-skin-sam .yui-calendar .calheader{background:transparent;font-weight:bold;padding:0 0 .6em 0;text-align:center;}.yui-skin-sam .yui-calendar .calheader img{border:none;}.yui-skin-sam .yui-calendar .calnavleft{background:url(http://yui.yahooapis.com/2.8.1/build/assets/skins/sam/sprite.png) no-repeat 0 -450px;width:25px;height:15px;top:0;bottom:0;left:-10px;margin-left:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar .calnavright{background:url(http://yui.yahooapis.com/2.8.1/build/assets/skins/sam/sprite.png) no-repeat 0 -500px;width:25px;height:15px;top:0;bottom:0;right:-10px;margin-right:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar .calweekdayrow{height:2em;}.yui-skin-sam .yui-calendar .calweekdayrow th{padding:0;border:none;}.yui-skin-sam .yui-calendar .calweekdaycell{color:#000;font-weight:bold;text-align:center;width:2em;}.yui-skin-sam .yui-calendar .calfoot{background-color:#f2f2f2;}.yui-skin-sam .yui-calendar .calrowhead,.yui-skin-sam .yui-calendar .calrowfoot{color:#a6a6a6;font-size:85%;font-style:normal;font-weight:normal;border:none;}.yui-skin-sam .yui-calendar .calrowhead{text-align:right;padding:0 2px 0 0;}.yui-skin-sam .yui-calendar .calrowfoot{text-align:left;padding:0 0 0 2px;}.yui-skin-sam .yui-calendar td.calcell{border:1px solid #ccc;background:#fff;padding:1px;height:1.6em;line-height:1.6em;text-align:center;white-space:nowrap;}.yui-skin-sam .yui-calendar td.calcell a{color:#06c;display:block;height:100%;text-decoration:none;}.yui-skin-sam .yui-calendar td.calcell.today{background-color:#000;}.yui-skin-sam .yui-calendar td.calcell.today a{background-color:#fff;}.yui-skin-sam .yui-calendar td.calcell.oom{background-color:#ccc;color:#a6a6a6;cursor:default;}.yui-skin-sam .yui-calendar td.calcell.selected{background-color:#fff;color:#000;}.yui-skin-sam .yui-calendar td.calcell.selected a{background-color:#b3d4ff;color:#000;}.yui-skin-sam .yui-calendar td.calcell.calcellhover{background-color:#426fd9;color:#fff;cursor:pointer;}.yui-skin-sam .yui-calendar td.calcell.calcellhover a{background-color:#426fd9;color:#fff;}.yui-skin-sam .yui-calendar td.calcell.previous{color:#e0e0e0;}.yui-skin-sam .yui-calendar td.calcell.restricted{text-decoration:line-through;}.yui-skin-sam .yui-calendar td.calcell.highlight1{background-color:#cf9;}.yui-skin-sam .yui-calendar td.calcell.highlight2{background-color:#9cf;}.yui-skin-sam .yui-calendar td.calcell.highlight3{background-color:#fcc;}.yui-skin-sam .yui-calendar td.calcell.highlight4{background-color:#cf9;}.yui-skin-sam .yui-calendar a.calnav{border:1px solid #f2f2f2;padding:0 4px;text-decoration:none;color:#000;zoom:1;}.yui-skin-sam .yui-calendar a.calnav:hover{background:url(http://yui.yahooapis.com/2.8.1/build/assets/skins/sam/sprite.png) repeat-x 0 0;border-color:#A0A0A0;cursor:pointer;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-mask{background-color:#000;opacity:.25;filter:alpha(opacity=25);}.yui-skin-sam .yui-calcontainer .yui-cal-nav{font-family:arial,helvetica,clean,sans-serif;font-size:93%;border:1px solid #808080;left:50%;margin-left:-7em;width:14em;padding:0;top:2.5em;background-color:#f2f2f2;}.yui-skin-sam .yui-calcontainer.withtitle .yui-cal-nav{top:4.5em;}.yui-skin-sam .yui-calcontainer.multi .yui-cal-nav{width:16em;margin-left:-8em;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-y,.yui-skin-sam .yui-calcontainer .yui-cal-nav-m,.yui-skin-sam .yui-calcontainer .yui-cal-nav-b{padding:5px 10px 5px 10px;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-b{text-align:center;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-e{margin-top:5px;padding:5px;background-color:#EDF5FF;border-top:1px solid black;display:none;}.yui-skin-sam .yui-calcontainer .yui-cal-nav label{display:block;font-weight:bold;} +.yui-skin-sam .yui-calcontainer .yui-cal-nav-mc{width:100%;_width:auto;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-y input.yui-invalid{background-color:#FFEE69;border:1px solid #000;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-yc{width:4em;}.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn{border:1px solid #808080;background:url(http://yui.yahooapis.com/2.8.1/build/assets/skins/sam/sprite.png) repeat-x 0 0;background-color:#ccc;margin:auto .15em;}.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn button{padding:0 8px;font-size:93%;line-height:2;*line-height:1.7;min-height:2em;*min-height:auto;color:#000;}.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn.yui-default{border:1px solid #304369;background-color:#426fd9;background:url(http://yui.yahooapis.com/2.8.1/build/assets/skins/sam/sprite.png) repeat-x 0 -1400px;}.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn.yui-default button{color:#fff;} diff --git a/view.php b/view.php index f3bfeec..b16bb03 100644 --- a/view.php +++ b/view.php @@ -11,6 +11,8 @@ $studentid = optional_param('student', 0, PARAM_INT); $printing = optional_param('printing'); $mode = optional_param('mode', 'thiscourse'); + $view = optional_param('view', NULL, PARAM_ALPHA); // which page to show + $current = optional_param('current', 0, PARAM_INT); if ($id) { if (! $cm = get_record("course_modules", "id", $id)) { @@ -57,6 +59,11 @@ error("No such user in this course"); } + if ($view) + set_current_view($course->id, $_GET['view']); + else + $view = get_current_view($course->id, 'months'); + require_capability('mod/attforblock:view', $context); $student = false;