Browse Source

Intégration Souke

feature/souke
Guillaume Bourgeois 7 months ago
parent
commit
146ee4c72a
35 changed files with 1211 additions and 982 deletions
  1. +2
    -2
      common/helpers/MeanPayment.php
  2. +177
    -49
      common/web/css/screen.css
  3. +123
    -9
      common/web/sass/_common.scss
  4. +2
    -1
      common/web/sass/screen.scss
  5. +8
    -7
      domain/Payment/PaymentSolver.php
  6. +5
    -0
      domain/PointSale/PointSale/PointSaleRepository.php
  7. +3
    -3
      domain/PointSale/PointSale/PointSaleSolver.php
  8. +6
    -2
      domain/Product/Product/ProductRepository.php
  9. +2
    -2
      frontend/views/site/_prices_producer.php
  10. +1
    -1
      frontend/views/site/contact.php
  11. +215
    -270
      frontend/web/css/screen.css
  12. +1
    -1
      frontend/web/sass/_responsive.scss
  13. +0
    -49
      frontend/web/sass/screen.scss
  14. +2
    -2
      producer/controllers/NewsletterController.php
  15. +23
    -15
      producer/controllers/SiteController.php
  16. +7
    -7
      producer/views/credit/add.php
  17. +7
    -14
      producer/views/credit/history.php
  18. +38
    -18
      producer/views/layouts/main.php
  19. +27
    -19
      producer/views/newsletter/index.php
  20. +3
    -3
      producer/views/site/contact.php
  21. +2
    -162
      producer/views/site/index.php
  22. +135
    -0
      producer/views/site/points-sale.php
  23. +139
    -0
      producer/views/site/products.php
  24. +204
    -235
      producer/web/css/screen.css
  25. +12
    -32
      producer/web/sass/_layout.scss
  26. +2
    -9
      producer/web/sass/credit/_add.scss
  27. +17
    -0
      producer/web/sass/credit/_history.scss
  28. +0
    -1
      producer/web/sass/order/_confirm.scss
  29. +0
    -7
      producer/web/sass/order/_order.scss
  30. +2
    -0
      producer/web/sass/screen.scss
  31. +1
    -1
      producer/web/sass/site/_credit_history.scss
  32. +1
    -59
      producer/web/sass/site/_index.scss
  33. +28
    -0
      producer/web/sass/site/_points_sale.scss
  34. +16
    -0
      producer/web/sass/site/_products.scss
  35. +0
    -2
      producer/web/sass/subscription/_form.scss

+ 2
- 2
common/helpers/MeanPayment.php View File

case self::CHEQUE : return 'Chèque' ; case self::CHEQUE : return 'Chèque' ;
case self::TRANSFER : return 'Virement' ; case self::TRANSFER : return 'Virement' ;
case self::OTHER : return 'Autre' ; case self::OTHER : return 'Autre' ;
case self::CREDIT : return 'Crédit' ;
default: return 'Crédit' ;
case self::CREDIT : return 'Cagnotte' ;
default: return 'Indéfini' ;
} }
} }

+ 177
- 49
common/web/css/screen.css View File

font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }
/* line 3, ../sass/_common.scss */
#main {
/* Boutons */
/* Alertes */
/* Tableaux */
/* Formulaires */
}
/* line 5, ../sass/_common.scss */ /* line 5, ../sass/_common.scss */
#main .btn-primary, #main .btn-primary,
#main .btn-secondary { #main .btn-secondary {
-moz-border-radius: 0px;
-webkit-border-radius: 0px;
border-radius: 0px;
font-family: 'worksans_semibold'; font-family: 'worksans_semibold';
} }
/* line 9, ../sass/_common.scss */
/* line 10, ../sass/_common.scss */
#main .btn-primary .bi, #main .btn-primary .bi,
#main .btn-secondary .bi { #main .btn-secondary .bi {
margin-right: 5px; margin-right: 5px;
} }
/* line 14, ../sass/_common.scss */
/* line 15, ../sass/_common.scss */
#main .btn-primary { #main .btn-primary {
background-color: #ee6f42; background-color: #ee6f42;
border: solid 1px #ee6f42;
border: 0px none;
color: white; color: white;
} }
/* line 19, ../sass/_common.scss */
/* line 20, ../sass/_common.scss */
#main .btn-primary:hover, #main .btn-primary:active, #main .btn-primary:focus { #main .btn-primary:hover, #main .btn-primary:active, #main .btn-primary:focus {
background-color: #ec5d2b;
border: solid 1px #ee6f42;
filter: brightness(90%);
border: 0px none;
color: white; color: white;
} }
/* line 26, ../sass/_common.scss */
/* line 27, ../sass/_common.scss */
#main .btn-secondary { #main .btn-secondary {
color: black; color: black;
background-color: #f4efe8; background-color: #f4efe8;
border: solid 1px #f4efe8; border: solid 1px #f4efe8;
} }
/* line 31, ../sass/_common.scss */
/* line 32, ../sass/_common.scss */
#main .btn-secondary:hover, #main .btn-secondary:focus, #main .btn-secondary.active { #main .btn-secondary:hover, #main .btn-secondary:focus, #main .btn-secondary.active {
background-color: #ece4d8; background-color: #ece4d8;
border: solid 1px #ece4d8; border: solid 1px #ece4d8;
color: black; color: black;
} }
/* line 38, ../sass/_common.scss */
#main .alert-information {
padding: 20px;
margin-bottom: 20px;
/* line 40, ../sass/_common.scss */
#main .alert {
border: 0px none; border: 0px none;
background-color: #ece4d8 !important;
color: black;
-moz-border-radius: 0px !important; -moz-border-radius: 0px !important;
-webkit-border-radius: 0px; -webkit-border-radius: 0px;
border-radius: 0px !important; border-radius: 0px !important;
color: black;
padding: 20px;
margin-bottom: 20px;
}
/* line 47, ../sass/_common.scss */
#main .alert.alert-success {
background-color: #e4e9ad !important;
}
/* line 51, ../sass/_common.scss */
#main .alert.alert-info {
background-color: #97bfc4 !important;
}
/* line 55, ../sass/_common.scss */
#main .alert.alert-warning {
background-color: #ecd58e !important;
}
/* line 59, ../sass/_common.scss */
#main .alert.alert-danger {
background-color: #edbaa4 !important;
}
/* line 63, ../sass/_common.scss */
#main .alert.alert-dark {
background-color: #ece4d8 !important;
}
/* line 70, ../sass/_common.scss */
#main .table {
border: 0px none;
}
/* line 73, ../sass/_common.scss */
#main .table.table-striped > tbody > tr:nth-of-type(2n) > *,
#main .table thead tr th {
background-color: #ece4d8;
}
/* line 78, ../sass/_common.scss */
#main .table.table-striped > tbody > tr:nth-of-type(2n+1) > * {
background-color: #f8f7f3;
}
/* line 82, ../sass/_common.scss */
#main .table thead tr th,
#main .table tbody tr td {
-moz-box-shadow: -20px 0 20px -20px rgba(0, 0, 0, 0.2) inset;
-webkit-box-shadow: -20px 0 20px -20px rgba(0, 0, 0, 0.2) inset;
box-shadow: -20px 0 20px -20px rgba(0, 0, 0, 0.2) inset;
}
/* line 86, ../sass/_common.scss */
#main .table thead tr th:last-child,
#main .table tbody tr td:last-child {
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
/* line 92, ../sass/_common.scss */
#main .table thead tr {
border: 0px none;
}
/* line 94, ../sass/_common.scss */
#main .table thead tr th {
border: 0px none;
padding: 10px 20px;
}
/* line 102, ../sass/_common.scss */
#main .table tbody tr {
border: 0px none;
}
/* line 104, ../sass/_common.scss */
#main .table tbody tr td {
border: 0px none;
padding: 20px;
}
/* line 114, ../sass/_common.scss */
#main form .control-label {
font-family: 'worksans_medium';
}
/* line 118, ../sass/_common.scss */
#main form input[type="text"],
#main form input[type="email"],
#main form input[type="password"],
#main form textarea,
#main form select {
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
-moz-border-radius: 0px;
-webkit-border-radius: 0px;
border-radius: 0px;
border: solid 1px #b7ab9b;
}
/* line 128, ../sass/_common.scss */
#main form .form-control:hover {
border: solid 1px gray;
}
/* line 132, ../sass/_common.scss */
#main form .form-control:focus {
-moz-box-shadow: 0px 0px 0px 1px #ee6f42;
-webkit-box-shadow: 0px 0px 0px 1px #ee6f42;
box-shadow: 0px 0px 0px 1px #ee6f42;
border: solid 1px #ee6f42;
}
/* line 138, ../sass/_common.scss */
#main form .has-error .control-label {
color: black;
}
/* line 142, ../sass/_common.scss */
#main form .has-error .form-control:focus, #main form .has-error .form-control {
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
border-color: #a94442;
}
/* line 147, ../sass/_common.scss */
#main form .has-error .help-block-error {
color: #a94442;
}
/* line 152, ../sass/_common.scss */
#main form .form-buttons {
text-align: right;
} }


