Skip to content

Commit

Permalink
ELIS-8631: Updated table names
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmcq authored and brentboghosian committed Mar 5, 2014
1 parent 84a2808 commit 88c7e49
Show file tree
Hide file tree
Showing 69 changed files with 286 additions and 277 deletions.
6 changes: 3 additions & 3 deletions accesslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ protected static function build_paths($force) {
$sql = "INSERT INTO {context_temp} (id, path, depth)
SELECT ctx.id, ".$DB->sql_concat('pctx.path', "'/'", 'ctx.id').", pctx.depth+1
FROM {context} ctx
JOIN {crlm_track} trk ON (trk.id = ctx.instanceid AND ctx.contextlevel = ".CONTEXT_ELIS_TRACK.")
JOIN {local_elisprogram_trk} trk ON (trk.id = ctx.instanceid AND ctx.contextlevel = ".CONTEXT_ELIS_TRACK.")
JOIN {context} pctx ON (pctx.instanceid = trk.curid AND pctx.contextlevel = ".CONTEXT_ELIS_PROGRAM.")
WHERE pctx.path IS NOT NULL AND pctx.depth > 0
$ctxemptyclause";
Expand Down Expand Up @@ -658,7 +658,7 @@ protected static function build_paths($force) {
path=".$DB->sql_concat("'$base/'", 'id')."
WHERE contextlevel=".CONTEXT_ELIS_COURSE."
AND EXISTS (SELECT 'x'
FROM {crlm_course} ep
FROM {local_elisprogram_crs} ep
WHERE ep.id = {context}.instanceid)
$emptyclause";
$DB->execute($sql);
Expand Down Expand Up @@ -851,7 +851,7 @@ protected static function build_paths($force) {
$sql = "INSERT INTO {context_temp} (id, path, depth)
SELECT ctx.id, ".$DB->sql_concat('pctx.path', "'/'", 'ctx.id').", pctx.depth+1
FROM {context} ctx
JOIN {crlm_class} cls ON (cls.id = ctx.instanceid AND ctx.contextlevel = ".CONTEXT_ELIS_CLASS.")
JOIN {local_elisprogram_cls} cls ON (cls.id = ctx.instanceid AND ctx.contextlevel = ".CONTEXT_ELIS_CLASS.")
JOIN {context} pctx ON (pctx.instanceid = cls.courseid AND pctx.contextlevel = ".CONTEXT_ELIS_COURSE.")
WHERE pctx.path IS NOT NULL AND pctx.depth > 0
$ctxemptyclause";
Expand Down
6 changes: 3 additions & 3 deletions bulkuserpage.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function process_selection($data) {
if (empty($data->_selection)) {
print_error('no_items_selected', 'local_elisprogram', $this->get_basepage()->url);
} else {
$usersstring = implode(', ', array_map('fullname', $DB->get_records_select('crlm_user', 'id in ('.implode(',',$data->_selection).')')));
$usersstring = implode(', ', array_map('fullname', $DB->get_records_select('local_elisprogram_usr', 'id in ('.implode(',',$data->_selection).')')));
$buttoncontinue = new single_button(
new moodle_url('index.php',
array('s' => $this->pagename,
Expand Down Expand Up @@ -357,8 +357,8 @@ function check_data($formdata) {
* @return string the filtering condition or null if the filter is disabled
*/
function get_sql_filter($data) {
$sql = "(NOT EXISTS (SELECT _u.id FROM {user} _u WHERE _u.idnumber = {crlm_user}.{$this->_field})
OR NOT EXISTS (SELECT _um.id FROM {crlm_user_moodle} _um WHERE _um.cuserid = {crlm_user}.id))";
$sql = "(NOT EXISTS (SELECT _u.id FROM {user} _u WHERE _u.idnumber = {local_elisprogram_usr}.{$this->_field})
OR NOT EXISTS (SELECT _um.id FROM {local_elisprogram_usr_mdl} _um WHERE _um.cuserid = {local_elisprogram_usr}.id))";
return array($sql, array());
}

Expand Down
4 changes: 2 additions & 2 deletions certificatelistpage.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ public function get_class_name_by_course($certdata) {
);

$select = "SELECT cls.idnumber ";
$from = "FROM {crlm_class} cls ".
"INNER JOIN {crlm_class_enrolment} clsenrol ON cls.id = clsenrol.classid ";
$from = "FROM {local_elisprogram_cls} cls ".
"INNER JOIN {local_elisprogram_cls_enrol} clsenrol ON cls.id = clsenrol.classid ";
$where = "WHERE clsenrol.userid = :userid AND cls.courseid = :courseid AND ".
"clsenrol.completetime = :timeissued ";

Expand Down
6 changes: 3 additions & 3 deletions certificatepage.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public function do_edit() {

/**
* This function retrieves a record by it's id
* @param int $id ID record for crlm_certificate_settings record
* @param int $id ID record for local_elisprogram_certcfg record
* @return object|bool Record object or false if something went wrong
*/
public function get_data_object_by_id($id) {
Expand Down Expand Up @@ -271,7 +271,7 @@ public function get_new_data_object($data=false) {
}

/**
* This function returns a crlm_certificate_setting record based on a matching entity id and entity type
* This function returns a local_elisprogram_certcfg record based on a matching entity id and entity type
* @param int $entityid The entity type id
* @param string $entitytype The entity type string
* @return object|bool Record object or false if nothing was found
Expand Down Expand Up @@ -387,7 +387,7 @@ public function do_default() {
$id = $this->optional_param('id', 0, PARAM_INT);
$target = $this->get_new_page(array('action' => 'edit', 'id' => $id), true);

// Look for an existing record in the crlm_certificate_settings table.
// Look for an existing record in the local_elisprogram_certcfg table.
$type = CERTIFICATE_ENTITY_TYPE_COURSE;
$params = array('id' => $id, 'entity_id' => $id, 'entity_type' => $type);

Expand Down
2 changes: 1 addition & 1 deletion classselector.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
$colheader1 = get_string('results_course_desc_header', 'local_elisprogram');
$colheader2 = get_string('results_id_number_header', 'local_elisprogram');

$from = "{$CFG->prefix}crlm_course cd RIGHT JOIN {$CFG->prefix}crlm_class cls ON cd.id = cls.courseid ";
$from = "{$CFG->prefix}local_elisprogram_crs cd RIGHT JOIN {$CFG->prefix}local_elisprogram_cls cls ON cd.id = cls.courseid ";
$table->set_sql($columns, $from, $where, $params);
$table->define_baseurl($baseurl);
$table->collapsible(false);
Expand Down
2 changes: 1 addition & 1 deletion coursecatalogpage.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ function print_yui_table($elementid) {
}

if (!defined('ENVTABLE')) {
define('ENVTABLE', 'crlm_environment');
define('ENVTABLE', 'local_elisprogram_env');
}

class waitlisttable extends yui_table {
Expand Down
2 changes: 1 addition & 1 deletion db/events.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
'schedule' => 'instant'
),

'crlm_class_completed' => array (
'local_elisprogram_cls_completed' => array (
'handlerfile' => '/local/elisprogram/lib/lib.php',
'handlerfunction' => 'pm_course_complete',
'schedule' => 'instant'
Expand Down
Loading

0 comments on commit 88c7e49

Please sign in to comment.