1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
use hipanel\modules\finance\grid\DomainServicePriceGridView; |
4
|
|
|
use hipanel\modules\finance\grid\DomainZonePriceGridView; |
5
|
|
|
use hipanel\modules\finance\models\DomainServicePrice; |
6
|
|
|
use hipanel\modules\finance\widgets\CreatePricesButton; |
7
|
|
|
use hipanel\widgets\IndexPage; |
8
|
|
|
use yii\data\ArrayDataProvider; |
9
|
|
|
use yii\helpers\Html; |
10
|
|
|
|
11
|
|
|
/** |
12
|
|
|
* @var \yii\web\View $this |
13
|
|
|
* @var \hipanel\modules\finance\helpers\PlanInternalsGrouper $grouper |
14
|
|
|
* @var \hipanel\modules\finance\models\Plan $model |
15
|
|
|
* @var array[] $parentPrices |
16
|
|
|
* @var \hipanel\modules\finance\models\DomainZonePrice[][] $zonePrices |
17
|
|
|
* @var \hipanel\modules\finance\models\DomainServicePrice[] $servicePrices |
18
|
|
|
* @var \hipanel\modules\finance\models\DomainZonePrice[][] $parentZonePrices |
19
|
|
|
* @var \hipanel\modules\finance\models\DomainServicePrice[] $parentServicePrices |
20
|
|
|
* @var IndexPage $page |
21
|
|
|
*/ |
22
|
|
|
[$zonePrices, $servicePrices] = $grouper->group(); |
23
|
|
|
[$parentZonePrices, $parentServicePrices] = $parentPrices; |
24
|
|
|
?> |
25
|
|
|
|
26
|
|
|
<?php if (!$model->your_tariff) : ?> |
27
|
|
|
<?php $page->beginContent('main-actions') ?> |
28
|
|
|
<?php if (Yii::$app->user->can('plan.create')) : ?> |
29
|
|
|
<?= CreatePricesButton::widget(compact('model')) ?> |
30
|
|
|
<?php endif ?> |
31
|
|
|
<?php if (Yii::$app->user->can('plan.update')) : ?> |
32
|
|
|
<?= Html::a(Yii::t('hipanel', 'Update'), ['@plan/update-prices', 'id' => $model->id], ['class' => 'btn btn-sm btn-warning']) ?> |
33
|
|
|
<?php endif ?> |
34
|
|
|
<?php $page->endContent() ?> |
35
|
|
|
<?php endif ?> |
36
|
|
|
|
37
|
|
|
<?php $page->beginContent('table') ?> |
38
|
|
|
<?php $page->beginBulkForm() ?> |
39
|
|
|
<?= DomainZonePriceGridView::widget([ |
40
|
|
|
'boxed' => false, |
41
|
|
|
'emptyText' => Yii::t('hipanel.finance.price', 'No prices found'), |
42
|
|
|
'dataProvider' => (new ArrayDataProvider([ |
43
|
|
|
'allModels' => $zonePrices, |
44
|
|
|
'pagination' => false, |
45
|
|
|
])), |
46
|
|
|
'parentPrices' => $parentZonePrices, |
47
|
|
|
'columns' => [ |
48
|
|
|
'name', |
49
|
|
|
'registration', |
50
|
|
|
'transfer', |
51
|
|
|
'renewal', |
52
|
|
|
'deleteInAgp', |
53
|
|
|
'restoringExpired', |
54
|
|
|
'restoringDeleted', |
55
|
|
|
], |
56
|
|
|
]) ?> |
57
|
|
|
<?php foreach ($servicePrices as $groupLabel => $servicePriceGroup) : ?> |
58
|
|
|
<?= Html::tag('h4', DomainServicePrice::getLabel($groupLabel), ['class' => 'box-title', 'style' => 'padding-left: 5px;']) ?> |
59
|
|
|
<?= DomainServicePriceGridView::widget([ |
60
|
|
|
'boxed' => false, |
61
|
|
|
'emptyText' => Yii::t('hipanel.finance.price', 'No prices found'), |
62
|
|
|
'dataProvider' => (new ArrayDataProvider([ |
63
|
|
|
'allModels' => [$servicePriceGroup], |
64
|
|
|
'pagination' => false, |
65
|
|
|
])), |
66
|
|
|
'parentPrices' => $parentServicePrices, |
67
|
|
|
'columns' => [ |
68
|
|
|
'purchase', |
69
|
|
|
'renewal', |
70
|
|
|
], |
71
|
|
|
]) ?> |
72
|
|
|
<?php endforeach ?> |
73
|
|
|
<?php $page->endBulkForm() ?> |
74
|
|
|
<?php $page->endContent() ?> |
|
|
|
|
75
|
|
|
|
Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.
A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.