Skip to content
Snippets Groups Projects
Commit 1d8ee52e authored by Tobias Reischmann's avatar Tobias Reischmann
Browse files

Show cancle button in non-editing mode of step and trigger forms

parent 178070d9
No related branches found
No related tags found
No related merge requests found
......@@ -88,8 +88,7 @@ class form_step_instance extends \moodleform {
$this->lib = lib_manager::get_step_lib($this->subpluginname);
$this->stepsettings = $stepsettings;
$editable = workflow_manager::is_editable($workflowid);
parent::__construct($url, null, 'post', '', null, $editable);
parent::__construct($url, null, 'post', '', null);
}
/**
......@@ -130,7 +129,7 @@ class form_step_instance extends \moodleform {
}
// For active workflows, we do not want the form to be editable.
if ($this->workflowid && workflow_manager::is_active($this->workflowid)) {
if ($this->workflowid && !workflow_manager::is_editable($this->workflowid)) {
$this->add_cancel_button();
} else {
$this->add_action_buttons();
......@@ -181,7 +180,7 @@ class form_step_instance extends \moodleform {
$this->lib->extend_add_instance_form_definition_after_data($mform, $this->stepsettings);
// For active workflows, we do not want the form to be editable.
if ($this->workflowid && workflow_manager::is_active($this->workflowid)) {
if ($this->workflowid && !workflow_manager::is_editable($this->workflowid)) {
// The group buttonar is the array of submit buttons. For inactive workflows this is only a cancel button.
$mform->hardFreezeAllVisibleExcept(array('buttonar'));
}
......
......@@ -93,8 +93,7 @@ class form_trigger_instance extends \moodleform {
$this->lib = lib_manager::get_trigger_lib($this->subpluginname);
}
$editable = workflow_manager::is_editable($workflowid);
parent::__construct($url, null, 'post', '', null, $editable);
parent::__construct($url, null, 'post', '', null);
}
/**
......@@ -136,7 +135,7 @@ class form_trigger_instance extends \moodleform {
}
// For active workflows, we do not want the form to be editable.
if ($this->workflowid && workflow_manager::is_active($this->workflowid)) {
if ($this->workflowid && !workflow_manager::is_editable($this->workflowid)) {
$this->add_cancel_button();
} else {
$this->add_action_buttons();
......@@ -184,7 +183,7 @@ class form_trigger_instance extends \moodleform {
}
// For active workflows, we do not want the form to be editable.
if ($this->workflowid && workflow_manager::is_active($this->workflowid)) {
if ($this->workflowid && !workflow_manager::is_editable($this->workflowid)) {
// The group buttonar is the array of submit buttons. For inactive workflows this is only a cancel button.
$mform->hardFreezeAllVisibleExcept(array('buttonar'));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment