Skip to content

Commit

Permalink
forced date dropper, SQL strict mode fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
simialbi committed Oct 19, 2021
1 parent b87c32c commit f3bdf66
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 115 deletions.
12 changes: 4 additions & 8 deletions src/controllers/BucketController.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,8 @@ public function actionViewAssignee($boardId, $id = null)
->alias('t')
->distinct(true)
->joinWith('assignments u')
->joinWith('checklistElements')
->joinWith('comments co')
->innerJoinWith('bucket b')
->with(['attachments', 'links'])
->with(['attachments', 'links', 'assignments', 'checklistElements', 'comments'])
->where(['not', ['{{t}}.[[status]]' => Task::STATUS_DONE]])
->andWhere([
'{{b}}.[[board_id]]' => $boardId,
Expand All @@ -144,7 +142,7 @@ public function actionViewAssignee($boardId, $id = null)
'finishedTasks' => $query->where(['{{t}}.[[status]]' => Task::STATUS_DONE])->andWhere([
'{{b}}.[[board_id]]' => $boardId,
'{{u}}.[[user_id]]' => $id
])->count('id')
])->count()
]);
}

Expand All @@ -161,10 +159,8 @@ public function actionViewAssigneeFinished($boardId, $id = null)
->alias('t')
->distinct(true)
->joinWith('assignments u')
->joinWith('checklistElements')
->joinWith('comments co')
->innerJoinWith('bucket b')
->with(['attachments', 'links'])
->with(['attachments', 'links', 'assignments', 'checklistElements', 'comments'])
->where(['{{t}}.[[status]]' => Task::STATUS_DONE])
->andWhere([
'{{b}}.[[board_id]]' => $boardId,
Expand Down Expand Up @@ -193,7 +189,7 @@ public function actionViewStatus($boardId, $status, $readonly = false)
{
$query = Task::find()
->alias('t')
->distinct(true)
// ->distinct(true)
->joinWith('assignments u')
->joinWith('checklistElements')
->joinWith('comments co')
Expand Down
1 change: 0 additions & 1 deletion src/models/Board.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ public static function findByUserId($id = null)
}

$query = static::find()
->distinct(true)
->cache(60)
->alias('b')
->joinWith('assignments ba', false)
Expand Down
216 changes: 110 additions & 106 deletions src/views/monitoring/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use simialbi\yii2\turbo\Frame;
use yii\bootstrap4\Html;
use yii\helpers\ArrayHelper;
use yii\widgets\Pjax;

/* @var $this \yii\web\View */
/* @var $searchModel \simialbi\yii2\kanban\models\SearchMonitoringList */
Expand All @@ -19,121 +18,126 @@
]);

?>

