Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 85... Línea 85...
85
     * Returns list of all available columns
85
     * Returns list of all available columns
86
     *
86
     *
87
     * @return column[]
87
     * @return column[]
88
     */
88
     */
89
    protected function get_all_columns(): array {
89
    protected function get_all_columns(): array {
90
        global $DB;
-
 
91
 
-
 
92
        $postalias = $this->get_table_alias('post');
90
        $postalias = $this->get_table_alias('post');
Línea 93... Línea 91...
93
 
91
 
94
        // Content.
-
 
95
        $contentfieldsql = "{$postalias}.content";
-
 
96
        if ($DB->get_dbfamily() === 'oracle') {
-
 
97
            $contentfieldsql = $DB->sql_order_by_text($contentfieldsql, 1024);
-
 
98
        }
92
        // Content.
99
        $columns[] = (new column(
93
        $columns[] = (new column(
100
            'content',
94
            'content',
101
            new lang_string('content', 'core_notes'),
95
            new lang_string('content', 'core_notes'),
102
            $this->get_entity_name()
96
            $this->get_entity_name()
103
        ))
97
        ))
104
            ->add_joins($this->get_joins())
98
            ->add_joins($this->get_joins())
105
            ->set_type(column::TYPE_LONGTEXT)
99
            ->set_type(column::TYPE_LONGTEXT)
106
            ->add_field($contentfieldsql, 'content')
100
            ->add_fields("{$postalias}.content, {$postalias}.format")
107
            ->add_field("{$postalias}.format")
101
            ->set_is_sortable(true)
108
            ->add_callback(static function(?string $content, stdClass $note): string {
102
            ->add_callback(static function(?string $content, stdClass $note): string {
109
                if ($content === null) {
103
                if ($content === null) {
110
                    return '';
104
                    return '';
111
                }
105
                }
Línea 163... Línea 157...
163
     * Return list of all available filters
157
     * Return list of all available filters
164
     *
158
     *
165
     * @return filter[]
159
     * @return filter[]
166
     */
160
     */
167
    protected function get_all_filters(): array {
161
    protected function get_all_filters(): array {
168
        global $DB;
-
 
169
 
-
 
170
        $postalias = $this->get_table_alias('post');
162
        $postalias = $this->get_table_alias('post');
Línea 171... Línea 163...
171
 
163
 
172
        // Content.
164
        // Content.
173
        $filters[] = (new filter(
165
        $filters[] = (new filter(
174
            text::class,
166
            text::class,
175
            'content',
167
            'content',
176
            new lang_string('content', 'core_notes'),
168
            new lang_string('content', 'core_notes'),
177
            $this->get_entity_name(),
169
            $this->get_entity_name(),
178
            $DB->sql_cast_to_char("{$postalias}.content")
170
            "{$postalias}.content"
179
        ))
171
        ))
Línea 180... Línea 172...
180
            ->add_joins($this->get_joins());
172
            ->add_joins($this->get_joins());
181
 
173