Skip to content

Commit ed3db58

Browse files
brianteemanwilsonge
authored andcommitted
[4.0] Workflow Transitions/Stages (#21592)
* [4.0] Transitions PR for #21586 Despite comments the fix was NOT in #21566 * [4.0] Workflow - transitions 1. Change the editor field to a text field - I am sure you will never need a full wysiwyg editor here 2. Add a label to the field called "Note" 2. change the tmpl to get the list of fields from the xml instead of being hardcoded 3. Add the content of the "note" to the list view. I really can't see the point in having the note if you can't see it in the list * cs * make the note styled consistently with similar fields * use layout for the rigght hand side * display the title * add the same to stages * oops * Update default.php * escape text
1 parent bf36374 commit ed3db58

File tree

9 files changed

+35
-56
lines changed

9 files changed

+35
-56
lines changed

administrator/components/com_workflow/Model/StagesModel.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ public function getListQuery()
136136
's.ordering',
137137
's.condition',
138138
's.default',
139-
's.published'
139+
's.published',
140+
's.description'
140141
)
141142
);
142143

administrator/components/com_workflow/Model/TransitionsModel.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,13 @@ public function getListQuery()
132132

133133
$select = $db->quoteName(
134134
array(
135-
't.id',
136-
't.title',
137-
't.from_stage_id',
138-
't.to_stage_id',
139-
't.published',
140-
't.ordering',
135+
't.id',
136+
't.title',
137+
't.from_stage_id',
138+
't.to_stage_id',
139+
't.published',
140+
't.ordering',
141+
't.description',
141142
)
142143
);
143144

administrator/components/com_workflow/forms/stage.xml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<form>
3-
<fieldset addfieldprefix="Joomla\Component\Workflow\Administrator\Field">
3+
<fieldset name="stage" addfieldprefix="Joomla\Component\Workflow\Administrator\Field">
44
<field
55
name="id"
66
type="text"
@@ -14,22 +14,19 @@
1414
name="title"
1515
type="text"
1616
label="COM_WORKFLOW_FIELD_NAME_LABEL"
17-
class="input-xxlarge input-large-text"
1817
size="40"
1918
required="true"
2019
/>
2120
<field
2221
name="description"
23-
type="editor"
24-
label="COM_WORKFLOW_FIELD_DESC_LABEL"
25-
class="input-xxlarge input-large-text"
22+
type="text"
23+
label="COM_WORKFLOW_STAGE_NOTE"
2624
/>
2725
<field
28-
name="condition"
29-
type="workflowcondition"
30-
label="COM_WORKFLOW_CONDITION"
31-
description="COM_WORKFLOW_CONDITION_DESC"
32-
class="input-xxlarge input-large-text"
26+
name="condition"
27+
type="workflowcondition"
28+
label="COM_WORKFLOW_CONDITION"
29+
description="COM_WORKFLOW_CONDITION_DESC"
3330
/>
3431
</fieldset>
3532

administrator/components/com_workflow/forms/transition.xml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<form>
3-
<fieldset addfieldprefix="Joomla\Component\Workflow\Administrator\Field">
3+
<fieldset name="transition" addfieldprefix="Joomla\Component\Workflow\Administrator\Field">
44
<field
55
name="id"
6-
type="text"
6+
type="hidden"
77
label="JGLOBAL_FIELD_ID_LABEL"
88
default="0"
99
class="readonly"
@@ -14,7 +14,6 @@
1414
name="title"
1515
type="text"
1616
label="COM_WORKFLOW_FIELD_NAME_LABEL"
17-
class="input-xxlarge input-large-text"
1817
size="40"
1918
required="true"
2019
/>
@@ -40,9 +39,8 @@
4039
/>
4140
<field
4241
name="description"
43-
type="editor"
44-
label="COM_WORKFLOW_FIELD_DESC_LABEL"
45-
class="input-xxlarge input-large-text"
42+
type="text"
43+
label="COM_WORKFLOW_TRANSITION_NOTE"
4644
/>
4745
</fieldset>
4846

administrator/components/com_workflow/tmpl/stage/edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<div class="row">
4040
<div class="col-md-9">
4141
<?php echo $this->form->renderField('condition'); ?>
42-
<?php echo $this->form->getInput('description'); ?>
42+
<?php echo $this->form->renderField('description'); ?>
4343
</div>
4444
<div class="col-md-3">
4545
<div class="card card-block card-light">

administrator/components/com_workflow/tmpl/stages/default.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,10 @@
123123
<a href="<?php echo $edit; ?>" title="<?php echo Text::_('JACTION_EDIT'); ?> <?php echo $this->escape(addslashes(Text::_($item->title))); ?>">
124124
<?php echo $editIcon; ?><?php echo $this->escape(Text::_($item->title)); ?>
125125
</a>
126+
<div class="small"><?php echo $this->escape(Text::_($item->description)); ?></div>
126127
<?php else: ?>
127128
<?php echo $this->escape(Text::_($item->title)); ?>
129+
<div class="small"><?php echo $this->escape(Text::_($item->description)); ?></div>
128130
<?php endif; ?>
129131
</th>
130132
<td class="text-center">

