Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 173... Línea 173...
173
     *
173
     *
174
     * @param bool $count When true, return the count SQL.
174
     * @param bool $count When true, return the count SQL.
175
     * @return array containing sql to use and an array of params.
175
     * @return array containing sql to use and an array of params.
176
     */
176
     */
177
    protected function get_sql_and_params($count = false) {
177
    protected function get_sql_and_params($count = false) {
178
        $fields = 'uca.id, uca.cohortid, uca.userid, uca.roleid, ';
178
        $fields = 'uca.id, uca.cohortid, uca.userid, uca.roleid, r.shortname AS rolename, ';
179
        $fields .= 'c.name as cohortname, c.idnumber as cohortidnumber, c.contextid as cohortcontextid, ';
179
        $fields .= 'c.name as cohortname, c.idnumber as cohortidnumber, c.contextid as cohortcontextid, ';
180
        $fields .= 'c.visible as cohortvisible, c.description as cohortdescription, c.theme as cohorttheme';
180
        $fields .= 'c.visible as cohortvisible, c.description as cohortdescription, c.theme as cohorttheme';
Línea 181... Línea 181...
181
 
181
 
182
        // Add extra user fields that we need for the graded user.
182
        // Add extra user fields that we need for the graded user.
Línea 191... Línea 191...
191
        }
191
        }
Línea 192... Línea 192...
192
 
192
 
193
        $sql = "SELECT $select
193
        $sql = "SELECT $select
194
                   FROM {tool_cohortroles} uca
194
                   FROM {tool_cohortroles} uca
-
 
195
                   JOIN {user} u ON u.id = uca.userid
195
                   JOIN {user} u ON u.id = uca.userid
196
                   JOIN {role} r ON r.id = uca.roleid
Línea 196... Línea 197...
196
                   JOIN {cohort} c ON c.id = uca.cohortid";
197
                   JOIN {cohort} c ON c.id = uca.cohortid";
197
 
198
 
198
        // Check if any additional filtering is required.
199
        // Check if any additional filtering is required.