Browse Source

Merge pull request #149 from barrysspace/hotfix/issue_145_hiding_status_M28

Fix #145 - hiding variable status items no longer working
MOODLE_28_STABLE
Dan Marsden 9 years ago
parent
commit
61f61982eb
  1. 9
      locallib.php

9
locallib.php

@ -1596,7 +1596,10 @@ class attendance {
public function update_status($status, $acronym, $description, $grade, $visible) { public function update_status($status, $acronym, $description, $grade, $visible) {
global $DB; global $DB;
if (empty($acronym) || empty($description)) { if (isset($visible)) {
$status->visible = $visible;
$updated[] = $visible ? get_string('show') : get_string('hide');
} else if (empty($acronym) || empty($description)) {
return array('acronym' => $acronym, 'description' => $description); return array('acronym' => $acronym, 'description' => $description);
} }
@ -1614,10 +1617,6 @@ class attendance {
$status->grade = $grade; $status->grade = $grade;
$updated[] = $grade; $updated[] = $grade;
} }
if (isset($visible)) {
$status->visible = $visible;
$updated[] = $visible ? get_string('show') : get_string('hide');
}
$DB->update_record('attendance_statuses', $status); $DB->update_record('attendance_statuses', $status);
$event = \mod_attendance\event\status_updated::create(array( $event = \mod_attendance\event\status_updated::create(array(

Loading…
Cancel
Save