Browse Source

fixed some php strict-mode warnings

MOODLE_23_STABLE
Brian King 12 years ago
parent
commit
1afc701bff
  1. 2
      db/install.php
  2. 1
      export.php
  3. 6
      locallib.php
  4. 6
      preferences.php

2
db/install.php

@ -34,7 +34,7 @@ function xmldb_attforblock_install() {
$result = true; $result = true;
$arr = array('P' => 2, 'A' => 0, 'L' => 1, 'E' => 1); $arr = array('P' => 2, 'A' => 0, 'L' => 1, 'E' => 1);
foreach ($arr as $k => $v) { foreach ($arr as $k => $v) {
unset($rec); $rec = new stdClass;
$rec->attendanceid = 0; $rec->attendanceid = 0;
$rec->acronym = get_string($k.'acronym', 'attforblock'); $rec->acronym = get_string($k.'acronym', 'attforblock');
$rec->description = get_string($k.'full', 'attforblock'); $rec->description = get_string($k.'full', 'attforblock');

1
export.php

@ -77,6 +77,7 @@ if ($mform->is_submitted()) {
$filename = clean_filename($course->shortname.'_Attendances_'.userdate(time(), '%Y%m%d-%H%M')); $filename = clean_filename($course->shortname.'_Attendances_'.userdate(time(), '%Y%m%d-%H%M'));
$group = $formdata->group ? $reportdata->groups[$formdata->group] : 0; $group = $formdata->group ? $reportdata->groups[$formdata->group] : 0;
$data = new stdClass;
$data->tabhead = array(); $data->tabhead = array();
$data->course = $att->course->fullname; $data->course = $att->course->fullname;
$data->group = $group ? $group->name : get_string('allparticipants'); $data->group = $group ? $group->name : get_string('allparticipants');

6
locallib.php

@ -1292,12 +1292,14 @@ function att_update_all_users_grades($attid, $course, $context) {
$statuses = att_get_statuses($attid); $statuses = att_get_statuses($attid);
$gradebook_maxgrade = att_get_gradebook_maxgrade($attid); $gradebook_maxgrade = att_get_gradebook_maxgrade($attid);
foreach ($userids as $userid) { foreach ($userids as $userid) {
$grades[$userid]->userid = $userid; $grade = new stdClass;
$grade->userid = $userid;
$userstatusesstat = att_get_user_statuses_stat($attid, $course->startdate, $userid); $userstatusesstat = att_get_user_statuses_stat($attid, $course->startdate, $userid);
$usertakensesscount = att_get_user_taken_sessions_count($attid, $course->startdate, $userid); $usertakensesscount = att_get_user_taken_sessions_count($attid, $course->startdate, $userid);
$usergrade = att_get_user_grade($userstatusesstat, $statuses); $usergrade = att_get_user_grade($userstatusesstat, $statuses);
$usermaxgrade = att_get_user_max_grade($usertakensesscount, $statuses); $usermaxgrade = att_get_user_max_grade($usertakensesscount, $statuses);
$grades[$userid]->rawgrade = att_calc_user_grade_fraction($usergrade, $usermaxgrade) * $gradebook_maxgrade; $grade->rawgrade = att_calc_user_grade_fraction($usergrade, $usermaxgrade) * $gradebook_maxgrade;
$grades[$userid] = $grade;
} }
return grade_update('mod/attforblock', $course->id, 'mod', 'attforblock', return grade_update('mod/attforblock', $course->id, 'mod', 'attforblock',

6
preferences.php

@ -85,9 +85,9 @@ switch ($att->pageparams->action) {
$att->update_status($att->pageparams->statusid, null, null, null, 1); $att->update_status($att->pageparams->statusid, null, null, null, 1);
break; break;
case att_preferences_page_params::ACTION_SAVE: case att_preferences_page_params::ACTION_SAVE:
$acronym = required_param('acronym', PARAM_MULTILANG); $acronym = required_param_array('acronym', PARAM_MULTILANG);
$description = required_param('description', PARAM_MULTILANG); $description = required_param_array('description', PARAM_MULTILANG);
$grade = required_param('grade', PARAM_INT); $grade = required_param_array('grade', PARAM_INT);
foreach ($acronym as $id => $v) { foreach ($acronym as $id => $v) {
$att->update_status($id, $acronym[$id], $description[$id], $grade[$id], null); $att->update_status($id, $acronym[$id], $description[$id], $grade[$id], null);

Loading…
Cancel
Save