From 2bf9f94c8f271ac2cefafc14557eb002010e8430 Mon Sep 17 00:00:00 2001 From: Luis Ramon Lopez Date: Wed, 5 Jan 2011 03:52:51 +0100 Subject: [PATCH] Grid view support. Multiple instances in the same course now allowed. Updated es_utf8 language strings --- CHANGES | 28 +++++++- attendances.php | 33 +++++++--- attsettings.php | 8 ++- backuplib.php | 6 +- db/install.xml | 8 +-- db/upgrade.php | 29 +++++++-- export.php | 6 +- lang/en_utf8/attforblock.php | 5 ++ lang/es_utf8/attforblock.php | 61 ++++++++++++----- .../help/attforblock/hiddensessions.html | 15 +++++ .../help/attforblock/sessiontypes.html | 17 +++++ lib.php | 27 ++++---- locallib.php | 65 ++++++++++--------- manage.php | 27 ++++---- mod_form.php | 4 -- report.php | 16 ++--- restorelib.php | 12 ++-- sessions.php | 5 +- styles.php | 2 +- version.php | 2 +- 20 files changed, 251 insertions(+), 125 deletions(-) create mode 100644 lang/es_utf8/help/attforblock/hiddensessions.html create mode 100644 lang/es_utf8/help/attforblock/sessiontypes.html diff --git a/CHANGES b/CHANGES index 1c6da13..44ca102 100644 --- a/CHANGES +++ b/CHANGES @@ -1,7 +1,29 @@ -2010-12-29 - 2010-12-30 lrlopez +2010-12-30 - 2011-01-04 lrlopez - * db/install.xml: - * db/upgrade.php: + * lang/: es_utf8/attforblock.php: + + Updated and fixed Spanish translation (Enrique Robredo) + + * styles.php: + + Fixed yui-calendar CSS modifying global CSS behaviour. + + * manage.php: + + Added an option for choosing between show session duration or show end + time in session list. + + * db/: install.xml: upgrade.php: version.php: + * attsettings.php: lib.php: locallib.php: manage.php: report.php: + + Added support to allow more than one attendance in the same course. + + * sessions.php: + + Fixed DST bug (adding multiple sessions could generate invalid start + times if any DST change occur in-between) + + * attendances.php: Implemented display modes (list and grid) * lang/: en_utf8/attforblock.php, es_utf8/attforblock.php: diff --git a/attendances.php b/attendances.php index 7c5aa6d..9f04b38 100644 --- a/attendances.php +++ b/attendances.php @@ -38,7 +38,7 @@ print_error('badcontext'); } - $statlist = implode(',', array_keys( (array)get_statuses($course->id) )); + $statlist = implode(',', array_keys( (array)get_statuses($attforblock->id) )); if ($form = data_submitted()) { $students = array(); // stores students ids $formarr = (array)$form; @@ -105,15 +105,28 @@ // get the viewmode & grid columns (default is set in module settings) $attforblockrecord = get_record('attforblock', 'course', $course->id); - $view = optional_param('view', $attforblockrecord->displaymode, PARAM_INT); - $gridcols = optional_param('gridcols', $attforblockrecord->gridcolumns, PARAM_INT); + $view = optional_param('view', get_user_preferences("attforblock_viewmode",0), PARAM_INT); + $gridcols = optional_param('gridcols', get_user_preferences("attforblock_gridcolumns",5), PARAM_INT); echo '
'; - $options = array (get_string('sortedlist','attforblock'), get_string('sortedgrid','attforblock')); - $data = "attendances.php?id=$id&sessionid=$sessionid&grouptype=$grouptype"; + $options = array (0 => get_string('sortedlist','attforblock'), 1 => get_string('sortedgrid','attforblock')); + $data = "attendances.php?id=$id&sessionid=$sessionid&grouptype=$grouptype&gridcols=$gridcols"; if ($group!=-1) { $data = $data . "&group=$group"; } popup_form("$data&view=", $options, 'viewmenu', $view, ''); + if ($view==1) { + set_user_preference("attforblock_viewmode", $view); + set_user_preference("attforblock_gridcolumns", $gridcols); + $options = array (1 => '1 '.get_string('column','attforblock'),'2 '.get_string('columns','attforblock'),'3 '.get_string('columns','attforblock'), + '4 '.get_string('columns','attforblock'),'5 '.get_string('columns','attforblock'),'6 '.get_string('columns','attforblock'), + '7 '.get_string('columns','attforblock'),'8 '.get_string('columns','attforblock'),'9 '.get_string('columns','attforblock'), + '10 '.get_string('columns','attforblock')); + $data = "attendances.php?id=$id&sessionid=$sessionid&grouptype=$grouptype&view=$view"; + if ($group!=-1) { + $data = $data . "&group=$group"; + } + popup_form("$data&gridcols=", $options, 'colsmenu', $gridcols, ''); + } echo '
'; if ($grouptype === 0) { if ($currentgroup) { @@ -137,7 +150,7 @@ ', "'.($sessdata->description ? $sessdata->description : get_string('nodescription', 'attforblock')).'"'; print_table($table); - $statuses = get_statuses($course->id); + $statuses = get_statuses($attforblock->id); $i = 3; foreach($statuses as $st) { switch($view) { @@ -210,8 +223,8 @@ $i = 0; // sanity check - $gridcols = $gridcols < 0 ? 0 : $gridcols; - for ($i=0; $i<=$gridcols; $i++) { + $gridcols = $gridcols < 1 ? 1 : $gridcols; + for ($i=0; $i<$gridcols; $i++) { $table->head[] = ' '; $table->align[] = 'center'; $table->size[] = '110px'; @@ -226,7 +239,7 @@ foreach($statuses as $st) { $data = $data . 'id == $att->statusid ? 'checked' : '').'>' . $st->acronym; } - $table->data[($i-1) / ($gridcols+1)][] = $data; + $table->data[($i-1) / ($gridcols)][] = $data; } break; } @@ -237,7 +250,7 @@ echo ''; echo ''; echo ''; - echo '
'; + echo '
'; echo ''; } else { print_heading(get_string('nothingtodisplay'), 'center'); diff --git a/attsettings.php b/attsettings.php index c10a9c2..ca8ef25 100644 --- a/attsettings.php +++ b/attsettings.php @@ -20,7 +20,10 @@ error("Course module is incorrect"); } } - $attforblockrecord = get_record('attforblock','course',$course->id); + //$attforblockrecord = get_record('attforblock','course',$course->id); + if (! $attforblockrecord = get_record('attforblock', 'id', $cm->instance)) { + error("Course module is incorrect"); + } require_login($course->id); @@ -84,6 +87,7 @@ if (!empty($newacronym) && !empty($newdescription)) { unset($rec); $rec->courseid = $course->id; + $rec->attendanceid = $attforblock->id; $rec->acronym = $newacronym; $rec->description = $newdescription; $rec->grade = $newgrade; @@ -113,7 +117,7 @@ get_string('action')); $table->align = array('center', 'center', 'center', 'center', 'center', 'center'); //$table->size = array('1px', '1px', '*', '1px', '1px', '1px'); - $statuses = get_statuses($course->id, false); + $statuses = get_statuses($attforblockrecord->id, false); $deltitle = get_string('delete'); foreach($statuses as $st) { diff --git a/backuplib.php b/backuplib.php index 0c36cc7..dab2af9 100644 --- a/backuplib.php +++ b/backuplib.php @@ -97,7 +97,7 @@ $status = true; - $datas = get_records('attendance_sessions', 'courseid', $attforblock->course); + $datas = get_records('attendance_sessions', 'attendanceid', $attforblock->id); if ($datas) { //Write start tag $status =fwrite ($bf,start_tag('SESSIONS',4,true)); @@ -136,7 +136,7 @@ $status = true; - $datas = get_records('attendance_statuses', 'courseid', $attforblock->course); + $datas = get_records('attendance_statuses', 'attendanceid', $attforblock->id); //If there is levels if ($datas) { //Write start tag @@ -170,7 +170,7 @@ $status = true; - $sessions = get_records_menu('attendance_sessions', 'courseid', $attforblock->course); + $sessions = get_records_menu('attendance_sessions', 'attendanceid', $attforblock->id); $sesslist = implode(',', array_keys($sessions)); $datas = get_records_list('attendance_log', 'sessionid', $sesslist); //If there is levels diff --git a/db/install.xml b/db/install.xml index c9cf21c..e7f83e0 100644 --- a/db/install.xml +++ b/db/install.xml @@ -10,8 +10,6 @@ - - @@ -24,7 +22,8 @@ - + + @@ -37,7 +36,8 @@ - + + diff --git a/db/upgrade.php b/db/upgrade.php index 751b04f..c72e99c 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -228,18 +228,33 @@ function xmldb_attforblock_upgrade($oldversion=0) { $result = $result && add_index($table, $index); } - if ($oldversion < 2010122900 and $result) { - $table = new XMLDBTable('attforblock'); + if ($oldversion < 2010123003 and $result) { + + $table = new XMLDBTable('attendance_sessions'); - $field = new XMLDBField('displaymode'); - $field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'grade'); + $field = new XMLDBField('attendanceid'); + $field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'groupid'); $result = $result && add_field($table, $field); - $field = new XMLDBField('gridcolumns'); - $field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '4', 'displaymode'); + $index = new XMLDBIndex('attendanceid'); + $index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('attendanceid')); + $result = $result && add_index($table, $index); + + $sql = "UPDATE {$CFG->prefix}attendance_sessions AS ses,{$CFG->prefix}attforblock AS att SET ses.attendanceid=att.id WHERE att.course=ses.courseid"; + $result = $result && execute_sql($sql); + + $table = new XMLDBTable('attendance_statuses'); + + $field = new XMLDBField('attendanceid'); + $field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'courseid'); $result = $result && add_field($table, $field); - } + $index = new XMLDBIndex('attendanceid'); + $index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('attendanceid')); + $result = $result && add_index($table, $index); + $sql = "UPDATE {$CFG->prefix}attendance_statuses AS sta,{$CFG->prefix}attforblock AS att SET sta.attendanceid=att.id WHERE att.course=sta.courseid"; + $result = $result && execute_sql($sql); + } return $result; } diff --git a/export.php b/export.php index d2ec5ce..f152d7f 100644 --- a/export.php +++ b/export.php @@ -56,7 +56,7 @@ $data->tabhead[] = get_string('lastname'); $data->tabhead[] = get_string('firstname'); - $select = "courseid = {$course->id} AND sessdate >= {$course->startdate}"; + $select = "courseid = {$course->id} AND attendanceid = {$attforblock->id} AND sessdate >= {$course->startdate}"; if (isset($fromform->includenottaken)) { $select .= " AND sessdate <= {$fromform->sessionenddate}"; } else { @@ -74,7 +74,7 @@ $i = 0; $data->table = array(); - $statuses = get_statuses($course->id); + $statuses = get_statuses($attforblock->id); foreach($students as $student) { if (isset($fromform->ident['id'])) { $data->table[$i][] = $student->id; @@ -91,7 +91,7 @@ $data->table[$i][] = '-'; } } - $data->table[$i][] = get_percent($student->id, $course).'%'; + $data->table[$i][] = get_percent($student->id, $course, $attforblock).'%'; $i++; } diff --git a/lang/en_utf8/attforblock.php b/lang/en_utf8/attforblock.php index 6f03cad..ffcca82 100644 --- a/lang/en_utf8/attforblock.php +++ b/lang/en_utf8/attforblock.php @@ -39,6 +39,8 @@ $string['caltoday'] = 'Today'; $string['calweekdays'] = ' \"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"'; $string['changeduration'] = 'Change duration'; $string['changesession'] = 'Change session'; +$string['column'] = 'column'; +$string['columns'] = 'columns'; $string['commonsession'] = 'Common'; $string['commonsessions'] = 'Common'; $string['countofselected'] = 'Count of selected'; @@ -62,6 +64,7 @@ $string['downloadooo'] = 'Download in OpenOffice format'; $string['downloadtext'] = 'Download in text format'; $string['duration'] = 'Duration'; $string['editsession'] = 'Edit Session'; +$string['endtime'] = 'Session end time'; $string['endofperiod'] = 'End of period'; $string['errorgroupsnotselected'] = 'Select one or more groups'; $string['errorinaddingsession'] = 'Error in adding session'; @@ -97,6 +100,7 @@ $string['report'] = 'Report'; $string['resetdescription'] = 'Remember that deleting attendance data will erase information from database. You can just hide older sessions having changed start date of course!'; $string['resetstatuses'] = 'Reset statuses to default'; $string['restoredefaults'] = 'Restore defaults'; +$string['save'] = 'Save attendance'; $string['session'] = 'Session'; $string['sessionadded'] = 'Session successfully added'; $string['sessionalreadyexists'] = 'Session already exists for this date'; @@ -114,6 +118,7 @@ $string['sessiontypeshort'] = 'Type'; $string['sessionupdated'] = 'Session successfully updated'; $string['settings'] = 'Settings'; $string['showdefaults'] = 'Show defaults'; +$string['showduration'] = 'Show duration'; $string['sortedgrid'] = 'Sorted grid'; $string['sortedlist'] = 'Sorted list'; $string['status'] = 'Status'; diff --git a/lang/es_utf8/attforblock.php b/lang/es_utf8/attforblock.php index 34e3efe..8b27014 100644 --- a/lang/es_utf8/attforblock.php +++ b/lang/es_utf8/attforblock.php @@ -1,13 +1,21 @@ -Si se elimina esta actividad, los datos de la base de datos no se verán afectados, así que reaparecerán en caso de volver a agregar nuevamente la actividad.'; $string['modulename'] = 'Asistencia'; $string['modulenameplural'] = 'Asistencias'; -$string['months'] = 'Meses'; +$string['months'] = 'Mensual'; $string['myvariables'] = 'Mis Variables'; $string['newdate'] = 'Nueva Fecha'; $string['newduration'] = 'Nueva duración'; $string['noattforuser'] = 'No existen registros de asistencia para el usuario'; $string['nodescription'] = 'Sesión de Clase Normal'; +$string['nogroups'] = 'No puede incluir sesiones grupales. No existen grupos en este curso.'; $string['noguest'] = 'Los invitados no pueden ver la asistencia'; $string['noofdaysabsent'] = 'Nº de días de ausencia'; $string['noofdaysexcused'] = 'Nº de días con faltas justificadas'; @@ -74,14 +94,13 @@ $string['nosessiondayselected'] = 'No se ha seleccionado día de Sesión'; $string['nosessionexists'] = 'No existen Sesiones para este curso'; $string['notfound'] = 'No se ha encontrado ninguna actividad Asistencia en este curso'; $string['olddate'] = 'Fecha Anterior'; -$string['Pacronym'] = 'P'; $string['period'] = 'Frecuencia'; -$string['Pfull'] = 'Presente'; $string['remarks'] = 'Observaciones'; $string['report'] = 'Informe'; $string['resetdescription'] = 'Recuerde que eliminando los datos de la asistencia provocará el borrado de información en la base de datos. Usted puede ocultar sesiones anteriores cambiando la fecha de inicio del curso en la zona de administración.'; $string['resetstatuses'] = 'Reinicar la configuración por defecto'; $string['restoredefaults'] = 'Restarurar valores por defecto'; +$string['save'] = 'Guardar asistencia'; $string['session'] = 'Sesión'; $string['sessionadded'] = 'Sesión añadida con éxito'; $string['sessionalreadyexists'] = 'Ya existe una sesión para la fecha indicada'; @@ -94,12 +113,16 @@ $string['sessions'] = 'Sesiones'; $string['sessionscompleted'] = 'Sesiones completadas'; $string['sessionsgenerated'] = 'Sesiones generadas con éxito'; $string['sessionstartdate'] = 'Fecha de Inicio de la Sesión'; +$string['sessiontype'] = 'Tipo de sesión'; +$string['sessiontypeshort'] = 'Tipo'; $string['sessionupdated'] = 'Sesión actualizada con éxito'; $string['settings'] = 'Configuración'; +$string['showduration'] = 'Mostrar duración'; $string['showdefaults'] = 'Mostrar opciones por defecto'; $string['sortedgrid'] = 'Rejilla alfabética'; $string['sortedlist'] = 'Lista alfabética'; $string['status'] = 'Estado'; +$string['statusdeleted'] = 'Estado eliminado'; $string['strftimedm'] = '%%d.%%m'; $string['strftimedmy'] = '%%d.%%m.%%Y'; $string['strftimedmyhm'] = '%%d.%%m.%%Y %%H.%%M'; @@ -110,9 +133,11 @@ $string['studentid'] = 'ID de Estudiante'; $string['takeattendance'] = 'Iniciar Asistencia'; $string['thiscourse'] = 'Este curso'; $string['update'] = 'Actualizar'; +$string['variable'] = 'variable'; $string['variablesupdated'] = 'Variables actualizadas con éxito'; $string['versionforprinting'] = 'versión para Imprimir'; $string['week'] = 'semana(s)'; -$string['weeks'] = 'Semanas'; +$string['weeks'] = 'Semanal'; $string['youcantdo'] = 'Usted no puede hacer nada'; + ?> diff --git a/lang/es_utf8/help/attforblock/hiddensessions.html b/lang/es_utf8/help/attforblock/hiddensessions.html new file mode 100644 index 0000000..1ce36db --- /dev/null +++ b/lang/es_utf8/help/attforblock/hiddensessions.html @@ -0,0 +1,15 @@ +