/* line 49, ../sass/_common.scss */
/* Divers */
/* line 159, ../sass/_common.scss */
.float-left { .float-left {
float: left; float: left;
} }


/* line 53, ../sass/_common.scss */
/* line 163, ../sass/_common.scss */
.float-right { .float-right {
float: right; float: right;
} }


/* line 167, ../sass/_common.scss */
.clr {
clear: both;
}

/* Navigation utilisateur en haut du site */ /* Navigation utilisateur en haut du site */
/* line 58, ../sass/_common.scss */
/* line 172, ../sass/_common.scss */
.container-nav-user-top { .container-nav-user-top {
position: relative; position: relative;
z-index: 999; z-index: 999;
} }
/* line 62, ../sass/_common.scss */
/* line 176, ../sass/_common.scss */
.container-nav-user-top .nav-user-top { .container-nav-user-top .nav-user-top {
position: absolute; position: absolute;
top: 0px; top: 0px;
background-color: white; background-color: white;
z-index: 100; z-index: 100;
} }
/* line 69, ../sass/_common.scss */
/* line 183, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .navbar { .container-nav-user-top .nav-user-top .navbar {
-moz-border-radius: 0px; -moz-border-radius: 0px;
-webkit-border-radius: 0px; -webkit-border-radius: 0px;
margin: 0px; margin: 0px;
min-height: 0px; min-height: 0px;
} }
/* line 76, ../sass/_common.scss */
/* line 190, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .navbar ul { .container-nav-user-top .nav-user-top .navbar ul {
position: relative; position: relative;
left: -10px; left: -10px;
} }
/* line 80, ../sass/_common.scss */
/* line 194, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .navbar ul li { .container-nav-user-top .nav-user-top .navbar ul li {
padding-left: 5px; padding-left: 5px;
} }
/* line 83, ../sass/_common.scss */
/* line 197, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .navbar ul li a.nav-link { .container-nav-user-top .nav-user-top .navbar ul li a.nav-link {
padding-left: 10px; padding-left: 10px;
padding-right: 10px; padding-right: 10px;
color: black; color: black;
font-size: 16px; font-size: 16px;
} }
/* line 92, ../sass/_common.scss */
/* line 206, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .navbar ul li a.nav-link:hover, .container-nav-user-top .nav-user-top .navbar ul li a.nav-link:focus, .container-nav-user-top .nav-user-top .navbar ul li a.nav-link.active { .container-nav-user-top .nav-user-top .navbar ul li a.nav-link:hover, .container-nav-user-top .nav-user-top .navbar ul li a.nav-link:focus, .container-nav-user-top .nav-user-top .navbar ul li a.nav-link.active {
background: none; background: none;
color: #ee6f42; color: #ee6f42;
} }
/* line 97, ../sass/_common.scss */
/* line 211, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .navbar ul li a.nav-link .bi { .container-nav-user-top .nav-user-top .navbar ul li a.nav-link .bi {
color: #ee6f42; color: #ee6f42;
font-size: 16px; font-size: 16px;
position: relative; position: relative;
top: 1px; top: 1px;
} }
/* line 107, ../sass/_common.scss */
/* line 221, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .navbar ul li .dropdown-menu a { .container-nav-user-top .nav-user-top .navbar ul li .dropdown-menu a {
padding: 2px 20px; padding: 2px 20px;
} }
/* line 110, ../sass/_common.scss */
/* line 224, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .navbar ul li .dropdown-menu a:hover, .container-nav-user-top .nav-user-top .navbar ul li .dropdown-menu a:focus { .container-nav-user-top .nav-user-top .navbar ul li .dropdown-menu a:hover, .container-nav-user-top .nav-user-top .navbar ul li .dropdown-menu a:focus {
background-color: #ece4d8; background-color: #ece4d8;
} }
/* line 119, ../sass/_common.scss */
/* line 233, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .dropdown-menu { .container-nav-user-top .nav-user-top .dropdown-menu {
z-index: 9999; z-index: 9999;
} }
/* line 121, ../sass/_common.scss */
/* line 235, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .dropdown-menu .divider.dropdown-header { .container-nav-user-top .nav-user-top .dropdown-menu .divider.dropdown-header {
padding: 0px; padding: 0px;
} }


@media screen and (max-width: 991px) { @media screen and (max-width: 991px) {
/* line 131, ../sass/_common.scss */
/* line 245, ../sass/_common.scss */
.container-nav-user-top { .container-nav-user-top {
padding: 0px; padding: 0px;
margin: 0px; margin: 0px;
width: 100%; width: 100%;
max-width: none; max-width: none;
} }
/* line 137, ../sass/_common.scss */
/* line 251, ../sass/_common.scss */
.container-nav-user-top .nav-user-top { .container-nav-user-top .nav-user-top {
position: relative; position: relative;
} }
/* line 141, ../sass/_common.scss */
/* line 255, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .navbar ul { .container-nav-user-top .nav-user-top .navbar ul {
width: 100%; width: 100%;
display: block; display: block;
margin-right: 0px; margin-right: 0px;
text-align: center; text-align: center;
} }
/* line 147, ../sass/_common.scss */
/* line 261, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .navbar ul li { .container-nav-user-top .nav-user-top .navbar ul li {
display: inline-block; display: inline-block;
} }
/* line 151, ../sass/_common.scss */
/* line 265, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .navbar ul li.nav-item-producers .dropdown-menu { .container-nav-user-top .nav-user-top .navbar ul li.nav-item-producers .dropdown-menu {
right: -95px; right: -95px;
} }
/* line 158, ../sass/_common.scss */
/* line 272, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .navbar .link-text { .container-nav-user-top .nav-user-top .navbar .link-text {
display: none; display: none;
} }
/* line 162, ../sass/_common.scss */
/* line 276, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .navbar .dropdown-menu { .container-nav-user-top .nav-user-top .navbar .dropdown-menu {
position: absolute; position: absolute;
right: 5%; right: 5%;
-webkit-box-shadow: 0px 0px 4px gray; -webkit-box-shadow: 0px 0px 4px gray;
box-shadow: 0px 0px 4px gray; box-shadow: 0px 0px 4px gray;
} }
/* line 171, ../sass/_common.scss */
/* line 285, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .navbar .dropdown-menu li a { .container-nav-user-top .nav-user-top .navbar .dropdown-menu li a {
padding-left: 15px; padding-left: 15px;
} }
} }
/* Block de date */ /* Block de date */
/* line 182, ../sass/_common.scss */
/* line 296, ../sass/_common.scss */
.block-date { .block-date {
margin: 0px auto; margin: 0px auto;
padding-top: 0px; padding-top: 0px;
text-align: center; text-align: center;
} }
/* line 187, ../sass/_common.scss */
/* line 301, ../sass/_common.scss */
.block-date .day { .block-date .day {
text-transform: capitalize; text-transform: capitalize;
line-height: 15px; line-height: 15px;
font-size: 13px; font-size: 13px;
text-transform: uppercase; text-transform: uppercase;
} }
/* line 194, ../sass/_common.scss */
/* line 308, ../sass/_common.scss */
.block-date .num { .block-date .num {
font-size: 30px; font-size: 30px;
line-height: 35px; line-height: 35px;
font-weight: bold; font-weight: bold;
} }
/* line 200, ../sass/_common.scss */
/* line 314, ../sass/_common.scss */
.block-date .month { .block-date .month {
text-transform: uppercase; text-transform: uppercase;
line-height: 15px; line-height: 15px;
} }


/* Page d'erreur */ /* Page d'erreur */
/* line 210, ../sass/_common.scss */
/* line 324, ../sass/_common.scss */
#main #content .site-error .col-lg-6 { #main #content .site-error .col-lg-6 {
margin: 0px auto; margin: 0px auto;
float: none; float: none;
} }
/* line 216, ../sass/_common.scss */
/* line 330, ../sass/_common.scss */
#main #content .site-error .panel .panel-body { #main #content .site-error .panel .panel-body {
padding-bottom: 0px; padding-bottom: 0px;
} }
/* line 220, ../sass/_common.scss */
/* line 334, ../sass/_common.scss */
#main #content .site-error .panel h2 { #main #content .site-error .panel h2 {
text-transform: none; text-transform: none;
font-size: 25px; font-size: 25px;
margin-top: 0px; margin-top: 0px;
margin-bottom: 0px; margin-bottom: 0px;
} }
/* line 228, ../sass/_common.scss */
/* line 342, ../sass/_common.scss */
#main #content .site-error .alert { #main #content .site-error .alert {
padding-bottom: 5px; padding-bottom: 5px;
} }
/* line 231, ../sass/_common.scss */
/* line 345, ../sass/_common.scss */
#main #content .site-error .alert h2 { #main #content .site-error .alert h2 {
margin-top: 5px; margin-top: 5px;
} }
/* line 235, ../sass/_common.scss */
/* line 349, ../sass/_common.scss */
#main #content .site-error .alert p { #main #content .site-error .alert p {
margin-bottom: 15px; margin-bottom: 15px;
} }
/* line 239, ../sass/_common.scss */
/* line 353, ../sass/_common.scss */
#main #content .site-error .alert .btn { #main #content .site-error .alert .btn {
text-decoration: none; text-decoration: none;
} }