<div class="kanban-monitoring-index">
<?= GridView::widget([
'filterModel' => $searchModel,
'dataProvider' => $dataProvider,
'pjax' => true,
'bordered' => false,
'export' => false,
'toolbar' => [
[
'content' => Html::a(FAS::i('plus'), ['monitoring/create'], [
'class' => ['btn', 'btn-success'],
'data' => [
'toggle' => 'modal',
'pjax' => '0',
'target' => '#taskModal'
<div class="kanban-monitoring-index">
<?= GridView::widget([
'filterModel' => $searchModel,
'dataProvider' => $dataProvider,
'pjax' => true,
'pjaxSettings' => [
'options' => [
'enablePushState' => false,
'clientOptions' => [
'skipOuterContainers' => true
]
])
]
],
'options' => [
'id' => 'monitoringPanel'
],
'panel' => [
'heading' => '',
'type' => 'light',
'before' => '{summary}',
'options' => [
'class' => ['rounded-0', 'mb-5', 'border-top-0']
]
],
],
'panelTemplate' => '{panelBefore}{items}{panelFooter}',
'columns' => [
['class' => '\kartik\grid\SerialColumn'],
[
'class' => '\kartik\grid\DataColumn',
'attribute' => 'name',
'vAlign' => GridView::ALIGN_MIDDLE
],
[
'class' => '\kartik\grid\DataColumn',
'attribute' => 'member_id',
'value' => function ($model) {
/** @var $model \simialbi\yii2\kanban\models\MonitoringList */
return implode(', ', ArrayHelper::getColumn($model->members, 'user.name'));
},
'filter' => $users,
'filterType' => GridView::FILTER_SELECT2,
'filterWidgetOptions' => [
'options' => ['placeholder' => '', 'multiple' => true],
'pluginOptions' => ['allowClear' => true]
],
'vAlign' => GridView::ALIGN_MIDDLE
'bordered' => false,
'export' => false,
'toolbar' => [
[
'content' => Html::a(FAS::i('plus'), ['monitoring/create'], [
'class' => ['btn', 'btn-success'],
'data' => [
'toggle' => 'modal',
'pjax' => '0',
'target' => '#taskModal'
]
])
]
],
[
'class' => '\kartik\grid\DataColumn',
'format' => 'datetime',
'attribute' => 'created_at',
'filterType' => GridView::FILTER_DATE,
'filterWidgetOptions' => [
'pickerButton' => '<span class="input-group-text kv-date-picker">' . FAS::i('calendar-alt') . '</span>',
'removeButton' => false,
'pluginOptions' => [
'format' => 'dd.mm.yyyy',
'todayHighlight' => true
]
],
'vAlign' => GridView::ALIGN_MIDDLE
'options' => [
'id' => 'monitoringPanel'
],
[
'class' => '\kartik\grid\DataColumn',
'format' => 'datetime',
'attribute' => 'updated_at',
'filterType' => GridView::FILTER_DATE,
'filterWidgetOptions' => [
'pickerButton' => '<span class="input-group-text kv-date-picker">' . FAS::i('calendar-alt') . '</span>',
'removeButton' => false,
'pluginOptions' => [
'format' => 'dd.mm.yyyy',
'todayHighlight' => true
]
'panel' => [
'heading' => '',
'type' => 'light',
'before' => '{summary}',
'options' => [
'class' => ['rounded-0', 'mb-5', 'border-top-0']
],
'vAlign' => GridView::ALIGN_MIDDLE
],
[
'class' => '\kartik\grid\ActionColumn',
'template' => '{view} {update} {delete} {csv}',
'viewOptions' => [
'icon' => (string)FAS::i('eye')
'panelTemplate' => '{panelBefore}{items}{panelFooter}',
'columns' => [
['class' => '\kartik\grid\SerialColumn'],
[
'class' => '\kartik\grid\DataColumn',
'attribute' => 'name',
'vAlign' => GridView::ALIGN_MIDDLE
],
'updateOptions' => [
'icon' => (string)FAS::i('pencil-alt'),
'data' => [
'toggle' => 'modal',
'pjax' => '0',
'target' => '#taskModal'
]
[
'class' => '\kartik\grid\DataColumn',
'attribute' => 'member_id',
'value' => function ($model) {
/** @var $model \simialbi\yii2\kanban\models\MonitoringList */
return implode(', ', ArrayHelper::getColumn($model->members, 'user.name'));
},
'filter' => $users,
'filterType' => GridView::FILTER_SELECT2,
'filterWidgetOptions' => [
'options' => ['placeholder' => '', 'multiple' => true],
'pluginOptions' => ['allowClear' => true]
],
'vAlign' => GridView::ALIGN_MIDDLE
],
'deleteOptions' => [
'icon' => (string)FAS::i('trash-alt')
[
'class' => '\kartik\grid\DataColumn',
'format' => 'datetime',
'attribute' => 'created_at',
'filterType' => '\simialbi\yii2\datedropper\Datedropper',
'filterWidgetOptions' => [
'clientOptions' => [
'format' => 'd.m.Y',
'large' => true,
'autofill' => false
]
],
'vAlign' => GridView::ALIGN_MIDDLE
],
'buttons' => [
'csv' => function ($url) {
return Html::a(FAS::i('file-csv'), $url, [
'target' => '_blank',
'data' => [
'pjax' => '0'
]
]);
}
[
'class' => '\kartik\grid\DataColumn',
'format' => 'datetime',
'attribute' => 'updated_at',
'filterType' => '\simialbi\yii2\datedropper\Datedropper',
'filterWidgetOptions' => [
'clientOptions' => [
'format' => 'd.m.Y',
'large' => true,
'autofill' => false
]
],
'vAlign' => GridView::ALIGN_MIDDLE
],
'width' => '120px'
[
'class' => '\kartik\grid\ActionColumn',
'template' => '{view} {update} {delete} {csv}',
'viewOptions' => [
'icon' => (string)FAS::i('eye')
],
'updateOptions' => [
'icon' => (string)FAS::i('pencil-alt'),
'data' => [
'toggle' => 'modal',
'pjax' => '0',
'target' => '#taskModal'
]
],
'deleteOptions' => [
'icon' => (string)FAS::i('trash-alt')
],
'buttons' => [
'csv' => function ($url) {
return Html::a(FAS::i('file-csv'), $url, [
'target' => '_blank',
'data' => [
'pjax' => '0'
]
]);
}
],
'width' => '120px'
]
]
]
]); ?>
</div>
]); ?>
</div>
<?php
Frame::end();

0 comments on commit f3bdf66

Please sign in to comment.