You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

648 lines
45KB

  1. <?php
  2. /**
  3. * Copyright Souke (2018)
  4. *
  5. * contact@souke.fr
  6. *
  7. * Ce logiciel est un programme informatique servant à aider les producteurs
  8. * à distribuer leur production en circuits courts.
  9. *
  10. * Ce logiciel est régi par la licence CeCILL soumise au droit français et
  11. * respectant les principes de diffusion des logiciels libres. Vous pouvez
  12. * utiliser, modifier et/ou redistribuer ce programme sous les conditions
  13. * de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA
  14. * sur le site "http://www.cecill.info".
  15. *
  16. * En contrepartie de l'accessibilité au code source et des droits de copie,
  17. * de modification et de redistribution accordés par cette licence, il n'est
  18. * offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons,
  19. * seule une responsabilité restreinte pèse sur l'auteur du programme, le
  20. * titulaire des droits patrimoniaux et les concédants successifs.
  21. *
  22. * A cet égard l'attention de l'utilisateur est attirée sur les risques
  23. * associés au chargement, à l'utilisation, à la modification et/ou au
  24. * développement et à la reproduction du logiciel par l'utilisateur étant
  25. * donné sa spécificité de logiciel libre, qui peut le rendre complexe à
  26. * manipuler et qui le réserve donc à des développeurs et des professionnels
  27. * avertis possédant des connaissances informatiques approfondies. Les
  28. * utilisateurs sont donc invités à charger et tester l'adéquation du
  29. * logiciel à leurs besoins dans des conditions permettant d'assurer la
  30. * sécurité de leurs systèmes et ou de leurs données et, plus généralement,
  31. * à l'utiliser et l'exploiter dans les mêmes conditions de sécurité.
  32. *
  33. * Le fait que vous puissiez accéder à cet en-tête signifie que vous avez
  34. * pris connaissance de la licence CeCILL, et que vous en avez accepté les
  35. * termes.
  36. */
  37. use common\helpers\GlobalParam;
  38. use domain\Distribution\Distribution\DistributionModule;
  39. use domain\Distribution\PointSaleDistribution\PointSaleDistribution;
  40. use domain\Producer\Producer\Producer;
  41. use domain\Producer\Producer\ProducerModule;
  42. use yii\helpers\Html;
  43. \producer\assets\VuejsOrderOrderAsset::register($this);
  44. $distributionModule =DistributionModule::getInstance();
  45. $producerModule = ProducerModule::getInstance();
  46. $producer = $this->context->getProducerCurrent();
  47. $this->setTitle('Commander');
  48. ?>
  49. <script>
  50. var appInitValues = {
  51. urlLogin: '<?= \Yii::$app->urlManagerFrontend->createAbsoluteUrl(['site/producer', 'id' => $this->context->getProducerCurrent()->id, 'return_url' => \Yii::$app->urlManagerProducer->createAbsoluteUrl(['order/order', 'slug_producer' => $this->context->getProducerCurrent()->slug])]) ?>',
  52. producerOptionOrderEntryPoint: '<?= $producer->option_order_entry_point ?>',
  53. <?php if (isset($order)): ?>pointSaleActiveId: <?= $order->id_point_sale ?><?php endif; ?>
  54. };
  55. </script>
  56. <div id="app-order-order" :class="{'loaded': !loadingInit}">
  57. <?php if (isset($order)): ?>
  58. <span id="order-distribution-date"><?= $order->distribution->date; ?></span>
  59. <?php endif; ?>
  60. <?php if (isset($date)): ?>
  61. <span id="distribution-date"><?= $date; ?></span>
  62. <?php endif; ?>
  63. <div v-if="loadingInit">
  64. <div class="text-center">
  65. <div class="spinner-border" role="status">
  66. <span class="visually-hidden">Chargement ...</span>
  67. </div>
  68. </div>
  69. </div>
  70. <div class="wrapper">
  71. <div v-if="!loadingInit && distributions.length == 0" class="alert alert-warning">
  72. Aucune distribution à venir chez ce producteur.
  73. </div>
  74. <div v-else>
  75. <div id="steps">
  76. <ul class="row g-0">
  77. <?php if ($producer->option_order_entry_point == Producer::ORDER_ENTRY_POINT_DATE): ?>
  78. <step-date
  79. first="true"
  80. :step="step"
  81. :point-sale-active="pointSaleActive"
  82. :date-format="dateFormat"
  83. :change-step="changeStep"
  84. :producer="producer"
  85. ></step-date>
  86. <step-point-sale
  87. :step="step"
  88. :point-sale-active="pointSaleActive"
  89. :change-step="changeStep"
  90. :producer="producer"
  91. ></step-point-sale>
  92. <?php else: ?>
  93. <step-point-sale
  94. first="true"
  95. :step="step"
  96. :point-sale-active="pointSaleActive"
  97. :change-step="changeStep"
  98. :producer="producer"
  99. ></step-point-sale>
  100. <step-date
  101. :step="step"
  102. :point-sale-active="pointSaleActive"
  103. :date-format="dateFormat"
  104. :change-step="changeStep"
  105. :producer="producer"
  106. ></step-date>
  107. <?php endif; ?>
  108. <li id="step-products" :class="'col-md-4 '+((step == 'products') ? 'active ' : '')">
  109. <button @click="changeStep('products')"
  110. :class="'btn '+ (step == 'products' ? 'btn-primary' : 'btn-secondary')"
  111. :disabled="step == 'date' || step == 'point-sale'">
  112. <span class="button-content"><span
  113. class="glyphicon glyphicon-th-list"></span> Produits</span>
  114. </button>
  115. <div class="info-step" v-if="oneProductOrdered()">
  116. {{ countProductOrdered() }} produit{{ (countProductOrdered() > 1) ? 's' : '' }}
  117. </div>
  118. </li>
  119. <!--<li id="step-payment" :class="'col-md-3 '+((step == 'payment') ? 'active' : '')">
  120. <button @click="changeStep('payment')"
  121. :class="'btn '+ (step == 'payment' ? 'btn-primary' : 'btn-secondary')"
  122. :disabled="step == 'date' || step == 'point-sale' || step == 'products'">
  123. <span class="button-content"><span
  124. class="glyphicon glyphicon-ok"></span> Confirmation</span>
  125. </button>
  126. </li>-->
  127. </ul>
  128. <div class="clr"></div>
  129. </div>
  130. <div class="content">
  131. <div v-if="order" class="alert alert-warning alert-edit-order">
  132. <div class="glyphicon glyphicon-pencil"></div>
  133. Attention, vous êtes en train de modifier votre commande du <strong>{{ dateFormat }}</strong>.
  134. </div>
  135. <div v-if="errors && errors.length" class="alert alert-danger">
  136. <ul>
  137. <li v-for="error in errors">
  138. <div v-html="error"></div>
  139. </li>
  140. </ul>
  141. </div>
  142. <div v-else-if="loading && step != 'payment'">
  143. <div class="text-center">
  144. <div class="spinner-border" role="status">
  145. <span class="visually-hidden">Chargement ...</span>
  146. </div>
  147. </div>
  148. </div>
  149. <transition name="slide">
  150. <div id="content-step-date" v-if="step == 'date'">
  151. <div v-if="!loading">
  152. <?php if ($producer->behavior_order_select_distribution == Producer::BEHAVIOR_ORDER_SELECT_DISTRIBUTION_LIST): ?>
  153. <div style="display:none ;">
  154. <?php endif; ?>
  155. <div id="legend">
  156. <div><span id="distribution-date-color"></span> Prochains jours de distribution
  157. </div>
  158. <div><span id="order-date-color"></span> Vos commandes déjà enregistrées</div>
  159. </div>
  160. <div id="calendar">
  161. <v-calendar
  162. is-inline
  163. is-expanded
  164. v-model="date"
  165. mode="single"
  166. color="green"
  167. :columns="calendar.columns"
  168. :masks="calendar.masks"
  169. :theme-styles="calendar.themeStyles"
  170. :attributes="calendar.attrs"
  171. :available-dates="calendar.availableDates"
  172. @dayclick='dayClick'
  173. ></v-calendar>
  174. </div>
  175. <?php if ($producer->behavior_order_select_distribution == Producer::BEHAVIOR_ORDER_SELECT_DISTRIBUTION_LIST): ?>
  176. </div>
  177. <?php endif; ?>
  178. <?php if ($producer->behavior_order_select_distribution == Producer::BEHAVIOR_ORDER_SELECT_DISTRIBUTION_LIST): ?>
  179. <div id="distributions-list">
  180. <?php $incomingDistributions = $distributionModule->findDistributionsIncoming(); ?>
  181. <?php foreach ($incomingDistributions as $distribution): ?>
  182. <?php
  183. $pointSaleDistributions = PointSaleDistribution::searchAll([
  184. 'id_distribution' => $distribution->id,
  185. 'delivery' => 1
  186. ], []);
  187. ?>
  188. <div class="card card-default">
  189. <div class="card-body">
  190. <button class="btn btn-primary" @click="dayClickList"
  191. data-distribution-date="<?= $distribution->date . ' 00:00:00' ?>">
  192. Sélectionner cette distribution
  193. </button>
  194. <span class="date"><?= ucfirst(strftime('%A %d %B', strtotime($distribution->date))); ?></span>
  195. <?php
  196. if ($pointSaleDistributions && count($pointSaleDistributions) > 0) {
  197. echo '<div class="point-sales">';
  198. foreach ($pointSaleDistributions as $pointSaleDistribution) {
  199. if ($pointSaleDistribution->pointSale->status == 1) {
  200. echo $pointSaleDistribution->pointSale->name . '';
  201. if (strlen($pointSaleDistribution->pointSale->locality)) {
  202. echo ' (' . $pointSaleDistribution->pointSale->locality . ')';
  203. }
  204. echo '<br />';
  205. }
  206. }
  207. echo '</div>';
  208. }
  209. ?>
  210. </div>
  211. </div>
  212. <?php endforeach; ?>
  213. </div>
  214. <?php endif; ?>
  215. </div>
  216. </div>
  217. </transition>
  218. <transition name="slide">
  219. <div id="content-step-point-sale" v-if="step == 'point-sale'">
  220. <div v-if="!loading">
  221. <h3>Où souhaitez-vous récupérer votre commande ?</h3>
  222. <table id="points-sale" class="table table-striped" v-if="pointsSale.length">
  223. <thead>
  224. <tr>
  225. <th>Point de vente</th>
  226. <th class="column-locality">Localité</th>
  227. <th></th>
  228. </tr>
  229. </thead>
  230. <tbody>
  231. <tr v-for="pointSale in orderedPointsSale"
  232. v-if="pointSale && (producer.option_order_entry_point == 'point-sale' || (producer.option_order_entry_point == 'date' && pointSale.pointSaleDistribution.delivery))"
  233. :class="(pointSaleActive && pointSale.id == pointSaleActive.id) ? 'selected' : ''">
  234. <td class="name">
  235. <span class="the-name">{{ pointSale.name }}</span>
  236. <div class="comment" v-if="pointSale.userPointSale">
  237. {{ pointSale.userPointSale.comment }}
  238. </div>
  239. <div class="locality">{{ pointSale.locality }}</div>
  240. <div class="comment" v-if="pointSale.infos && pointSale.infos.length > 0"
  241. v-html="pointSale.infos"></div>
  242. <div class="minimum-order-amount" v-if="pointSale.minimum_order_amount">
  243. Montant minimum de commande : {{ formatPrice(pointSale.minimum_order_amount) }}
  244. </div>
  245. </td>
  246. <td class="column-locality">{{ pointSale.locality }}</td>
  247. <td class="actions">
  248. <template
  249. v-if="(order == null || order.id_point_sale != pointSale.id) && pointSale.maximum_number_orders && pointSale.count_orders && pointSale.count_orders >= pointSale.maximum_number_orders">
  250. <span class="label label-default">
  251. <template v-if="pointSale.is_bread_box">
  252. Déjà réservée
  253. </template>
  254. <template v-else>
  255. Maximum de commande atteint
  256. </template>
  257. </span>
  258. </template>
  259. <template v-else>
  260. <div :class="'form-group' + (pointSale.invalid_code ? ' has-error' : '')">
  261. <form>
  262. <div class="input-group"
  263. v-if="pointSale.code && pointSale.code.length > 0">
  264. <span class="input-group-text">
  265. <i class="bi bi-lock"></i>
  266. </span>
  267. <input v-model="pointsSaleCodes[pointSale.id]" type="password"
  268. placeholder="Code" class="form-control input-code" />
  269. </div>
  270. </form>
  271. </div>
  272. <div v-if="!user && producer.credit == 1 && pointSale.credit == 1">
  273. <a :href="urlLogin" class="btn btn-secondary">
  274. <i class="bi bi-box-arrow-in-right"></i>
  275. Connexion obligatoire
  276. </a>
  277. </div>
  278. <div v-else>
  279. <button class="btn btn-primary" @click="pointSaleClick"
  280. :data-code="pointSale.code && pointSale.code.length > 0"
  281. :data-id-point-sale="pointSale.id">
  282. <i class="bi bi-geo-alt"></i>
  283. Choisir
  284. </button>
  285. </div>
  286. </template>
  287. </td>
  288. </tr>
  289. </tbody>
  290. </table>
  291. <div class="alert alert-warning" v-else>
  292. Aucun point de vente disponible pour ce jour de distribution.
  293. </div>
  294. </div>
  295. </div>
  296. </transition>
  297. <transition name="slide">
  298. <div id="content-step-products" v-if="step == 'products'">
  299. <div v-if="!loading">
  300. <div v-if="products.length">
  301. <table id="products" class="table table-bordered">
  302. <thead>
  303. <tr>
  304. <th class="photo">Photo</th>
  305. <th class="name">Nom</th>
  306. <th class="price">Prix unitaire</th>
  307. <th class="quantity">Quantité</th>
  308. <th class="total">Total</th>
  309. </tr>
  310. </thead>
  311. <tbody>
  312. <template v-for="category in categories">
  313. <tr v-if="category.id && countProductsByCategory(category)" :id="'category'+category.id" :class="(categoryCurrent && categoryCurrent.id == category.id) ? 'category-open' : 'category-closed'">
  314. <td class="category-name" colspan="5" @click="setCategoryCurrent(category)">
  315. <!--<span v-if="categoryCurrent && categoryCurrent.id == category.id"
  316. class="bi bi-caret-down-fill"></span>
  317. <span v-else class="bi bi-caret-right-fill"></span>-->
  318. {{ category.name }}
  319. <span class="badge bg-secondary">{{ countProductsByCategory(category) }}<!-- produit<template
  320. v-if="countProductsByCategory(category) > 1">s</template>--></span>
  321. <span v-if="countSelectedProductsByCategory(category) > 0"
  322. class="badge badge-count-selected-products bg-primary">{{ countSelectedProductsByCategory(category) }}<!-- produit<template
  323. v-if="countSelectedProductsByCategory(category) > 1">s</template>--><span> sélectionné<template
  324. v-if="countSelectedProductsByCategory(category) > 1">s</template></span></span>
  325. </td>
  326. </tr>
  327. <template v-if="(categoryCurrent && categoryCurrent.id == category.id) || category.id == null">
  328. <tr v-for="product in products"
  329. v-if="product.id_product_category == category.id && isProductAvailable(product)" class="product-open">
  330. <td class="photo">
  331. <a class="product-photo" :href="product.photo_big" :title="product.name">
  332. <img v-if="product.photo.length" class="photo-product" :src="product.photo"/>
  333. </a>
  334. </td>
  335. <td class="name product-name-description-block">
  336. <span class="name">{{ product.name }}</span>
  337. <span class="other">
  338. <span v-if="product.weight">({{ product.weight }}&nbsp;g)</span>
  339. </span>
  340. <div>
  341. <span v-if="product.quantity_max > 0 && ((product.quantity_form / product.coefficient_unit == product.quantity_remaining) || ((product.quantity_remaining * product.coefficient_unit) - product.quantity_form) < product.step)"
  342. class="badge bg-danger">Épuisé</span>
  343. </div>
  344. <div class="description" v-if="product.description.length">
  345. {{ product.description }}
  346. </div>
  347. <div class="description-long" v-if="product.recipe.length">
  348. <a href="javascript:void(0);" class="show-more-link">En savoir
  349. plus</a>
  350. <div class="content">
  351. {{ product.recipe }}
  352. </div>
  353. </div>
  354. </td>
  355. <td class="price-unit">
  356. <template v-if="productHasPrice(product)">
  357. <div>
  358. {{ formatPrice(getBestProductPrice(product.id,
  359. product.quantity_form)) }}<br/>
  360. <span class="price-infos">{{ product.wording_unit }}</span>
  361. <template v-if="product.unit == 'piece' && product.weight">
  362. <br />
  363. <span class="price-infos">
  364. {{ formatPrice(product.price_unit_ref) }} / kg
  365. </span>
  366. </template>
  367. </div>
  368. <div v-if="productHasPriceWithFromQuantity(product)"
  369. class="alert alert-info decreasing-prices">
  370. <ul>
  371. <li v-for="price in product.prices"
  372. v-if="price.from_quantity > 0">
  373. <strong>{{ formatPrice(price.price_with_tax)
  374. }}</strong><br/>à partir de {{
  375. price.from_quantity }} {{ product.wording_unit_ref
  376. }}
  377. </li>
  378. </ul>
  379. </div>
  380. </template>
  381. </td>
  382. <td class="td-quantity">
  383. <template v-if="productHasPrice(product)">
  384. <div class="input-group">
  385. <span class="input-group-btn">
  386. <button class="btn btn-secondary btn-moins"
  387. type="button"
  388. @click="productQuantityClick(product, product.unit == 'piece' ? -1 : -parseFloat(product.step))"
  389. :disabled="product.quantity_form == 0">
  390. <i class="bi bi-dash-lg"></i></button>
  391. </span>
  392. <input type="text" v-model="product.quantity_form"
  393. class="form-control quantity" readonly="readonly"/>
  394. <span class="input-group-text">{{ product.unit == 'piece' ? 'p.' : product.unit }}</span>
  395. <span class="input-group-btn">
  396. <button class="btn btn-secondary btn-plus"
  397. type="button"
  398. @click="productQuantityClick(product, product.unit == 'piece' ? 1 : parseFloat(product.step))"
  399. :disabled="product.quantity_form == product.quantity_remaining && product.quantity_max > 0">
  400. <i class="bi bi-plus-lg"></i></button>
  401. </span>
  402. </div>
  403. </template>
  404. </td>
  405. <td class="price-total">
  406. <template
  407. v-if="productHasPrice(product) && product.quantity_form > 0">
  408. {{ formatPrice(getBestProductPrice(product.id,
  409. product.quantity_form) * (product.quantity_form /
  410. product.coefficient_unit )) }}
  411. </template>
  412. </td>
  413. </tr>
  414. </template>
  415. </template>
  416. <tr class="total">
  417. <td class="summary" colspan="4">
  418. <template v-if="priceTotal() > 0">
  419. <h3>Résumé</h3>
  420. <ul>
  421. <li v-for="product in products" v-if="product.quantity_form > 0">
  422. <span class="quantity">{{ product.quantity_form }} {{ product.unit == 'piece' ? 'p.' : product.unit }}</span>
  423. <span class="name">{{ product.name }}</span>
  424. <!--<span class="other">
  425. <span v-if="product.description.length">/</span>
  426. <span class="description">{{ product.description }}</span>-->
  427. <span class="other">
  428. <span v-if="product.weight">({{ product.weight }}&nbsp;g)</span>
  429. </span>
  430. </li>
  431. </ul>
  432. </template>
  433. </td>
  434. <td class="price-total">
  435. <span>{{ priceTotal(true) }}</span>
  436. </td>
  437. </tr>
  438. </tbody>
  439. </table>
  440. <div id="content-step-payment">
  441. <div>
  442. <div class="delivery">
  443. <div class="delivery-home" v-if="pointSaleActive.is_home_delivery">
  444. <label for="deliver-address">Adresse de livraison</label>
  445. <textarea id="deliver-address" v-model="deliveryAddress" class="form-control"
  446. required="required"></textarea>
  447. </div>
  448. </div>
  449. <div class="card comment">
  450. <div class="card-body">
  451. <h5 class="card-title">
  452. <label for="order-comment">
  453. <i class="bi bi-chat-left"></i>
  454. Commentaire
  455. </label>
  456. </h5>
  457. <div class="card-text">
  458. <form>
  459. <textarea id="order-comment" v-model="comment" class="form-control" placeholder="Tappez ici votre commentaire ..."></textarea>
  460. </form>
  461. </div>
  462. </div>
  463. </div>
  464. <template
  465. v-if="producer.credit == 1 && pointSaleActive.credit == 1 && (pointSaleActive.credit_functioning == 'mandatory' || (pointSaleActive.credit_functioning == 'user' && user.credit_active)) && !checkCreditLimit(order) ">
  466. <div class="alert alert-danger">
  467. Vous devez
  468. <template v-if="producer.online_payment == 1"><a
  469. href="<?= \Yii::$app->urlManager->createUrl(['credit/add']) ?>">recharger
  470. votre cagnotte</a></template>
  471. <template v-else>recharger votre cagnotte</template>
  472. auprès de votre producteur ou supprimer des produits.</span>
  473. Votre producteur n'autorise pas une cagnotte avec un montant inférieur
  474. à <strong>{{ formatPrice(producer.credit_limit) }}</strong>.
  475. </div>
  476. <div class="block-actions">
  477. <a class="btn btn-primary"
  478. href="<?= \Yii::$app->urlManager->createUrl(['site/index']) ?>">Retour à
  479. l'accueil</a>
  480. </div>
  481. </template>
  482. <template v-else>
  483. <div class="card credit" v-if="user && producer.credit == 1 && pointSaleActive.credit == 1 && (pointSaleActive.credit_functioning != 'user' || (pointSaleActive.credit_functioning == 'user' && user.credit_active))">
  484. <div class="card-body">
  485. <h5 class="card-title">
  486. <label for="order-comment">
  487. <i class="bi bi-piggy-bank"></i>
  488. Cagnotte
  489. </label>
  490. </h5>
  491. <div class="card-text">
  492. <input type="checkbox" id="use-credit" v-model="useCredit" disabled="disabled"
  493. v-if="pointSaleActive.credit_functioning == 'mandatory' || (pointSaleActive.credit_functioning == 'user' && user.credit_active)"/>
  494. <input type="checkbox" id="use-credit" v-model="useCredit" v-else/> <label
  495. for="use-credit">Utiliser ma cagnotte ({{ formatPrice(user.credit)
  496. }})</label>
  497. <div class="info" v-if="useCredit">
  498. <template v-if="order == null || order.amount_paid == 0">
  499. <span v-if="checkCreditLimit(order)">{{ priceTotal(true) }} seront débités</span>
  500. <span v-else>
  501. {{ formatPrice(user.credit) }} seront débités. (Limite de cagnotte à {{ formatPrice(producer.credit_limit) }})<br/>
  502. Restera {{ formatPrice(priceTotal() - user.credit) }} à régler.
  503. </span>
  504. </template>
  505. <template
  506. v-else-if="order != null && order.amount_paid > 0 && order.amount_paid < priceTotal()">
  507. <span v-if="checkCreditLimit(order)">{{ formatPrice(priceTotal() - order.amount_paid) }} seront débités</span>
  508. <span v-else>
  509. {{ formatPrice(user.credit) }} seront débités. (Limite de cagnotte à {{ formatPrice(producer.credit_limit) }})<br/>
  510. Restera {{ formatPrice(priceTotal() - order.amount_paid - user.credit) }} à régler.
  511. </span>
  512. </template>
  513. <template v-else-if="order != null && order.amount_paid > priceTotal()">
  514. <span>{{ formatPrice(order.amount_paid - priceTotal()) }} seront remboursés</span>
  515. </template>
  516. </div>
  517. </div>
  518. </div>
  519. </div>
  520. <?php if ($producerModule->isOnlinePaymentActiveAndTypeOrder($producer)): ?>
  521. <div class="alert alert-info">
  522. <i class="bi bi-credit-card"></i>
  523. La commande est à payer en ligne lors de l'étape suivante.
  524. </div>
  525. <?php endif; ?>
  526. <div id="signup-guest" class="card" v-if="!user && producer.option_allow_order_guest">
  527. <div class="card-title">
  528. <h5>Informations personnelles</h5>
  529. </div>
  530. <div class="card-text">
  531. <form action="#">
  532. <div class="form-group field-signupguest-email required">
  533. <label class="control-label" for="signupguest-email">Email</label>
  534. <input type="email" id="signupguest-email" class="form-control"
  535. name="SignupForm[email]">
  536. <p class="help-block help-block-error"></p>
  537. </div>
  538. <div class="form-group field-signupguest-firstname required">
  539. <label class="control-label" for="signupguest-firstname">Prénom</label>
  540. <input type="text" id="signupguest-firstname" class="form-control"
  541. name="SignupForm[firstname]">
  542. <p class="help-block help-block-error"></p>
  543. </div>
  544. <div class="form-group field-signupguest-lastname required">
  545. <label class="control-label" for="signupguest-lastname">Nom</label>
  546. <input type="text" id="signupguest-lastname" class="form-control"
  547. name="SignupForm[lastname]">
  548. <p class="help-block help-block-error"></p>
  549. </div>
  550. <div class="form-group field-signupguest-phone required">
  551. <label class="control-label" for="signupguest-phone">Téléphone</label>
  552. <input type="text" id="signupguest-phone" class="form-control"
  553. name="SignupForm[phone]">
  554. <p class="help-block help-block-error"></p>
  555. </div>
  556. </form>
  557. </div>
  558. </div>
  559. <div class="block-actions">
  560. <button class="btn btn-primary" disabled="disabled" v-if="disableConfirmButton || !oneProductOrdered()">
  561. <span v-if="disableConfirmButton" class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
  562. Je confirme ma commande
  563. </button>
  564. <button class="btn btn-primary" v-else @click="confirmClick">
  565. Je confirme ma commande
  566. </button>
  567. </div>
  568. </template>
  569. </div>
  570. </div>
  571. </div>
  572. <div class="alert alert-warning" v-else>
  573. Aucun produit disponible
  574. </div>
  575. </div>
  576. </div>
  577. </transition>
  578. <transition name="slide">
  579. </transition>
  580. </div>
  581. </div>
  582. <!--<div v-if="producer != null && producer.online_payment && producer.option_online_payment_type == 'credit'"
  583. id="credit-online-payment">
  584. <div class="panel panel-default">
  585. <div class="panel-heading">
  586. <i class="glyphicon glyphicon-euro"></i> Paiement en ligne
  587. <a href="<?= \Yii::$app->urlManager->createUrl(['credit/add']) ?>" class="btn btn-sm btn-secondary"><i
  588. class="glyphicon glyphicon-credit-card"></i> Créditer mon compte</a>
  589. </div>
  590. <div class="panel-body">
  591. Vous utilisez le crédit pour régler vos commandes ? Simplifiez les paiements avec votre producteur
  592. en créditant votre compte par carte bancaire.
  593. </div>
  594. </div>
  595. </div>-->
  596. <?= $this->render('_block_infos'); ?>
  597. </div>
  598. </div>
  599. <script type="text/x-template" id="template-step-date">
  600. <li id="step-date" :class="'col-md-4'+((step == 'date') ? ' active' : '')+(first ? ' first' : '')">
  601. <button @click="changeStep('date')" :class="'btn '+ (step == 'date' ? 'btn-primary' : 'btn-secondary')"
  602. :disabled="producer && producer.option_order_entry_point == 'point-sale' && !pointSaleActive">
  603. <span class="button-content"><span class="glyphicon glyphicon-time"></span> Date</span></span>
  604. </button>
  605. <div class="info-step" v-if="dateFormat">
  606. {{ dateFormat }}
  607. </div>
  608. </li>
  609. </script>
  610. <script type="text/x-template" id="template-step-point-sale">
  611. <li id="step-point-sale" :class="'col-md-4'+((step == 'point-sale') ? ' active ' : '')+(first ? ' first' : '')">
  612. <button @click="changeStep('point-sale')"
  613. :class="'btn '+ (step == 'point-sale' ? 'btn-primary' : 'btn-secondary')"
  614. :disabled="producer && (producer.option_order_entry_point == 'date' && step == 'date')">
  615. <span class="button-content"><span
  616. class="glyphicon glyphicon-map-marker"></span> <?= $producerModule->getPointSaleWording($producer); ?></span>
  617. </button>
  618. <div class="info-step" v-if="pointSaleActive">
  619. {{ pointSaleActive.name }}
  620. </div>
  621. </li>
  622. </script>