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 {
$this->set_attribute('class', $this->attributes['class'] . ' ' . $uniqueid);
$this->workflowid = $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}',
"workflowid " . $sqlwhere, $params);
$this->define_baseurl(new \moodle_url($PAGE->url, array('workflowid' => $workflowid)));
......@@ -67,6 +67,7 @@ class step_table extends \table_sql {
'type' => 'trigger',
'subpluginname' => $trigger->subpluginname,
'sortindex' => $trigger->sortindex,
'show_action' => $trigger->sortindex,
'instancename' => $trigger->instancename,
)
), false);
......@@ -82,7 +83,7 @@ class step_table extends \table_sql {
get_string('step_subpluginname', 'tool_lifecycle'),
];
if (! workflow_manager::is_editable($this->workflowid)) {
$columns [] = 'show';
$columns [] = 'show_action';
$headers [] = get_string('step_show', 'tool_lifecycle');
} else {
$columns [] = 'sortindex';
......@@ -94,7 +95,12 @@ class step_table extends \table_sql {
}
$this->define_columns($columns);
$this->define_headers($headers);
if (!workflow_manager::is_editable($this->workflowid)) {
$this->sortable(false, 'show_action');
} else {
$this->sortable(false, 'sortindex');
}
$this->setup();
}
......@@ -200,7 +206,7 @@ class step_table extends \table_sql {
* @param $row
* @return string action button for editing of the subplugin
*/
public function col_show($row) {
public function col_show_action($row) {
$alt = 'view';
$icon = 't/viewdetails';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment