array('maxfiles' => EDITOR_UNLIMITED_FILES, 'noclean' => true, 'context' => $modcontext));
$mform->setType('sdescription', PARAM_RAW);
+ // If warnings allow selector for reporting.
+ if (!empty(get_config('attendance', 'enablewarnings'))) {
+ $mform->addElement('checkbox', 'absenteereport', '', get_string('includeabsentee', 'attendance'));
+ $mform->addHelpButton('absenteereport', 'includeabsentee', 'attendance');
+ if (isset($pluginconfig->absenteereport_default)) {
+ $mform->setDefault('absenteereport', $pluginconfig->absenteereport_default);
+ }
+ } else {
+ $mform->addElement('hidden', 'absenteereport', 1);
+ $mform->setType('absenteereport', PARAM_INT);
+ }
// For multiple sessions.
$mform->addElement('header', 'headeraddmultiplesessions', get_string('addmultiplesessions', 'attendance'));
if (!empty($pluginconfig->multisessionexpanded)) {
<INDEX NAME="course" UNIQUE="false" FIELDS="course"/>
</INDEXES>
</TABLE>
- <TABLE NAME="attendance_sessions" COMMENT="attendance_sessions table retrofitted from MySQL">
+ <TABLE NAME="attendance_sessions" COMMENT="attendance_sessions table">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="attendanceid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="automark" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="automarkcompleted" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="statusset" TYPE="int" LENGTH="5" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Which set of statuses to use"/>
+ <FIELD NAME="absenteereport" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" SEQUENCE="false"/>
<FIELD NAME="caleventid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
</FIELDS>
<KEYS>
// Attendance savepoint reached.
upgrade_mod_savepoint(true, 2017082200, 'attendance');
}
+
+ if ($oldversion < 2017120700) {
+ $table = new xmldb_table('attendance_sessions');
+
+ $field = new xmldb_field('absenteereport');
+ $field->set_attributes(XMLDB_TYPE_INTEGER, '1', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '1', 'statusset');
+ if (!$dbman->field_exists($table, $field)) {
+ $dbman->add_field($table, $field);
+ }
+
+ upgrade_mod_savepoint(true, 2017120700, 'attendance');
+ }
+
return $result;
}
$string['week'] = 'week(s)';
$string['weeks'] = 'Weeks';
$string['youcantdo'] = 'You can\'t do anything';
+$string['includeabsentee'] = 'Include session when calculating absentee report';
+$string['includeabsentee_help'] = 'If checked this session will be included in the absentee report calculations.';
\ No newline at end of file
GROUP BY attendanceid, setnumber) stm
ON (stm.setnumber = ats.statusset AND stm.attendanceid = ats.attendanceid)
{$joingroup}
- WHERE 1 = 1 {$where}
+ WHERE ats.absenteereport = 1 {$where}
GROUP BY uniqueid, a.id, a.name, a.course, c.fullname, atl.studentid, n.id, n.warningpercent,
n.emailsubject, n.emailcontent, n.emailcontentformat, n.warnafter, n.maxwarn,
n.emailuser, n.thirdpartyemails, cm.id, c.id, {$unames2}, ns.userid
$description = new lang_string('defaultsessionsettings_help', 'mod_attendance');
$settings->add(new admin_setting_heading('defaultsessionsettings', $name, $description));
+ $settings->add(new admin_setting_configcheckbox('attendance/absenteereport_default',
+ get_string('includeabsentee', 'attendance'), '', 1));
+
$settings->add(new admin_setting_configcheckbox('attendance/studentscanmark_default',
get_string('studentscanmark', 'attendance'), '', 0));
*/
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2017112000;
+$plugin->version = 2017120700;
$plugin->requires = 2017102700; // Requires 3.4
-$plugin->release = '3.4.1';
+$plugin->release = '3.4.2';
$plugin->maturity = MATURITY_ALPHA;
$plugin->cron = 0;
$plugin->component = 'mod_attendance';