Browse Source

Merge branch 'dev'

master
Guillaume 3 years ago
parent
commit
12567a0b75
7 changed files with 97 additions and 79 deletions
  1. +2
    -1
      backend/views/user/_form.php
  2. +1
    -0
      common/models/User.php
  3. +13
    -13
      producer/controllers/OrderController.php
  4. +1
    -1
      producer/views/order/order.php
  5. +67
    -63
      producer/web/css/screen.css
  6. +7
    -1
      producer/web/js/vuejs/order-order.js
  7. +6
    -0
      producer/web/sass/_layout.scss

+ 2
- 1
backend/views/user/_form.php View File

<?= $form->field($model, 'type') <?= $form->field($model, 'type')
->dropDownList([ ->dropDownList([
User::TYPE_INDIVIDUAL => 'Particulier', User::TYPE_INDIVIDUAL => 'Particulier',
User::TYPE_LEGAL_PERSON => 'Personne morale'
User::TYPE_LEGAL_PERSON => 'Personne morale',
User::TYPE_GUEST => 'Visiteur'
], [ ], [
'v-model' => 'type' 'v-model' => 'type'
]) ; ?> ]) ; ?>

+ 1
- 0
common/models/User.php View File



const TYPE_INDIVIDUAL = 'individual' ; const TYPE_INDIVIDUAL = 'individual' ;
const TYPE_LEGAL_PERSON = 'legal-person' ; const TYPE_LEGAL_PERSON = 'legal-person' ;
const TYPE_GUEST = 'guest' ;
const STATUS_DELETED = 0; const STATUS_DELETED = 0;
const STATUS_ACTIVE = 10; const STATUS_ACTIVE = 10;

+ 13
- 13
producer/controllers/OrderController.php View File

// gestion user : option_allow_order_guest // gestion user : option_allow_order_guest
if(isset($posts['user']) && $posts['user']) { if(isset($posts['user']) && $posts['user']) {


$user = User::searchOne([
'email' => $posts['user']['email']
$userIndividualExist = User::searchOne([
'email' => $posts['user']['email'],
'type' => User::TYPE_INDIVIDUAL
]) ; ]) ;


if($user) {
$producer->addUser($user->id, $idProducer) ;
if($userIndividualExist) {
$errorUserGuest = 'Cette adresse email est déjà utilisée, veuillez vous <a href="'.Yii::$app->urlManagerFrontend->createUrl(['site/producer', 'id' => $idProducer]).'">connecter à votre compte</a> ou en utiliser une autre.' ;
return ['status' => 'error', 'errors' => [$errorUserGuest]];
} }


$user = User::searchOne([
'email' => $posts['user']['email'],
'type' => User::TYPE_GUEST
]) ;

if(!$user) { if(!$user) {
$user = new User ; $user = new User ;
$user->id_producer = 0; $user->id_producer = 0;
$user->type = User::TYPE_GUEST;
$password = Password::generate() ; $password = Password::generate() ;
//$password = $posts['user']['password'] ;
$user->setPassword($password); $user->setPassword($password);
$user->generateAuthKey(); $user->generateAuthKey();
$user->username = $posts['user']['email']; $user->username = $posts['user']['email'];
$user->lastname = $posts['user']['lastname']; $user->lastname = $posts['user']['lastname'];
$user->phone = $posts['user']['phone']; $user->phone = $posts['user']['phone'];
$user->save() ; $user->save() ;

// liaison producer / user // liaison producer / user
$producer->addUser($user->id, $idProducer) ; $producer->addUser($user->id, $idProducer) ;

// mail bienvenue
$user->sendMailWelcome($password);
}
else {
$producer->addUser($user->id, $idProducer) ;
} }
} }


} }


} }

+ 1
- 1
producer/views/order/order.php View File

<div v-if="errors.length" class="alert alert-danger"> <div v-if="errors.length" class="alert alert-danger">
<ul> <ul>
<li v-for="error in errors"> <li v-for="error in errors">
{{ error }}
<div v-html="error"></div>
</li> </li>
</ul> </ul>
</div> </div>

+ 67
- 63
producer/web/css/screen.css View File

.alert.alert-warning a { .alert.alert-warning a {
color: #8a6d3b; color: #8a6d3b;
} }
/* line 95, ../sass/_layout.scss */
.alert.alert-danger a {
color: #a94442;
}


