Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 62... Línea 62...
62
    public $order;
62
    public $order;
Línea 63... Línea 63...
63
 
63
 
64
    /** @var int group id */
64
    /** @var int group id */
Línea -... Línea 65...
-
 
65
    public $groupid;
-
 
66
 
-
 
67
    /** @var int forces the use of a course filter in site context */
65
    public $groupid;
68
    public $sitecoursefilter;
66
 
69
 
Línea 67... Línea 70...
67
    /** @var report_loglive_table_log table log which will be used for rendering logs */
70
    /** @var report_loglive_table_log table log which will be used for rendering logs */
68
    public $tablelog;
71
    public $tablelog;
Línea 78... Línea 81...
78
     * @param moodle_url|string $url (optional) page url.
81
     * @param moodle_url|string $url (optional) page url.
79
     * @param int $date date (optional) from which records will be fetched.
82
     * @param int $date date (optional) from which records will be fetched.
80
     * @param int $page (optional) page number.
83
     * @param int $page (optional) page number.
81
     * @param int $perpage (optional) number of records to show per page.
84
     * @param int $perpage (optional) number of records to show per page.
82
     * @param string $order (optional) sortorder of fetched records
85
     * @param string $order (optional) sortorder of fetched records
-
 
86
     * @param int $sitecoursefilter (optional) use a course filter in site context.
83
     */
87
     */
84
    public function __construct($logreader = "", $course = 0, $url = "", $date = 0, $page = 0, $perpage = 100,
88
    public function __construct($logreader = "", $course = 0, $url = "", $date = 0, $page = 0, $perpage = 100,
85
                                $order = "timecreated DESC") {
89
                                $order = "timecreated DESC", $sitecoursefilter = 0) {
Línea 86... Línea 90...
86
 
90
 
Línea 87... Línea 91...
87
        global $PAGE;
91
        global $PAGE, $SITE;
88
 
92
 
89
        // Use first reader as selected reader, if not passed.
93
        // Use first reader as selected reader, if not passed.
90
        if (empty($logreader)) {
94
        if (empty($logreader)) {
Línea 106... Línea 110...
106
        }
110
        }
107
        $this->url = $url;
111
        $this->url = $url;
Línea 108... Línea 112...
108
 
112
 
109
        // Use site course id, if course is empty.
113
        // Use site course id, if course is empty.
-
 
114
        if (!empty($course) && is_int($course)) {
-
 
115
            $courseid = $course;
110
        if (!empty($course) && is_int($course)) {
116
            try {
-
 
117
                $course = get_course($courseid);
-
 
118
            } catch (dml_missing_record_exception) {
-
 
119
                // Missing courses may have be deleted, so display them in site context.
-
 
120
                $course = 0;
-
 
121
                $sitecoursefilter = $courseid;
111
            $course = get_course($course);
122
            }
112
        }
123
        }
Línea 113... Línea 124...
113
        $this->course = $course;
124
        $this->course = $course;
114
 
125
 
Línea 118... Línea 129...
118
        $this->date = $date;
129
        $this->date = $date;
Línea 119... Línea 130...
119
 
130
 
120
        $this->page = $page;
131
        $this->page = $page;
121
        $this->perpage = $perpage;
132
        $this->perpage = $perpage;
-
 
133
        $this->order = $order;
122
        $this->order = $order;
134
        $this->sitecoursefilter = $sitecoursefilter;
123
        $this->set_refresh_rate();
135
        $this->set_refresh_rate();
Línea 124... Línea 136...
124
    }
136
    }
125
 
137
 
Línea 182... Línea 194...
182
            $filter->courseid = 0;
194
            $filter->courseid = 0;
183
        }
195
        }
184
        $filter->logreader = $readers[$this->selectedlogreader];
196
        $filter->logreader = $readers[$this->selectedlogreader];
185
        $filter->date = $this->date;
197
        $filter->date = $this->date;
186
        $filter->orderby = $this->order;
198
        $filter->orderby = $this->order;
-
 
199
        $filter->sitecoursefilter = $this->sitecoursefilter;
Línea 187... Línea 200...
187
 
200
 
188
        return $filter;
201
        return $filter;
Línea 189... Línea 202...
189
    }
202
    }