Skip to content
This repository has been archived by the owner on Mar 17, 2020. It is now read-only.

Commit

Permalink
Merge pull request #103 from joomla-projects/merge_created_and_modifi…
Browse files Browse the repository at this point in the history
…ed_date

Merged modified and creation date
  • Loading branch information
bembelimen authored Sep 8, 2017
2 parents 2daa87c + 1f323e6 commit 63380cd
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 12 deletions.
3 changes: 2 additions & 1 deletion administrator/components/com_workflow/Model/Workflows.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ public function __construct($config = array())
'title',
'state',
'created_by',
'created'
'created',
'modified'
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@
defined('_JEXEC') or die;

$extension = $this->escape($this->state->get('filter.extension'));

$listOrder = $this->escape($this->state->get('list.ordering'));

$orderingColumn = 'created';

if (strpos($listOrder, 'modified') !== false)
{
$orderingColumn = 'modified';
}

?>
<?php foreach ($this->workflows as $i => $item):
$states = JRoute::_('index.php?option=com_workflow&view=states&workflow_id=' . $item->id . '&extension=' . $extension);
Expand All @@ -37,10 +47,10 @@
<?php echo JHtml::_('jgrid.isdefault', $item->default, $i, 'workflows.', true); ?>
</td>
<td class="text-center">
<?php echo $item->created; ?>
</td>
<td class="text-center">
<?php echo $item->modified; ?>
<?php
$date = $item->{$orderingColumn};
echo $date > 0 ? JHtml::_('date', $date, JText::_('DATE_FORMAT_LC4')) : '-';
?>
</td>
<td class="text-center">
<?php echo empty($item->name) ? JText::_('COM_WORKFLOW_NA') : $item->name; ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@

$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));

$orderingColumn = 'created';

if (strpos($listOrder, 'modified') !== false)
{
$orderingColumn = 'modified';
}

?>
<tr>
<th style="width:1%" class="nowrap text-center hidden-sm-down">
Expand All @@ -30,11 +38,8 @@
<th style="width:10%" class="text-center nowrap hidden-sm-down">
<?php echo JText::_('COM_WORKFLOW_DEFAULT'); ?>
</th>
<th style="width:10%" class="nowrap text-center hidden-sm-down">
<?php echo JHtml::_('searchtools.sort', 'COM_WORKFLOW_CREATION_DATE', 'created', $listDirn, $listOrder); ?>
</th>
<th style="width:10%" class="nowrap text-center hidden-sm-down">
<?php echo JHtml::_('searchtools.sort', 'COM_WORKFLOW_MODIFICATION_DATE', 'modified', $listDirn, $listOrder); ?>
<th style="width:10%" class="nowrap hidden-sm-down text-center">
<?php echo JHtml::_('searchtools.sort', 'COM_WORKFLOW_DATE_' . strtoupper($orderingColumn), $orderingColumn, $listDirn, $listOrder); ?>
</th>
<th style="width:10%" class="nowrap text-center hidden-sm-down">
<?php echo JHtml::_('searchtools.sort', 'COM_WORKFLOW_AUTHOR', 'created_by', $listDirn, $listOrder); ?>
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 @@ -14,7 +14,7 @@ COM_WORKFLOW_CREATED_AT_ASC="Created Date ASC"
COM_WORKFLOW_CREATED_AT_DESC="Created Date DESC"
COM_WORKFLOW_CREATED_DESC="When item was created"
COM_WORKFLOW_CREATED_LABEL="Creation date"
COM_WORKFLOW_CREATION_DATE="Created Date"
COM_WORKFLOW_DATE_CREATED="Created Date"
COM_WORKFLOW_DEFAULT="Default"
COM_WORKFLOW_DESC_CONDITION="Condition descending"
COM_WORKFLOW_DESC_TAB="Description"
Expand All @@ -36,7 +36,7 @@ COM_WORKFLOW_ITEM_UNSET_DEFAULT="Item uset default"
COM_WORKFLOW_LIST_LIMIT="Limit output"
COM_WORKFLOW_LIST_LIMIT_DESC="You can limit list of items"
COM_WORKFLOW_MANAGE="manage"
COM_WORKFLOW_MODIFICATION_DATE="Modified Date"
COM_WORKFLOW_DATE_MODIFIED="Modified Date"
COM_WORKFLOW_MODIFIED_AT_ASC="Modified Date ascending"
COM_WORKFLOW_MODIFIED_AT_DESC="Modified Date descending"
COM_WORKFLOW_MODIFIED_DESC="When item was modificated"
Expand Down

0 comments on commit 63380cd

Please sign in to comment.