/* line 98, ../sass/_layout.scss */
/* line 104, ../sass/_layout.scss */
ul.pagination li.active a { ul.pagination li.active a {
background-color: #FF7F00; background-color: #FF7F00;
border: solid 1px #FF7F00; border: solid 1px #FF7F00;
} }
/* line 102, ../sass/_layout.scss */
/* line 108, ../sass/_layout.scss */
ul.pagination li.active a:hover { ul.pagination li.active a:hover {
background-color: white; background-color: white;
border: solid 1px white; border: solid 1px white;
color: #FF7F00; color: #FF7F00;
} }
/* line 109, ../sass/_layout.scss */
/* line 115, ../sass/_layout.scss */
ul.pagination li a { ul.pagination li a {
color: #FF7F00; color: #FF7F00;
} }
/* line 112, ../sass/_layout.scss */
/* line 118, ../sass/_layout.scss */
ul.pagination li a:hover, ul.pagination li a:focus, ul.pagination li a:active { ul.pagination li a:hover, ul.pagination li a:focus, ul.pagination li a:active {
background-color: white; background-color: white;
border: solid 1px white; border: solid 1px white;
color: #FF7F00; color: #FF7F00;
} }


/* line 121, ../sass/_layout.scss */
/* line 127, ../sass/_layout.scss */
#header-bap { #header-bap {
position: absolute; position: absolute;
right: 0px; right: 0px;
text-align: center; text-align: center;
z-index: 1000; z-index: 1000;
} }
/* line 132, ../sass/_layout.scss */
/* line 138, ../sass/_layout.scss */
#header-bap .container { #header-bap .container {
padding-left: 0px; padding-left: 0px;
padding-right: 0px; padding-right: 0px;
} }
/* line 137, ../sass/_layout.scss */
/* line 143, ../sass/_layout.scss */
#header-bap a#logo { #header-bap a#logo {
color: black; color: black;
text-decoration: none; text-decoration: none;
position: relative; position: relative;
top: 3px; top: 3px;
} }
/* line 143, ../sass/_layout.scss */
/* line 149, ../sass/_layout.scss */
#header-bap a#logo img { #header-bap a#logo img {
width: 45px; width: 45px;
} }
/* line 148, ../sass/_layout.scss */
/* line 154, ../sass/_layout.scss */
#header-bap ul#nav-bap { #header-bap ul#nav-bap {
float: right; float: right;
} }
/* line 152, ../sass/_layout.scss */
/* line 158, ../sass/_layout.scss */
#header-bap ul#nav-bap li a { #header-bap ul#nav-bap li a {
color: black; color: black;
font-size: 15px; font-size: 15px;
color: #FF7F00; color: #FF7F00;
} }
/* line 157, ../sass/_layout.scss */
/* line 163, ../sass/_layout.scss */
#header-bap ul#nav-bap li a:hover, #header-bap ul#nav-bap li a:focus { #header-bap ul#nav-bap li a:hover, #header-bap ul#nav-bap li a:focus {
color: #333; color: #333;
color: #FF7F00; color: #FF7F00;
background: none; background: none;
} }
/* line 164, ../sass/_layout.scss */
/* line 170, ../sass/_layout.scss */
#header-bap ul#nav-bap li ul { #header-bap ul#nav-bap li ul {
background-color: white; background-color: white;
border-top: solid 2px #FF7F00; border-top: solid 2px #FF7F00;
top: 50px; top: 50px;
width: 200px; width: 200px;
} }
/* line 172, ../sass/_layout.scss */
/* line 178, ../sass/_layout.scss */
#header-bap ul#nav-bap li ul li a { #header-bap ul#nav-bap li ul li a {
text-transform: uppercase; text-transform: uppercase;
font-size: 13px; font-size: 13px;
} }
/* line 176, ../sass/_layout.scss */
/* line 182, ../sass/_layout.scss */
#header-bap ul#nav-bap li ul li a:hover { #header-bap ul#nav-bap li ul li a:hover {
color: #ff9933; color: #ff9933;
} }
/* line 180, ../sass/_layout.scss */
/* line 186, ../sass/_layout.scss */
#header-bap ul#nav-bap li ul li a small { #header-bap ul#nav-bap li ul li a small {
font-size: 10px; font-size: 10px;
line-height: 13px; line-height: 13px;
margin-left: 18px; margin-left: 18px;
} }


