Skip to content
Snippets Groups Projects
Unverified Commit c3d5d9d5 authored by Tobias Reischmann's avatar Tobias Reischmann Committed by GitHub
Browse files

Merge pull request #76 from learnweb/bug/steporder

Fix sort order of non editable workflow step views
parents ff89ac54 b5182a25
Branches
Tags
No related merge requests found
...@@ -50,7 +50,7 @@ class step_table extends \table_sql { ...@@ -50,7 +50,7 @@ class step_table extends \table_sql {
$this->set_attribute('class', $this->attributes['class'] . ' ' . $uniqueid); $this->set_attribute('class', $this->attributes['class'] . ' ' . $uniqueid);
$this->workflowid = $workflowid; $this->workflowid = $workflowid;
list($sqlwhere, $params) = $DB->get_in_or_equal($workflowid); list($sqlwhere, $params) = $DB->get_in_or_equal($workflowid);
$this->set_sql("id, subpluginname, instancename, sortindex, 'step' as type", $this->set_sql("id, subpluginname, instancename, sortindex, sortindex as show_action, 'step' as type",
'{tool_lifecycle_step}', '{tool_lifecycle_step}',
"workflowid " . $sqlwhere, $params); "workflowid " . $sqlwhere, $params);
$this->define_baseurl(new \moodle_url($PAGE->url, array('workflowid' => $workflowid))); $this->define_baseurl(new \moodle_url($PAGE->url, array('workflowid' => $workflowid)));
...@@ -67,6 +67,7 @@ class step_table extends \table_sql { ...@@ -67,6 +67,7 @@ class step_table extends \table_sql {
'type' => 'trigger', 'type' => 'trigger',
'subpluginname' => $trigger->subpluginname, 'subpluginname' => $trigger->subpluginname,
'sortindex' => $trigger->sortindex, 'sortindex' => $trigger->sortindex,
'show_action' => $trigger->sortindex,
'instancename' => $trigger->instancename, 'instancename' => $trigger->instancename,
) )
), false); ), false);
...@@ -82,7 +83,7 @@ class step_table extends \table_sql { ...@@ -82,7 +83,7 @@ class step_table extends \table_sql {
get_string('step_subpluginname', 'tool_lifecycle'), get_string('step_subpluginname', 'tool_lifecycle'),
]; ];
if (! workflow_manager::is_editable($this->workflowid)) { if (! workflow_manager::is_editable($this->workflowid)) {
$columns [] = 'show'; $columns [] = 'show_action';
$headers [] = get_string('step_show', 'tool_lifecycle'); $headers [] = get_string('step_show', 'tool_lifecycle');
} else { } else {
$columns [] = 'sortindex'; $columns [] = 'sortindex';
...@@ -94,7 +95,12 @@ class step_table extends \table_sql { ...@@ -94,7 +95,12 @@ class step_table extends \table_sql {
} }
$this->define_columns($columns); $this->define_columns($columns);
$this->define_headers($headers); $this->define_headers($headers);
if (!workflow_manager::is_editable($this->workflowid)) {
$this->sortable(false, 'show_action');
} else {
$this->sortable(false, 'sortindex'); $this->sortable(false, 'sortindex');
}
$this->setup(); $this->setup();
} }
...@@ -200,7 +206,7 @@ class step_table extends \table_sql { ...@@ -200,7 +206,7 @@ class step_table extends \table_sql {
* @param $row * @param $row
* @return string action button for editing of the subplugin * @return string action button for editing of the subplugin
*/ */
public function col_show($row) { public function col_show_action($row) {
$alt = 'view'; $alt = 'view';
$icon = 't/viewdetails'; $icon = 't/viewdetails';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment