@@ -37,7 +37,7 @@ termes. | |||
*/ | |||
return [ | |||
'adminEmail' => 'contact@laboiteapain.net', | |||
'supportEmail' => 'contact@laboiteapain.net', | |||
'adminEmail' => 'contact@opendistrib.net', | |||
'supportEmail' => 'contact@opendistrib.net', | |||
'user.passwordResetTokenExpire' => 3600, | |||
]; |
@@ -98,7 +98,7 @@ class Producer extends ActiveRecordCommon | |||
public function rules() | |||
{ | |||
return [ | |||
[['name', 'siret', 'order_deadline', 'order_delay','type'], 'required'], | |||
[['name', 'order_deadline', 'order_delay','type'], 'required'], | |||
[['order_deadline', 'order_delay'], 'integer'], | |||
['order_deadline', 'in', 'range' => [8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]], | |||
['order_delay', 'in', 'range' => [1, 2, 3, 4, 5, 6, 7]], |
@@ -0,0 +1,16 @@ | |||
<?php | |||
use yii\db\Migration; | |||
use yii\db\mysql\Schema; | |||
class m190305_104710_producer_siret_non_requis extends Migration { | |||
public function up() { | |||
$this->alterColumn('producer', 'siret', Schema::TYPE_STRING.' DEFAULT NULL') ; | |||
} | |||
public function down() { | |||
$this->alterColumn('producer', 'siret', Schema::TYPE_STRING.' NOT NULL') ; | |||
} | |||
} |
@@ -251,7 +251,8 @@ class SiteController extends FrontendController | |||
{ | |||
$model = new SignupForm(); | |||
if ($model->load(Yii::$app->request->post())) { | |||
if ($user = $model->signup()) { | |||
$user = $model->signup() ; | |||
if ($user) { | |||
if (Yii::$app->getUser()->login($user)) { | |||
if($model->option_user_producer == 'producer') { | |||
$this->redirect(Yii::$app->urlManagerBackend->createAbsoluteUrl(['site/index'])); |
@@ -115,11 +115,6 @@ class SignupForm extends Model | |||
return $('#option-producer').prop('checked') ; | |||
}"], | |||
['siret', 'string'], | |||
['siret', 'required', 'message' => 'Champs obligatoire', 'when' => function($model) { | |||
return $model->option_user_producer == 'producer'; | |||
}, 'whenClient' => "function (attribute, value) { | |||
return $('#option-producer').prop('checked') ; | |||
}"], | |||
['siret', function($attribute, $params) { | |||
$siret = $this->$attribute; | |||
@@ -197,7 +192,7 @@ class SignupForm extends Model | |||
'lastname' => 'Nom', | |||
'phone' => 'Téléphone', | |||
'is_producer' => "Je suis professionnel et souhaite mettre en place un système de réservation dans mon établissement", | |||
'name_producer' => 'Nom du producteur', | |||
'name_producer' => 'Nom de votre structure', | |||
'siret' => 'Numéro SIRET', | |||
'postcode' => 'Code postal', | |||
'city' => 'Commune', |
@@ -76,7 +76,6 @@ $this->params['breadcrumbs'][] = $this->title; | |||
<div id="fields-producer"> | |||
<?= $form->field($model, 'name_producer') ?> | |||
<?= $form->field($model, 'type')->textInput(['placeholder' => 'Boulangerie, brasserie, ferme ...']); ?> | |||
<?= $form->field($model, 'siret') ?> | |||
<?= $form->field($model, 'postcode') ?> | |||
<?= $form->field($model, 'city') ?> | |||
<?= $form->field($model, 'free_price',[ |