MDL-37516 Conditional activities: user field condition display fixes
authorsam marshall <s.marshall@open.ac.uk>
Wed, 15 May 2013 12:11:51 +0000 (13:11 +0100)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 2 Jul 2013 18:00:17 +0000 (20:00 +0200)
lib/conditionlib.php

index 57f9e35..6e9dc83 100644 (file)
@@ -547,7 +547,7 @@ abstract class condition_info_base {
                     }
                 } else {
                     $field = $condition->userfield;
-                    $fieldname = $condition->userfield;
+                    $fieldname = get_user_field_name($condition->userfield);
                 }
                 $details = new stdClass;
                 $details->fieldname = $fieldname;
@@ -829,7 +829,7 @@ abstract class condition_info_base {
             foreach ($this->item->conditionsfield as $field => $details) {
                 $a = new stdclass;
                 $a->field = format_string($details->fieldname, true, array('context' => $context));
-                $a->value = $details->value;
+                $a->value = s($details->value);
                 $information .= html_writer::start_tag('li');
                 $information .= get_string('requires_user_field_'.$details->operator, 'condition', $a) . ' ';
                 $information .= html_writer::end_tag('li');
@@ -1061,7 +1061,7 @@ abstract class condition_info_base {
                     $available = false;
                     $a = new stdClass();
                     $a->field = format_string($details->fieldname, true, array('context' => $context));
-                    $a->value = $details->value;
+                    $a->value = s($details->value);
                     $information .= html_writer::start_tag('li');
                     $information .= get_string('requires_user_field_'.$details->operator, 'condition', $a) . ' ';
                     $information .= html_writer::end_tag('li');