Skip to content

Commit

Permalink
Merge pull request #121 from chmst/Workflow_name_in_lists
Browse files Browse the repository at this point in the history
Resolve issue 114
  • Loading branch information
bembelimen committed Sep 11, 2017
2 parents 5810ae5 + cda42b9 commit 6e963f3
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 4 deletions.
10 changes: 10 additions & 0 deletions administrator/components/com_workflow/Model/States.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,17 @@ protected function populateState($ordering = null, $direction = null)

$workflowID = $app->getUserStateFromRequest($this->context . '.filter.workflow_id', 'workflow_id', 1, 'int');
$extension = $app->getUserStateFromRequest($this->context . '.filter.extension', 'extension', 'com_content', 'cmd');

if ($workflowID)
{
$table = $this->getTable('Workflow', 'Administrator');

if ($table->load($workflowID))
{
$this->setState('active_workflow', $table->title);
}
}

$this->setState('filter.workflow_id', $workflowID);
$this->setState('filter.extension', $extension);

Expand Down
10 changes: 10 additions & 0 deletions administrator/components/com_workflow/Model/Transitions.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,17 @@ protected function populateState($ordering = null, $direction = null)
$app = Factory::getApplication();
$workflowID = $app->getUserStateFromRequest($this->context . '.filter.workflow_id', 'workflow_id', 1, 'int');
$extension = $app->getUserStateFromRequest($this->context . '.filter.extension', 'extension', 'com_content', 'cmd');

if ($workflowID)
{
$table = $this->getTable('Workflow', 'Administrator');

if ($table->load($workflowID))
{
$this->setState('active_workflow', $table->title);
}
}

$this->setState('filter.workflow_id', $workflowID);
$this->setState('filter.extension', $extension);

Expand Down
4 changes: 3 additions & 1 deletion administrator/components/com_workflow/View/States/Html.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,10 @@ public function display($tpl = null)
protected function addToolbar()
{
$canDo = ContentHelper::getActions($this->extension, "workflow", $this->workflowID);

$workflow = !empty($this->state->get('active_workflow', '')) ? $this->state->get('active_workflow', '') . ': ' : '';

ToolbarHelper::title(\JText::_('COM_WORKFLOW_STATES_LIST'), 'address contact');
ToolbarHelper::title(\JText::sprintf('COM_WORKFLOW_STATES_LIST', $this->escape($workflow)), 'address contact');

if ($canDo->get("core.create"))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ protected function addToolbar()
{
$canDo = ContentHelper::getActions($this->extension, "workflow", $this->workflowID);

ToolbarHelper::title(\JText::_('COM_WORKFLOW_TRANSITIONS_LIST'), 'address contact');
$workflow = !empty($this->state->get('active_workflow', '')) ? $this->state->get('active_workflow', '') . ': ' : '';

ToolbarHelper::title(\JText::sprintf('COM_WORKFLOW_STATES_LIST', $this->escape($workflow)), 'address contact');

if ($canDo->get("core.create"))
{
Expand Down
4 changes: 2 additions & 2 deletions administrator/language/en-GB/en-GB.com_workflow.ini
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ COM_WORKFLOW_SELECT_FROM_STATE="- Select From State -"
COM_WORKFLOW_SELECT_TO_STATE="- Select To State -"
COM_WORKFLOW_STATE="State"
COM_WORKFLOW_STATES="States"
COM_WORKFLOW_STATES_LIST="States List"
COM_WORKFLOW_STATES_LIST="%s States List"
COM_WORKFLOW_STATE_ADD="Add state"
COM_WORKFLOW_STATE_EDIT="Edit state"
COM_WORKFLOW_STATUS_DESC="This means if state is published"
Expand All @@ -87,7 +87,7 @@ COM_WORKFLOW_TO_STATE="To state"
COM_WORKFLOW_TO_STATE_DESC="Select to what state, this transition should be"
COM_WORKFLOW_TRANSITION="Transition"
COM_WORKFLOW_TRANSITIONS="Transitions"
COM_WORKFLOW_TRANSITIONS_LIST="Transitions List"
COM_WORKFLOW_TRANSITIONS_LIST="%s Transitions List"
COM_WORKFLOW_TRANSITION_ADD="Add Transition"
COM_WORKFLOW_TRANSITION_DUPLICATE="That transition already exist"
COM_WORKFLOW_TRANSITION_EDIT="Edit Transition"
Expand Down

0 comments on commit 6e963f3

Please sign in to comment.