/* Paiement */ /* Paiement */
/* line 250, ../sass/_common.scss */
/* line 364, ../sass/_common.scss */
.payment-detail-remaining-surplus { .payment-detail-remaining-surplus {
font-size: 13px; font-size: 13px;
color: gray; color: gray;
} }
/* line 254, ../sass/_common.scss */
/* line 368, ../sass/_common.scss */
.payment-detail-remaining-surplus strong { .payment-detail-remaining-surplus strong {
font-weight: bold; font-weight: bold;
} }

+ 123
- 9
common/web/sass/_common.scss View File

@import "compass"; @import "compass";


#main { #main {
/* Boutons */
.btn-primary, .btn-primary,
.btn-secondary { .btn-secondary {
@include border-radius(0px);
font-family: 'worksans_semibold'; font-family: 'worksans_semibold';


.bi { .bi {


.btn-primary { .btn-primary {
background-color: $color-primary; background-color: $color-primary;
border: solid 1px $color-primary;
border: 0px none;
color: white; color: white;


&:hover, &:active, &:focus { &:hover, &:active, &:focus {
background-color: darken($color-primary, 5);
border: solid 1px $color-primary;
filter: brightness(90%);
border: 0px none;
color: white; color: white;
} }
} }
} }
} }


.alert-information {
/* Alertes */
.alert {
border: 0px none;
@include border-radius(0px !important);
color: black;
padding: 20px; padding: 20px;
margin-bottom: 20px; margin-bottom: 20px;

&.alert-success {
background-color: #e4e9ad !important;
}

&.alert-info {
background-color: #97bfc4 !important;
}

&.alert-warning {
background-color: #ecd58e !important;
}

&.alert-danger {
background-color: #edbaa4 !important;
}

&.alert-dark {
background-color: $color-gray !important;
}
}

/* Tableaux */
$table-striped-bg-factor: black;
.table {
border: 0px none; border: 0px none;
background-color: $color-gray !important;
color: black;
@include border-radius(0px !important);

&.table-striped > tbody > tr:nth-of-type(2n) > *,
thead tr th {
background-color: $color-gray;
}

&.table-striped > tbody > tr:nth-of-type(2n+1) > * {
background-color: #f8f7f3;
}

thead tr th,
tbody tr td {
@include box-shadow(-20px 0 20px -20px rgba(0,0,0,0.2) inset);

&:last-child {
@include box-shadow(none);
}
}

thead {
tr {
border: 0px none;
th {
border: 0px none;
padding: 10px 20px;
}
}
}

tbody {
tr {
border: 0px none;
td {
border: 0px none;
padding: 20px;
}
}
}
} }
}


/* Formulaires */
form {
.control-label {
font-family: 'worksans_medium';
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
@include box-shadow(none);
@include border-radius(0px);
border: solid 1px $color-gray-dark;
}

.form-control:hover {
border: solid 1px gray;
}


.form-control:focus {
@include box-shadow(0px 0px 0px 1px $color-primary) ;
border: solid 1px $color-primary;
}

.has-error {
.control-label {
color: black;
}

.form-control:focus, .form-control {
@include box-shadow(none);
border-color: #a94442;
}

.help-block-error {
color: #a94442;
}
}

.form-buttons {
text-align: right;
}
}
}

/* Divers */
.float-left { .float-left {
float: left; float: left;
} }
float: right; float: right;
} }


.clr {
clear: both;
}

/* Navigation utilisateur en haut du site */ /* Navigation utilisateur en haut du site */
.container-nav-user-top { .container-nav-user-top {
position: relative; position: relative;

+ 2
- 1
common/web/sass/screen.scss View File



$color-primary: #ee6f42; $color-primary: #ee6f42;
$color-secondary: #e4ac07; $color-secondary: #e4ac07;
$color-gray: #ece4d8;
$color-gray-light: #f4efe8; $color-gray-light: #f4efe8;
$color-gray: #ece4d8;
$color-gray-dark: #b7ab9b;


$dir-fonts: '../fonts/' ; $dir-fonts: '../fonts/' ;



+ 8
- 7
domain/Payment/PaymentSolver.php View File

$type = $payment->getType(); $type = $payment->getType();


if (Payment::TYPE_INITIAL_CREDIT == $type) { if (Payment::TYPE_INITIAL_CREDIT == $type) {
$str = 'Crédit initial';
$str = 'Crédit initial cagnotte';
} elseif (Payment::TYPE_CREDIT == $type) { } elseif (Payment::TYPE_CREDIT == $type) {
$str = 'Crédit';
$str = 'Crédit cagnotte';
} elseif (Payment::TYPE_PAYMENT == $type) { } elseif (Payment::TYPE_PAYMENT == $type) {
$str = 'Débit';
$str = 'Paiement';
} elseif (Payment::TYPE_REFUND == $type) { } elseif (Payment::TYPE_REFUND == $type) {
$str = 'Recrédit';
$str = 'Remboursement';
} elseif (Payment::TYPE_DEBIT == $type) { } elseif (Payment::TYPE_DEBIT == $type) {
$str = 'Débit';
$str = 'Débit cagnotte';
} }


if (Payment::TYPE_PAYMENT == $type || Payment::TYPE_REFUND == $type) { if (Payment::TYPE_PAYMENT == $type || Payment::TYPE_REFUND == $type) {
} }


if ($order && $order->distribution) { if ($order && $order->distribution) {
$str .= ' : commande du <a href="'.\Yii::$app->urlManager->createUrl(['distribution/index', 'date' => $order->distribution->date]).'">' . date('d/m/Y', strtotime($order->distribution->date)).'</a>';
//$str .= '<br /><small>commande du <a href="'.\Yii::$app->urlManager->createUrl(['distribution/index', 'date' => $order->distribution->date]).'">' . date('d/m/Y', strtotime($order->distribution->date)).'</a></small>';
$str .= '<br /><small>Commande du ' . date('d/m/Y', strtotime($order->distribution->date)).'</small>';
} else { } else {
$str .= ' : commande supprimée';
$str .= '<br /><small>Commande supprimée</small>';
} }
} }



+ 5
- 0
domain/PointSale/PointSale/PointSaleRepository.php View File

->find(); ->find();
} }


public function countPointSalesPublic()
{
return $this->queryPointSalesPublic($this->getProducerContext())->count();
}

