@@ -60,12 +64,40 @@
*/ ?>
+ watchers)) : ?>
+ = Html::tag('p', 'Watchers', ['class' => 'lead', 'style' => 'border-bottom: 1px solid #E1E1E1; margin-bottom: 0.5em;s']); ?>
+
+ watchers as $watcherId => $watcher) : ?>
+ Url::toRoute(['/client/client/view', 'id' => $watcherId]),
+ ]);
+ print Gravatar::widget([
+ 'emailHash' => $watcherEmailHash,
+ 'defaultImage' => 'identicon',
+ 'options' => [
+ 'alt' => reset($piece),
+ 'class' => '',
+ 'title' => reset($piece)
+ ],
+ 'size' => 32,
+ ]);
+ print Html::endTag('a');
+ }
+ ?>
+
+
+
beginFooter(); ?>
- watcher) && in_array(Yii::$app->user->identity->username, $model->watcher)) : ?>
- = Html::a('
'.Yii::t('app', 'Unsubscribe'), ['unsubscribe', 'id' => $model->id], ['class' => 'btn btn-default btn-block']) ?>
+ watchers) && array_key_exists(Yii::$app->user->identity->id, $model->watchers)) : ?>
+ = Html::a('
' . Yii::t('app', 'Unsubscribe'), ['unsubscribe', 'id' => $model->id], ['class' => 'btn btn-default btn-block']) ?>
- = Html::a('
'.Yii::t('app', 'Subscribe'), ['subscribe', 'id' => $model->id], ['class' => 'btn btn-default btn-block']) ?>
+ = Html::a('
' . Yii::t('app', 'Subscribe'), ['subscribe', 'id' => $model->id], ['class' => 'btn btn-default btn-block']) ?>
+
endFooter(); ?>
@@ -110,42 +142,42 @@
]); ?>
- = Gravatar::widget([
- 'emailHash' => $model->author_email,
- 'defaultImage' => 'identicon',
- 'options' => [
- 'alt' => '',
- 'class' => 'img-circle',
- ],
- 'size' => 160,
- ]); ?>
+ author_email) {
+ print Gravatar::widget([
+ 'emailHash' => $model->author_email,
+ 'defaultImage' => 'identicon',
+ 'options' => [
+ 'alt' => '',
+ 'class' => 'img-circle',
+ ],
+ 'size' => 160,
+ ]);
+ }
+ ?>
= Html::tag('div', $model->author, ['class' => 'profile-user-name']); ?>
= Html::tag('div', $model->author_seller, ['class' => 'profile-user-role']); ?>
beginFooter(); ?>
= DetailView::widget([
- 'model' => $model,
+ 'model' => $client,
'attributes' => [
// 'subject',
[
- 'attribute'=>'state',
- 'format'=>'html',
- 'value'=>Label::widget([
- 'type'=>'state',
- 'label'=> Re::l($model->state_label),
- 'value'=>$model->state,
- ]),
+ 'attribute' => 'state',
+ 'format' => 'html',
+ 'value' => Html::tag('span', $client['state'], ['class' => 'label label-default'])
],
[
- 'attribute' => 'topics',
- 'format'=>'html',
+ 'attribute' => 'balance',
+ 'format' => 'html',
'value' => Topic::widget(['topics' => $model->topics]),
'visible' => $model->topics != null,
],
[
- 'attribute'=>'priority',
- 'format'=>'html',
+ 'attribute' => 'credit',
+ 'format' => 'html',
'value'=> Label::widget([
'type'=>'priority',
'label'=> Re::l($model->priority_label),
@@ -153,27 +185,64 @@
])
],
[
- 'attribute'=>'author',
- 'format'=>'html',
- 'value'=>Html::a($model->author,['/client/client/view','id'=>$model->author_id]),
- ],
- [
- 'attribute'=>'responsible',
- 'format'=>'html',
- 'value'=>Html::a($model->responsible,['/client/client/view','id'=>$model->responsible_id]),
- 'visible'=> $model->responsible != null,
- ],
- [
- 'attribute'=>'recipient',
- 'format'=>'html',
- 'value'=>Html::a($model->recipient,['/client/client/view','id'=>$model->recipient_id]),
+ 'attribute' => 'contact',
+ 'label' => Yii::t('app', 'Country'),
+ 'format' => 'html',
+ 'value' => Html::tag('span', '', ['class' => 'flag-icon flag-icon-' . $client['contact']['country']]) . ' ' . $client['contact']['country_name']
],
[
- 'attribute'=>'watcher',
- 'format'=>'html',
- // 'value'=> Watcher::widget(['watchers'=>$model->watcher]),
- 'visible'=> is_array($model->watcher)
+ 'attribute' => 'contact',
+ 'label' => Yii::t('app', 'Email'),
+ 'format' => 'html',
+ 'value' => Html::mailto($client['contact']['email'], $client['contact']['email'])
],
+// // 'subject',
+// [
+// 'attribute'=>'state',
+// 'format'=>'html',
+// 'value'=>Label::widget([
+// 'type'=>'state',
+// 'label'=> Re::l($model->state_label),
+// 'value'=>$model->state,
+// ]),
+// ],
+// [
+// 'attribute' => 'topics',
+// 'format'=>'html',
+// 'value' => Topic::widget(['topics' => $model->topics]),
+// 'visible' => $model->topics != null,
+// ],
+// [
+// 'attribute'=>'priority',
+// 'format'=>'html',
+// 'value'=> Label::widget([
+// 'type'=>'priority',
+// 'label'=> Re::l($model->priority_label),
+// 'value'=>$model->priority,
+// ])
+// ],
+// [
+// 'attribute'=>'author',
+// 'format'=>'html',
+// 'value'=>Html::a($model->author,['/client/client/view','id'=>$model->author_id]),
+// ],
+// [
+// 'attribute'=>'responsible',
+// 'format'=>'html',
+// 'value'=>Html::a($model->responsible,['/client/client/view','id'=>$model->responsible_id]),
+// 'visible'=> $model->responsible != null,
+// ],
+// [
+// 'attribute'=>'recipient',
+// 'format'=>'html',
+// 'value'=>Html::a($model->recipient,['/client/client/view','id'=>$model->recipient_id]),
+// ],
+// [
+// 'attribute'=>'watcher',
+// 'format'=>'html',
+// // 'value'=> Watcher::widget(['watchers'=>$model->watcher]),
+// 'visible'=> is_array($model->watcher)
+// ],
],
]); ?>
endFooter(); ?>
diff --git a/views/ticket/index.php b/views/ticket/index.php
index df8b055..52c32ee 100644
--- a/views/ticket/index.php
+++ b/views/ticket/index.php
@@ -7,12 +7,13 @@
use hipanel\widgets\Gravatar;
use hipanel\grid\ActionColumn;
-use hipanel\grid\BoxedGridView;
+use hipanel\grid\GridView;
use hipanel\widgets\ActionBox;
use hipanel\widgets\Select2;
use hipanel\modules\ticket\widgets\Topic;
use yii\helpers\Html;
use yii\helpers\Url;
+use hipanel\widgets\Box;
$this->title = Yii::t('app', 'Tickets');
$this->params['breadcrumbs'][] = $this->title;
@@ -69,8 +70,27 @@
]); ?>
-= BoxedGridView::widget([
- 'boxOptions' => ['options' => ['class' => 'box-primary']],
+ false, 'options' => ['class' => 'box-primary']]); ?>
+beginHeader(); ?>
+= $box->renderTitle(' '); ?>
+beginTools(); ?>
+
+= \hipanel\widgets\GridViewSortTool::widget([
+ 'sort' => $sort,
+ 'sortNames' => [
+ 'create_time',
+ 'lastanswer',
+ 'time',
+ 'subject',
+ 'spent',
+ 'author',
+ 'rescipient',
+ ]
+]); ?>
+
+endTools(); ?>
+beginBody(); ?>
+= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'id' => 'ticket-grid',
@@ -294,4 +314,7 @@
],
'checkbox',
],
-]); ?>
\ No newline at end of file
+]); ?>
+endBody(); ?>
+endHeader(); ?>
+
\ No newline at end of file
diff --git a/views/ticket/view.php b/views/ticket/view.php
index e33b499..5cf48fa 100644
--- a/views/ticket/view.php
+++ b/views/ticket/view.php
@@ -20,6 +20,7 @@
margin: 1rem;
}
');
+//\yii\helpers\VarDumper::dump($model, 10, true);
?>
render('_leftBlock', [
'model' => $model,
'form' => $form,
+ 'client' => $client,
'topic_data' => $topic_data,
'state_data' => $state_data,
'priority_data' => $priority_data,