Added "Start of period" into export tab
authorLuis Ramon Lopez <lrlopez@gmail.com>
Sun, 16 Jan 2011 19:18:08 +0000 (20:18 +0100)
committerLuis Ramon Lopez <lrlopez@gmail.com>
Sun, 16 Jan 2011 19:18:08 +0000 (20:18 +0100)
CHANGES
export.php
export_form.php
lang/en_utf8/attforblock.php
lang/es_utf8/attforblock.php

diff --git a/CHANGES b/CHANGES
index 18b2e0f..022cc9d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,10 @@
+2011-01-16  lrlopez
+
+        * export.php: export_form.php:
+        * lang/: en_utf8/attforblock.php: es_utf8/attforblock.php:
+        Added "Start of period" into export tab and two new strings for
+        the new fields on the form.
+
 2011-01-15  lrlopez
 
         * db/install.xml:
index f152d7f..7e7a7a5 100644 (file)
                        $data->tabhead[] = get_string('lastname');
                        $data->tabhead[] = get_string('firstname');
                        
-                       $select = "courseid = {$course->id} AND attendanceid = {$attforblock->id} AND sessdate >= {$course->startdate}";
-                       if (isset($fromform->includenottaken)) {
-                               $select .= " AND sessdate <= {$fromform->sessionenddate}";
-                       } else {
-                               $select .= " AND lasttaken != 0";
+                       $select = "courseid = {$course->id} AND attendanceid = {$attforblock->id} ";
+                        if (!isset($fromform->includeallsessions)) {
+                            $finalenddate = $fromform->sessionenddate + 86400;  // take into account the whole day
+                            $select .= "AND sessdate >= {$fromform->sessionstartdate} AND sessdate < {$finalenddate} ";
+                        }
+                       if (!isset($fromform->includenottaken)) {
+                            $select .= " AND lasttaken != 0";
                        }
        
                        if ($sessions = get_records_select('attendance_sessions', $select, 'sessdate ASC')) {
index 610a7cc..c9f5869 100644 (file)
@@ -59,9 +59,14 @@ class mod_attforblock_export_form extends moodleform {
 //             $durtime[] =& MoodleQuickForm::createElement('select', 'minutes', get_string('minute', 'form'), $minutes, false, true);
 //        $mform->addGroup($durtime, 'durtime', get_string('duration','attforblock'), array(' '), true);
         
+        $mform->addElement('checkbox', 'includeallsessions', get_string('includeall','attforblock'), get_string('yes'));
+        $mform->setDefault('includeallsessions', true);
         $mform->addElement('checkbox', 'includenottaken', get_string('includenottaken','attforblock'), get_string('yes'));
+        $mform->addElement('date_selector', 'sessionstartdate', get_string('startofperiod','attforblock'));
+        $mform->setDefault('sessionstartdate', $course->startdate);
+        $mform->disabledIf('sessionstartdate', 'includeallsessions', 'checked');
         $mform->addElement('date_selector', 'sessionenddate', get_string('endofperiod','attforblock'));
-               $mform->disabledIf('sessionenddate', 'includenottaken', 'notchecked');
+       $mform->disabledIf('sessionenddate', 'includeallsessions', 'checked');
         
         $mform->addElement('select', 'format', get_string('format'), 
                                                array('excel' => get_string('downloadexcel','attforblock'),
index ffcca82..2b88002 100644 (file)
@@ -73,6 +73,7 @@ $string['gridcolumns'] = 'Grid columns';
 $string['groupsession'] = 'Group';
 $string['hiddensessions'] = 'Hidden sessions';
 $string['identifyby'] = 'Identify student by';
+$string['includeall'] = 'Select all sessions';
 $string['includenottaken'] = 'Include not taken sessions';
 $string['indetail'] = 'In detail...';
 $string['moduledescription'] = 'You can add only one module Attendance per course.<br />Removal of this module will not entail removal of the data!';
@@ -121,6 +122,7 @@ $string['showdefaults'] = 'Show defaults';
 $string['showduration'] = 'Show duration';
 $string['sortedgrid'] = 'Sorted grid';
 $string['sortedlist'] = 'Sorted list';
+$string['startofperiod'] = 'Start of period';
 $string['status'] = 'Status';
 $string['statusdeleted'] = 'Status deleted';
 $string['strftimedm'] = '%%d.%%m';
index 8b27014..fa5d891 100644 (file)
@@ -64,7 +64,7 @@ $string['downloadooo'] = 'Descargar en Formato OpenOffice';
 $string['downloadtext'] = 'Descargar en Formato de Texto';
 $string['duration'] = 'Duración';
 $string['editsession'] = 'Editar Sesión';
-$string['endofperiod'] = 'Fin del periodo';
+$string['endofperiod'] = 'Fecha final';
 $string['endtime'] = 'Hora de finalización';
 $string['errorgroupsnotselected'] = 'Elija uno o más grupos';
 $string['errorinaddingsession'] = 'Error añadiendo Sesión';
@@ -73,6 +73,7 @@ $string['gridcolumns'] = 'Columnas de la rejilla';
 $string['groupsession'] = 'Grupal';
 $string['hiddensessions'] = 'Sesiones ocultas';
 $string['identifyby'] = 'Identificar estudiantes por';
+$string['includeall'] = 'Seleccionar todas las sesiones';
 $string['includenottaken'] = 'Incluir sesiones no registradas';
 $string['indetail'] = 'En detalle...';
 $string['moduledescription'] = 'Sólo se puede agregar una actividad \"Asistencia\" por curso.<br>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.';
@@ -121,6 +122,7 @@ $string['showduration'] = 'Mostrar duración';
 $string['showdefaults'] = 'Mostrar opciones por defecto';
 $string['sortedgrid'] = 'Rejilla alfabética';
 $string['sortedlist'] = 'Lista alfabética';
+$string['startofperiod'] = 'Fecha de comienzo';
 $string['status'] = 'Estado';
 $string['statusdeleted'] = 'Estado eliminado';
 $string['strftimedm'] = '%%d.%%m';