Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 100... Línea 100...
100
     * Returns list of all available columns
100
     * Returns list of all available columns
101
     *
101
     *
102
     * @return column[]
102
     * @return column[]
103
     */
103
     */
104
    protected function get_all_columns(): array {
104
    protected function get_all_columns(): array {
105
        global $DB;
-
 
106
 
-
 
107
        $tablealias = $this->get_table_alias('cohort');
105
        $tablealias = $this->get_table_alias('cohort');
108
        $contextalias = $this->get_table_alias('context');
106
        $contextalias = $this->get_table_alias('context');
Línea 109... Línea 107...
109
 
107
 
110
        // Category/context column.
108
        // Category/context column.
Línea 148... Línea 146...
148
            ->set_type(column::TYPE_TEXT)
146
            ->set_type(column::TYPE_TEXT)
149
            ->add_fields("{$tablealias}.idnumber")
147
            ->add_fields("{$tablealias}.idnumber")
150
            ->set_is_sortable(true);
148
            ->set_is_sortable(true);
Línea 151... Línea 149...
151
 
149
 
152
        // Description column.
-
 
153
        $descriptionfieldsql = "{$tablealias}.description";
-
 
154
        if ($DB->get_dbfamily() === 'oracle') {
-
 
155
            $descriptionfieldsql = $DB->sql_order_by_text($descriptionfieldsql, 1024);
-
 
156
        }
150
        // Description column.
157
        $columns[] = (new column(
151
        $columns[] = (new column(
158
            'description',
152
            'description',
159
            new lang_string('description'),
153
            new lang_string('description'),
160
            $this->get_entity_name()
154
            $this->get_entity_name()
161
        ))
155
        ))
162
            ->add_joins($this->get_joins())
156
            ->add_joins($this->get_joins())
163
            ->add_join($this->get_context_join())
157
            ->add_join($this->get_context_join())
164
            ->set_type(column::TYPE_LONGTEXT)
-
 
165
            ->add_field($descriptionfieldsql, 'description')
158
            ->set_type(column::TYPE_LONGTEXT)
166
            ->add_fields("{$tablealias}.descriptionformat, {$tablealias}.id, {$tablealias}.contextid")
159
            ->add_fields("{$tablealias}.description, {$tablealias}.descriptionformat, {$tablealias}.id, {$tablealias}.contextid")
-
 
160
            ->add_fields(context_helper::get_preload_record_columns_sql($contextalias))
167
            ->add_fields(context_helper::get_preload_record_columns_sql($contextalias))
161
            ->set_is_sortable(true)
168
            ->add_callback(static function(?string $description, stdClass $cohort): string {
162
            ->add_callback(static function(?string $description, stdClass $cohort): string {
169
                global $CFG;
163
                global $CFG;
Línea 170... Línea 164...
170
                require_once("{$CFG->libdir}/filelib.php");
164
                require_once("{$CFG->libdir}/filelib.php");
Línea 263... Línea 257...
263
     * Return list of all available filters
257
     * Return list of all available filters
264
     *
258
     *
265
     * @return filter[]
259
     * @return filter[]
266
     */
260
     */
267
    protected function get_all_filters(): array {
261
    protected function get_all_filters(): array {
268
        global $DB;
-
 
269
 
-
 
270
        $tablealias = $this->get_table_alias('cohort');
262
        $tablealias = $this->get_table_alias('cohort');
Línea 271... Línea 263...
271
 
263
 
272
        // Cohort select filter.
264
        // Cohort select filter.
273
        $filters[] = (new filter(
265
        $filters[] = (new filter(
Línea 341... Línea 333...
341
        $filters[] = (new filter(
333
        $filters[] = (new filter(
342
            text::class,
334
            text::class,
343
            'description',
335
            'description',
344
            new lang_string('description'),
336
            new lang_string('description'),
345
            $this->get_entity_name(),
337
            $this->get_entity_name(),
346
            $DB->sql_cast_to_char("{$tablealias}.description")
338
            "{$tablealias}.description"
347
        ))
339
        ))
348
            ->add_joins($this->get_joins());
340
            ->add_joins($this->get_joins());
Línea 349... Línea 341...
349
 
341
 
350
        // Theme filter.
342
        // Theme filter.