Asistencia

+

Ocultar sesiones

+

+ dirroot.'/mod/attforblock/version.php'); + echo get_string('version').": $module->release ($module->version)"; + unset($module); + $module = $temp; + ?> +

+

Las sesiones se ocultan cuando la fecha de comienzo de un curso es anterior que la actual. Modifique la fecha de inicio del curso y las sesiones ocultas se mostrarán.

+

Se puede utilizar esta opción para ocultar sesiones antiguas en lugar de eliminarlas. +Tenga en cuenta que únicamente las sesiones visibles son las que se tendrán en cuenta en el Libro de Calificaciones.

diff --git a/lang/es_utf8/help/attforblock/sessiontypes.html b/lang/es_utf8/help/attforblock/sessiontypes.html new file mode 100644 index 0000000..99f35c9 --- /dev/null +++ b/lang/es_utf8/help/attforblock/sessiontypes.html @@ -0,0 +1,17 @@ +

Asistencia

+

+ dirroot.'/mod/attforblock/version.php'); + echo get_string('version').": $module->release ($module->version)"; + unset($module); + $module = $temp; + ?> +

+

Hay dos tipos de sesiones: comunes y grupales. + La posibilidad de elegir una u otra dependerá del modo de grupo con que fue creada la actividad.

+

Modo de grupo "No hay grupos" únicamente se pueden elegir sesiones comunes.

