From 27b08837b0abe98e37ee3841c4b47214c624d735 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Tue, 24 Aug 2021 09:09:54 +1200 Subject: [PATCH] Fix up update form with new field. --- classes/form/updatesession.php | 1 + classes/structure.php | 4 ++++ db/upgrade.php | 4 ++-- version.php | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/classes/form/updatesession.php b/classes/form/updatesession.php index c4ce7da..8f8dfea 100644 --- a/classes/form/updatesession.php +++ b/classes/form/updatesession.php @@ -80,6 +80,7 @@ class updatesession extends \moodleform { 'preventsharediptime' => $sess->preventsharediptime, 'includeqrcode' => $sess->includeqrcode, 'rotateqrcode' => $sess->rotateqrcode, + 'automarkcmid' => $sess->automarkcmid ); if ($sess->subnet == $attendancesubnet) { $data['usedefaultsubnet'] = 1; diff --git a/classes/structure.php b/classes/structure.php index 145b0d1..17e051a 100644 --- a/classes/structure.php +++ b/classes/structure.php @@ -619,6 +619,10 @@ class mod_attendance_structure { $sess->preventsharediptime = $formdata->preventsharediptime; } + if (!empty($formdata->automarkcmid)) { + $sess->automarkcmid = $formdata->automarkcmid; + } + $sess->timemodified = time(); $DB->update_record('attendance_sessions', $sess); diff --git a/db/upgrade.php b/db/upgrade.php index c8974b2..6a9d8ab 100755 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -650,7 +650,7 @@ function xmldb_attendance_upgrade($oldversion=0) { upgrade_mod_savepoint(true, 2021050700, 'attendance'); } - if ($oldversion < 2021060700) { + if ($oldversion < 2021082400) { // Changing precision of field statusset on table attendance_log to (1333). $table = new xmldb_table('attendance_sessions'); @@ -662,7 +662,7 @@ function xmldb_attendance_upgrade($oldversion=0) { } // Attendance savepoint reached. - upgrade_mod_savepoint(true, 2021060700, 'attendance'); + upgrade_mod_savepoint(true, 2021082400, 'attendance'); } return $result; diff --git a/version.php b/version.php index be173b2..0fcc9a6 100755 --- a/version.php +++ b/version.php @@ -23,7 +23,7 @@ */ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2021082300; +$plugin->version = 2021082400; $plugin->requires = 2021051700; // Requires 3.11. $plugin->release = '3.11.6'; $plugin->maturity = MATURITY_STABLE;