Skip to main content
Sign in
Snippets Groups Projects
Commit 88ffa232 authored by Justus Dieckmann's avatar Justus Dieckmann
Browse files

Course shortname and Workflow name as secondary information

parent 3c84a233
Branches
No related tags found
No related merge requests found
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
* @copyright 2019 Justus Dieckmann WWU * @copyright 2019 Justus Dieckmann WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
namespace tool_lifecycle\table; namespace tool_lifecycle\table;
use core\plugininfo\format; use core\plugininfo\format;
...@@ -38,9 +39,9 @@ class interaction_log_table extends \table_sql { ...@@ -38,9 +39,9 @@ class interaction_log_table extends \table_sql {
parent::__construct($uniqueid); parent::__construct($uniqueid);
global $PAGE; global $PAGE;
$fields = "l.id as processid, c.id as courseid, c.fullname as coursefullname, w.title as workflow, " . $fields = "l.id as processid, c.id as courseid, c.fullname as coursefullname, c.shortname as courseshortname, " .
"s.id as stepinstanceid, s.instancename as stepinstancename, s.subpluginname as subpluginname, " . "w.title as workflow, s.subpluginname as subpluginname, s.instancename as stepname, u.id as userid, "
"u.id as userid, " . get_all_user_name_fields(true, 'u') . ", l.time, l.action"; . get_all_user_name_fields(true, 'u') . ", l.time, l.action";
$from = '{tool_lifecycle_action_log} l join ' . $from = '{tool_lifecycle_action_log} l join ' .
'{course} c on l.courseid = c.id join ' . '{course} c on l.courseid = c.id join ' .
'{tool_lifecycle_workflow} w on l.workflowid = w.id join ' . '{tool_lifecycle_workflow} w on l.workflowid = w.id join ' .
...@@ -53,6 +54,7 @@ class interaction_log_table extends \table_sql { ...@@ -53,6 +54,7 @@ class interaction_log_table extends \table_sql {
$where = 'l.courseid IN (' . $ids . ')'; $where = 'l.courseid IN (' . $ids . ')';
} }
$this->column_nosort = array('action');
$this->set_sql($fields, $from, $where, []); $this->set_sql($fields, $from, $where, []);
$this->define_baseurl($PAGE->url); $this->define_baseurl($PAGE->url);
$this->init(); $this->init();
...@@ -62,20 +64,29 @@ class interaction_log_table extends \table_sql { ...@@ -62,20 +64,29 @@ class interaction_log_table extends \table_sql {
* Initialises the columns of the table. * Initialises the columns of the table.
*/ */
public function init() { public function init() {
$this->define_columns(['courseid', 'coursefullname', 'workflow', 'time', 'user', 'action']); $this->define_columns(['course', 'step', 'action', 'user', 'time']);
$this->define_headers([ $this->define_headers([
get_string('course'), get_string('course'),
get_string('fullnamecourse'), get_string('step', 'tool_lifecycle'),
get_string('workflow', 'tool_lifecycle'), get_string('action', 'tool_lifecycle'),
get_string('date'),
get_string('user'), get_string('user'),
get_string('action', 'tool_lifecycle') get_string('date'),
]); ]);
$this->setup(); $this->setup();
} }
public function col_course($row) {
$courselink = \html_writer::link(course_get_url($row->courseid), $row->coursefullname);
return $courselink . '<br><span class="secondary-info">' . $row->courseshortname . '</span>';
}
public function col_step($row) {
return $row->stepname . '<br><span class="secondary-info">Workflow: ' . $row->workflow . '</span>';
}
/** /**
* Render user column. * Render user column.
*
* @param $row * @param $row
* @return string * @return string
*/ */
...@@ -86,6 +97,7 @@ class interaction_log_table extends \table_sql { ...@@ -86,6 +97,7 @@ class interaction_log_table extends \table_sql {
/** /**
* Render time column. * Render time column.
*
* @param $row * @param $row
* @return string * @return string
* @throws \coding_exception * @throws \coding_exception
...@@ -95,26 +107,11 @@ class interaction_log_table extends \table_sql { ...@@ -95,26 +107,11 @@ class interaction_log_table extends \table_sql {
return userdate($row->time, $dateformat); return userdate($row->time, $dateformat);
} }
/** public function col_action($row) {
* Render courseid column. $interactionlib = lib_manager::get_step_interactionlib($row->subpluginname);
* @param $row return $interactionlib->get_action_string($row->action);
* @return string course link
*/
public function col_courseid($row) {
return \html_writer::link(course_get_url($row->courseid), $row->courseid);
} }
/**
* Render coursefullname column.
* @param $row
* @return string course link
*/
public function col_coursefullname($row) {
return \html_writer::link(course_get_url($row->courseid), $row->coursefullname);
}
public function print_nothing_to_display() { public function print_nothing_to_display() {
global $OUTPUT; global $OUTPUT;
... ...
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
overflow: initial; overflow: initial;
} }
.lifecycle-table span.workflow_displaytitle { .lifecycle-table span.workflow_displaytitle,
.lifecycle-table span.secondary-info {
color: #888; color: #888;
font-size: .9em; font-size: .9em;
padding: 0.5em; padding: 0.5em;
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment