Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 16... Línea 16...
16
 
16
 
Línea 17... Línea 17...
17
declare(strict_types=1);
17
declare(strict_types=1);
Línea 18... Línea -...
18
 
-
 
19
namespace core_reportbuilder\external;
18
 
20
 
19
namespace core_reportbuilder\external;
-
 
20
 
21
use core_user;
21
use core_customfield\external\field_data_exporter;
22
use renderer_base;
22
use core\external\persistent_exporter;
23
use core\external\persistent_exporter;
23
use core\output\renderer_base;
-
 
24
use core_reportbuilder\datasource;
-
 
25
use core_reportbuilder\manager;
24
use core_reportbuilder\datasource;
26
use core_reportbuilder\local\models\report;
Línea 25... Línea 27...
25
use core_reportbuilder\manager;
27
use core_tag\external\{tag_item_exporter, util};
26
use core_reportbuilder\local\models\report;
28
use core\user;
27
use core_user\external\user_summary_exporter;
29
use core_user\external\user_summary_exporter;
Línea 56... Línea 58...
56
        return [
58
        return [
57
            'sourcename' => [
59
            'sourcename' => [
58
                'type' => PARAM_RAW,
60
                'type' => PARAM_RAW,
59
                'null' => NULL_ALLOWED,
61
                'null' => NULL_ALLOWED,
60
            ],
62
            ],
-
 
63
            'tags' => [
-
 
64
                'type' => tag_item_exporter::read_properties_definition(),
-
 
65
                'multiple' => true,
-
 
66
            ],
-
 
67
            'customfields' => ['type' => field_data_exporter::read_properties_definition()],
61
            'modifiedby' => ['type' => user_summary_exporter::read_properties_definition()],
68
            'modifiedby' => ['type' => user_summary_exporter::read_properties_definition()],
62
        ];
69
        ];
63
    }
70
    }
Línea 64... Línea 71...
64
 
71
 
Línea 67... Línea 74...
67
     *
74
     *
68
     * @param renderer_base $output
75
     * @param renderer_base $output
69
     * @return array
76
     * @return array
70
     */
77
     */
71
    protected function get_other_values(renderer_base $output): array {
78
    protected function get_other_values(renderer_base $output): array {
-
 
79
        $reportid = $this->persistent->get('id');
72
        $source = $this->persistent->get('source');
80
        $source = $this->persistent->get('source');
73
        $usermodified = core_user::get_user($this->persistent->get('usermodified'));
81
        $usermodified = user::get_user($this->persistent->get('usermodified'));
Línea 74... Línea 82...
74
 
82
 
75
        return [
83
        return [
-
 
84
            'sourcename' => manager::report_source_exists($source, datasource::class) ? $source::get_name() : null,
-
 
85
            'tags' => util::get_item_tags('core_reportbuilder', 'reportbuilder_report', $reportid),
-
 
86
            'customfields' => (new field_data_exporter(null, [
-
 
87
                'component' => 'core_reportbuilder',
-
 
88
                'area' => 'report',
-
 
89
                'instanceid' => $reportid,
76
            'sourcename' => manager::report_source_exists($source, datasource::class) ? $source::get_name() : null,
90
            ]))->export($output),
77
            'modifiedby' => (new user_summary_exporter($usermodified))->export($output),
91
            'modifiedby' => (new user_summary_exporter($usermodified))->export($output),
78
        ];
92
        ];
79
    }
93
    }