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_user/user
19
 * @module    gradereport_user/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 56... Línea 61...
56
     * Build up the view all link.
61
     * Build up the view all link.
57
     *
62
     *
58
     * @returns {string|*}
63
     * @returns {string|*}
59
     */
64
     */
60
    selectAllResultsLink() {
65
    selectAllResultsLink() {
61
        return Url.relativeUrl('/grade/report/user/index.php', {
-
 
62
            id: this.courseID,
66
        const url = new URL(this.baseUrl);
63
            userid: 0,
67
        url.searchParams.set('userid', 0);
64
            searchvalue: this.getSearchTerm()
68
        url.searchParams.set('searchvalue', this.getSearchTerm());
65
        }, false);
69
        return url.toString();
66
    }
70
    }
Línea 67... Línea 71...
67
 
71
 
68
    /**
72
    /**
69
     * Build up the link that is dedicated to a particular result.
73
     * Build up the link that is dedicated to a particular result.
70
     *
74
     *
71
     * @param {Number} userID The ID of the user selected.
75
     * @param {Number} userID The ID of the user selected.
72
     * @returns {string|*}
76
     * @returns {string|*}
73
     */
77
     */
74
    selectOneLink(userID) {
78
    selectOneLink(userID) {
75
        return Url.relativeUrl('/grade/report/user/index.php', {
79
        const url = new URL(this.baseUrl);
76
            id: this.courseID,
80
        url.searchParams.set('userid', userID);
77
            searchvalue: this.getSearchTerm(),
81
        url.searchParams.set('searchvalue', this.getSearchTerm());
78
            userid: userID,
-
 
79
        }, false);
82
        return url.toString();
Línea 80... Línea 83...
80
    }
83
    }
81
 
84
 
82
    /**
85
    /**