Skip to content

Commit

Permalink
MDL-26188 Workshop: get rid of a method that is not used anyway
Browse files Browse the repository at this point in the history
The protected method get_allocations_recordset() is a relict from
earlier development phases of Workshop module. Removing it as it
confuses recent Eloy's recordset usage detection tool.
  • Loading branch information
mudrd8mz committed Feb 4, 2011
1 parent 54b7b59 commit 51abc39
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions mod/workshop/allocation/manual/lib.php
Expand Up @@ -335,42 +335,6 @@ public function ui() {
public static function delete_instance($workshopid) { public static function delete_instance($workshopid) {
return; return;
} }

/**
* Returns the list of all allocations where the given users are involved
*
* We must use recordset here because we do not have any unique identifier available
*
* @param array [userid] => whatever
* @return moodle_recordset|null
*/
protected function get_allocations_recordset(array $users) {
global $DB, $PAGE;

if (empty($users)) {
return null;
}

list($authorids, $authorparams) = $DB->get_in_or_equal(array_keys($users), SQL_PARAMS_NAMED, 'a0000');
list($reviewerids, $reviewerparams) = $DB->get_in_or_equal(array_keys($users), SQL_PARAMS_NAMED, 'r0000');
$params = array_merge($authorparams, $reviewerparams);
$params['workshopid'] = $this->workshop->id;

$sql = "SELECT author.id AS authorid, author.firstname AS authorfirstname, author.lastname AS authorlastname,
author.picture AS authorpicture, author.imagealt AS authorimagealt, author.email AS authoremail,
s.id AS submissionid, s.title AS submissiontitle, s.grade AS submissiongrade,
a.id AS assessmentid, a.timecreated AS timeallocated, a.reviewerid,
reviewer.firstname AS reviewerfirstname, reviewer.lastname AS reviewerlastname,
reviewer.picture as reviewerpicture, reviewer.imagealt AS reviewerimagealt
FROM {user} author
LEFT JOIN {workshop_submissions} s ON (s.authorid = author.id)
LEFT JOIN {workshop_assessments} a ON (s.id = a.submissionid)
LEFT JOIN {user} reviewer ON (a.reviewerid = reviewer.id)
WHERE (author.id $authorids OR reviewer.id $reviewerids) AND (s.id IS NULL OR s.workshopid = :workshopid)
ORDER BY author.lastname,author.firstname,author.id,reviewer.lastname,reviewer.firstname,reviewer.id";

return $DB->get_recordset_sql($sql, $params);
}
} }


/** /**
Expand Down

0 comments on commit 51abc39

Please sign in to comment.