/* line 192, ../sass/_layout.scss */
/* line 198, ../sass/_layout.scss */
#left { #left {
background-color: #FFF8DC; background-color: #FFF8DC;
text-align: center; text-align: center;
padding: 0px; padding: 0px;
position: relative; position: relative;
} }
/* line 199, ../sass/_layout.scss */
/* line 205, ../sass/_layout.scss */
#left .fixed { #left .fixed {
position: fixed; position: fixed;
display: none; display: none;
} }
/* line 205, ../sass/_layout.scss */
/* line 211, ../sass/_layout.scss */
#left #logo { #left #logo {
position: relative; position: relative;
background-color: white; background-color: white;
text-align: center; text-align: center;
overflow: hidden; overflow: hidden;
} }
/* line 217, ../sass/_layout.scss */
/* line 223, ../sass/_layout.scss */
#left #logo img { #left #logo img {
position: absolute; position: absolute;
top: 50%; top: 50%;
max-width: 90px; max-width: 90px;
max-height: 90px; max-height: 90px;
} }
/* line 227, ../sass/_layout.scss */
/* line 233, ../sass/_layout.scss */
#left h1, #left h2, #left #infos, #left #infos a { #left h1, #left h2, #left #infos, #left #infos a {
color: #323232; color: #323232;
} }
/* line 231, ../sass/_layout.scss */
/* line 237, ../sass/_layout.scss */
#left h1 { #left h1 {
text-transform: uppercase; text-transform: uppercase;
font-family: "highvoltageregular"; font-family: "highvoltageregular";
text-align: center; text-align: center;
font-weight: normal; font-weight: normal;
} }
/* line 242, ../sass/_layout.scss */
/* line 248, ../sass/_layout.scss */
#left h2 { #left h2 {
font-family: "capsuularegular"; font-family: "capsuularegular";
font-size: 15px; font-size: 15px;
font-weight: normal; font-weight: normal;
text-align: center; text-align: center;
} }
/* line 248, ../sass/_layout.scss */
/* line 254, ../sass/_layout.scss */
#left h2 .favorite { #left h2 .favorite {
padding-left: 0px; padding-left: 0px;
} }
/* line 251, ../sass/_layout.scss */
/* line 257, ../sass/_layout.scss */
#left h2 .favorite .glyphicon { #left h2 .favorite .glyphicon {
font-size: 14px; font-size: 14px;
} }
/* line 256, ../sass/_layout.scss */
/* line 262, ../sass/_layout.scss */
#left h2 a { #left h2 a {
color: #323232; color: #323232;
} }
/* line 262, ../sass/_layout.scss */
/* line 268, ../sass/_layout.scss */
#left nav#main-nav { #left nav#main-nav {
background-color: white; background-color: white;
border: solid 1px #e0e0e0; border: solid 1px #e0e0e0;
border-bottom: 0px none; border-bottom: 0px none;
margin-top: 20px; margin-top: 20px;
} }
/* line 269, ../sass/_layout.scss */
/* line 275, ../sass/_layout.scss */
#left nav#main-nav ul li { #left nav#main-nav ul li {
display: block; display: block;
} }
/* line 272, ../sass/_layout.scss */
/* line 278, ../sass/_layout.scss */
#left nav#main-nav ul li a { #left nav#main-nav ul li a {
color: #323232; color: #323232;
color: black; color: black;
display: block; display: block;
text-align: left; text-align: left;
} }
/* line 281, ../sass/_layout.scss */
/* line 287, ../sass/_layout.scss */
#left nav#main-nav ul li a .glyphicon { #left nav#main-nav ul li a .glyphicon {
font-size: 15px; font-size: 15px;
margin-right: 3px; margin-right: 3px;
} }
/* line 286, ../sass/_layout.scss */
/* line 292, ../sass/_layout.scss */
#left nav#main-nav ul li a span.label { #left nav#main-nav ul li a span.label {
padding-bottom: 3px; padding-bottom: 3px;
font-family: "Arial"; font-family: "Arial";
float: right; float: right;
} }
/* line 294, ../sass/_layout.scss */
/* line 300, ../sass/_layout.scss */
#left nav#main-nav ul li.active span.label, #left nav#main-nav ul li a:hover span.label { #left nav#main-nav ul li.active span.label, #left nav#main-nav ul li a:hover span.label {
background-color: #e67200; background-color: #e67200;
color: white; color: white;
} }
/* line 300, ../sass/_layout.scss */
/* line 306, ../sass/_layout.scss */
#left nav#main-nav ul li a:hover, #left nav#main-nav ul li.active a { #left nav#main-nav ul li a:hover, #left nav#main-nav ul li.active a {
background: #FF7F00; background: #FF7F00;
color: white; color: white;
-webkit-border-radius: 0px; -webkit-border-radius: 0px;
border-radius: 0px; border-radius: 0px;
} }
/* line 309, ../sass/_layout.scss */
/* line 315, ../sass/_layout.scss */
#left nav#main-nav ul li#btn-administration a { #left nav#main-nav ul li#btn-administration a {
color: #FF7F00; color: #FF7F00;
} }
/* line 312, ../sass/_layout.scss */
/* line 318, ../sass/_layout.scss */
#left nav#main-nav ul li#btn-administration a:hover { #left nav#main-nav ul li#btn-administration a:hover {
color: white; color: white;
} }
/* line 320, ../sass/_layout.scss */
/* line 326, ../sass/_layout.scss */
#left nav#main-nav #user { #left nav#main-nav #user {
color: #FF7F00; color: #FF7F00;
float: right; float: right;
padding: 10px; padding: 10px;
} }