public function queryPointSalesPublic(Producer $producer) public function queryPointSalesPublic(Producer $producer)
{ {
return $this->createDefaultQuery() return $this->createDefaultQuery()

+ 3
- 3
domain/PointSale/PointSale/PointSaleSolver.php View File



public function getLocalityWithAddressTooltip(PointSale $pointSale): string public function getLocalityWithAddressTooltip(PointSale $pointSale): string
{ {
$html = '';

$html = '<span class="locality">';
if($pointSale->address && strlen($pointSale->address) > 0) { if($pointSale->address && strlen($pointSale->address) > 0) {
$html .= '<span data-toggle="tooltip" data-placement="bottom" title="'.Html::encode($pointSale->address).'">'.Html::encode($pointSale->locality).'</span>';
$html .= '<span data-bs-toggle="tooltip" data-bs-placement="bottom" title="'.Html::encode($pointSale->address).'">'.Html::encode($pointSale->locality).'</span>';
} }
else { else {
$html .= Html::encode($pointSale->locality); $html .= Html::encode($pointSale->locality);
} }
$html .= '</span>';


return $html; return $html;
} }

+ 6
- 2
domain/Product/Product/ProductRepository.php View File

/** /**
* Retourne le nombre de produits du producteur courant. * Retourne le nombre de produits du producteur courant.
*/ */
public function countProducts(): int
public function countProducts($isStatusOnline = false): int
{ {
return $this->createDefaultQuery()->count();
$query = $this->createDefaultQuery();
if($isStatusOnline) {
$query->filterIsStatusOnline();
}
return $query->count();
} }


public function queryProductsByDistribution(Distribution $distribution, bool $filterStatus = true, string $orderBy = null) public function queryProductsByDistribution(Distribution $distribution, bool $filterStatus = true, string $orderBy = null)

+ 2
- 2
frontend/views/site/_prices_producer.php View File

</h3> </h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<div class="alert alert-information" role="alert">
<div class="alert alert-dark" role="alert">
Découvrez ci-dessous la <strong>grille tarifaire</strong> pour l'hébergement de votre circuit court sur Souke. Découvrez ci-dessous la <strong>grille tarifaire</strong> pour l'hébergement de votre circuit court sur Souke.
Le montant qui vous est facturé mensuellement dépend de votre chiffre d’affaire hors taxe réalisé sur le logiciel. Le montant qui vous est facturé mensuellement dépend de votre chiffre d’affaire hors taxe réalisé sur le logiciel.
Il est donc adapté chaque mois en fonction de l’évolution de votre activité. Le service est Il est donc adapté chaque mois en fonction de l’évolution de votre activité. Le service est
</h3> </h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<div class="alert alert-information" role="alert">
<div class="alert alert-dark" role="alert">
Retrouvez ici les modules payants de Souke correspondant aux développements qui n'ont pas encore Retrouvez ici les modules payants de Souke correspondant aux développements qui n'ont pas encore
été totalement financés et aux fonctionnalités nécessitant une configuration spécifique. Contactez-moi été totalement financés et aux fonctionnalités nécessitant une configuration spécifique. Contactez-moi
pour demander l'activation d'un module. pour demander l'activation d'un module.

+ 1
- 1
frontend/views/site/contact.php View File

<?php ActiveForm::end(); ?> <?php ActiveForm::end(); ?>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="alert alert-information">
<div class="alert alert-dark">
Ce formulaire de contact vous permet de joindre le développeur de la plateforme Souke. Ce formulaire de contact vous permet de joindre le développeur de la plateforme Souke.
Si vous souhaitez joindre un producteur, merci de le faire directement depuis sa boutique. Si vous souhaitez joindre un producteur, merci de le faire directement depuis sa boutique.
</div> </div>

+ 215
- 270
frontend/web/css/screen.css
File diff suppressed because it is too large
View File


+ 1
- 1
frontend/web/sass/_responsive.scss View File

padding: 0px; padding: 0px;
} }


.alert-information {
.alert-dark {
margin-top: 20px; margin-top: 20px;
} }
} }

+ 0
- 49
frontend/web/sass/screen.scss View File

font-weight: bold; font-weight: bold;
} }


.table {
background-color: white;
}

.help-block { .help-block {
padding-bottom: 5px; padding-bottom: 5px;
} }
} }
} }


#wrapper form {

.control-label {
font-family: 'worksans_medium';
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
@include box-shadow(none);
@include border-radius(0px);
border: solid 1px #e0e0e0;
}

.form-control:hover {
border: solid 1px gray;
}

.form-control:focus {
@include box-shadow(0px 0px 0px 1px $color-primary) ;
border: solid 1px $color-primary;
}

.has-error {
.control-label {
color: black;
}

.form-control:focus, .form-control {
@include box-shadow(none);
border-color: #a94442;
}

.help-block-error {
color: #a94442;
}
}
}

.form-buttons {
text-align: right;
}

p { p {
padding-bottom: 20px; padding-bottom: 20px;
line-height: 21px; line-height: 21px;

+ 2
- 2
producer/controllers/NewsletterController.php View File

$userModule = $this->getUserModule(); $userModule = $this->getUserModule();
$userCurrent = $this->getUserCurrent(); $userCurrent = $this->getUserCurrent();
$userModule->subscribeUserNewsletter($userCurrent); $userModule->subscribeUserNewsletter($userCurrent);
$this->setFlash('success', "Votre inscription au bulletin d'information a bien été prise en compte.");
//$this->setFlash('success', "<i class=\"bi bi-check2-square\"></i> Votre inscription à l'infolettre a bien été prise en compte.");
return $this->redirect('index'); return $this->redirect('index');
} }


$userModule = $this->getUserModule(); $userModule = $this->getUserModule();
$userCurrent = $this->getUserCurrent(); $userCurrent = $this->getUserCurrent();
$userModule->unsubscribeUserNewsletter($userCurrent); $userModule->unsubscribeUserNewsletter($userCurrent);
$this->setFlash('success', "À partir de maintenant, vous ne recevrez plus d'email de la part de ce producteur.");
//$this->setFlash('success', "<i class=\"bi bi-check2-square\"></i> Votre désinscription a bien été prise en compte, vous ne recevrez plus d'infolettre de la part de ce producteur.");
return $this->redirect('index'); return $this->redirect('index');
} }



+ 23
- 15
producer/controllers/SiteController.php View File

} }
} }


/**
* Affiche la page d'accueil des producteurs comprenant une image, une
* description, la liste des points de vente et les produits.
*/
public function actionIndex() public function actionIndex()
{ {
$productModule = $this->getProductModule();
$pointSaleModule = $this->getPointSaleModule();
return $this->render('index');
}


$dataProviderPointsSale = new ActiveDataProvider([
'query' => $pointSaleModule->queryPointSalesPublic($this->getProducerCurrent()),
'pagination' => [
'pageSize' => 50,
],
'sort' => false,
]);
public function actionProducts()
{
$productModule = $this->getProductModule();


$productCategoryArray = $this->getProductCategoryModule()->findProductCategories(); $productCategoryArray = $this->getProductCategoryModule()->findProductCategories();
$dataProviderProductsByCategories = []; $dataProviderProductsByCategories = [];
} }
} }


return $this->render('index', [
return $this->render('products', [
'dataProviderProductsByCategories' => $dataProviderProductsByCategories, 'dataProviderProductsByCategories' => $dataProviderProductsByCategories,
'dataProviderPointsSale' => $dataProviderPointsSale,
'dataProviderProducts' => $dataProviderProducts, 'dataProviderProducts' => $dataProviderProducts,
'hasProductPhoto' => $hasProductPhoto, 'hasProductPhoto' => $hasProductPhoto,
'hasProductWeight' => $hasProductWeight, 'hasProductWeight' => $hasProductWeight,
]); ]);
} }


public function actionPointsSale()
{
$pointSaleModule = $this->getPointSaleModule();

$dataProviderPointsSale = new ActiveDataProvider([
'query' => $pointSaleModule->queryPointSalesPublic($this->getProducerCurrent()),
'pagination' => [
'pageSize' => 50,
],
'sort' => false,
]);

return $this->render('points-sale', [
'dataProviderPointsSale' => $dataProviderPointsSale,
]);
}

public function filterProductsPublic($dataProviderProducts) public function filterProductsPublic($dataProviderProducts)
{ {
$productModule = $this->getProductModule(); $productModule = $this->getProductModule();

+ 7
- 7
producer/views/credit/add.php View File

$producerModule = ProducerModule::getInstance(); $producerModule = ProducerModule::getInstance();
$producer = $this->context->getProducerCurrent(); $producer = $this->context->getProducerCurrent();


$this->setTitle('Créditer mon compte');
$this->setPageTitle('Crédit mon compte');
$this->setTitle('Créditer ma cagnotte');
$this->setPageTitle('Crédit ma cagnotte');


$this->addButton( $this->addButton(
[ [
'label' => 'Retour',
'label' => '<i class="bi bi-arrow-left-short"></i> Retour',
'url' => 'credit/history', 'url' => 'credit/history',
'class' => 'btn btn-default'
'class' => 'btn btn-secondary'
] ]
); );


'enableAjaxValidation' => false, 'enableAjaxValidation' => false,
]); ?> ]); ?>
<?= $form->field($creditForm, 'amount', [ <?= $form->field($creditForm, 'amount', [
'template' => '{label}<div class="input-group input-group-lg">{input}<span class="input-group-addon"><span class="glyphicon glyphicon-euro"></span></span></div>{hint}',
'template' => '{label}<div class="input-group input-group-lg">{input}<span class="input-group-text">€</span></div>{hint}{error}',
]) ])
->label('Quel montant souhaitez-vous créditer ?')
->label('Quel montant souhaitez-vous créditer sur votre cagnotte ?')
->hint('Montant minimum : '.$producerModule->getOnlinePaymentMinimumAmount().' €'); ?> ->hint('Montant minimum : '.$producerModule->getOnlinePaymentMinimumAmount().' €'); ?>


<div class="form-group"> <div class="form-group">
<?= Html::submitButton('<span class="glyphicon glyphicon-lock"></span> Payer', ['class' => 'btn btn-primary']
<?= Html::submitButton('<i class="bi bi-credit-card"></i> Payer', ['class' => 'btn btn-primary']
) ?> ) ?>
</div> </div>
<?php <?php

+ 7
- 14
producer/views/credit/history.php View File

