echo " with id <b>" . $model->remote_id . "</b>"; } ?> </div> <div class="col-md-3 col-lg-3"> that has a priority of <b><?php echo !empty($model->priority) ? $model->setting('priorities.' . $model->priority) : 'Normal'; ?> </b> </div> <div class="col-md-2 col-lg-2"> alert me using <b><?php echo $model->methods; ?> </b> </div> <div class="col-md-2 col-lg-2"> <?php echo \nitm\widgets\modal\Modal::widget(['size' => 'large', 'toggleButton' => ['tag' => 'a', 'class' => 'btn btn-info', 'label' => Icon::forAction('update'), 'href' => \Yii::$app->urlManager->createUrl(['/alerts/form/update/' . $model->getId(), '__format' => 'modal']), 'title' => Yii::t('yii', 'Update '), 'role' => 'updateAlert']]); ?> <?php echo Html::a(Icon::forAction('delete'), '#', ['class' => 'btn btn-danger', 'role' => 'removeAlert', 'data-action' => '/alerts/delete/' . $model->getId(), 'data-parent' => "#alert" . $model->getId()]); ?> </div> </div> <?php if (!isset($notAsListItem)) { ?> </li> <?php }
</p> <p> <?php echo $filterButton; ?> </p> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['id', ['format' => 'raw', 'attribute' => 'parent_ids', 'value' => function ($model) { return $model->url('parent_ids', [$model->parent(), 'name']); $select2 = \nitm\widgets\metadata\ParentListInput::widget(['model' => $model, 'name' => 'parent_id_autocomplete', 'data' => [['id' => $model->parent()->getId(), 'text' => $model->parent()->name]], 'options' => ['multiple' => false, 'class' => 'form-control', 'id' => 'categories_parent' . $model->getId(), 'role' => 'autocompleteSelect', 'data-real-input' => "#categories-parent_ids" . $model->getId()], 'url' => '/api/autocomplete/category/true']); $input = Html::hiddenInput('parent_ids', $model->parent()->getId(), ['title' => $model->parent()->name, 'id' => 'categories-parent_ids' . $model->getId()]); return $select2; }], 'name', 'slug', ['class' => 'yii\\grid\\ActionColumn', 'template' => '{view} {form/update} {disable}', 'buttons' => ['form/update' => function ($url, $model) { return \nitm\widgets\modal\Modal::widget(['toggleButton' => ['tag' => 'a', 'label' => Icon::forAction('update'), 'href' => \Yii::$app->urlManager->createUrl([$url, '__format' => 'modal']), 'title' => Yii::t('yii', 'Edit '), 'role' => 'disabledOnClose', 'data-pjax' => 0, 'class' => $model->disabled ? 'hidden' : '']]); }, 'view' => function ($url, $model) { return \nitm\widgets\modal\Modal::widget(['size' => 'large', 'toggleButton' => ['tag' => 'a', 'label' => Icon::forAction('view'), 'href' => \Yii::$app->urlManager->createUrl([$url, '__format' => 'modal']), 'title' => Yii::t('yii', 'View ' . $model->name), 'role' => 'disabledOnClose', 'data-pjax' => 0, 'class' => $model->disabled ? 'hidden' : '']]); }, 'disable' => function ($url, $model) { return Html::a(Icon::forAction('disable', 'disabled', $model), $url, ['title' => Yii::t('yii', 'Disable category: ' . $model->name), 'role' => 'metaAction disableAction', 'data-parent' => '#' . $model->isWhat() . $model->getId(), 'data-pjax' => 0, 'data-method' => 'post']); }], "urlCreator" => function ($action, $model) { $csrfVar = \Yii::$app->request->csrfParam; $csrfToken = \Yii::$app->request->getCsrfToken(); $params = ["/" . $model->isWhat() . '/' . $action . "/" . $model->id]; return \yii\helpers\Url::toRoute($params); }]], 'options' => ['id' => 'categories'], 'rowOptions' => function ($model, $key, $index, $grid) { return ["class" => 'item']; }, 'pager' => ['class' => \nitm\widgets\ias\ScrollPager::className(), 'overflowContainer' => '.content', 'container' => '#categories', 'item' => ".item", 'negativeMargin' => 150, 'delay' => 500]]); ?> </div>
protected function getAsGrid() { return GridView::widget(['dataProvider' => new \yii\data\ArrayDataProvider(['allModels' => $this->items]), 'options' => ['role' => 'metadata', 'id' => 'metadata' . $this->uniqid, 'role' => 'statusIndicator' . $this->uniqid], 'showHeader' => false, 'showFooter' => false, 'summary' => false, 'layout' => "{items}", 'columns' => array_merge($this->attributes, [['class' => 'yii\\grid\\ActionColumn', 'buttons' => ['form/update-metadata' => function ($url, $model) { return \nitm\widgets\modal\Modal::widget(['toggleButton' => ['tag' => 'a', 'label' => Icon::forAction('pencil'), 'href' => \Yii::$app->urlManager->createUrl([$url, '__format' => 'modal']), 'title' => \Yii::t('yii', 'Edit '), 'role' => 'dynamicAction updateAction disabledOnClose']]); }, 'delete-metadata' => function ($url, $model) { return Html::a(Icon::forAction('delete'), \Yii::$app->urlManager->createUrl([$url]), ['title' => \Yii::t('yii', 'Delete Metadata'), 'role' => 'metaAction deleteAction', 'data-depth' => 0, 'data-parent' => 'tr', 'data-pjax' => '0', 'data-force' => 1]); }], 'template' => "{form/update-metadata} {delete-metadata}", 'urlCreator' => function ($action, $model, $key, $index) { return (!MetadataInfo::$controllerRoute ? $model->isWhat() : MetadataInfo::$controllerRoute) . '/' . $action . '/' . $model->getId(); }, 'options' => ['rowspan' => 2, 'class' => 'col-md-1 col-lg-1']]])]); }
}], ['sortLinkOptions' => ['data-pjax' => 1], 'attribute' => 'rating', 'label' => '%', 'format' => 'raw', 'value' => function ($model, $index, $widget) { return $this->context->voteWidget(['size' => 'large', 'model' => $model->voteModel(), 'parentType' => $model->isWhat(), 'parentId' => $model->getId()]); }, 'options' => ['rowspan' => 3]], ['sortLinkOptions' => ['data-pjax' => 1], 'format' => 'raw', 'attribute' => 'type_id', 'label' => 'Type', 'value' => function ($model) { return $model->url('type_id', [$model->typeOf(), 'name']); }], ['sortLinkOptions' => ['data-pjax' => 1], 'format' => 'raw', 'attribute' => 'request_for_id', 'label' => 'Request For', 'value' => function ($model) { return $model->url('request_for_id', [$model->requestFor(), 'name']); }], ['sortLinkOptions' => ['data-pjax' => 1], 'format' => 'raw', 'attribute' => 'status', 'label' => 'Urgency', 'value' => function ($model, $index, $widget) { return $model->url('status', $model->getUrgency()); }, 'contentOptions' => ['class' => 'visible-lg visible-md'], 'headerOptions' => ['class' => 'visible-lg visible-md']], ['sortLinkOptions' => ['data-pjax' => 1], 'attribute' => 'author_id', 'label' => 'Author', 'format' => 'raw', 'value' => function ($model, $index, $widget) { return $model->author()->url(\Yii::$app->getModule('nitm')->useFullnames, \Yii::$app->request->url, [$model->formname() . '[author]' => $model->author_id]); }], ['sortLinkOptions' => ['data-pjax' => 1], 'attribute' => 'created_at', 'format' => 'datetime', 'contentOptions' => ['class' => 'visible-lg visible-md'], 'headerOptions' => ['class' => 'visible-lg visible-md']], ['class' => 'yii\\grid\\ActionColumn', 'buttons' => ['form/update' => function ($url, $model) { return \nitm\widgets\modal\Modal::widget(['size' => 'x-large', 'toggleButton' => ['tag' => 'a', 'label' => Icon::forAction('update'), 'href' => \Yii::$app->urlManager->createUrl([$url, '__format' => 'modal']), 'title' => Yii::t('yii', 'Edit '), 'class' => 'fa-2x', 'role' => 'dynamicAction updateAction disabledOnClose'], 'contentOptions' => ["class" => "modal-full"], 'dialogOptions' => ["class" => "modal-full"]]); }, 'close' => function ($url, $model) { return Html::a(Icon::forAction('close', 'closed', $model), \Yii::$app->urlManager->createUrl([$url]), ['title' => Yii::t('yii', ($model->closed ? 'Open' : 'Close') . ' ' . $model->title), 'role' => 'metaAction closeAction', 'class' => 'fa-2x', 'data-parent' => 'tr', 'data-pjax' => '0']); }, 'complete' => function ($url, $model) { return Html::a(Icon::forAction('complete', 'completed', $model), \Yii::$app->urlManager->createUrl([$url]), ['title' => Yii::t('yii', ($model->completed ? 'Incomplete' : 'Complete') . ' ' . $model->title), 'role' => 'metaAction resolveAction disabledOnClose', 'class' => 'fa-2x', 'data-parent' => 'tr', 'data-pjax' => '0']); }], 'template' => "{form/update} {complete} {close}", 'urlCreator' => function ($action, $model, $key, $index) { return '/' . $model->isWhat() . '/' . $action . '/' . $model->getId(); }, 'options' => ['rowspan' => 3]]], 'tableOptions' => ['class' => 'table'], 'rowOptions' => function ($model, $key, $index, $grid) { return ["class" => 'item ' . \nitm\helpers\Statuses::getIndicator($model->getStatus()), "style" => "border-top:solid medium #CCC", 'id' => 'request' . $model->getId(), 'role' => 'statusIndicator' . $model->getId()]; }, 'afterRow' => function ($model, $key, $index, $grid) { $replies = $this->context->replyCountWidget(["model" => $model->replyModel(), 'fullDetails' => false]); $revisions = $this->context->revisionsCountWidget(['model' => $model->revisionModel(), "parentId" => $model->getId(), "parentType" => $model->isWhat(), 'fullDetails' => false]); $issues = $this->context->issueCountWidget(['model' => $model->issueModel(), 'enableComments' => true, "parentId" => $model->getId(), "parentType" => $model->isWhat(), 'fullDetails' => false]); $follow = \nitm\widgets\alerts\Follow::widget(['model' => $model->followModel(), 'buttonOptions' => ['size' => 'normal']]); $title = Html::tag('h4', $model->title); $activityInfo = Html::tag('div', Html::tag('div', $replies, ['class' => 'col-md-3 col-lg-3 center-block']) . Html::tag('div', $revisions, ['class' => 'col-md-3 col-lg-3 center-block']) . Html::tag('div', $issues, ['class' => 'col-md-3 col-lg-3 center-block']) . Html::tag('div', $follow, ['class' => 'col-md-3 col-lg-3 center-block']), ['class' => 'row']); $links = Html::tag('div', \nitm\widgets\metadata\ShortLink::widget(['label' => 'View', 'url' => \Yii::$app->urlManager->createAbsoluteUrl([$model->isWhat() . '/view/' . $model->getId()]), 'header' => $model->title, 'type' => 'modal', 'size' => 'large'])); $links .= Html::tag('div', \nitm\widgets\metadata\ShortLink::widget(['label' => 'Update', 'url' => \Yii::$app->urlManager->createAbsoluteUrl([$model->isWhat() . '/form/update/' . $model->getId()]), 'header' => $model->title, 'type' => 'modal', 'size' => 'x-large', 'modalOptions' => ['dialogOptions' => ['class' => 'modal-full']]])); $statusInfo = \nitm\widgets\metadata\StatusInfo::widget(['items' => [['blamable' => $model->editor(), 'date' => $model->updated_at, 'value' => $model->edits, 'label' => ['true' => "Updated ", 'false' => "No updates"]], ['blamable' => $model->completedBy(), 'date' => $model->completed_at, 'value' => $model->completed, 'label' => ['true' => "Completed ", 'false' => "Not completed"]], ['blamable' => $model->closedBy(), 'date' => $model->closed_at, 'value' => $model->closed, 'label' => ['true' => "Closed ", 'false' => "Not closed"]]]]); $metaInfo = Html::tag('div', Html::tag('div', implode('<br>', [$title, $statusInfo, $activityInfo, $links])), ['class' => 'wrapper']);
echo $model->closed_at; ?> </i> <?php } ?> </div> </div> <div class="col-md-4 col-lg-4 text-right"> <?php echo Html::a(Icon::forAction('close', 'closed', $model), \Yii::$app->urlManager->createUrl(['/issue/close/' . $model->id]), ['title' => Yii::t('yii', ($model->closed ? 'Open' : 'Close') . ' '), 'class' => 'fa-2x', 'role' => 'metaAction closeAction', 'data-parent' => 'tr', 'data-pjax' => '0']); echo Html::a(Icon::forAction('update', null, $model), \Yii::$app->urlManager->createUrl(['/issue/form/update/' . $model->id, Issues::COMMENT_PARAM => $enableComments, '__format' => 'html']), ['title' => Yii::t('yii', 'Edit '), 'class' => 'fa-2x' . ($model->closed ? ' hidden' : ''), 'role' => 'updateIssueTrigger disabledOnClose']); echo Html::a(Icon::forAction('resolve', 'resolved', $model), \Yii::$app->urlManager->createUrl(['/issue/resolve/' . $model->id]), ['title' => Yii::t('yii', ($model->resolved ? 'Unresolve' : 'Resolve') . ' '), 'class' => 'fa-2x' . ($model->closed ? ' hidden' : ''), 'role' => 'metaAction resolveAction disabledOnClose', 'data-parent' => 'tr', 'data-pjax' => '0']); echo Html::a(Icon::forAction('duplicate', 'duplicate', $model), \Yii::$app->urlManager->createUrl(['/issue/duplicate/' . $model->id]), ['title' => Yii::t('yii', ($model->duplicate ? 'Flag as not duplicate' : 'flag as duplicate') . ' '), 'class' => 'fa-2x', 'role' => 'metaAction duplicateAction']); if ($enableComments == true) { echo Html::a(Icon::forAction('comment', null, null, ['size' => '2x']) . ActivityIndicator::widget(['position' => 'top right', 'size' => 'small', 'text' => $repliesModel->count(), 'type' => 'info']), \Yii::$app->urlManager->createUrl(['/reply/index/' . $model->isWhat() . '/' . $model->getId(), '__format' => 'html']), ['id' => 'issue-comment-link' . $uniqid, 'title' => 'See comments for this issue', 'data-id' => '#issue-comments' . $uniqid, 'onclick' => '(function (event) {event.preventDefault(); $nitm.module("tools").visibility("#issue-comment-link' . $uniqid . '", true);})(event)']); } ?> </div> <?php if ($enableComments == true) { ?> <div class="col-lg-12 col-md-12"> <div class="clear" style="display:none;" id="issue-comments<?php echo $uniqid; ?> "> </div> </div> <?php }
/** * @var yii\web\View $this * @var app\models\search\Issues $model * @var yii\widgets\ActiveForm $form */ $uniqid = uniqid(); ?> <div class="issues-search"> <?php $form = ActiveForm::begin(['method' => 'get', "type" => ActiveForm::TYPE_VERTICAL, 'action' => \Yii::$app->urlManager->createUrl(["/issue/issues/{$parentType}/{$parentId}", Issues::COMMENT_PARAM => $enableComments, $model::SEARCH_PARAM => 1, $model::SEARCH_PARAM_BOOL => 1]), 'options' => ["role" => "searchIssue", 'id' => 'issue-search-form' . $uniqid, 'data-pjax' => 1], 'fieldConfig' => ['inputOptions' => ['class' => 'form-control input-sm'], 'template' => "{label}\n<div class=\"col-lg-12 col-md-12\">{input}</div>\n<div class=\"col-lg-12\">{error}</div>", 'labelOptions' => ['class' => 'control-label sr-only']], 'enableAjaxValidation' => true]); ?> <?php echo $form->field($model, 'text', ['addon' => ['append' => ['content' => Html::button(Icon::forAction('search'), ['class' => 'btn btn-primary btn-sm', 'data-pjax' => 1]), 'asButton' => true]]]); ?> <?php // echo $form->field($model, 'author') ?> <?php // echo $form->field($model, 'closed') ?> <?php // echo $form->field($model, 'duplicate') ?> <?php