/* line 328, ../sass/_layout.scss */
/* line 334, ../sass/_layout.scss */
#main { #main {
background-color: #FFF8DC; background-color: #FFF8DC;
border: solid 1px #e0e0e0; border: solid 1px #e0e0e0;
padding: 0px; padding: 0px;
background-color: white; background-color: white;
} }
/* line 335, ../sass/_layout.scss */
/* line 341, ../sass/_layout.scss */
#main #img-big { #main #img-big {
height: 130px; height: 130px;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
} }
/* line 340, ../sass/_layout.scss */
/* line 346, ../sass/_layout.scss */
#main #img-big img.img-photo { #main #img-big img.img-photo {
width: 100%; width: 100%;
position: absolute; position: absolute;
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
} }
/* line 350, ../sass/_layout.scss */
/* line 356, ../sass/_layout.scss */
#main #infos-producer { #main #infos-producer {
padding: 5px 10px; padding: 5px 10px;
margin-bottom: 0px; margin-bottom: 0px;
border-bottom: solid 1px #e0e0e0; border-bottom: solid 1px #e0e0e0;
color: gray; color: gray;
} }
/* line 359, ../sass/_layout.scss */
/* line 365, ../sass/_layout.scss */
#main #infos-producer strong { #main #infos-producer strong {
font-weight: bold; font-weight: bold;
} }
/* line 363, ../sass/_layout.scss */
/* line 369, ../sass/_layout.scss */
#main #infos-producer .favorite { #main #infos-producer .favorite {
float: right; float: right;
color: gray; color: gray;
} }
/* line 366, ../sass/_layout.scss */
/* line 372, ../sass/_layout.scss */
#main #infos-producer .favorite a { #main #infos-producer .favorite a {
color: black; color: black;
} }
/* line 372, ../sass/_layout.scss */
/* line 378, ../sass/_layout.scss */
#main h2#page-title { #main h2#page-title {
padding-left: 15px; padding-left: 15px;
padding-right: 15px; padding-right: 15px;
top: -10px; top: -10px;
text-align: left; text-align: left;
} }
/* line 386, ../sass/_layout.scss */
/* line 392, ../sass/_layout.scss */
#main h2#page-title #buttons { #main h2#page-title #buttons {
margin-bottom: 15px; margin-bottom: 15px;
font-family: "Arial"; font-family: "Arial";
} }
/* line 393, ../sass/_layout.scss */
/* line 399, ../sass/_layout.scss */
#main #content { #main #content {
padding: 0px 20px 20px 20px; padding: 0px 20px 20px 20px;
padding-bottom: 40px; padding-bottom: 40px;
min-height: 300px; min-height: 300px;
} }
/* line 398, ../sass/_layout.scss */
/* line 404, ../sass/_layout.scss */
#main #content h1, #main #content h2, #main #content h3, #main #content h4, #main #content h5, #main #content h6 { #main #content h1, #main #content h2, #main #content h3, #main #content h4, #main #content h5, #main #content h6 {
font-family: "highvoltageregular"; font-family: "highvoltageregular";
margin-top: 30px; margin-top: 30px;
margin-bottom: 20px; margin-bottom: 20px;
} }
/* line 403, ../sass/_layout.scss */
/* line 409, ../sass/_layout.scss */
#main #content h1.first, #main #content h2.first, #main #content h3.first, #main #content h4.first, #main #content h5.first, #main #content h6.first { #main #content h1.first, #main #content h2.first, #main #content h3.first, #main #content h4.first, #main #content h5.first, #main #content h6.first {
margin-top: 0px; margin-top: 0px;
} }
/* line 408, ../sass/_layout.scss */
/* line 414, ../sass/_layout.scss */
#main #content h1 { #main #content h1 {
font-size: 30px; font-size: 30px;
} }
/* line 412, ../sass/_layout.scss */
/* line 418, ../sass/_layout.scss */
#main #content h2 { #main #content h2 {
font-size: 25px; font-size: 25px;
} }
/* line 417, ../sass/_layout.scss */
/* line 423, ../sass/_layout.scss */
#main #content h3 { #main #content h3 {
font-family: "capsuularegular"; font-family: "capsuularegular";
text-transform: uppercase; text-transform: uppercase;
margin-bottom: 30px; margin-bottom: 30px;
margin-top: 45px; margin-top: 45px;
} }
/* line 425, ../sass/_layout.scss */
/* line 431, ../sass/_layout.scss */
#main #content h3 span { #main #content h3 span {
padding-top: 14px; padding-top: 14px;
color: #323232; color: #323232;
} }
/* line 431, ../sass/_layout.scss */
/* line 437, ../sass/_layout.scss */
#main #content h4 { #main #content h4 {
font-size: 20px; font-size: 20px;
} }
/* line 435, ../sass/_layout.scss */
/* line 441, ../sass/_layout.scss */
#main #content h5 { #main #content h5 {
font-size: 18px; font-size: 18px;
} }
/* line 439, ../sass/_layout.scss */
/* line 445, ../sass/_layout.scss */
#main #content h6 { #main #content h6 {
font-size: 16px; font-size: 16px;
} }
/* line 445, ../sass/_layout.scss */
/* line 451, ../sass/_layout.scss */
#main #content form .form-group .hint-block { #main #content form .form-group .hint-block {
color: gray; color: gray;
} }


