MDL-54546 tool_lp: Use correct property types for user/course exporters
authorJun Pataleta <jun@moodle.com>
Thu, 12 May 2016 05:50:46 +0000 (13:50 +0800)
committerJun Pataleta <jun@moodle.com>
Thu, 12 May 2016 11:04:58 +0000 (19:04 +0800)
admin/tool/lp/classes/external/course_summary_exporter.php
competency/classes/external/user_summary_exporter.php

index 4f44a7d..ace8117 100644 (file)
@@ -58,7 +58,7 @@ class course_summary_exporter extends \core_competency\external\exporter {
                 'type' => PARAM_TEXT,
             ),
             'idnumber' => array(
-                'type' => PARAM_TEXT,
+                'type' => PARAM_RAW,
             )
         );
     }
index d09b142..ab9bbbb 100644 (file)
@@ -69,30 +69,30 @@ class user_summary_exporter extends exporter {
     public static function define_properties() {
         return array(
             'id' => array(
-                'type' => PARAM_INT,
+                'type' => \core_user::get_property_type('id'),
             ),
             'email' => array(
-                'type' => PARAM_TEXT,
+                'type' => \core_user::get_property_type('email'),
                 'default' => ''
             ),
             'idnumber' => array(
-                'type' => PARAM_NOTAGS,
+                'type' => \core_user::get_property_type('idnumber'),
                 'default' => ''
             ),
             'phone1' => array(
-                'type' => PARAM_NOTAGS,
+                'type' => \core_user::get_property_type('phone1'),
                 'default' => ''
             ),
             'phone2' => array(
-                'type' => PARAM_NOTAGS,
+                'type' => \core_user::get_property_type('phone2'),
                 'default' => ''
             ),
             'department' => array(
-                'type' => PARAM_TEXT,
+                'type' => \core_user::get_property_type('department'),
                 'default' => ''
             ),
             'institution' => array(
-                'type' => PARAM_TEXT,
+                'type' => \core_user::get_property_type('institution'),
                 'default' => ''
             )
         );
@@ -101,10 +101,10 @@ class user_summary_exporter extends exporter {
     public static function define_other_properties() {
         return array(
             'fullname' => array(
-                'type' => PARAM_TEXT
+                'type' => PARAM_RAW
             ),
             'identity' => array(
-                'type' => PARAM_TEXT
+                'type' => PARAM_RAW
             ),
             'profileurl' => array(
                 'type' => PARAM_URL