Completed
Push — master ( c2bc12...ef5bc2 )
by Dmitry
04:55
created

src/views/plan/index.php (1 issue)

duplicate/similar code.

Duplication Informational

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
use hipanel\modules\finance\grid\PlanGridView;
4
use hipanel\widgets\IndexPage;
5
use hipanel\widgets\Pjax;
6
use yii\helpers\Html;
7
8
$this->title = Yii::t('hipanel:finance', 'Tariff plans');
9
$this->params['breadcrumbs'][] = $this->title;
10
11
?>
12
13
<?php Pjax::begin(array_merge(Yii::$app->params['pjax'], ['enablePushState' => true])) ?>
14
    <?php $page = IndexPage::begin(compact('model', 'dataProvider')) ?>
15
16
        <?php $page->setSearchFormData([]) ?>
17
18
        <?php $page->beginContent('main-actions') ?>
19 View Code Duplication
            <?php if (Yii::$app->user->can('plan.create')) : ?>
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
20
                <?= Html::a(Yii::t('hipanel', 'Create'), ['/finance/plan/create'], ['class' => 'btn btn-sm btn-success']) ?>
21
            <?php endif ?>
22
        <?php $page->endContent() ?>
23
24
        <?php $page->beginContent('sorter-actions') ?>
25
            <?= $page->renderSorter(['attributes' => ['id']]) ?>
26
        <?php $page->endContent() ?>
27
28
        <?php $page->beginContent('bulk-actions') ?>
29
            <?php if (Yii::$app->user->can('plan.create')) : ?>
30
                <?= $page->renderBulkButton('@plan/restore', Yii::t('hipanel.finance.plan', 'Restore')) ?>
31
            <?php endif ?>
32
            <?php if (Yii::$app->user->can('plan.update')) : ?>
33
                <?= $page->renderBulkDeleteButton('@plan/delete') ?>
34
            <?php endif ?>
35
        <?php $page->endContent() ?>
36
37
        <?php $page->beginContent('table') ?>
38
            <?php $page->beginBulkForm() ?>
39
                <?= PlanGridView::widget([
40
                    'boxed' => false,
41
                    'dataProvider' => $dataProvider,
42
                    'filterModel' => $model,
43
                    'columns' => [
44
                        'checkbox',
45
                        'actions',
46
                        'name',
47
                        'client',
48
                        'type',
49
                        'state',
50
                    ],
51
                ]) ?>
52
            <?php $page->endBulkForm() ?>
53
        <?php $page->endContent() ?>
54
    <?php $page->end() ?>
55
<?php Pjax::end() ?>
56