$paymentManager = PaymentModule::getInstance(); $paymentManager = PaymentModule::getInstance();
$featureChecker = FeatureModule::getInstance()->getChecker(); $featureChecker = FeatureModule::getInstance()->getChecker();
$producer = $this->context->getProducerCurrent(); $producer = $this->context->getProducerCurrent();
$this->setTitle('Crédit : <span id="credit-user">' . number_format($creditUser, 2) . ' €</span>');
$this->setTitle('Cagnotte : <span id="credit-user">' . number_format($creditUser, 2) . ' €</span>');
$this->setPageTitle('Crédit'); $this->setPageTitle('Crédit');


if ($featureChecker->isEnabled(Feature::ALIAS_ONLINE_PAYMENT) && $this->context->getProducerCurrent()->online_payment) { if ($featureChecker->isEnabled(Feature::ALIAS_ONLINE_PAYMENT) && $this->context->getProducerCurrent()->online_payment) {
$this->addButton( $this->addButton(
[ [
'label' => '<span class="glyphicon glyphicon-credit-card"></span> Créditer mon compte',
'label' => '<i class="bi bi-credit-card"></i> Créditer ma cagnotte',
'url' => 'credit/add', 'url' => 'credit/add',
'class' => 'btn btn-primary' 'class' => 'btn btn-primary'
] ]
return $paymentManager->getDate($model, true); return $paymentManager->getDate($model, true);
} }
], ],
[
/*[
'attribute' => 'id_user_action', 'attribute' => 'id_user_action',
'value' => function ($model) use ($paymentManager) { 'value' => function ($model) use ($paymentManager) {
return $paymentManager->getStrUserAction($model); return $paymentManager->getStrUserAction($model);
} }
],
],*/
[ [
'label' => 'Type', 'label' => 'Type',
'format' => 'raw', 'format' => 'raw',
} }
], ],
[ [
'label' => '- Débit',
'label' => 'Montant',
'format' => 'raw', 'format' => 'raw',
'value' => function ($model) use ($paymentManager) { 'value' => function ($model) use ($paymentManager) {
if ($paymentManager->isTypeDebit($model)) { if ($paymentManager->isTypeDebit($model)) {
return '-&nbsp;' . $paymentManager->getAmount($model, true); return '-&nbsp;' . $paymentManager->getAmount($model, true);
} }
return '';
}
],
[
'label' => '+ Crédit',
'format' => 'raw',
'value' => function ($model) use ($paymentManager) {
if ($paymentManager->isTypeCredit($model)) {
return '+&nbsp;' . $paymentManager->getAmount($model, true);
elseif($paymentManager->isTypeCredit($model)) {
return '<span class="payment-positive">+&nbsp;' . $paymentManager->getAmount($model, true).'</span>';
} }
return ''; return '';
} }

+ 38
- 18
producer/views/layouts/main.php View File

use domain\Feature\Feature\Feature; use domain\Feature\Feature\Feature;
use domain\Feature\Feature\FeatureModule; use domain\Feature\Feature\FeatureModule;
use domain\Order\Order\Order; use domain\Order\Order\Order;
use domain\PointSale\PointSale\PointSaleModule;
use domain\Producer\Producer\ProducerModule; use domain\Producer\Producer\ProducerModule;
use domain\Product\Product\ProductModule;
use domain\User\User\UserModule; use domain\User\User\UserModule;
use domain\User\UserProducer\UserProducer; use domain\User\UserProducer\UserProducer;
use yii\bootstrap\Nav; use yii\bootstrap\Nav;
$userCurrent = GlobalParam::getCurrentUser(); $userCurrent = GlobalParam::getCurrentUser();
$producerModule = ProducerModule::getInstance(); $producerModule = ProducerModule::getInstance();
$featureModule = FeatureModule::getInstance(); $featureModule = FeatureModule::getInstance();
$productModule = ProductModule::getInstance();
$pointSaleModule = PointSaleModule::getInstance();
$producerUser = null; $producerUser = null;
if ($userModule->getAuthorizationChecker()->isGrantedAsProducer($userCurrent)) { if ($userModule->getAuthorizationChecker()->isGrantedAsProducer($userCurrent)) {
$producerUser = $producerModule->findOneProducerById($userCurrent->id_producer); $producerUser = $producerModule->findOneProducerById($userCurrent->id_producer);
<?= $this->render('@common/views/matomo.php') ?> <?= $this->render('@common/views/matomo.php') ?>
<style> <style>
#header #title h1, #header #title h1,
#header #title h2 .location .bi {
#header #title h2 .location .bi,
#content a,
.credit-history #credit-user,
.credit-history #content .table span.payment-positive {
color: <?= $mainColor ?> color: <?= $mainColor ?>
} }
#header nav#main-nav ul li.active a, #header nav#main-nav ul li.active a,
#header nav#main-nav ul li a:hover, #header nav#main-nav ul li a:hover,
#header nav#main-nav ul li a span.label-success {
background-color: <?= $mainColor ?>
#header nav#main-nav ul li a span.label-success,
#main .btn-primary {
background-color: <?= $mainColor ?>;
} }
#header nav#main-nav { #header nav#main-nav {
border-top: solid 5px <?= $mainColor ?>; border-top: solid 5px <?= $mainColor ?>;
} }
#main form .form-control:focus {
box-shadow: 0px 0px 0px 1px <?= $mainColor ?>;
border: solid 1px <?= $mainColor ?>;
}
</style> </style>
</head> </head>
<body class="<?= \Yii::$app->controller->id . '-' . \Yii::$app->controller->action->id ?>"> <body class="<?= \Yii::$app->controller->id . '-' . \Yii::$app->controller->action->id ?>">
$labelOrders = $countOrders > 0 ? 'success' : 'default'; $labelOrders = $countOrders > 0 ? 'success' : 'default';


$isUserSubscribedNewsletter = $userModule->isUserSubscribedNewsletter($userCurrent); $isUserSubscribedNewsletter = $userModule->isUserSubscribedNewsletter($userCurrent);
$isHome = in_array($this->getControllerAction(), ['site/index', 'site/products', 'site/points-sale']);


echo Nav::widget([ echo Nav::widget([
'encodeLabels' => false, 'encodeLabels' => false,
[ [
'url' => $this->getUrlManagerProducer()->createUrl(['site/index']), 'url' => $this->getUrlManagerProducer()->createUrl(['site/index']),
'label' => '<i class="bi bi-house-door"></i>', 'label' => '<i class="bi bi-house-door"></i>',
'active' => $this->getControllerAction() == 'site/index',
'active' => $isHome,
], ],
[ [
'label' => '<i class="bi bi-pencil-square"></i> Commander', 'label' => '<i class="bi bi-pencil-square"></i> Commander',
], ],
]); ]);



echo Nav::widget([
'encodeLabels' => false,
'options' => ['class' => 'submenu'],
'items' => [
$submenuItems = null;
if($isHome) {
$submenuItems = [
[ [
'url' => $this->getUrlManagerProducer()->createUrl(['site/index']),
'label' => 'Présentation',
'active' => $this->getControllerAction() == 'site/index',
'url' => $this->getUrlManagerProducer()->createUrl(['site/index']),
'label' => 'Présentation',
'active' => $this->getControllerAction() == 'site/index',
], ],
[ [
'url' => $this->getUrlManagerProducer()->createUrl(['site/index']),
'label' => 'Produits',
'url' => $this->getUrlManagerProducer()->createUrl(['site/products']),
'label' => 'Produits <span class="label label-default">'.$productModule->getRepository()->countProducts(true).'</span>',
'active' => $this->getControllerAction() == 'site/products', 'active' => $this->getControllerAction() == 'site/products',
], ],
[ [
'url' => $this->getUrlManagerProducer()->createUrl(['site/index']),
'label' => 'Points de vente',
'url' => $this->getUrlManagerProducer()->createUrl(['site/points-sale']),
'label' => 'Points de vente <span class="label label-default">'.$pointSaleModule->getRepository()->countPointSalesPublic().'</span>',
'active' => $this->getControllerAction() == 'site/points-sale', 'active' => $this->getControllerAction() == 'site/points-sale',
], ],
]
]);
];
}

if($submenuItems) {
echo Nav::widget([
'encodeLabels' => false,
'options' => ['class' => 'submenu'],
'items' => $submenuItems
]);
}

?> ?>


</nav> </nav>

+ 27
- 19
producer/views/newsletter/index.php View File



$userModule = UserModule::getInstance(); $userModule = UserModule::getInstance();


$this->setTitle("Bulletin d'information");
$this->setTitle("Infolettre");

if($userModule->isUserSubscribedNewsletter($user)) {
$this->addButton(
[
'label' => '<i class="bi bi-x-circle"></i> Me désinscrire',
'url' => 'newsletter/unsubscribe',
'class' => 'btn btn-secondary'
]
);
}
else {
$this->addButton(
[
'label' => '<i class="bi bi-megaphone"></i> M\'inscrire',
'url' => 'newsletter/subscribe',
'class' => 'btn btn-primary'
]
);
}



