Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 19... Línea 19...
19
 * @module    gradereport_singleview/user
19
 * @module    gradereport_singleview/user
20
 * @copyright 2023 Mathew May <mathew.solutions>
20
 * @copyright 2023 Mathew May <mathew.solutions>
21
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
21
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
22
 */
22
 */
23
import UserSearch from 'core_user/comboboxsearch/user';
23
import UserSearch from 'core_user/comboboxsearch/user';
24
import Url from 'core/url';
-
 
25
import {renderForPromise, replaceNodeContents} from 'core/templates';
24
import {renderForPromise, replaceNodeContents} from 'core/templates';
26
import * as Repository from 'core_grades/searchwidget/repository';
25
import * as Repository from 'core_grades/searchwidget/repository';
Línea 27... Línea 26...
27
 
26
 
Línea -... Línea 27...
-
 
27
export default class User extends UserSearch {
-
 
28
 
-
 
29
    /**
-
 
30
     * Construct the class.
-
 
31
     *
28
export default class User extends UserSearch {
32
     * @param {string} baseUrl The base URL for the page.
29
 
33
     */
-
 
34
    constructor(baseUrl) {
30
    constructor() {
35
        super();
Línea 31... Línea 36...
31
        super();
36
        this.baseUrl = baseUrl;
32
    }
37
    }
33
 
38
 
Línea 34... Línea 39...
34
    static init() {
39
    static init(baseUrl) {
35
        return new User();
40
        return new User(baseUrl);
36
    }
41
    }
Línea 63... Línea 68...
63
     *
68
     *
64
     * @param {Number} userID The ID of the user selected.
69
     * @param {Number} userID The ID of the user selected.
65
     * @returns {string|*}
70
     * @returns {string|*}
66
     */
71
     */
67
    selectOneLink(userID) {
72
    selectOneLink(userID) {
68
        return Url.relativeUrl('/grade/report/singleview/index.php', {
-
 
69
            id: this.courseID,
73
        const url = new URL(this.baseUrl);
70
            searchvalue: this.getSearchTerm(),
74
        url.searchParams.set('searchvalue', this.getSearchTerm());
71
            item: 'user',
75
        url.searchParams.set('item', 'user');
72
            userid: userID,
76
        url.searchParams.set('userid', userID);
73
        }, false);
77
        return url.toString();
74
    }
78
    }
Línea 75... Línea 79...
75
 
79
 
76
    /**
80
    /**
77
     * Get the data we will be searching against in this component.
81
     * Get the data we will be searching against in this component.