Move local function into locallib.php
authorDan Marsden <dan@danmarsden.com>
Wed, 16 Mar 2016 02:34:07 +0000 (15:34 +1300)
committerDan Marsden <dan@danmarsden.com>
Wed, 16 Mar 2016 02:34:07 +0000 (15:34 +1300)
lib.php
locallib.php

diff --git a/lib.php b/lib.php
index e2dbc88..eeb9d03 100644 (file)
--- a/lib.php
+++ b/lib.php
@@ -395,15 +395,3 @@ function attendance_pluginfile($course, $cm, $context, $filearea, $args, $forced
     }
     send_stored_file($file, 0, 0, true);
 }
-
-// Count the number of status sets that exist for this instance.
-function attendance_get_max_statusset($attendanceid) {
-    global $DB;
-
-    $max = $DB->get_field_sql('SELECT MAX(setnumber) FROM {attendance_statuses} WHERE attendanceid = ? AND deleted = 0',
-                              array($attendanceid));
-    if ($max) {
-        return $max;
-    }
-    return 0;
-}
index b13046a..6f1eb6b 100644 (file)
@@ -281,4 +281,21 @@ function attendance_form_sessiondate_selector (MoodleQuickForm $mform) {
     $sesendtime[] =& $mform->createElement('select', 'endhour', get_string('hour', 'form'), $hours, false, true);
     $sesendtime[] =& $mform->createElement('select', 'endminute', get_string('minute', 'form'), $minutes, false, true);
     $mform->addGroup($sesendtime, 'sestime', get_string('time', 'attendance'), array(' '), true);
-}
\ No newline at end of file
+}
+
+/**
+ * Count the number of status sets that exist for this instance.
+ *
+ * @param int $attendanceid
+ * @return int
+ */
+function attendance_get_max_statusset($attendanceid) {
+    global $DB;
+
+    $max = $DB->get_field_sql('SELECT MAX(setnumber) FROM {attendance_statuses} WHERE attendanceid = ? AND deleted = 0',
+        array($attendanceid));
+    if ($max) {
+        return $max;
+    }
+    return 0;
+}