?> ?>
<div class="newsletter-index"> <div class="newsletter-index">
<?php if($userModule->isUserSubscribedNewsletter($user)): ?> <?php if($userModule->isUserSubscribedNewsletter($user)): ?>
<div class="panel panel-default">
<div class="panel-body">
Vous êtes inscrit au bulletin d'information <strong><?= Html::encode($producer->name) ?></strong>.
</div>
<div class="alert alert-success">
<i class="bi bi-megaphone"></i>
Vous êtes inscrit à l'infolettre <strong><?= Html::encode($producer->name) ?></strong>.
</div> </div>
<p>
<a class="btn btn-danger" href="<?= $this->getUrlManagerProducer()->createUrl(['newsletter/unsubscribe']) ?>">
Me désinscrire
</a>
</p>
<?php else: ?> <?php else: ?>
<div class="panel panel-default">
<div class="panel-body">
Vous n'êtes pas inscrit au bulletin d'information <strong><?= Html::encode($producer->name) ?></strong>.
</div>
<div class="alert alert-danger">
<i class="bi bi-x-circle"></i>
Vous n'êtes pas inscrit à l'infolettre <strong><?= Html::encode($producer->name) ?></strong>.
</div> </div>
<p>
<a class="btn btn-success" href="<?= $this->getUrlManagerProducer()->createUrl(['newsletter/subscribe']) ?>">
M'inscrire
</a>
</p>
<?php endif; ?> <?php endif; ?>
</div> </div>

+ 3
- 3
producer/views/site/contact.php View File

'template' => '<div class="row"><div class="col-md-12">{image}</div><div class="col-md-12">{input}</div></div>', 'template' => '<div class="row"><div class="col-md-12">{image}</div><div class="col-md-12">{input}</div></div>',
]); ?> ]); ?>
<?= $form->field($model, 'isTest')->hiddenInput() ?> <?= $form->field($model, 'isTest')->hiddenInput() ?>
<div class="form-group">
<?= Html::submitButton('Envoyer', ['class' => 'btn btn-primary', 'name' => 'contact-button']) ?>
<div class="form-group form-buttons">
<?= Html::submitButton('<i class="bi bi-send"></i> Envoyer', ['class' => 'btn btn-primary', 'name' => 'contact-button']) ?>
</div> </div>
<?php ActiveForm::end(); ?> <?php ActiveForm::end(); ?>
</div> </div>
<?php if($producer->website): ?> <?php if($producer->website): ?>
<br /> <br />
<a href="<?= Html::encode($producer->website); ?>" target="_blank" class="btn btn-default"> <a href="<?= Html::encode($producer->website); ?>" target="_blank" class="btn btn-default">
<span class="glyphicon glyphicon-globe"></span>
<i class="bi bi-globe"></i>
Site web Site web
</a> </a>
<?php endif; ?> <?php endif; ?>

+ 2
- 162
producer/views/site/index.php View File



?> ?>


<section id="presentation">
<div id="presentation">
<?php if (strlen($producer->description)): ?> <?php if (strlen($producer->description)): ?>
<div class="description"> <div class="description">
<?= $producer->description; ?> <?= $producer->description; ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
<div class="clr"></div> <div class="clr"></div>
</section>

<!--
<section id="points-sale">
<h3><span><?= $producerModule->getPointSaleWording($producer); ?></span></h3>
<?= GridView::widget([
'dataProvider' => $dataProviderPointsSale,
'summary' => '',
'columns' => [
[
'attribute' => 'name',
'format' => 'raw',
'contentOptions' => ['class' => 'name'],
'value' => function ($model) use ($pointSaleModule) {
$html = '<span class="the-name">' . Html::encode($model->name) . '</span>';
if (strlen($model->locality)) {
$html .= '<br />à ' . $pointSaleModule->getSolver()->getLocalityWithAddressTooltip($model);
}
return $html;
}
],
[
'label' => 'Jours de livraison',
'format' => 'raw',
'contentOptions' => ['class' => 'days'],
'value' => function ($model) use ($distributionModule) {

$producer = \Yii::$app->controller->getProducerCurrent();

if ($producer->behavior_home_point_sale_day_list == Producer::BEHAVIOR_HOME_POINT_SALE_DAY_LIST_WEEK) {
$arrayDays = [
'monday' => 'Lundi',
'tuesday' => 'Mardi',
'wednesday' => 'Mercredi',
'thursday' => 'Jeudi',
'friday' => 'Vendredi',
'saturday' => 'Samedi',
'sunday' => 'Dimanche'
];

$html = '';
foreach ($arrayDays as $dayEn => $dayFr) {
$fieldDelivery = 'delivery_' . $dayEn;
$fieldInfos = 'infos_' . $dayEn;

if ($model->$fieldDelivery) {
$html .= '<strong>' . $dayFr . '</strong>';
if (strlen($model->$fieldInfos)) {
$html .= ' / <small>' . nl2br(str_replace(['[select_previous_day]', '[/select_previous_day]'], '', $model->$fieldInfos)) . '</small>';
}
$html .= '<br />';
}
}

return $html;
} elseif ($producer->behavior_home_point_sale_day_list == Producer::BEHAVIOR_HOME_POINT_SALE_DAY_LIST_INCOMING_DISTRIBUTIONS) {
$html = '';
$incomingDistributions = $distributionModule->findDistributionsIncoming();
$cpt = 0;
foreach ($incomingDistributions as $distribution) {
$countPointSaleDistribution = PointSaleDistribution::searchCount([
'id_distribution' => $distribution->id,
'id_point_sale' => $model->id,
'delivery' => 1
]);
if ($countPointSaleDistribution) {
$html .= strftime('%A %d %B', strtotime($distribution->date)) . '<br />';
}

$cpt++;
}
return $html;
}
}
]
],
]); ?>
</section>


<section id="products">
<h3><span>Produits</span></h3>

<?php
$columnsProducts = [];
if ($hasProductPhoto) {
$columnsProducts [] = [
'attribute' => 'photo',
'format' => 'raw',
'headerOptions' => ['class' => 'photo'],
'contentOptions' => ['class' => 'photo'],
'value' => function ($model) {
if (strlen($model->photo)) {
return '<a class="product-photo" href="'.Image::getThumbnailBig($model->photo).'" title="'.Html::encode($model->name).'"><img class="photo-product" src="'. Image::getThumbnailSmall($model->photo).'" />';
}
return '';
}
];
}

$columnsProducts[] = [
'attribute' => 'name',
'format' => 'raw',
'contentOptions' => ['class' => 'name product-name-description-block'],
'value' => function ($model) {
$html = '<div class="name">' . Html::encode($model->name) . '</div>';
if (strlen($model->description)) {
$html .= '<div class="description">' . Html::encode($model->description).'</div>';
}
if (strlen($model->recipe)) {
$html .= '<div class="description-long"><a href="javascript:void(0);" class="show-more-link">En savoir plus</a><div class="content">' . nl2br(Html::encode($model->recipe)).'</div></div>';
}
return $html;
}
];

if ($hasProductWeight) {
$columnsProducts[] = [
'attribute' => 'weight',
'format' => 'raw',
'value' => function ($model) {
if (strlen($model->weight)) {
return $model->weight . '&nbsp;g';
}
return '';
}
];
}

$columnsProducts[] = [
'attribute' => 'price',
'value' => function ($model) use ($productModule) {
if ($model->price) {
return Price::format($productModule->getPriceWithTax($model)) . ' (' . $productModule->getSolver()->strUnit($model, 'wording_unit', true) . ')';
}
return '';
}
];
?>

<?php if ($dataProviderProducts->query->count()) : ?>
<?= GridView::widget([
'dataProvider' => $dataProviderProducts,
'summary' => '',
'columns' => $columnsProducts
]); ?>
<?php endif; ?>

<?php foreach ($categories as $category): ?>
<?php if ($dataProviderProductsByCategories[$category->id]->query->count()): ?>
<h4><?= Html::encode($category->name) ?></h4>
<?= GridView::widget([
'dataProvider' => $dataProviderProductsByCategories[$category->id],
'summary' => '',
'columns' => $columnsProducts
]); ?>
<?php endif; ?>
<?php endforeach; ?>
</section>

-->
</div>

+ 135
- 0
producer/views/site/points-sale.php View File

<?php

