<div class="panel-heading"> | <div class="panel-heading"> | ||||
<h3 class="panel-title"> | <h3 class="panel-title"> | ||||
<i class="fa fa-paper-plane"></i> | <i class="fa fa-paper-plane"></i> | ||||
Bulletin d'information | |||||
Infolettres | |||||
</h3> | </h3> | ||||
</div> | </div> | ||||
<div class="panel-body"> | <div class="panel-body"> | ||||
], | ], | ||||
] | ] | ||||
); ?> | ); ?> | ||||
<?php if($userModule->getAuthorizationChecker()->isGrantedAsAdministrator($userCurrent)): ?> | |||||
<?= $form->field($model, 'newsletter_souke')->widget(Toggle::class, | |||||
[ | |||||
'options' => [ | |||||
'data-id' => $model->id, | |||||
'data-on' => 'Oui', | |||||
'data-off' => 'Non', | |||||
], | |||||
] | |||||
); ?> | |||||
<?php endif; ?> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
termes. | termes. | ||||
*/ | */ | ||||
use common\helpers\GlobalParam; | |||||
use common\helpers\Price; | use common\helpers\Price; | ||||
use domain\Order\Order\OrderModule; | use domain\Order\Order\OrderModule; | ||||
use domain\User\User\UserModule; | use domain\User\User\UserModule; | ||||
use yii\helpers\Html; | use yii\helpers\Html; | ||||
use yii\widgets\ActiveForm; | use yii\widgets\ActiveForm; | ||||
$userCurrent = GlobalParam::getCurrentUser(); | |||||
$orderModule = OrderModule::getInstance(); | $orderModule = OrderModule::getInstance(); | ||||
$userModule = UserModule::getInstance(); | $userModule = UserModule::getInstance(); | ||||
$userProducerModule = UserProducerModule::getInstance(); | $userProducerModule = UserProducerModule::getInstance(); | ||||
</li> | </li> | ||||
<?php endif; ?> | <?php endif; ?> | ||||
<li class="list-group-item"> | <li class="list-group-item"> | ||||
<strong>Bulletin d'information</strong> | |||||
<strong>Infolettre</strong> | |||||
<span class="pull-right"> | <span class="pull-right"> | ||||
<?php $isUserSubscribedNewsletter = $userModule->getNewsletterManager()->isUserSubscribedNewsletter($model); ?> | <?php $isUserSubscribedNewsletter = $userModule->getNewsletterManager()->isUserSubscribedNewsletter($model); ?> | ||||
<span class="label label-<?= $isUserSubscribedNewsletter ? 'success' : 'default' ?>"> | <span class="label label-<?= $isUserSubscribedNewsletter ? 'success' : 'default' ?>"> | ||||
</span> | </span> | ||||
</span> | </span> | ||||
</li> | </li> | ||||
<?php if($userModule->getAuthorizationChecker()->isGrantedAsAdministrator($userCurrent)): ?> | |||||
<li class="list-group-item"> | |||||
<strong>Infolettre Souke</strong> | |||||
<span class="pull-right"> | |||||
<?php $isUserSubscribedNewsletterSouke = $model->newsletter_souke; ?> | |||||
<span class="label label-<?= $isUserSubscribedNewsletterSouke ? 'success' : 'default' ?>"> | |||||
<?= $isUserSubscribedNewsletterSouke ? 'Oui' : 'Non' ?> | |||||
</span> | |||||
</span> | |||||
</li> | |||||
<?php endif; ?> | |||||
<?php if($model->userPointSale): ?> | <?php if($model->userPointSale): ?> | ||||
<li class="list-group-item"> | <li class="list-group-item"> | ||||
<strong>Points de vente</strong> | <strong>Points de vente</strong> |
'product_price_percent' => 'Prix produits : pourcentage', | 'product_price_percent' => 'Prix produits : pourcentage', | ||||
'user_groups' => "Groupes d'utilisateurs", | 'user_groups' => "Groupes d'utilisateurs", | ||||
'evoliz_code' => 'Code client Evoliz', | 'evoliz_code' => 'Code client Evoliz', | ||||
'newsletter' => "Inscrit au bulletin d'information", | |||||
'newsletter' => "Inscrit à l'infolettre", | |||||
'exclude_export_shopping_cart_labels' => "Exclure de l'export d'étiquettes", | 'exclude_export_shopping_cart_labels' => "Exclure de l'export d'étiquettes", | ||||
'send_mail_welcome' => "Envoyer un email de bienvenue", | 'send_mail_welcome' => "Envoyer un email de bienvenue", | ||||
'email_sending_invoicing_documents' => 'Email facturation', | 'email_sending_invoicing_documents' => 'Email facturation', | ||||
'trust_alert' => 'Alerte confiance', | 'trust_alert' => 'Alerte confiance', | ||||
'trust_alert_comment' => 'Commentaire', | 'trust_alert_comment' => 'Commentaire', | ||||
'newsletter_souke' => 'Infolettre Souke' | |||||
'newsletter_souke' => "S'abonner à l'infolettre de Souke" | |||||
]; | ]; | ||||
} | } | ||||
public $verifyCode; | public $verifyCode; | ||||
public $is_test; | public $is_test; | ||||
public $newsletter = false; | public $newsletter = false; | ||||
public $newsletter_souke = false; | |||||
/** | /** | ||||
* @inheritdoc | * @inheritdoc | ||||
return !$model->signup_producer_only; | return !$model->signup_producer_only; | ||||
}], | }], | ||||
['password', 'string', 'min' => 6, 'tooShort' => 'Votre mot de passe doit contenir au moins 6 caractères'], | ['password', 'string', 'min' => 6, 'tooShort' => 'Votre mot de passe doit contenir au moins 6 caractères'], | ||||
[['is_producer', 'newsletter'], 'boolean'], | |||||
[['is_producer', 'newsletter', 'newsletter_souke'], 'boolean'], | |||||
['cgv', 'boolean'], | ['cgv', 'boolean'], | ||||
['cgv', function ($attribute, $params) { | ['cgv', function ($attribute, $params) { | ||||
$cgv = $this->$attribute; | $cgv = $this->$attribute; | ||||
'city' => 'Commune', | 'city' => 'Commune', | ||||
'id_producer' => 'Producteur', | 'id_producer' => 'Producteur', | ||||
'type' => 'Type de producteur', | 'type' => 'Type de producteur', | ||||
// 'free_price' => 'Prix libre', | |||||
'id_tax_rate_default' => 'TVA par défaut', | 'id_tax_rate_default' => 'TVA par défaut', | ||||
'verifyCode' => 'Code de vérification', | 'verifyCode' => 'Code de vérification', | ||||
'newsletter' => "S'abonner au bulletin d'information de ce producteur" | |||||
'newsletter' => "S'abonner à l'infolettre de ce producteur", | |||||
'newsletter_souke' => "S'abonner à l'infolettre de Souke", | |||||
]; | ]; | ||||
} | } | ||||
$user->name = $this->name; | $user->name = $this->name; | ||||
$user->lastname = $this->lastname; | $user->lastname = $this->lastname; | ||||
$user->phone = $this->phone; | $user->phone = $this->phone; | ||||
$user->newsletter_souke = $this->newsletter_souke; | |||||
} | } | ||||
public function populateProducer($producer) | public function populateProducer($producer) |
<?= $form->field($signupForm, 'lastname') ?> | <?= $form->field($signupForm, 'lastname') ?> | ||||
<?= $form->field($signupForm, 'name') ?> | <?= $form->field($signupForm, 'name') ?> | ||||
<?= $form->field($signupForm, 'phone') ?> | <?= $form->field($signupForm, 'phone') ?> | ||||
<?= $form->field($signupForm, 'newsletter')->checkbox() ?> | |||||
<?php if(strlen($producer->code)): ?> | <?php if(strlen($producer->code)): ?> | ||||
<?= $form->field($signupForm, 'code',[ | <?= $form->field($signupForm, 'code',[ | ||||
'inputTemplate' => '<div class="input-group"><span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>{input}</div>', | 'inputTemplate' => '<div class="input-group"><span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>{input}</div>', | ||||
->label('Code du producteur') | ->label('Code du producteur') | ||||
->hint('Renseignez-vous auprès de votre producteur pour qu\'il vous fournisse le code d\'accès') ; ?> | ->hint('Renseignez-vous auprès de votre producteur pour qu\'il vous fournisse le code d\'accès') ; ?> | ||||
<?php endif; ?> | <?php endif; ?> | ||||
<?= $form->field($signupForm, 'newsletter')->checkbox() ?> | |||||
<?= $form->field($signupForm, 'newsletter_souke')->checkbox() ?> | |||||
<?= $form->field($signupForm, 'verifyCode')->widget(\yii\captcha\Captcha::className(), [ | <?= $form->field($signupForm, 'verifyCode')->widget(\yii\captcha\Captcha::className(), [ | ||||
'template' => '<div class="row"><div class="col-lg-3">{image}</div><div class="col-lg-6">{input}</div></div>', | 'template' => '<div class="row"><div class="col-lg-3">{image}</div><div class="col-lg-6">{input}</div></div>', | ||||
]) ?> | ]) ?> |
<div id="fields-user"> | <div id="fields-user"> | ||||
<?= $form->field($model, 'id_producer') | <?= $form->field($model, 'id_producer') | ||||
->dropDownList($dataProducers, ['prompt' => '--','encode' => false,'options' => $optionsProducers]) ?> | ->dropDownList($dataProducers, ['prompt' => '--','encode' => false,'options' => $optionsProducers]) ?> | ||||
<?= $form->field($model, 'newsletter')->checkbox() ?> | |||||
<div id="bloc-code-acces"> | <div id="bloc-code-acces"> | ||||
<?= $form->field($model, 'code',[ | <?= $form->field($model, 'code',[ | ||||
'inputTemplate' => '<div class="input-group"><span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>{input}</div>', | 'inputTemplate' => '<div class="input-group"><span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>{input}</div>', | ||||
->label('Code') | ->label('Code') | ||||
->hint('Renseignez-vous auprès de votre producteur pour qu\'il vous fournisse le code d\'accès') ; ?> | ->hint('Renseignez-vous auprès de votre producteur pour qu\'il vous fournisse le code d\'accès') ; ?> | ||||
</div> | </div> | ||||
<?= $form->field($model, 'newsletter')->checkbox() ?> | |||||
<?= $form->field($model, 'newsletter_souke')->checkbox() ?> | |||||
</div> | </div> | ||||
<?= $form->field($model, 'verifyCode')->widget(\yii\captcha\Captcha::className(), [ | <?= $form->field($model, 'verifyCode')->widget(\yii\captcha\Captcha::className(), [ |
} | } | ||||
elseif($producerRedirect) { | elseif($producerRedirect) { | ||||
$urlRedirect = $this->getUrlManagerProducer()->createAbsoluteUrl(['site/index', 'slug_producer' => $producerRedirect->slug]); | $urlRedirect = $this->getUrlManagerProducer()->createAbsoluteUrl(['site/index', 'slug_producer' => $producerRedirect->slug]); | ||||
$redirectLabel = "Redirection vers l'espace de votre producteur ..."; | |||||
$redirectLabel = "Redirection vers la boutique de votre producteur ..."; | |||||
} | } | ||||
?> | ?> |
<?= $form->field($model, 'phone')->textInput() ?> | <?= $form->field($model, 'phone')->textInput() ?> | ||||
<?= $form->field($model, 'email')->textInput(); ?> | <?= $form->field($model, 'email')->textInput(); ?> | ||||
<?= $form->field($model, 'address')->textarea() ?> | <?= $form->field($model, 'address')->textarea() ?> | ||||
<?= $form->field($model, 'newsletter_souke')->checkbox() ?> | |||||
<h2>Mot de passe</h2> | <h2>Mot de passe</h2> | ||||
<p>Renseignez les champs ci-dessous si vous souhaitez modifier votre mot de passe.</p> | <p>Renseignez les champs ci-dessous si vous souhaitez modifier votre mot de passe.</p> |
<div class="clr"></div> | <div class="clr"></div> | ||||
</div> | </div> | ||||
<div class="content"> | <div class="content"> | ||||
<div v-if="order" class="alert alert-warning alert-edit-order"> | |||||
<div v-if="order && date" class="alert alert-warning alert-edit-order"> | |||||
<div class="glyphicon glyphicon-pencil"></div> | <div class="glyphicon glyphicon-pencil"></div> | ||||
Attention, vous êtes en train de modifier votre commande du <strong>{{ dateFormat }}</strong>. | Attention, vous êtes en train de modifier votre commande du <strong>{{ dateFormat }}</strong>. | ||||
</div> | </div> |