Skip to content

Commit

Permalink
[multienrol]More changes to the internal->manual transition
Browse files Browse the repository at this point in the history
  • Loading branch information
martinlanghoff committed Mar 9, 2006
1 parent 908c1ae commit 29f8533
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
6 changes: 3 additions & 3 deletions admin/enrol.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
if (empty($frm->default)) {
$frm->default = '';
}
if ($frm->default && $frm->default != 'internal' && !in_array($frm->default, $frm->enable)) {
if ($frm->default && $frm->default != 'manual' && !in_array($frm->default, $frm->enable)) {
$frm->enable[] = $frm->default;
}
asort($frm->enable);
$frm->enable = array_merge(array('internal'), $frm->enable); // make sure internal plugin is called first
$frm->enable = array_merge(array('manual'), $frm->enable); // make sure manual plugin is called first
set_config('enrol_plugins_enabled', implode(',', $frm->enable));
set_config('enrol', $frm->default);
redirect("enrol.php?sesskey=$USER->sesskey", get_string("changessaved"), 1);
Expand Down Expand Up @@ -76,7 +76,7 @@
if (stristr($CFG->enrol_plugins_enabled, $module) !== false) {
$enable .= ' checked="checked"';
}
if ($module == 'internal') {
if ($module == 'manual') {
$enable .= ' disabled="disabled"';
}
$enable .= ' />';
Expand Down
2 changes: 1 addition & 1 deletion course/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@
</td>
</tr>
<?php
if (method_exists(enrolment_factory::factory($course->enrol), 'print_entry') && $course->enrol != 'internal') {
if (method_exists(enrolment_factory::factory($course->enrol), 'print_entry') && $course->enrol != 'manual') {
?>
<tr valign="top">
<td align="right"><?php print_string("cost") ?>:</td>
Expand Down
5 changes: 5 additions & 0 deletions lib/db/mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -1673,6 +1673,11 @@ function main_upgrade($oldversion=0) {
execute_sql("UPDATE {$CFG->prefix}user_teachers SET enrol='manual' WHERE enrol=''");
}

if ($oldversion < 2005103101) { // rename internal to manual
set_config('enrol_plugins_enabled', str_replace('internal', 'manual', $CFG->enrol_plugins_enabled));
set_config('enrol', str_replace('internal', 'manual', $CFG->enrol));
}

return $result;
}

Expand Down
5 changes: 5 additions & 0 deletions lib/db/postgres7.php
Original file line number Diff line number Diff line change
Expand Up @@ -1416,6 +1416,11 @@ function main_upgrade($oldversion=0) {
execute_sql("UPDATE {$CFG->prefix}user_teachers SET enrol='manual' WHERE enrol=''");
}

if ($oldversion < 2005103101) { // rename internal to manual
set_config('enrol_plugins_enabled', str_replace('internal', 'manual', $CFG->enrol_plugins_enabled));
set_config('enrol', str_replace('internal', 'manual', $CFG->enrol));
}

return $result;
}

Expand Down

0 comments on commit 29f8533

Please sign in to comment.