Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
Added trigger RENDER-ACTION-BUTTONS-DOCUMENT for DOCUMENT view
Browse files Browse the repository at this point in the history
  • Loading branch information
githubjeka committed Jun 18, 2018
1 parent 700a1fa commit 524d3e7
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions views/document/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,15 @@
<div class="panel">
<div class="panel-heading">
<?= \tracker\widgets\BackBtn::widget(['alternativeUrl' => ['index']]) ?>
<?php if ((int)$model->created_by === (int)Yii::$app->user->id) : ?>
<div class="pull-right">
<div class="pull-right">
<?= $this->trigger(
'RENDER-ACTION-BUTTONS-DOCUMENT',
new \yii\base\Event([
'sender' => $model,
'data' => []
])
) ?>
<?php if ((int)$model->created_by === (int)Yii::$app->user->id) : ?>
<?php $url = Url::to([
'/' . Module::getIdentifier() . '/document/add-file',
'id' => $model->id,
Expand All @@ -45,8 +52,8 @@
<a href="<?= $url; ?>" class="btn btn-primary btn-sm text-uppercase" data-target="#globalModal">
<i class="fa fa-pencil"></i> <?= Yii::t('TrackerIssuesModule.views', 'Change info'); ?>
</a>
</div>
<?php endif; ?>
<?php endif; ?>
</div>
<h1 class="panel-title text-center">
<?= \tracker\widgets\DocumentCategoryLabel::widget(['category' => $model->categoryModel]) ?>
</h1>
Expand Down Expand Up @@ -202,6 +209,7 @@ class="img-rounded tt img_margin"
\tracker\models\Issue::tableName() . '.id = child_id'
)
->andWhere('parent_id IS NULL')
->orderBy([\tracker\models\Issue::tableName() . '.deadline' => SORT_ASC])
->all();
?>
<?php if (count($issues) > 0) : ?>
Expand All @@ -219,8 +227,17 @@ function subtaskRender(\tracker\models\Issue $issue, \yii\i18n\Formatter $format
echo Yii::t('TrackerIssuesModule.views', 'constantly');
echo Html::endTag('span');
}
echo '&nbsp;';
echo $formatter->asDate($issue->content->created_at);

if ($issue->deadline) {
echo '&nbsp;';
echo Html::beginTag('span', [
'data-toggle' => 'tooltip',
'title' => Yii::t('TrackerIssuesModule.views', 'Deadline')
]);
echo $formatter->asDate($issue->deadline);
echo Html::endTag('span');
}

echo '&nbsp;';
$user = $issue->content->getCreatedBy()->one();
$createrImage = \humhub\modules\user\widgets\Image::widget([
Expand Down

0 comments on commit 524d3e7

Please sign in to comment.