|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <?php
-
-
-
- use yii\helpers\Html;
- use yii\widgets\ActiveForm;
- use yii\helpers\ArrayHelper;
-
- \backend\assets\VuejsUserFormAsset::register($this);
-
- $userManager = $this->getUserManager();
- $producerManager = $this->getProducerManager();
-
- ?>
-
- <div class="user-form" id="app-user-form">
-
- <div class="col-md-8">
- <?php $form = ActiveForm::begin([
- 'enableClientValidation' => false
- ]); ?>
-
- <?= $form->field($model, 'type')
- ->dropDownList( $userManager->getTypeChoicesArray(), [
- 'v-model' => 'type'
- ]) ; ?>
- <?= $form->field($model, 'name_legal_person', ['options' => ['v-show' => "type == 'legal-person'"]])->textInput() ?>
- <?= $form->field($model, 'lastname')->textInput() ?>
- <?= $form->field($model, 'name')->textInput() ?>
- <?= $form->field($model, 'phone')->textInput() ?>
- <?= $form->field($model, 'email')->textInput() ?>
- <?= $form->field($model, 'address')->textarea() ?>
-
- <?php if($producerManager->getConfig('option_export_evoliz')): ?>
- <?= $form->field($model, 'evoliz_code')->textInput() ?>
- <?php endif; ?>
-
- <?= $form->field($model, 'points_sale')->checkboxlist(
- ArrayHelper::map($pointsSaleArray, 'id', function ($pointSale) use ($model) {
- $commentUserPointSale = isset($pointSale->userPointSale[0]) ? $pointSale->userPointSale[0]->comment : '';
- $html = Html::encode($pointSale->name);
- if ($pointSale->restricted_access) {
- $html .= '<input type="text" placeholder="Commentaire" class="form-control" name="User[comment_point_sale_' . $pointSale->id . ']" value="' . (($model->id) ? Html::encode($commentUserPointSale) : '') . '" />';
- }
- return $html;
- }), [
- 'encode' => false
- ]);
- ?>
-
- <?= $form->field($model, 'user_groups')->checkboxlist(
- ArrayHelper::map($userGroupsArray, 'id', function ($userGroup) use ($model) {
- return Html::encode($userGroup->name);
- }), [
- 'encode' => false
- ]);
- ?>
-
- <?php
- ?>
-
- <div class="form-group">
- <?= Html::submitButton($model->isNewRecord ? 'Ajouter' : 'Modifier', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
- </div>
-
- <?php ActiveForm::end(); ?>
- </div>
-
- <div class="col-md-4">
- <h2>Mot de passe</h2>
- <?php $form = ActiveForm::begin(); ?>
- <div class="form-group">
- <?= Html::submitButton('Envoyer un nouveau mot de passe', ['class' => 'btn btn-primary', 'name' => 'submit_new_password', 'value' => 1]) ?>
- </div>
- <?php ActiveForm::end(); ?>
- </div>
-
- </div>
|