/**
* Copyright distrib (2018)
*
* contact@opendistrib.net
*
* Ce logiciel est un programme informatique servant à aider les producteurs
* à distribuer leur production en circuits courts.
*
* Ce logiciel est régi par la licence CeCILL soumise au droit français et
* respectant les principes de diffusion des logiciels libres. Vous pouvez
* utiliser, modifier et/ou redistribuer ce programme sous les conditions
* de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA
* sur le site "http://www.cecill.info".
*
* En contrepartie de l'accessibilité au code source et des droits de copie,
* de modification et de redistribution accordés par cette licence, il n'est
* offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons,
* seule une responsabilité restreinte pèse sur l'auteur du programme, le
* titulaire des droits patrimoniaux et les concédants successifs.
*
* A cet égard l'attention de l'utilisateur est attirée sur les risques
* associés au chargement, à l'utilisation, à la modification et/ou au
* développement et à la reproduction du logiciel par l'utilisateur étant
* donné sa spécificité de logiciel libre, qui peut le rendre complexe à
* manipuler et qui le réserve donc à des développeurs et des professionnels
* avertis possédant des connaissances informatiques approfondies. Les
* utilisateurs sont donc invités à charger et tester l'adéquation du
* logiciel à leurs besoins dans des conditions permettant d'assurer la
* sécurité de leurs systèmes et ou de leurs données et, plus généralement,
* à l'utiliser et l'exploiter dans les mêmes conditions de sécurité.
*
* Le fait que vous puissiez accéder à cet en-tête signifie que vous avez
* pris connaissance de la licence CeCILL, et que vous en avez accepté les
* termes.
*/

use common\helpers\Image;
use common\helpers\Price;
use domain\Distribution\Distribution\DistributionModule;
use domain\Distribution\PointSaleDistribution\PointSaleDistribution;
use domain\PointSale\PointSale\PointSaleModule;
use domain\Producer\Producer\Producer;
use domain\Producer\Producer\ProducerModule;
use domain\Product\Product\ProductModule;
use yii\grid\GridView;
use yii\helpers\Html;

$productModule = ProductModule::getInstance();
$producerModule = ProducerModule::getInstance();
$distributionModule = DistributionModule::getInstance();
$pointSaleModule = PointSaleModule::getInstance();

$producer = $this->context->getProducerCurrent();

$this->setTitle('Points de vente');
$this->setPageTitle('Points de vente');

?>

<div id="points-sale">
<?= GridView::widget([
'dataProvider' => $dataProviderPointsSale,
'summary' => '',
'columns' => [
[
'attribute' => 'name',
'format' => 'raw',
'contentOptions' => ['class' => 'name'],
'value' => function ($model) use ($pointSaleModule) {
$html = '<span class="the-name">' . Html::encode($model->name) . '</span>';
if (strlen($model->locality)) {
$html .= '<br />' . $pointSaleModule->getSolver()->getLocalityWithAddressTooltip($model);
}
return $html;
}
],
[
'label' => 'Informations',
'format' => 'raw',
'contentOptions' => ['class' => 'days'],
'value' => function ($model) use ($distributionModule) {

$producer = \Yii::$app->controller->getProducerCurrent();

if ($producer->behavior_home_point_sale_day_list == Producer::BEHAVIOR_HOME_POINT_SALE_DAY_LIST_WEEK) {
$arrayDays = [
'monday' => 'Lundi',
'tuesday' => 'Mardi',
'wednesday' => 'Mercredi',
'thursday' => 'Jeudi',
'friday' => 'Vendredi',
'saturday' => 'Samedi',
'sunday' => 'Dimanche'
];

$html = '';
foreach ($arrayDays as $dayEn => $dayFr) {
$fieldDelivery = 'delivery_' . $dayEn;
$fieldInfos = 'infos_' . $dayEn;

if ($model->$fieldDelivery) {
$html .= '<div class="block-day"><strong>' . $dayFr . '</strong>';
if (strlen($model->$fieldInfos)) {
$html .= '<br /><small>' . nl2br(str_replace(['[select_previous_day]', '[/select_previous_day]'], '', $model->$fieldInfos)) . '</small>';
}
$html .= '</div>';
}
}

return $html;
} elseif ($producer->behavior_home_point_sale_day_list == Producer::BEHAVIOR_HOME_POINT_SALE_DAY_LIST_INCOMING_DISTRIBUTIONS) {
$html = '';
$incomingDistributions = $distributionModule->findDistributionsIncoming();
$cpt = 0;
foreach ($incomingDistributions as $distribution) {
$countPointSaleDistribution = PointSaleDistribution::searchCount([
'id_distribution' => $distribution->id,
'id_point_sale' => $model->id,
'delivery' => 1
]);
if ($countPointSaleDistribution) {
$html .= strftime('%A %d %B', strtotime($distribution->date)) . '<br />';
}

$cpt++;
}
return $html;
}
}
]
],
]); ?>
</div>

+ 139
- 0
producer/views/site/products.php View File

<?php

/**
* Copyright distrib (2018)
*
* contact@opendistrib.net
*
* Ce logiciel est un programme informatique servant à aider les producteurs
* à distribuer leur production en circuits courts.
*
* Ce logiciel est régi par la licence CeCILL soumise au droit français et
* respectant les principes de diffusion des logiciels libres. Vous pouvez
* utiliser, modifier et/ou redistribuer ce programme sous les conditions
* de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA
* sur le site "http://www.cecill.info".
*
* En contrepartie de l'accessibilité au code source et des droits de copie,
* de modification et de redistribution accordés par cette licence, il n'est
* offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons,
* seule une responsabilité restreinte pèse sur l'auteur du programme, le
* titulaire des droits patrimoniaux et les concédants successifs.
*
* A cet égard l'attention de l'utilisateur est attirée sur les risques
* associés au chargement, à l'utilisation, à la modification et/ou au
* développement et à la reproduction du logiciel par l'utilisateur étant
* donné sa spécificité de logiciel libre, qui peut le rendre complexe à
* manipuler et qui le réserve donc à des développeurs et des professionnels
* avertis possédant des connaissances informatiques approfondies. Les
* utilisateurs sont donc invités à charger et tester l'adéquation du
* logiciel à leurs besoins dans des conditions permettant d'assurer la
* sécurité de leurs systèmes et ou de leurs données et, plus généralement,
* à l'utiliser et l'exploiter dans les mêmes conditions de sécurité.
*
* Le fait que vous puissiez accéder à cet en-tête signifie que vous avez
* pris connaissance de la licence CeCILL, et que vous en avez accepté les
* termes.
*/

use common\helpers\Image;
use common\helpers\Price;
use domain\Distribution\Distribution\DistributionModule;
use domain\Distribution\PointSaleDistribution\PointSaleDistribution;
use domain\PointSale\PointSale\PointSaleModule;
use domain\Producer\Producer\Producer;
use domain\Producer\Producer\ProducerModule;
use domain\Product\Product\ProductModule;
use yii\grid\GridView;
use yii\helpers\Html;

$productModule = ProductModule::getInstance();
$producerModule = ProducerModule::getInstance();
$distributionModule = DistributionModule::getInstance();
$pointSaleModule = PointSaleModule::getInstance();

$producer = $this->context->getProducerCurrent();

$this->setTitle('Produits');
$this->setPageTitle('Produits');

?>

<div id="products">
<?php
$columnsProducts = [];
if ($hasProductPhoto) {
$columnsProducts [] = [
'attribute' => 'photo',
'format' => 'raw',
'headerOptions' => ['class' => 'photo'],
'contentOptions' => ['class' => 'photo'],
'value' => function ($model) {
if (strlen($model->photo)) {
return '<a class="product-photo" href="'.Image::getThumbnailBig($model->photo).'" title="'.Html::encode($model->name).'"><img class="photo-product" src="'. Image::getThumbnailSmall($model->photo).'" />';
}
return '';
}
];
}

$columnsProducts[] = [
'attribute' => 'name',
'format' => 'raw',
'contentOptions' => ['class' => 'name product-name-description-block'],
'value' => function ($model) {
$html = '<div class="name">' . Html::encode($model->name) . '</div>';
if (strlen($model->description)) {
$html .= '<div class="description">' . Html::encode($model->description).'</div>';
}
if (strlen($model->recipe)) {
$html .= '<div class="description-long"><a href="javascript:void(0);" class="show-more-link">En savoir plus</a><div class="content">' . nl2br(Html::encode($model->recipe)).'</div></div>';
}
return $html;
}
];

if ($hasProductWeight) {
$columnsProducts[] = [
'attribute' => 'weight',
'format' => 'raw',
'value' => function ($model) {
if (strlen($model->weight)) {
return $model->weight . '&nbsp;g';
}
return '';
}
];
}

$columnsProducts[] = [
'attribute' => 'price',
'format' => 'raw',
'value' => function ($model) use ($productModule) {
if ($model->price) {
return Price::format($productModule->getPriceWithTax($model)) . '<br /><small>' . $productModule->getSolver()->strUnit($model, 'wording_unit', true) . '</small>';
}
return '';
}
];
?>