+

Modo de grupo "Grupos visible" es posible elegir sesiones grupales o comunes.

+

Modo de grupo "Grupos Separados" únicamente es posible elegir sesiones grupales.

+

En caso de que fuese necesario, es posible seleccionar varios grupos simultáneos o alternos utilizando la tecla ctrl

diff --git a/lib.php b/lib.php index e1bc832..5a2f987 100644 --- a/lib.php +++ b/lib.php @@ -29,27 +29,28 @@ function attforblock_add_instance($attforblock) { $attforblock->timemodified = time(); - if ($att = get_record('attforblock', 'course', $attforblock->course)) { + /*if ($att = get_record('attforblock', 'course', $attforblock->course)) { $modnum = get_field('modules', 'id', 'name', 'attforblock'); if (!get_record('course_modules', 'course', $attforblock->course, 'module', $modnum)) { delete_records('attforblock', 'course', $attforblock->course); $attforblock->id = insert_record('attforblock', $attforblock); - } else { + /*} else { return false; } - } else { + } else {*/ $attforblock->id = insert_record('attforblock', $attforblock); - } + //} //Copy statuses for new instance from defaults - if (!get_records('attendance_statuses', 'courseid', $attforblock->course)) { + //if (!get_records('attendance_statuses', 'courseid', $attforblock->course)) { $statuses = get_records('attendance_statuses', 'courseid', 0, 'id'); foreach($statuses as $stat) { $rec = $stat; $rec->courseid = $attforblock->course; + $rec->attendanceid = $attforblock->id; insert_record('attendance_statuses', $rec); } - } + //} // attforblock_grade_item_update($attforblock); // attforblock_update_grades($attforblock); @@ -165,11 +166,11 @@ function attforblock_user_outline($course, $user, $mod, $attforblock) { require_once('locallib.php'); if (isstudent($course->id, $user->id)) { - if ($sescount = get_attendance($user->id,$course)) { + if ($sescount = get_attendance($user->id,$course, $attforblock)) { $strgrade = get_string('grade'); - $maxgrade = get_maxgrade($user->id, $course); - $usergrade = get_grade($user->id, $course); - $percent = get_percent($user->id,$course); + $maxgrade = get_maxgrade($user->id, $course,$attforblock); + $usergrade = get_grade($user->id, $course,$attforblock); + $percent = get_percent($user->id,$course, $attforblock); $result->info = "$strgrade: $usergrade / $maxgrade ($percent%)"; } } @@ -229,13 +230,13 @@ function attforblock_get_user_grades($attforblock, $userid=0) { if ($userid) { $result = array(); $result[$userid]->userid = $userid; - $result[$userid]->rawgrade = $attforblock->grade * get_percent($userid, $course) / 100; + $result[$userid]->rawgrade = $attforblock->grade * get_percent($userid, $course, $attforblock) / 100; } else { if ($students = get_course_students($course->id)) { $result = array(); foreach ($students as $student) { $result[$student->id]->userid = $student->id; - $result[$student->id]->rawgrade = $attforblock->grade * get_percent($student->id, $course) / 100; + $result[$student->id]->rawgrade = $attforblock->grade * get_percent($student->id, $course, $attforblock) / 100; } } } @@ -313,7 +314,7 @@ function attforblock_grade_item_update($attforblock, $grades=NULL) { }else{ // MDL-14303 $cm = get_coursemodule_from_instance('attforblock', $attforblock->id); - $params = array('itemname'=>$attforblock->name, 'idnumber'=>$cm->id); + $params = array('itemname'=>$attforblock->name/*, 'idnumber'=>$attforblock->id*/); } if ($attforblock->grade > 0) { diff --git a/locallib.php b/locallib.php index 1f42c6c..9114c09 100644 --- a/locallib.php +++ b/locallib.php @@ -46,12 +46,12 @@ function show_tabs($cm, $context, $currenttab='sessions') //getting settings for course -function get_statuses($courseid, $onlyvisible = true) +function get_statuses($attendanceid, $onlyvisible = true) { if ($onlyvisible) { - $result = get_records_select('attendance_statuses', "courseid = $courseid AND visible = 1 AND deleted = 0", 'grade DESC'); + $result = get_records_select('attendance_statuses', "attendanceid = $attendanceid AND visible = 1 AND deleted = 0", 'grade DESC'); } else { - $result = get_records_select('attendance_statuses', "courseid = $courseid AND deleted = 0", 'grade DESC'); + $result = get_records_select('attendance_statuses', "attendanceid = $attendanceid AND deleted = 0", 'grade DESC'); // $result = get_records('attendance_statuses', 'courseid', $courseid, 'grade DESC'); } return $result; @@ -59,14 +59,14 @@ function get_statuses($courseid, $onlyvisible = true) //gets attendance status for a student, returns count -function get_attendance($userid, $course, $statusid=0) +function get_attendance($userid, $course, $attendance, $statusid=0) { global $CFG; $qry = "SELECT count(*) as cnt FROM {$CFG->prefix}attendance_log al JOIN {$CFG->prefix}attendance_sessions ats ON al.sessionid = ats.id - WHERE ats.courseid = $course->id + WHERE ats.attendanceid = $attendance->id AND ats.sessdate >= $course->startdate AND al.studentid = $userid"; if ($statusid) { @@ -76,7 +76,7 @@ function get_attendance($userid, $course, $statusid=0) return count_records_sql($qry); } -function get_grade($userid, $course) +function get_grade($userid, $course, $attendance) { global $CFG; $logs = get_records_sql("SELECT l.id, l.statusid, l.statusset @@ -85,10 +85,11 @@ function get_grade($userid, $course) ON l.sessionid = s.id WHERE l.studentid = $userid AND s.courseid = $course->id + AND s.attendanceid = $attendance->id AND s.sessdate >= $course->startdate"); $result = 0; if ($logs) { - $stat_grades = records_to_menu(get_records('attendance_statuses', 'courseid', $course->id), 'id', 'grade'); + $stat_grades = records_to_menu(get_records('attendance_statuses', 'attendanceid', $attendance->id), 'id', 'grade'); foreach ($logs as $log) { $result += $stat_grades[$log->statusid]; } @@ -108,7 +109,7 @@ function local_array_intersect_key($array1, $array2) { return $result; } -function get_maxgrade($userid, $course) +function get_maxgrade($userid, $course, $attendance) { global $CFG; $logs = get_records_sql("SELECT l.id, l.statusid, l.statusset @@ -117,10 +118,11 @@ function get_maxgrade($userid, $course) ON l.sessionid = s.id WHERE l.studentid = $userid AND s.courseid = $course->id + AND s.attendanceid = $attendance->id AND s.sessdate >= $course->startdate"); $maxgrade = 0; if ($logs) { - $stat_grades = records_to_menu(get_records('attendance_statuses', 'courseid', $course->id), 'id', 'grade'); + $stat_grades = records_to_menu(get_records('attendance_statuses', 'attendanceid', $attendance->id), 'id', 'grade'); foreach ($logs as $log) { $ids = array_flip(explode(',', $log->statusset)); // $grades = array_intersect_key($stat_grades, $ids); // require PHP 5.1.0 and higher @@ -162,15 +164,15 @@ function get_percent_adaptive($userid, $course) // NOT USED return sprintf("%0.{$dp}f", $result); } -function get_percent($userid, $course) +function get_percent($userid, $course, $attforblock) { global $CFG; - $maxgrd = get_maxgrade($userid, $course); + $maxgrd = get_maxgrade($userid, $course, $attforblock); if ($maxgrd == 0) { $result = 0; } else { - $result = get_grade($userid, $course) / $maxgrd * 100; + $result = get_grade($userid, $course, $attforblock) / $maxgrd * 100; } if ($result < 0) { $result = 0; @@ -218,20 +220,20 @@ function print_row($left, $right) { function print_attendance_table($user, $course, $attforblock) { - $complete = get_attendance($user->id, $course); + $complete = get_attendance($user->id, $course, $attforblock); echo ''; print_row(get_string('sessionscompleted','attforblock').':', "$complete"); - $statuses = get_statuses($course->id); + $statuses = get_statuses($attforblock->id); foreach($statuses as $st) { - print_row($st->description.': ', ''.get_attendance($user->id, $course, $st->id).''); + print_row($st->description.': ', ''.get_attendance($user->id, $course, $attforblock, $st->id).''); } if ($attforblock->grade) { - $percent = get_percent($user->id, $course).' %'; - $grade = get_grade($user->id, $course); + $percent = get_percent($user->id, $course, $attforblock).' %'; + $grade = get_grade($user->id, $course, $attforblock); print_row(get_string('attendancepercent','attforblock').':', "$percent"); - print_row(get_string('attendancegrade','attforblock').':', "$grade / ".get_maxgrade($user->id, $course)); + print_row(get_string('attendancegrade','attforblock').':', "$grade / ".get_maxgrade($user->id, $course, $attforblock)); } print_row(' ', ' '); echo '
'; @@ -260,30 +262,31 @@ function print_user_attendaces($user, $cm, $attforblock, $course = 0, $printing echo ''.fullname($user).''; if ($course) { echo '
'; - $complete = get_attendance($user->id, $course); + $complete = get_attendance($user->id, $course, $attforblock); if($complete) { print_attendance_table($user, $course, $attforblock); } else { echo get_string('attendancenotstarted','attforblock'); } } else { - $stqry = "SELECT ats.id,ats.courseid + $stqry = "SELECT ats.id,ats.courseid AS 'cid',ats.attendanceid AS 'aid' FROM {$CFG->prefix}attendance_log al JOIN {$CFG->prefix}attendance_sessions ats ON al.sessionid = ats.id WHERE al.studentid = {$user->id} - GROUP BY ats.courseid - ORDER BY ats.courseid asc"; - $recs = get_records_sql_menu($stqry); - foreach ($recs as $id => $courseid) { + GROUP BY cid + ORDER BY cid,aid asc"; + $recs = get_records_sql($stqry); + foreach ($recs as $rec) { echo '
'; echo ''; - $nextcourse = get_record('course', 'id', $courseid); - echo ''; + $nextcourse = get_record('course', 'id', $rec['cid']); + $nextattendance = get_record('attforblock', 'id', $rec['aid']); + echo ''; echo '
'.$nextcourse->fullname.'
'.$nextcourse->fullname.' - '.$nextattendance->name . ''; - $complete = get_attendance($user->id, $nextcourse); + $complete = get_attendance($user->id, $nextcourse, $nextattendance); if($complete) { - print_attendance_table($user, $nextcourse, $attforblock); + print_attendance_table($user, $nextcourse, $nextattendance); } else { echo get_string('attendancenotstarted','attforblock'); } @@ -304,9 +307,9 @@ function print_user_attendaces($user, $cm, $attforblock, $course = 0, $printing $enddate = $ret['enddate']; if ($startdate && $enddate) { - $where = "ats.courseid={$course->id} AND al.studentid = {$user->id} AND ats.sessdate >= $startdate AND ats.sessdate < $enddate"; + $where = "ats.courseid={$course->id} AND ats.attendanceid={$attforblock->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}"; + $where = "ats.courseid={$course->id} AND ats.attendanceid={$attforblock->id} AND al.studentid = {$user->id}"; } $stqry = "SELECT ats.id,ats.sessdate,ats.description,al.statusid,al.remarks @@ -317,7 +320,7 @@ function print_user_attendaces($user, $cm, $attforblock, $course = 0, $printing $stqry .= " ORDER BY ats.sessdate asc"; if ($sessions = get_records_sql($stqry)) { - $statuses = get_statuses($course->id); + $statuses = get_statuses($attforblock->id); $i = 0; $table->head = array('#', get_string('date'), get_string('time'), get_string('description','attforblock'), get_string('status','attforblock'), get_string('remarks','attforblock')); diff --git a/manage.php b/manage.php index d61952a..e9acf72 100644 --- a/manage.php +++ b/manage.php @@ -10,7 +10,7 @@ $from = optional_param('from', PARAM_ACTION); $view = optional_param('view', NULL, PARAM_ALPHA); // which page to show $current = optional_param('current', 0, PARAM_INT); - + $showendtime = optional_param('showendtime', get_user_preferences("attforblock_showendtime",0), PARAM_INT); if (! $cm = get_record('course_modules', 'id', $id)) { error('Course Module ID was incorrect'); } @@ -43,14 +43,16 @@ !has_capability('mod/attforblock:changeattendances', $context)) { redirect("view.php?id=$cm->id"); } - + + set_user_preference("attforblock_showendtime",$showendtime); + //if teacher is coming from block, then check for a session exists for today if($from === 'block') { $today = time(); // because we compare with database, we don't need to use usertime() $sql = "SELECT id, groupid, lasttaken FROM {$CFG->prefix}attendance_sessions WHERE $today BETWEEN sessdate AND (sessdate + duration) - AND courseid = $course->id"; + AND courseid = $course->id AND attendanceid = $attforblock->id"; if($atts = get_records_sql($sql)) { $size = count($atts); if ($size == 1) { @@ -76,23 +78,23 @@ print_heading(get_string('attendanceforthecourse','attforblock').' :: ' .$course->fullname); - if(!count_records_select('attendance_sessions', "courseid = $course->id AND sessdate >= $course->startdate")) { // no session exists for this course + if(!count_records_select('attendance_sessions', "courseid = $course->id AND attendanceid = $attforblock->id AND sessdate >= $course->startdate")) { // no session exists for this course show_tabs($cm, $context); print_heading(get_string('nosessionexists','attforblock')); - $hiddensess = count_records_select('attendance_sessions', "courseid = $course->id AND sessdate < $course->startdate"); + $hiddensess = count_records_select('attendance_sessions', "courseid = $course->id AND attendanceid = $attforblock->id AND sessdate < $course->startdate"); echo '
'.helpbutton('hiddensessions', '', 'attforblock', true, true, '', true); echo get_string('hiddensessions', 'attforblock').': '.$hiddensess.'
'; } else { //sessions generated , display them add_to_log($course->id, 'attendance', 'manage attendances', 'mod/attforblock/manage.php?course='.$course->id, $user->lastname.' '.$user->firstname); show_tabs($cm, $context); - print_sessions_list($course); + print_sessions_list($course, $attforblock); } // require_once('lib.php'); // $t = attforblock_get_user_grades($attforblock); //////////////////////////////////////////// print_footer($course); -function print_sessions_list($course) { +function print_sessions_list($course, $attforblock) { global $CFG, $context, $cm, $current, $view, $id; $strhours = get_string('hours'); @@ -109,9 +111,9 @@ function print_sessions_list($course) { $currentgroup = $ret['currentgroup']; if ($startdate && $enddate) { - $where = "courseid={$course->id} AND sessdate >= $course->startdate AND sessdate >= $startdate AND sessdate < $enddate"; + $where = "courseid={$course->id} AND attendanceid = $attforblock->id AND sessdate >= $course->startdate AND sessdate >= $startdate AND sessdate < $enddate"; } else { - $where = "courseid={$course->id} AND sessdate >= $course->startdate"; + $where = "courseid={$course->id} AND attendanceid = $attforblock->id AND sessdate >= $course->startdate"; } if ($currentgroup > -1) { @@ -122,7 +124,7 @@ function print_sessions_list($course) { $i = 0; $table->width = '100%'; //$table->tablealign = 'center'; - $table->head = array('#', get_string('sessiontypeshort', 'attforblock'), get_string('date'), get_string('time'), get_string('duration', 'attforblock'), get_string('description','attforblock'), get_string('actions'), get_string('select')); + $table->head = array('#', get_string('sessiontypeshort', 'attforblock'), get_string('date'), get_string('from'), ($showendtime=='0') ? get_string('duration', 'attforblock') : get_string('to'), get_string('description','attforblock'), get_string('actions'), get_string('select')); $table->align = array('', '', '', 'right', 'left', 'center', 'center'); $table->size = array('1px', '', '1px', '1px', '1px', '*', '1px', '1px'); @@ -170,17 +172,18 @@ function print_sessions_list($course) { $hours = floor($sessdata->duration / HOURSECS); $mins = floor(($sessdata->duration - $hours * HOURSECS) / MINSECS); $mins = $mins < 10 ? "0$mins" : "$mins"; - $table->data[$sessdata->id][] = $hours ? "{$hours} {$strhours} {$mins} {$strmins}" : "{$mins} {$strmins}"; + $table->data[$sessdata->id][] = ($showendtime=='0') ? ($hours ? "{$hours} {$strhours} {$mins} {$strmins}" : "{$mins} {$strmins}") : userdate($sessdata->sessdate+$sessdata->duration, get_string('strftimehm', 'attforblock'));; $table->data[$sessdata->id][] = $desc; $table->data[$sessdata->id][] = $actions; $table->data[$sessdata->id][] = ''; unset($desc, $actions); } } + echo '
'; echo "
id}\">"; //&sessionid={$sessdata->id} print_table($table); - $hiddensess = count_records_select('attendance_sessions', "courseid = $course->id AND sessdate < $course->startdate"); + $hiddensess = count_records_select('attendance_sessions', "courseid = $course->id AND attendanceid = $attforblock->id AND sessdate < $course->startdate"); echo ''; diff --git a/mod_form.php b/mod_form.php index 866f41d..47549eb 100644 --- a/mod_form.php +++ b/mod_form.php @@ -20,11 +20,7 @@ class mod_attforblock_mod_form extends moodleform_mod { $mform->addElement('modgrade', 'grade', get_string('grade')); $mform->setDefault('grade', 100); - - $mform->addElement('select', 'displaymode', get_string('displaymode','attforblock'), array (get_string('sortedlist','attforblock'), get_string('sortedgrid','attforblock'))); - $mform->addElement('select', 'gridcolumns', get_string('gridcolumns','attforblock'), array ('1','2','3','4','5','6','7','8','9','10')); - $this->standard_coursemodule_elements(true); //------------------------------------------------------------------------------- diff --git a/report.php b/report.php index 9090e03..5141999 100644 --- a/report.php +++ b/report.php @@ -60,7 +60,7 @@ $sort = $sort == 'firstname' ? 'firstname' : 'lastname'; - if(!count_records('attendance_sessions', 'courseid', $course->id)) { // no session exists for this course + if(!count_records_select('attendance_sessions', "courseid = {$course->id} AND attendanceid = {$attforblock->id}")) { // no session exists for this course redirect("sessions.php?id=$cm->id&action=add"); } else { if ($current == 0) @@ -74,9 +74,9 @@ $currentgroup = $ret['currentgroup']; if ($startdate && $enddate) { - $where = "courseid={$course->id} AND sessdate >= $course->startdate AND sessdate >= $startdate AND sessdate < $enddate"; + $where = "courseid={$course->id} AND attendanceid = {$attforblock->id} AND sessdate >= $course->startdate AND sessdate >= $startdate AND sessdate < $enddate"; } else { - $where = "courseid={$course->id} AND sessdate >= $course->startdate"; + $where = "courseid={$course->id} AND attendanceid = {$attforblock->id} AND sessdate >= $course->startdate"; } if ($currentgroup) { @@ -86,8 +86,8 @@ $students = get_users_by_capability($context, 'moodle/legacy:student', '', "u.$sort ASC", '', '', '', '', false); } - $statuses = get_statuses($course->id); - $allstatuses = get_statuses($course->id, false); + $statuses = get_statuses($attforblock->id); + $allstatuses = get_statuses($attforblock->id, false); if ($students and @@ -176,11 +176,11 @@ } } foreach($statuses as $st) { - $table->data[$student->id][] = get_attendance($student->id, $course, $st->id); + $table->data[$student->id][] = get_attendance($student->id, $course, $attforblock, $st->id); } if ($attforblock->grade) { - $table->data[$student->id][] = get_grade($student->id, $course).' / '.get_maxgrade($student->id, $course); - $table->data[$student->id][] = get_percent($student->id, $course).'%'; + $table->data[$student->id][] = get_grade($student->id, $course, $attforblock).' / '.get_maxgrade($student->id, $course, $attforblock); + $table->data[$student->id][] = get_percent($student->id, $course, $attforblock).'%'; } } print_table($table); diff --git a/restorelib.php b/restorelib.php index 26320ad..00ae151 100644 --- a/restorelib.php +++ b/restorelib.php @@ -13,9 +13,9 @@ //Now get completed xmlized object $info = $data->info; - if (count_records('attforblock', 'course', $restore->course_id)) { + /*if (count_records('attforblock', 'course', $restore->course_id)) { return false; - } + }*/ //Now, build the attforblock record structure $attforblock->course = $restore->course_id; @@ -67,6 +67,7 @@ //Now, build the attforblock_SESSIONS record structure $stat->courseid = $restore->course_id; + $stat->attendanceid = $new_attforblock_id; $stat->groupid = backup_todb($stat_info['#']['GROUPID']['0']['#']); $group = restore_group_getid($restore, $stat->groupid); if ($group) { @@ -117,6 +118,7 @@ //Now, build the attforblock_STATUS record structure $stat->courseid = $restore->course_id; + $stat->attendanceid = $new_attforblock_id; $stat->acronym = backup_todb($stat_info['#']['ACRONYM']['0']['#']); $stat->description = backup_todb($stat_info['#']['DESCRIPTION']['0']['#']); $stat->grade = backup_todb($stat_info['#']['GRADE']['0']['#']); @@ -139,6 +141,7 @@ //Now, build the attforblock_STATUS record structure $stat->courseid = $restore->course_id; + $stat->attendanceid = $new_attforblock_id; $stat->acronym = backup_todb($stat_info['#']['ACRONYM']['0']['#']); $stat->description = backup_todb($stat_info['#']['DESCRIPTION']['0']['#']); $stat->grade = backup_todb($stat_info['#']['GRADE']['0']['#']); @@ -159,6 +162,7 @@ foreach($stats as $stat) { // $stat = $stats[$i]; $stat->courseid = $restore->course_id; + $stat->attendanceid = $new_attforblock_id; $newid = insert_record('attendance_statuses', $stat); $oldidarray[$old_attforblock_id]['attendance_statuses'][$oldstats[$i++]] = $newid; // $i++; @@ -182,9 +186,9 @@ @$logs = $info['MOD']['#']['ATTFORBLOCK_LOG']['0']['#']['ROWS']; } - $stats = get_records_menu('attendance_statuses', 'courseid', $restore->course_id); + $stats = get_records_menu('attendance_statuses', 'attendanceid', $new_attforblock_id); $statslist = implode(',', array_keys($stats)); - $sessions = get_records('attendance_sessions', 'courseid', $restore->course_id); + $sessions = get_records('attendance_sessions', 'attendanceid', $new_attforblock_id); //Iterate over logs for($i = 0; $i < sizeof($logs); $i++) { diff --git a/sessions.php b/sessions.php index 79d11fb..713ae93 100644 --- a/sessions.php +++ b/sessions.php @@ -60,6 +60,7 @@ if (isset($fromform->addmultiply)) { $startdate = $fromform->sessiondate;// + $fromform->stime['hour']*3600 + $fromform->stime['minute']*60; + $starttime = $startdate - usergetmidnight($startdate); $enddate = $fromform->sessionenddate + ONE_DAY; // because enddate in 0:0am //get number of days @@ -91,7 +92,8 @@ // continue; // } $rec->courseid = $course->id; - $rec->sessdate = $sdate; + $rec->attendanceid = $attforblock->id; + $rec->sessdate = usergetmidnight($sdate) + $starttime; $rec->duration = $duration; $rec->description = $fromform->sdescription; $rec->timemodified = $now; @@ -117,6 +119,7 @@ } else { // insert one session $rec->courseid = $course->id; + $rec->attendanceid = $attforblock->id; $rec->sessdate = $fromform->sessiondate; $rec->duration = $duration; $rec->description = $fromform->sdescription; diff --git a/styles.php b/styles.php index a9ed2aa..57e109b 100644 --- a/styles.php +++ b/styles.php @@ -40,7 +40,7 @@ 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%;} +.yuidialog body{font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;} .yuidialog select,.yuidialog input,.yuidialog button,.yuidialog textarea,.yuidialog button{font:99% arial,helvetica,clean,sans-serif;} .yuidialog table{font-size:inherit;font:100%;} .yuidialog pre,.yuidialog code,.yuidialog kbd,.yuidialog samp,.yuidialog 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;} diff --git a/version.php b/version.php index bbf2968..962d302 100644 --- a/version.php +++ b/version.php @@ -5,7 +5,7 @@ /// This fragment is called by moodle_needs_upgrading() and /admin/index.php ///////////////////////////////////////////////////////////////////////////////// -$module->version = 2010122900; // The current module version (Date: YYYYMMDDXX) +$module->version = 2010123003; // The current module version (Date: YYYYMMDDXX) $module->release = '2.2.1'; $module->cron = 0; // Period for cron to check this module (secs) ?>
'; echo '
'.helpbutton('hiddensessions', '', 'attforblock', true, true, '', true); echo get_string('hiddensessions', 'attforblock').': '.$hiddensess.'