Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 47... Línea 47...
47
 
47
 
48
        $columnheaders = [
48
        $columnheaders = [
49
            'classname'    => get_string('classname', 'tool_task'),
49
            'classname'    => get_string('classname', 'tool_task'),
50
            'type'         => get_string('tasktype', 'admin'),
50
            'type'         => get_string('tasktype', 'admin'),
-
 
51
            'time'         => get_string('taskage', 'tool_task'),
51
            'time'         => get_string('taskage', 'tool_task'),
52
            'progress'     => get_string('progress', 'core'),
52
            'timestarted'  => get_string('started', 'tool_task'),
53
            'timestarted'  => get_string('started', 'tool_task'),
53
            'hostname'     => get_string('hostname', 'tool_task'),
54
            'hostname'     => get_string('hostname', 'tool_task'),
54
            'pid'          => get_string('pid', 'tool_task'),
55
            'pid'          => get_string('pid', 'tool_task'),
55
        ];
56
        ];
Línea 151... Línea 152...
151
     * @return  string
152
     * @return  string
152
     */
153
     */
153
    public function col_timestarted($row): string {
154
    public function col_timestarted($row): string {
154
        return userdate($row->timestarted);
155
        return userdate($row->timestarted);
155
    }
156
    }
-
 
157
 
-
 
158
    /**
-
 
159
     * Format the progress column.
-
 
160
     *
-
 
161
     * @param \stdClass $row
-
 
162
     * @return string
-
 
163
     */
-
 
164
    public function col_progress($row): string {
-
 
165
        // Check to see if there is a stored progress record for this task.
-
 
166
        if ($row->type === 'adhoc') {
-
 
167
            $idnumber = \core\output\stored_progress_bar::convert_to_idnumber($row->classname, $row->id);
-
 
168
        } else {
-
 
169
            $idnumber = \core\output\stored_progress_bar::convert_to_idnumber($row->classname);
-
 
170
        }
-
 
171
 
-
 
172
        $bar = \core\output\stored_progress_bar::get_by_idnumber($idnumber);
-
 
173
        if ($bar) {
-
 
174
            return $bar->get_content();
-
 
175
        } else {
-
 
176
            return '-';
-
 
177
        }
-
 
178
    }
-
 
179
 
156
}
180
}