Issues (213)

src/views/hub/_form.php (1 issue)

1
<?php
2
/** @var array $types */
3
use hipanel\helpers\Url;
4
use hipanel\modules\stock\widgets\combo\OrderCombo;
0 ignored issues
show
The type hipanel\modules\stock\widgets\combo\OrderCombo was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
5
use hipanel\widgets\DynamicFormCopyButton;
6
use hipanel\widgets\DynamicFormWidget;
7
use yii\bootstrap\ActiveForm;
8
use yii\helpers\Html;
9
10
?>
11
12
<div class="row">
13
    <?php $form = ActiveForm::begin([
14
        'id' => 'dynamic-form',
15
        'enableAjaxValidation' => true,
16
        'validationUrl' => Url::toRoute(['validate-form', 'scenario' => $model->scenario]),
17
    ]); ?>
18
19
    <?php DynamicFormWidget::begin([
20
        'widgetContainer' => 'dynamicform_wrapper', // required: only alphanumeric characters plus "_" [A-Za-z0-9_]
21
        'widgetBody' => '.container-items', // required: css class selector
22
        'widgetItem' => '.item', // required: css class
23
        'limit' => 999, // the maximum times, an element can be cloned (default 999)
24
        'min' => 1, // 0 or 1 (default 1)
25
        'insertButton' => '.add-item', // css class
26
        'deleteButton' => '.remove-item', // css class
27
        'model' => $model,
28
        'formId' => 'dynamic-form',
29
        'formFields' => [
30
            'inn',
31
            'name',
32
            'type_id',
33
            'mac',
34
            'note',
35
            'model',
36
            'order_no',
37
        ],
38
    ]) ?>
39
40
    <div class="container-items">
41
        <?php foreach ($models as $i => $model) : ?>
42
            <div class="item col-md-6">
43
                <?php if (!$model->isNewRecord) : ?>
44
                    <?= Html::activeHiddenInput($model, "[$i]id") ?>
45
                <?php endif; ?>
46
                <div class="box box-solid">
47
                    <?php if ($model->isNewRecord) : ?>
48
                        <div class="box-header with-border">
49
                            <h3 class="box-title"></h3>
50
                            <div class="box-tools pull-right">
51
                                <button type="button" class="btn btn-success btn-sm add-item">
52
                                    <i class="fa fa-plus"></i>
53
                                </button>
54
                                <?= DynamicFormCopyButton::widget() ?>
55
                                <button type="button" class="btn btn-danger btn-sm remove-item">
56
                                    <i class="fa fa-minus"></i>
57
                                </button>
58
                            </div>
59
                        </div>
60
                    <?php endif; ?>
61
                    <div class="box-body">
62
                        <div class="row">
63
                            <div class="col-md-6">
64
                                <?= $form->field($model, "[$i]name") ?>
65
                            </div>
66
                            <div class="col-md-6">
67
                                <?= $form->field($model, "[$i]type_id")->dropDownList($types, ['prompt' => '--']) ?>
68
                            </div>
69
                            <div class="col-md-12">
70
                                <?= $form->field($model, "[$i]mac")
71
                                    ->hint(Yii::t('hipanel:server:hub', 'Example: {0}', ['00:27:0e:2a:b9:aa, 00-27-0E-2A-B9-AA, 0.27.e.2a.b9.aa ...'])) ?>
72
                            </div>
73
                            <div class="col-md-6">
74
                                <?= $form->field($model, "[$i]inn") ?>
75
                            </div>
76
                            <div class="col-md-6">
77
                                <?= $form->field($model, "[$i]ip") ?>
78
                            </div>
79
                            <div class="col-md-6">
80
                                <?= $form->field($model, "[$i]model") ?>
81
                            </div>
82
                            <div class="col-md-6">
83
                                <?= $form->field($model, "[$i]order_no")->widget(OrderCombo::class) ?>
84
                            </div>
85
                        </div>
86
                        <?= $form->field($model, "[$i]note")->textarea() ?>
87
                    </div>
88
                </div>
89
            </div>
90
        <?php endforeach; ?>
91
    </div>
92
93
    <?php DynamicFormWidget::end() ?>
94
95
    <div class="col-md-12">
96
        <?= Html::submitButton(Yii::t('hipanel', 'Save'), ['class' => 'btn btn-success']) ?>
97
        &nbsp;
98
        <?= Html::button(Yii::t('hipanel', 'Cancel'), ['class' => 'btn btn-default', 'onclick' => 'history.go(-1)']) ?>
99
    </div>
100
101
    <?php $form->end() ?>
102
</div>
103