Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 70... Línea 70...
70
            ->setHiddenLabel(true);
70
            ->setHiddenLabel(true);
Línea 71... Línea 71...
71
 
71
 
72
        $mform->setType("{$this->name}_operator", PARAM_INT);
72
        $mform->setType("{$this->name}_operator", PARAM_INT);
Línea -... Línea 73...
-
 
73
        $mform->setDefault("{$this->name}_operator", self::USER_ANY);
-
 
74
 
73
        $mform->setDefault("{$this->name}_operator", self::USER_ANY);
75
        // Specific user selection.
74
 
76
        $valuelabel = get_string('filterfieldvalue', 'core_reportbuilder', $this->get_header());
75
        $options = [
77
        $options = [
76
            'ajax' => 'core_user/form_user_selector',
78
            'ajax' => 'core_user/form_user_selector',
77
            'multiple' => true,
79
            'multiple' => true,
78
            'valuehtmlcallback' => static function($userid): string {
80
            'valuehtmlcallback' => static function($userid): string {
79
                $user = core_user::get_user($userid);
81
                $user = core_user::get_user($userid);
80
                return fullname($user, has_capability('moodle/site:viewfullnames', context_system::instance()));
82
                return fullname($user, has_capability('moodle/site:viewfullnames', context_system::instance()));
81
            }
83
            }
82
        ];
84
        ];
83
        $mform->addElement('autocomplete', "{$this->name}_value", get_string('user'), [], $options)
85
        $mform->addElement('autocomplete', "{$this->name}_value", $valuelabel, [], $options)
84
            ->setHiddenLabel(true);
86
            ->setHiddenLabel(true);
Línea 85... Línea 87...
85
        $mform->hideIf("{$this->name}_value", "{$this->name}_operator", 'neq', self::USER_SELECT);
87
        $mform->hideIf("{$this->name}_value", "{$this->name}_operator", 'neq', self::USER_SELECT);