} else {
$in = implode(',', $SESSION->bulk_users);
- $userlist = $DB->get_records_select_menu('user', "id IN ($in)", null, 'fullname', 'id,'.sql_fullname().' AS fullname');
+ $userlist = $DB->get_records_select_menu('user', "id IN ($in)", null, 'fullname', 'id,'.$DB->sql_fullname().' AS fullname');
$usernames = implode(', ', $userlist);
$optionsyes = array();
$optionsyes['confirm'] = 1;
} else {
$in = implode(',', $SESSION->bulk_users);
- $userlist = $DB->get_records_select_menu('user', "id IN ($in)", null, 'fullname', 'id,'.sql_fullname().' AS fullname');
+ $userlist = $DB->get_records_select_menu('user', "id IN ($in)", null, 'fullname', 'id,'.$DB->sql_fullname().' AS fullname');
$usernames = implode(', ', $userlist);
$optionsyes = array();
$optionsyes['confirm'] = 1;
}
if ($ld && !empty($log->info)) {
// ugly hack to make sure fullname is shown correctly
- if (($ld->mtable == 'user') and ($ld->field == sql_concat('firstname', "' '" , 'lastname'))) {
+ if (($ld->mtable == 'user') and ($ld->field == $DB->sql_concat('firstname', "' '" , 'lastname'))) {
$log->info = fullname($DB->get_record($ld->mtable, array('id'=>$log->info)), true);
} else {
$log->info = $DB->get_field($ld->mtable, $ld->field, array('id'=>$log->info));
function search_generate_SQL($parsetree, $datafield, $metafield, $mainidfield, $useridfield,
$userfirstnamefield, $userlastnamefield, $timefield, $instancefield) {
- global $CFG;
+ global $CFG, $DB;
- $LIKE = sql_ilike();
+ $LIKE = $DB->sql_ilike();
$NOTLIKE = 'NOT ' . $LIKE;
if ($CFG->dbfamily == "postgres") {
$REGEXP = "~*";
* @return type?
*/
function get_sql_where() {
+ global $DB;
if(!isset($this->columns['fullname'])) {
return '';
}
- $LIKE = sql_ilike();
+ $LIKE = $DB->sql_ilike();
if(!empty($this->sess->i_first) && !empty($this->sess->i_last)) {
return 'firstname '.$LIKE.' \''.$this->sess->i_first.'%\' AND lastname '.$LIKE.' \''.$this->sess->i_last.'%\'';
}
* @return array sql string and $params
*/
function get_sql_filter($data) {
- global $CFG;
+ global $CFG, $DB;
static $counter = 0;
$name = 'ex_courserole'.$counter++;
$where .= " AND c.category=$categoryid";
}
if ($value) {
- $where .= " AND c.shortname ".sql_ilike()." :$name";
+ $where .= " AND c.shortname ".$DB->sql_ilike()." :$name";
$params[$name] = $value;
}
return array("id IN (SELECT userid
* @return object filter
*/
function get_field($fieldname, $advanced) {
- global $USER;
+ global $USER, $DB;
switch ($fieldname) {
case 'username': return new user_filter_text('username', get_string('username'), $advanced, 'username');
- case 'realname': return new user_filter_text('realname', get_string('fullnameuser'), $advanced, sql_fullname());
+ case 'realname': return new user_filter_text('realname', get_string('fullnameuser'), $advanced, $DB->sql_fullname());
case 'lastname': return new user_filter_text('lastname', get_string('lastname'), $advanced, 'lastname');
case 'firstname': return new user_filter_text('firstname', get_string('firstname'), $advanced, 'firstname');
case 'email': return new user_filter_text('email', get_string('email'), $advanced, 'email');
* @return array sql string and $params
*/
function get_sql_filter($data) {
- global $CFG;
+ global $CFG, $DB;
static $counter = 0;
$name = 'ex_profilefield'.$counter++;
$where = "";
$op = " IN ";
- $ilike = sql_ilike();
+ $ilike = $DB->sql_ilike();
if ($operator < 5 and $value === '') {
return '';
* @return array sql string and $params
*/
function get_sql_filter($data) {
+ global $DB;
static $counter = 0;
$name = 'ex_text'.$counter++;
return '';
}
- $ilike = sql_ilike();
+ $ilike = $DB->sql_ilike();
switch($operator) {
case 0: // contains