administrator/components/com_workflow/tmpl/transition/edit.php

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -26,46 +26,22 @@
2626
?>
2727

2828
<form action="<?php echo Route::_('index.php?option=com_workflow&view=transition&workflow_id=' . $this->workflowID . '&extension=' . $this->input->getCmd('extension') . '&layout=' . $layout . $tmpl . '&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="workflow-form" class="form-validate">
29-
30-
<?php echo LayoutHelper::render('joomla.edit.title_alias', $this); ?>
31-
3229
<div>
30+
<?php echo LayoutHelper::render('joomla.edit.title_alias', $this); ?>
31+
3332
<?php echo HTMLHelper::_('uitab.startTabSet', 'myTab', array('active' => 'details')); ?>
3433

3534
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'details', Text::_('COM_WORKFLOW_DESCRIPTION')); ?>
3635
<div class="row">
3736
<div class="col-md-9">
38-
<div class="control-group">
39-
<div class="control-label">
40-
<?php echo $this->form->getLabel('from_stage_id'); ?>
41-
</div>
42-
<div class="controls">
43-
<?php echo $this->form->getInput('from_stage_id'); ?>
44-
</div>
45-
</div>
46-
<div class="control-group">
47-
<div class="control-label">
48-
<?php echo $this->form->getLabel('to_stage_id'); ?>
49-
</div>
50-
<div class="controls">
51-
<?php echo $this->form->getInput('to_stage_id'); ?>
52-
</div>
53-
</div>
54-
<?php echo $this->form->getInput('description'); ?>
37+
<?php echo $this->form->renderField('from_stage_id'); ?>
38+
<?php echo $this->form->renderField('to_stage_id'); ?>
39+
<?php echo $this->form->renderField('description'); ?>
5540
</div>
5641
<div class="col-md-3">
5742
<div class="card card-block card-light">
5843
<div class="card-body">
59-
<fieldset class="form-vertical form-no-margin">
60-
<div class="control-group">
61-
<div class="control-label">
62-
<?php echo $this->form->getLabel('published'); ?>
63-
</div>
64-
<div class="controls">
65-
<?php echo $this->form->getInput('published'); ?>
66-
</div>
67-
</div>
68-
</fieldset>
44+
<?php echo LayoutHelper::render('joomla.edit.global', $this); ?>
6945
</div>
7046
</div>
7147
</div>

administrator/components/com_workflow/tmpl/transitions/default.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,12 @@
116116
<?php if ($canEdit) : ?>
117117
<?php $editIcon = '<span class="fa fa-pencil-square mr-2" aria-hidden="true"></span>'; ?>
118118
<a href="<?php echo $edit; ?>" title="<?php echo Text::_('JACTION_EDIT'); ?> <?php echo $this->escape(addslashes(Text::_($item->title))); ?>">
119-
<?php echo $editIcon; ?><?php echo $item->title; ?>
119+
<?php echo $editIcon; ?><?php echo $this->escape(Text::_($item->title)); ?>
120120
</a>
121+
<div class="small"><?php echo $this->escape(Text::_($item->description)); ?></div>
121122
<?php else: ?>
122-
<?php echo $item->title; ?>
123+
<?php echo $this->escape(Text::_($item->title)); ?>
124+
<div class="small"><?php echo $this->escape(Text::_($item->description)); ?></div>
123125
<?php endif; ?>
124126
</th>
125127
<td class="text-center">

administrator/language/en-GB/en-GB.com_workflow.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ COM_WORKFLOW_STAGES="Stages"
8282
COM_WORKFLOW_STAGES_LIST="%s Stages List"
8383
COM_WORKFLOW_STAGE_ADD="Add Stage"
8484
COM_WORKFLOW_STAGE_EDIT="Edit Stage"
85+
COM_WORKFLOW_STAGE_NOTE="Note"
8586
COM_WORKFLOW_TOOLBAR_DEFAULT="Default"
8687
COM_WORKFLOW_TOO_MANY_ITEMS="Too many items selected."
8788
COM_WORKFLOW_TO_STAGE="Target Stage"
@@ -92,6 +93,7 @@ COM_WORKFLOW_TRANSITIONS_LIST="%s Transitions List"
9293
COM_WORKFLOW_TRANSITION_ADD="Add Transition"
9394
COM_WORKFLOW_TRANSITION_DUPLICATE="This transition already exists."
9495
COM_WORKFLOW_TRANSITION_EDIT="Edit Transition"
96+
COM_WORKFLOW_TRANSITION_NOTE="Note"
9597
COM_WORKFLOW_TRANSITION_THE_SAME_STAGE="Current stage and target stage are the same."
9698
COM_WORKFLOW_TRASHED="Trashed"
9799
COM_WORKFLOW_UNPUBLISHED="Unpublished"

0 commit comments

Comments
 (0)