MDL-xxxx show appropriate instance status on user enrolments page
authorPetr Škoda <commits@skodak.org>
Wed, 26 Dec 2012 16:28:09 +0000 (17:28 +0100)
committerDan Poltawski <dan@moodle.com>
Tue, 8 Jan 2013 06:22:59 +0000 (14:22 +0800)
enrol/locallib.php

index e923c2e..2b4e0fc 100644 (file)
@@ -867,7 +867,7 @@ class course_enrolment_manager {
                 $details['enrolments'][$ue->id] = array(
                     'text' => $ue->enrolmentinstancename,
                     'period' => $period,
                 $details['enrolments'][$ue->id] = array(
                     'text' => $ue->enrolmentinstancename,
                     'period' => $period,
-                    'dimmed' =>  ($periodoutside || $ue->status != ENROL_USER_ACTIVE),
+                    'dimmed' =>  ($periodoutside or $ue->status != ENROL_USER_ACTIVE or $ue->enrolmentinstance->status != ENROL_INSTANCE_ENABLED),
                     'actions' => $ue->enrolmentplugin->get_user_enrolment_actions($manager, $ue)
                 );
             }
                     'actions' => $ue->enrolmentplugin->get_user_enrolment_actions($manager, $ue)
                 );
             }