Browse Source

Move local function into locallib.php

MOODLE_29_STABLE
Dan Marsden 9 years ago
parent
commit
a2e76dcf46
  1. 12
      lib.php
  2. 17
      locallib.php

12
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;
}

17
locallib.php

@ -282,3 +282,20 @@ function attendance_form_sessiondate_selector (MoodleQuickForm $mform) {
$sesendtime[] =& $mform->createElement('select', 'endminute', get_string('minute', 'form'), $minutes, false, true);
$mform->addGroup($sesendtime, 'sestime', get_string('time', 'attendance'), array(' '), true);
}
/**
* 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;
}

Loading…
Cancel
Save