/* line 453, ../sass/_layout.scss */
/* line 459, ../sass/_layout.scss */
#footer-producer { #footer-producer {
text-align: center; text-align: center;
position: absolute; position: absolute;
left: 0px; left: 0px;
width: 100%; width: 100%;
} }
/* line 460, ../sass/_layout.scss */
/* line 466, ../sass/_layout.scss */
#footer-producer a { #footer-producer a {
color: #FF7F00; color: #FF7F00;
} }
/* line 462, ../sass/_layout.scss */
/* line 468, ../sass/_layout.scss */
#footer-producer a:active { #footer-producer a:active {
text-decoration: underline; text-decoration: underline;
} }


/* line 468, ../sass/_layout.scss */
/* line 474, ../sass/_layout.scss */
#footer { #footer {
background-color: #FFF8DC; background-color: #FFF8DC;
height: 100px; height: 100px;
float: right; float: right;
text-align: center; text-align: center;
} }
/* line 474, ../sass/_layout.scss */
/* line 480, ../sass/_layout.scss */
#footer .content { #footer .content {
padding-top: 20px; padding-top: 20px;
color: black; color: black;
} }
/* line 478, ../sass/_layout.scss */
/* line 484, ../sass/_layout.scss */
#footer .content a { #footer .content a {
color: black; color: black;
font-family: "capsuularegular"; font-family: "capsuularegular";
padding-left: 10px; padding-left: 10px;
padding-right: 10px; padding-right: 10px;
} }
/* line 485, ../sass/_layout.scss */
/* line 491, ../sass/_layout.scss */
#footer .content a:hover { #footer .content a:hover {
text-decoration: underline; text-decoration: underline;
} }
/* line 492, ../sass/_layout.scss */
/* line 498, ../sass/_layout.scss */
#footer #code-source img { #footer #code-source img {
height: 20px; height: 20px;
} }

+ 7
- 1
producer/web/js/vuejs/order-order.js View File

}, },
confirmClick: function() { confirmClick: function() {


var app = this ;
var $signupGuestForm = $('#signup-guest form') ; var $signupGuestForm = $('#signup-guest form') ;
if($signupGuestForm.length > 0 && !$signupGuestForm.valid()) { if($signupGuestForm.length > 0 && !$signupGuestForm.valid()) {
$signupGuestForm.submit() ; $signupGuestForm.submit() ;
return false ; return false ;
} }


this.disableConfirmButton = true ;
app.disableConfirmButton = true ;
var productsArray = {} ; var productsArray = {} ;
for(var key in this.products) { for(var key in this.products) {
user: user user: user
}).then(function(response) { }).then(function(response) {
if(response.data.status == 'success') { if(response.data.status == 'success') {
app.errors = [] ;
window.location.href = opendistrib_base_url(true)+'order/confirm?idOrder='+response.data.idOrder ; window.location.href = opendistrib_base_url(true)+'order/confirm?idOrder='+response.data.idOrder ;
} }
else {
app.errors = response.data.errors ;
app.disableConfirmButton = false ;
}
}); });
}, },
checkProducts: function() { checkProducts: function() {

+ 6
- 0
producer/web/sass/_layout.scss View File

color: #8a6d3b ; color: #8a6d3b ;
} }
} }

&.alert-danger {
a {
color: #a94442 ;
}
}
} }


ul.pagination { ul.pagination {

Loading…
Cancel
Save