Skip to content

Commit

Permalink
Merge branch '4.0-dev' into 4.0-dev-fix-todo
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonge committed Feb 5, 2019
2 parents 4749bb1 + e6726e7 commit 06d085d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
5 changes: 5 additions & 0 deletions administrator/components/com_fields/Table/FieldTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ public function check()
$this->created_time = $date->toSql();
}

if (!(int) $this->modified_time)
{
$this->modified_time = $date->toSql();
}

if (empty($this->created_user_id))
{
$this->created_user_id = $user->get('id');
Expand Down
10 changes: 7 additions & 3 deletions administrator/components/com_workflow/View/Stages/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,14 @@ protected function addToolbar()
ToolbarHelper::addNew('stage.add');
}

if ($canDo->get('core.edit.state') && !$isCore)
if ($canDo->get('core.edit.state'))
{
ToolbarHelper::publishList('stages.publish');
ToolbarHelper::unpublishList('stages.unpublish');
if (!$isCore)
{
ToolbarHelper::publishList('stages.publish');
ToolbarHelper::unpublishList('stages.unpublish');
}

ToolbarHelper::makeDefault('stages.setDefault', 'COM_WORKFLOW_TOOLBAR_DEFAULT');
}

Expand Down
8 changes: 4 additions & 4 deletions administrator/components/com_workflow/tmpl/stages/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@
<?php foreach ($this->stages as $i => $item):
$edit = Route::_('index.php?option=com_workflow&task=stage.edit&id=' . $item->id . '&workflow_id=' . (int) $this->workflowID . '&extension=' . $this->extension);

$canEdit = $user->authorise('core.edit', $this->extension . '.stage.' . $item->id) && !$isCore;
$canEdit = $user->authorise('core.edit', $this->extension . '.stage.' . $item->id);
// @TODO set proper checkin fields
$canCheckin = true || $user->authorise('core.admin', 'com_checkin') || $item->checked_out == $userId || $item->checked_out == 0;
$canChange = $user->authorise('core.edit.stage', $this->extension . '.stage.' . $item->id) && $canCheckin && !$isCore;
$canChange = $user->authorise('core.edit.stage', $this->extension . '.stage.' . $item->id) && $canCheckin;
?>
<tr class="row<?php echo $i % 2; ?>">
<td class="order text-center hidden-sm-down">
Expand All @@ -118,14 +118,14 @@
</td>
<td class="text-center">
<div class="btn-group">
<?php echo HTMLHelper::_('jgrid.published', $item->published, $i, 'stages.', $canChange); ?>
<?php echo HTMLHelper::_('jgrid.published', $item->published, $i, 'stages.', $canChange && !$isCore); ?>
</div>
</td>
<td class="text-center">
<?php echo HTMLHelper::_('jgrid.isdefault', $item->default, $i, 'stages.', $canChange); ?>
</td>
<th scope="row">
<?php if ($canEdit) : ?>
<?php if ($canEdit && !$isCore) : ?>
<?php $editIcon = '<span class="fa fa-pencil-square mr-2" aria-hidden="true"></span>'; ?>
<a href="<?php echo $edit; ?>" title="<?php echo Text::_('JACTION_EDIT'); ?> <?php echo $this->escape(addslashes(Text::_($item->title))); ?>">
<?php echo $editIcon; ?><?php echo $this->escape(Text::_($item->title)); ?>
Expand Down
10 changes: 5 additions & 5 deletions administrator/components/com_workflow/tmpl/workflows/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@
$edit = Route::_('index.php?option=com_workflow&task=workflow.edit&id=' . $item->id . '&extension=' . $extension);

$isCore = !empty($item->core);
$canEdit = $user->authorise('core.edit', $extension . '.workflow.' . $item->id) && !$isCore;
$canEdit = $user->authorise('core.edit', $extension . '.workflow.' . $item->id);
// @TODO set proper checkin fields
$canCheckin = true || $user->authorise('core.admin', 'com_checkin') || $item->checked_out == $userId || $item->checked_out == 0;
$canEditOwn = $user->authorise('core.edit.own', $extension . '.workflow.' . $item->id) && $item->created_by == $userId && !$isCore;
$canChange = $user->authorise('core.edit.state', $extension . '.workflow.' . $item->id) && $canCheckin && !$isCore;
$canEditOwn = $user->authorise('core.edit.own', $extension . '.workflow.' . $item->id) && $item->created_by == $userId;
$canChange = $user->authorise('core.edit.state', $extension . '.workflow.' . $item->id) && $canCheckin;
?>
<tr class="row<?php echo $i % 2; ?>" data-dragable-group="0">
<td class="order text-center hidden-sm-down">
Expand All @@ -133,11 +133,11 @@
</td>
<td class="text-center">
<div class="btn-group">
<?php echo HTMLHelper::_('jgrid.published', $item->published, $i, 'workflows.', $canChange); ?>
<?php echo HTMLHelper::_('jgrid.published', $item->published, $i, 'workflows.', $canChange && !$isCore); ?>
</div>
</td>
<th scope="row">
<?php if ($canEdit || $canEditOwn) : ?>
<?php if (!$isCore && ($canEdit || $canEditOwn)) : ?>
<?php $editIcon = '<span class="fa fa-pencil-square mr-2" aria-hidden="true"></span>'; ?>
<a href="<?php echo $edit; ?>" title="<?php echo Text::_('JACTION_EDIT', true); ?> <?php echo Text::_($item->title, true); ?>">
<?php echo $editIcon; ?><?php echo $this->escape(Text::_($item->title)); ?>
Expand Down

0 comments on commit 06d085d

Please sign in to comment.