<?php if ($dataProviderProducts->query->count()) : ?>
<?= GridView::widget([
'dataProvider' => $dataProviderProducts,
'summary' => '',
'columns' => $columnsProducts
]); ?>
<?php endif; ?>

<?php foreach ($categories as $category): ?>
<?php if ($dataProviderProductsByCategories[$category->id]->query->count()): ?>
<h4><?= Html::encode($category->name) ?></h4>
<?= GridView::widget([
'dataProvider' => $dataProviderProductsByCategories[$category->id],
'summary' => '',
'columns' => $columnsProducts
]); ?>
<?php endif; ?>
<?php endforeach; ?>
</div>

+ 204
- 235
producer/web/css/screen.css
File diff suppressed because it is too large
View File


+ 12
- 32
producer/web/sass/_layout.scss View File



body { body {
background-color: $color-gray-light !important; background-color: $color-gray-light !important;
font-family: 'worksans_regular' ;
font-family: 'worksans_regular' !important;
color: #333 ; color: #333 ;
line-height: 20px ; line-height: 20px ;
font-size: 14px ; font-size: 14px ;
} }


.panel { .panel {
margin-bottom: 30px;
strong { strong {
font-weight: bold; font-weight: bold;
} }


#main { #main {
position: relative ; position: relative ;

.btn {
@include border-radius(0px);
}

.btn-primary {
background-color: $color-primary ;
border: solid 1px $color-primary ;
color: white ;

&:hover, &:active, &:focus {
background-color: darken($color-primary, 5) ;
border: solid 1px $color-primary;
color: white ;
}
}
}


.btn {
background-image: none ;
} }


#main .alert { #main .alert {


.product-name-description-block { .product-name-description-block {
.name { .name {
font-family: 'capsuularegular' ;
font-family: 'worksans_semibold' ;
color: black ; color: black ;
font-size: 20px ;
line-height: 25px ;
font-weight: bold;
font-size: 1.4em ;
line-height: 1.6em ;
} }


.other { .other {
font-family: 'capsuularegular' ;
font-family: 'worksans_regular' ;
color: black ; color: black ;
font-weight: bold; font-weight: bold;
font-size: 17px ; font-size: 17px ;
} }


.description-long { .description-long {
a {
color: $color-primary;
}
.content { .content {
display: none; display: none;
} }
font-size: 0.9em; font-size: 0.9em;
@include box-shadow(none); @include box-shadow(none);
border-bottom: solid 2px $color-gray-light; border-bottom: solid 2px $color-gray-light;

span.label {
background-color: white;
border: solid 1px $color-gray-dark;
color: $color-gray-dark;
}
} }


&.active a, &.active a,
padding: 5px 10px ; padding: 5px 10px ;
margin-bottom: 0px ; margin-bottom: 0px ;
font-size: 16px ; font-size: 16px ;
font-family: 'capsuularegular' ;
background-color: white ; background-color: white ;
border-bottom: solid 1px #e0e0e0 ; border-bottom: solid 1px #e0e0e0 ;
color: gray ; color: gray ;


a { a {
color: black ; color: black ;
font-family: 'capsuularegular' ;
font-size: 18px ; font-size: 18px ;
padding-left: 10px ; padding-left: 10px ;
padding-right: 10px ; padding-right: 10px ;

+ 2
- 9
producer/web/sass/credit/_add.scss View File



.credit-add { .credit-add {
.form { .form {
max-width: 350px ;
margin: 0px auto ;
width: 300px ;
margin-top: 30px; margin-top: 30px;
text-align: center ; text-align: center ;


.form-group.field-creditform-amount { .form-group.field-creditform-amount {
text-align: center ;
//text-align: center ;
margin-bottom: 30px; margin-bottom: 30px;


label { label {
.input-group { .input-group {
width: 150px; width: 150px;
margin: 0px auto; margin: 0px auto;
//display: inline-block;


input#creditform-amount { input#creditform-amount {
text-align: center; text-align: center;

&:focus {
@include box-shadow(none);
border-color: #ccc;
}
} }
} }



+ 17
- 0
producer/web/sass/credit/_history.scss View File


.credit-history {
#content {
.table {
span.payment-positive {
display: inline-block;
font-family: 'worksans_bold';
padding: 3px 12px;
background-color: $color-gray-light;
@include border-radius(15px);
}
small {
color: gray;
}
}
}
}

+ 0
- 1
producer/web/sass/order/_confirm.scss View File

margin-left: 151px ; margin-left: 151px ;


h3 { h3 {
font-family: 'capsuularegular' ;
font-size: 30px ; font-size: 30px ;
color: #333 ; color: #333 ;
margin-bottom: 20px ; margin-bottom: 20px ;

+ 0
- 7
producer/web/sass/order/_order.scss View File

width: 100% ; width: 100% ;
text-transform: normal ; text-transform: normal ;
color: $color-primary ; color: $color-primary ;
font-family: 'capsuularegular' ;
font-size: 17px ; font-size: 17px ;
font-weight: bold ; font-weight: bold ;
} }
table#points-sale { table#points-sale {
td.name { td.name {
.the-name { .the-name {
font-family: 'capsuularegular' ;
color: black ; color: black ;
font-size: 20px ; font-size: 20px ;
line-height: 25px ; line-height: 25px ;
} }


span.label { span.label {
//font-family: 'capsuularegular' ;
font-family: 'Arial' ; font-family: 'Arial' ;
font-weight: normal ; font-weight: normal ;
float: right ; float: right ;
.summary { .summary {
h3 { h3 {
margin-top: 0px ; margin-top: 0px ;
font-family: 'capsuularegular' ;
text-transform: none ; text-transform: none ;
margin-bottom: 5px ; margin-bottom: 5px ;
} }
} }


.name { .name {
font-family: 'capsuularegular' ;
font-size: 24px ; font-size: 24px ;
} }
.other { .other {
//font-family: 'arial' ;
font-family: 'capsuularegular' ;
font-size: 18px ; font-size: 18px ;
} }
} }

+ 2
- 0
producer/web/sass/screen.scss View File

@import "compass"; @import "compass";
@import "_layout.scss"; @import "_layout.scss";
@import "site/_index.scss"; @import "site/_index.scss";
@import "site/_products.scss";
@import "site/_points_sale.scss";
@import "site/_credit_history.scss"; @import "site/_credit_history.scss";
@import "site/_contact.scss"; @import "site/_contact.scss";
@import "order/_form.scss"; @import "order/_form.scss";

+ 1
- 1
producer/web/sass/site/_credit_history.scss View File



.site-credit-history {
.credit-history {
#credit-user { #credit-user {
color: $color-primary; color: $color-primary;
font-size: 29px ; font-size: 29px ;

+ 1
- 59
producer/web/sass/site/_index.scss View File

*/ */


.site-index { .site-index {
#order {
margin-bottom: 40px ;
text-align: center ;
}
#presentation { #presentation {
.photo { .photo {
text-align: center ; text-align: center ;
.img-photo { .img-photo {
width: 100% ;
width: 100% ;
max-width: 500px ; max-width: 500px ;
} }
} }
} }
} }
} }
#points-sale {
.name {
color: #333 ;
.the-name {
font-family: 'capsuularegular' ;
font-size: 20px ;
color: black ;
}
}
.days {
strong {

}
small {
color: gray ;
//font-size: 14px ;
}
}
}
#products {

h4 {
font-family: "worksans_bold" ;
font-size: 22px ;
line-height: 30px ;
padding-top: 13px ;
text-transform: uppercase !important ;
}

td.photo {
width: 100px ;
img.photo-product {
width: 120px ;
height: auto ;
}
}
.name {
color: #333 ;
.the-name {
font-family: 'capsuularegular' ;
font-size: 20px ;
color: black ;
}
.recipe {
}
}
}
} }

+ 28
- 0
producer/web/sass/site/_points_sale.scss View File


.site-points-sale {
#points-sale {
.name {
.the-name {
font-family: 'worksans_semibold';
font-size: 20px ;
color: black ;
}
.locality {
color: gray;
}
}
.days {
.block-day {
&:not(:last-child) {
margin-bottom: 15px;
}
strong {
font-family: 'worksans_medium';
}
small {
color: gray ;
}
}
}
}
}

+ 16
- 0
producer/web/sass/site/_products.scss View File


.site-products {
#products {
td.photo {
width: 100px ;
img.photo-product {
width: 120px ;
height: auto ;
}
}

small {
color: gray;
}
}
}

+ 0
- 2
producer/web/sass/subscription/_form.scss View File

} }
.the-name { .the-name {
font-family: 'capsuularegular' ;
font-size: 20px ; font-size: 20px ;
color: black ; color: black ;
} }
} }
.name { .name {
font-family: "capsuularegular" ;
font-size: 20px ; font-size: 20px ;
color: black ; color: black ;
} }

Loading…
Cancel
Save