From: stronk7 <stronk7>
Date: Mon, 7 Apr 2008 23:44:42 +0000 (+0000)
Subject: Respect inherited default enrol method when deciding to display the course cost.... 
X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=c5340330f32acfe99c256de62a8a8377e889e208;p=moodle.git

Respect inherited default enrol method when deciding to display the course cost. MDL-14096 ; merged from 19_STABLE
---

diff --git a/course/edit_form.php b/course/edit_form.php
index d13a59f70d..1c0431cd3d 100644
--- a/course/edit_form.php
+++ b/course/edit_form.php
@@ -316,7 +316,8 @@ class course_edit_form extends moodleform {
         if (!empty($course)) {
             $enrol_object = $course;
         }
-        if (method_exists(enrolment_factory::factory($enrol_object->enrol), 'print_entry') && $enrol_object->enrol != 'manual'){
+        // If the print_entry method exists and the course enrol method isn't manual (both set or inherited from site), show cost
+        if (method_exists(enrolment_factory::factory($enrol_object->enrol), 'print_entry') && !($enrol_object->enrol == 'manual' || (empty($enrol_object->enrol) && $CFG->enrol == 'manual'))) {
             $costgroup=array();
             $currencies = get_list_of_currencies();
             $costgroup[]= &MoodleQuickForm::createElement('text','cost', '', 'maxlength="6" size="6"');