Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

534 lines
29KB

  1. <?php
  2. /**
  3. * Copyright La boîte à pain (2018)
  4. *
  5. * contact@opendistrib.net
  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\Dropdown;
  38. use common\helpers\GlobalParam;
  39. use domain\Config\TaxRate\TaxRate;
  40. use domain\Distribution\Distribution\DistributionModule;
  41. use domain\Distribution\Distribution\ExportManager;
  42. use domain\Document\Document\Document;
  43. use domain\Feature\Feature\Feature;
  44. use domain\Feature\Feature\FeatureModule;
  45. use domain\Producer\Producer\Producer;
  46. use domain\User\User\UserModule;
  47. use domain\User\UserGroup\UserGroupModule;
  48. use yii\helpers\ArrayHelper;
  49. use yii\helpers\Html;
  50. use yii\widgets\ActiveForm;
  51. \backend\assets\VuejsProducerUpdateAsset::register($this);
  52. $userModule = UserModule::getInstance();
  53. $userGroupModule = UserGroupModule::getInstance();
  54. $distributionExportManager = DistributionModule::getInstance()->getExportManager();
  55. $featureChecker = FeatureModule::getInstance()->getChecker();
  56. $userCurrent = GlobalParam::getCurrentUser();
  57. $this->setTitle('Paramètres');
  58. $this->addBreadcrumb($this->getTitle());
  59. ?>
  60. <script>
  61. var appInitValues = {
  62. isAdmin: <?= (int)$userModule->getAuthorizationChecker()->isGrantedAsAdministrator($userCurrent) ?>
  63. };
  64. </script>
  65. <div class="user-update" id="app-producer-update">
  66. <div id="nav-params">
  67. <a v-for="section in sectionsArray" v-if="!section.isAdminSection || (section.isAdminSection && isAdmin)"
  68. :class="'btn '+((currentSection == section.name) ? 'btn-primary' : 'btn-default')"
  69. @click="changeSection(section)" :href="'#'+section.name">
  70. {{ section.nameDisplay }}
  71. </a>
  72. </div>
  73. <div class="user-form">
  74. <?php $form = ActiveForm::begin([
  75. 'enableClientValidation' => false,
  76. ]); ?>
  77. <div>
  78. <div v-show="currentSection == 'general'" class="panel panel-default">
  79. <div class="panel-body">
  80. <h4>Accès</h4>
  81. <?= $form->field($model, 'active')
  82. ->dropDownList(Dropdown::noYesChoices())
  83. ->label('En ligne')
  84. ->hint('Activez cette option pour rendre votre espace visible à vos clients.'); ?>
  85. <?= $form->field($model, 'code')->hint("Saisissez ce champs si vous souhaitez protéger l'accès à votre espace par un code, sinon laissez-le vide.<br />"
  86. . "Ce code est à communiquer à vos clients pour qu'ils puissent ajouter votre espace à leurs favoris.<br />"
  87. . "<a href=\"" . Yii::$app->urlManager->createUrl(['communicate/index']) . "\">Cliquez ici</a> pour télécharger un mode d'emploi comprenant ce code à distribuer à vos clients.") ?>
  88. <h4>Général</h4>
  89. <?= $form->field($model, 'name') ?>
  90. <?= $form->field($model, 'type') ?>
  91. <?php /*$form->field($model, 'description')
  92. ->textarea(['rows' => 4])
  93. ->hint('Affiché sur la page d\'accueil')*/ ?>
  94. <?= $form->field($model, 'description')->widget(letyii\tinymce\Tinymce::class, [
  95. 'configs' => [
  96. 'plugins' => Yii::$app->parameterBag->get('tinyMcePlugins'),
  97. ]
  98. ])->hint('Affiché sur la page d\'accueil') ; ?>
  99. <?= $form->field($model, 'address')
  100. ->textarea(['rows' => 4]) ?>
  101. <?= $form->field($model, 'postcode') ?>
  102. <?= $form->field($model, 'city') ?>
  103. <h4>Contact</h4>
  104. <?= $form->field($model, 'contact_email') ?>
  105. <?= $form->field($model, 'website') ?>
  106. <h4>Apparence</h4>
  107. <?= $form->field($model, 'background_color_logo') ?>
  108. <?= $form->field($model, 'logoFile')->fileInput() ?>
  109. <?php
  110. if (strlen($model->logo)) {
  111. echo '<img src="' . Yii::$app->urlManagerProducer->getHostInfo() . '/' . Yii::$app->urlManagerProducer->baseUrl . '/uploads/' . $model->logo . '" width="200px" /><br />';
  112. echo '<input type="checkbox" name="delete_logo" id="delete_logo" /> <label for="delete_logo">Supprimer le logo</label><br /><br />';
  113. }
  114. ?>
  115. <?= $form->field($model, 'photoFile')->fileInput()->hint('Format idéal : 900 x 150 px') ?>
  116. <?php
  117. if (strlen($model->photo)) {
  118. echo '<img src="' . Yii::$app->urlManagerProducer->getHostInfo() . '/' . Yii::$app->urlManagerProducer->baseUrl . '/uploads/' . $model->photo . '" width="400px" /><br />';
  119. echo '<input type="checkbox" name="delete_photo" id="delete_photo" /> <label for="delete_photo">Supprimer la photo</label><br /><br />';
  120. }
  121. ?>
  122. <?= $form->field($model, 'behavior_home_point_sale_day_list')
  123. ->dropDownList([
  124. Producer::BEHAVIOR_HOME_POINT_SALE_DAY_LIST_WEEK => 'Jours de la semaine',
  125. Producer::BEHAVIOR_HOME_POINT_SALE_DAY_LIST_INCOMING_DISTRIBUTIONS => 'Distributions à venir',
  126. ]); ?>
  127. <?= $form->field($model, 'option_point_sale_wording') ?>
  128. <h4>Groupes utilisateurs</h4>
  129. <?= $form->field($model, 'id_user_group_default')
  130. ->dropDownList($userGroupModule->getRepository()->populateUserGroupDropdownList()); ?>
  131. </div>
  132. </div>
  133. <div v-show="currentSection == 'tableau-bord'" class="panel panel-default">
  134. <div class="panel-body">
  135. <h4>Tableau de bord administration</h4>
  136. <?= $form->field($model, 'option_dashboard_number_distributions')
  137. ->dropDownList(Dropdown::numberChoices(3, 30, false, '', 3)); ?>
  138. <?= $form->field($model, 'option_dashboard_date_start')->textInput([
  139. 'class' => 'datepicker form-control'
  140. ]); ?>
  141. <?= $form->field($model, 'option_dashboard_date_end')->textInput([
  142. 'class' => 'datepicker form-control'
  143. ]); ?>
  144. </div>
  145. </div>
  146. <div v-show="currentSection == 'prise-commande'" class="panel panel-default">
  147. <div class="panel-body">
  148. <h4>Horaires</h4>
  149. <?php
  150. $delaysArray = [
  151. 1 => '1 jour',
  152. 2 => '2 jours',
  153. 3 => '3 jours',
  154. 4 => '4 jours',
  155. 5 => '5 jours',
  156. 6 => '6 jours',
  157. 7 => '7 jours',
  158. ];
  159. $deadlinesArray = [
  160. 24 => 'Minuit',
  161. 23 => '23h',
  162. 22 => '22h',
  163. 21 => '21h',
  164. 20 => '20h',
  165. 19 => '19h',
  166. 18 => '18h',
  167. 17 => '17h',
  168. 16 => '16h',
  169. 15 => '15h',
  170. 14 => '14h',
  171. 13 => '13h',
  172. 12 => '12h',
  173. 11 => '11h',
  174. 10 => '10h',
  175. 9 => '9h',
  176. 8 => '8h',
  177. ];
  178. $daysArray = [
  179. 'monday' => 'Lundi',
  180. 'tuesday' => 'Mardi',
  181. 'wednesday' => 'Mercredi',
  182. 'thursday' => 'Jeudi',
  183. 'friday' => 'Vendredi',
  184. 'saturday' => 'Samedi',
  185. 'sunday' => 'Dimanche'
  186. ];
  187. ?>
  188. <div class="row">
  189. <div class="col-md-2">
  190. <strong>Par défaut</strong>
  191. </div>
  192. <div class="col-md-5">
  193. <?= $form->field($model, 'order_delay')
  194. ->dropDownList($delaysArray, ['prompt' => '--'])
  195. ->hint('Si <strong>1 jour</strong> est sélectionné, le client pourra commander jusqu\'à la veille de la production.<br />'
  196. . 'Si <strong>2 jours</strong> est sélectionné, le client pourra commander jusqu\'à l\'avant-veille de la production, etc.'); ?>
  197. </div>
  198. <div class="col-md-5">
  199. <?= $form->field($model, 'order_deadline')
  200. ->dropDownList($deadlinesArray, ['prompt' => '--'])
  201. ->hint('Heure limite jusqu\'à laquelle les clients peuvent commander pour satisfaire le délai de commande.<br />'
  202. . 'Par exemple, si <strong>2 jours</strong> est sélectionné dans le délai de commande, le client devra commander l\'avant-veille de la production avant l\'heure précisée ici.'); ?>
  203. </div>
  204. </div>
  205. <?php foreach ($daysArray as $day => $labelDay): ?>
  206. <div class="row">
  207. <div class="col-md-2">
  208. <strong><?= $labelDay ?></strong>
  209. </div>
  210. <div class="col-md-5">
  211. <?= $form->field($model, 'order_delay_' . $day, [
  212. 'template' => '{input}',
  213. ])->dropDownList($delaysArray, ['prompt' => '--'])->label(''); ?>
  214. </div>
  215. <div class="col-md-5">
  216. <?= $form->field($model, 'order_deadline_' . $day, [
  217. 'template' => '{input}',
  218. ])->dropDownList($deadlinesArray, ['prompt' => '--'])->label(''); ?>
  219. </div>
  220. </div>
  221. <?php endforeach; ?>
  222. <h4>Informations</h4>
  223. <?= $form->field($model, 'order_infos')
  224. ->textarea(['rows' => 6])
  225. ->hint('Affichées au client lors de sa commande') ?>
  226. <?= $form->field($model, 'option_payment_info')
  227. ->textarea(['rows' => 6])
  228. ->hint('Affichées au client à la fin de la prise de commande') ?>
  229. <h4>Tunnel de commande</h4>
  230. <?= $form->field($model, 'option_order_entry_point')
  231. ->dropDownList([
  232. Producer::ORDER_ENTRY_POINT_DATE => 'Date',
  233. Producer::ORDER_ENTRY_POINT_POINT_SALE => 'Point de vente',
  234. ], []); ?>
  235. <?= $form->field($model, 'behavior_order_select_distribution')
  236. ->dropDownList([
  237. Producer::BEHAVIOR_ORDER_SELECT_DISTRIBUTION_CALENDAR => 'Calendrier',
  238. Producer::BEHAVIOR_ORDER_SELECT_DISTRIBUTION_LIST => 'Liste',
  239. ]); ?>
  240. <?= $form->field($model, 'option_delivery')
  241. ->dropDownList(Dropdown::noYesChoices()); ?>
  242. <?php echo $form->field($model, 'option_allow_order_guest')
  243. ->dropDownList(Dropdown::noYesChoices()); ?>
  244. <h4>Notifications</h4>
  245. <?= $form->field($model, 'option_notify_producer_order_summary')
  246. ->dropDownList(Dropdown::noYesChoices()); ?>
  247. <?= $form->field($model, 'option_email_confirm')
  248. ->dropDownList(Dropdown::noYesChoices()); ?>
  249. <?= $form->field($model, 'option_email_confirm_producer')
  250. ->dropDownList(Dropdown::noYesChoices()); ?>
  251. <h4>Divers</h4>
  252. <?= $form->field($model, 'option_leave_period_start')->textInput([
  253. 'class' => 'datepicker form-control'
  254. ]); ?>
  255. <?= $form->field($model, 'option_leave_period_end')->textInput([
  256. 'class' => 'datepicker form-control'
  257. ]); ?>
  258. <?php
  259. $choicesWeeksDistributionsActivatedInAdvanceArray = [null => '--'];
  260. for ($i = 1; $i < 13; $i++) {
  261. $choicesWeeksDistributionsActivatedInAdvanceArray[$i] = $i . ' semaine' . (($i > 1) ? 's' : '');
  262. }
  263. ?>
  264. <?= $form->field($model, 'option_weeks_distributions_activated_in_advance')
  265. ->dropDownList($choicesWeeksDistributionsActivatedInAdvanceArray)
  266. ->hint("Attention, les premières semaines doivent être activées manuellement."); ?>
  267. <?= $form->field($model, 'option_order_reference_type')
  268. ->dropDownList([
  269. Producer::ORDER_REFERENCE_TYPE_NONE => '--',
  270. Producer::ORDER_REFERENCE_TYPE_YEARLY => 'Annuelle',
  271. ], []); ?>
  272. <?= $form->field($model, 'option_behavior_cancel_order')
  273. ->dropDownList([
  274. Producer::BEHAVIOR_DELETE_ORDER_DELETE => 'Suppression de la commande',
  275. Producer::BEHAVIOR_DELETE_ORDER_STATUS => 'Passage de la commande en statut "supprimé"',
  276. ], []); ?>
  277. </div>
  278. </div>
  279. <div v-show="currentSection == 'exports'" class="panel panel-default">
  280. <div class="panel-body">
  281. <h4>Exports affichés dans les distributions</h4>
  282. <?= $distributionExportManager->getProducerFormCheckboxes($form, $model) ?>
  283. <h4>Options exports</h4>
  284. <?= $form->field($model, 'option_csv_separator')
  285. ->dropDownList([
  286. ';' => 'Point-virgule (;)',
  287. ',' => 'Virgule (,)'
  288. ], []); ?>
  289. <?= $form->field($model, 'option_export_display_product_reference')
  290. ->dropDownList(Dropdown::noYesChoices()); ?>
  291. <?= $form->field($model, 'option_export_display_column_delivery_note')
  292. ->dropDownList(Dropdown::noYesChoices()); ?>
  293. <?= $form->field($model, 'option_csv_export_all_products')
  294. ->dropDownList(Dropdown::noYesChoices()); ?>
  295. <?= $form->field($model, 'option_csv_export_by_piece')
  296. ->dropDownList(Dropdown::noYesChoices()); ?>
  297. <?php if($featureChecker->isEnabled(Feature::ALIAS_EXPORT_SHOPPING_CART_LABELS_ADVANCED)): ?>
  298. <?= $form->field($model, 'export_shopping_cart_labels_format')
  299. ->dropDownList($distributionExportManager->getGenerator(ExportManager::SHOPPING_CART_LABELS_PDF)->populateDropdownSpecificFormats()); ?>
  300. <?php else: ?>
  301. <?= $form->field($model, 'export_shopping_cart_labels_number_per_column')
  302. ->dropDownList(Dropdown::numberChoices(1, 20)); ?>
  303. <?php endif; ?>
  304. </div>
  305. </div>
  306. <div v-show="currentSection == 'abonnements'" class="panel panel-default">
  307. <div class="panel-body">
  308. <h4>Abonnements</h4>
  309. <?= $form->field($model, 'user_manage_subscription')
  310. ->dropDownList(Dropdown::noYesChoices()); ?>
  311. </div>
  312. </div>
  313. <div v-show="currentSection == 'credit-payment'" class="panel panel-default">
  314. <div class="panel-body">
  315. <h4>Crédit</h4>
  316. <?= $form->field($model, 'credit')
  317. ->dropDownList(Dropdown::noYesChoices())
  318. ->label('Activer le système de Crédit')
  319. ->hint('Le système de Crédit permet à vos clients d\'avoir un compte prépayé sur le site <em>distrib</em>.<br />'
  320. . 'Ils créditent leur compte en vous donnant la somme de leur choix et c\'est ensuite à vous de ' . Html::a('mettre à jour', ['user/index']) . ' leur Crédit en ligne.<br />'
  321. . 'Ceci fait, les clients paient leur commande directement via leur Crédit.'); ?>
  322. <?= $form->field($model, 'credit_functioning')
  323. ->dropDownList([
  324. Producer::CREDIT_FUNCTIONING_OPTIONAL => Producer::$creditFunctioningArray[Producer::CREDIT_FUNCTIONING_OPTIONAL],
  325. Producer::CREDIT_FUNCTIONING_MANDATORY => Producer::$creditFunctioningArray[Producer::CREDIT_FUNCTIONING_MANDATORY],
  326. Producer::CREDIT_FUNCTIONING_USER => Producer::$creditFunctioningArray[Producer::CREDIT_FUNCTIONING_USER],
  327. ], [])->hint(Producer::HINT_CREDIT_FUNCTIONING); ?>
  328. <?= $form->field($model, 'use_credit_checked_default')
  329. ->dropDownList(Dropdown::noYesChoices())
  330. ->hint('Utilisation optionnelle du Crédit.'); ?>
  331. <?= $form->field($model, 'credit_limit_reminder', [
  332. 'template' => '{label}<div class="input-group">{input}<span class="input-group-addon"><span class="glyphicon glyphicon-euro"></span></span></div>{hint}',
  333. ])
  334. ->hint("Une relance est envoyé au client dès que ce seuil est dépassé."); ?>
  335. <?= $form->field($model, 'credit_limit', [
  336. 'template' => '{label}<div class="input-group">{input}<span class="input-group-addon"><span class="glyphicon glyphicon-euro"></span></span></div>{hint}',
  337. ])->hint('Limite de crédit que l\'utilisateur ne pourra pas dépasser. Laisser vide pour permettre un crédit négatif et infini.'); ?>
  338. <?= $form->field($model, 'option_check_by_default_prevent_user_credit')
  339. ->dropDownList(Dropdown::noYesChoices()); ?>
  340. <?php if($featureChecker->isEnabled(Feature::ALIAS_ONLINE_PAYMENT)): ?>
  341. <h4>Paiement en ligne</h4>
  342. <?php if($userModule->getAuthorizationChecker()->isGrantedAsAdministrator($userCurrent)): ?>
  343. <?= $form->field($model, 'online_payment')
  344. ->dropDownList(Dropdown::noYesChoices()); ?>
  345. <?= $form->field($model, 'option_stripe_mode_test')->dropDownList(Dropdown::noYesChoices()); ?>
  346. <?= $form->field($model, 'option_online_payment_type')
  347. ->dropDownList([
  348. 'credit' => 'Alimentation du crédit',
  349. 'order' => 'Paiement à la commande',
  350. ], []); ?>
  351. <?= $form->field($model, 'option_stripe_public_key')->textInput(); ?>
  352. <?= $form->field($model, 'option_stripe_private_key')->textInput(); ?>
  353. <?= $form->field($model, 'option_stripe_endpoint_secret')->textInput(); ?>
  354. <?php endif; ?>
  355. <?= $form->field($model, 'option_online_payment_minimum_amount')
  356. ->hint('Valeur par défaut si non défini : ' . Producer::ONLINE_PAYMENT_MINIMUM_AMOUNT_DEFAULT . ' €')
  357. ->textInput(); ?>
  358. <?php endif; ?>
  359. </div>
  360. </div>
  361. <div v-show="currentSection == 'infos'" class="panel panel-default">
  362. <div class="panel-body">
  363. <h4>Informations légales</h4>
  364. <?= $form->field($model, 'mentions')
  365. ->textarea(['rows' => 15])
  366. ->hint('') ?>
  367. <?= $form->field($model, 'gcs')
  368. ->textarea(['rows' => 15])
  369. ->hint('') ?>
  370. </div>
  371. </div>
  372. <div v-show="currentSection == 'logiciels-caisse'" class="panel panel-default">
  373. <div class="panel-body">
  374. <h4>Tiller</h4>
  375. <?= $form->field($model, 'tiller')
  376. ->dropDownList(Dropdown::noYesChoices())
  377. ->label('Synchroniser avec Tiller'); ?>
  378. <?= $form->field($model, 'tiller_api_version')
  379. ->dropDownList([
  380. 'v2' => 'v2',
  381. 'v3' => 'v3'
  382. ]); ?>
  383. <h4>API V2</h4>
  384. <?= $form->field($model, 'tiller_provider_token'); ?>
  385. <?= $form->field($model, 'tiller_restaurant_token'); ?>
  386. <h4>API V3</h4>
  387. <?= $form->field($model, 'tiller_store_id'); ?>
  388. <?= $form->field($model, 'tiller_redirect_uri'); ?>
  389. <?= $form->field($model, 'tiller_client_id'); ?>
  390. <?= $form->field($model, 'tiller_client_secret'); ?>
  391. </div>
  392. </div>
  393. <div v-show="currentSection == 'facturation'" class="panel panel-default">
  394. <div class="panel-body">
  395. <h4>Facturation</h4>
  396. <?= $form->field($model, 'id_tax_rate_default')
  397. ->dropDownList(ArrayHelper::map(TaxRate::find()->all(), 'id', function ($model) {
  398. return $model->name;
  399. }))
  400. ->label('TVA à appliquer par défaut'); ?>
  401. <?= $form->field($model, 'option_tax_calculation_method')
  402. ->dropDownList(Document::$taxCalculationMethodArray); ?>
  403. <?= $form->field($model, 'option_export_evoliz')->dropDownList(Dropdown::noYesChoices()); ?>
  404. <?php $hintKeywordsPrefix = "Saisissez [ANNEE] pour intégrer l'année courante"; ?>
  405. <?= $form->field($model, 'document_quotation_prefix')->hint($hintKeywordsPrefix); ?>
  406. <?= $form->field($model, 'document_quotation_first_reference'); ?>
  407. <?= $form->field($model, 'document_quotation_duration'); ?>
  408. <?= $form->field($model, 'document_invoice_prefix')->hint($hintKeywordsPrefix);; ?>
  409. <?= $form->field($model, 'document_invoice_first_reference'); ?>
  410. <?= $form->field($model, 'document_delivery_note_prefix')->hint($hintKeywordsPrefix);; ?>
  411. <?= $form->field($model, 'document_delivery_note_first_reference'); ?>
  412. <?= $form->field($model, 'delivery_note_automatic_validation')->dropDownList(Dropdown::noYesChoices()); ?>
  413. <?= $form->field($model, 'option_invoice_only_based_on_delivery_notes')->dropDownList(Dropdown::noYesChoices()); ?>
  414. <?= $form->field($model, 'option_document_width_logo')
  415. ->dropDownList(Dropdown::numberChoices(50, 250, true, 'px', 50)); ?>
  416. <?= $form->field($model, 'document_display_orders_invoice')->dropDownList(Dropdown::noYesChoices()); ?>
  417. <?= $form->field($model, 'document_display_orders_delivery_note')->dropDownList(Dropdown::noYesChoices()); ?>
  418. <?= $form->field($model, 'document_display_prices_delivery_note')->dropDownList(Dropdown::noYesChoices()); ?>
  419. <?= $form->field($model, 'document_display_product_description')->dropDownList(Dropdown::noYesChoices()); ?>
  420. <?= $form->field($model, 'option_document_price_decimals')->dropDownList([
  421. 2 => '2',
  422. 3 => '3'
  423. ]); ?>
  424. <?= $form->field($model, 'option_document_display_price_unit_reference')
  425. ->dropDownList(Dropdown::noYesChoices()); ?>
  426. <?= $form->field($model, 'document_infos_top')
  427. ->textarea(['rows' => 8])
  428. ->hint("Affichées juste en dessous de l'adresse"); ?>
  429. <?= $form->field($model, 'document_infos_bottom')
  430. ->textarea(['rows' => 8]) ?>
  431. <?= $form->field($model, 'document_image_bottomFile')->fileInput()->hint('') ?>
  432. <?php
  433. if (strlen($model->document_image_bottom)) {
  434. echo '<img src="' . Yii::$app->urlManagerProducer->getHostInfo() . '/' . Yii::$app->urlManagerProducer->baseUrl . '/uploads/' . $model->document_image_bottom . '" width="400px" /><br />';
  435. echo '<input type="checkbox" name="delete_document_image_bottom" id="delete_document_image_bottom" /> <label for="delete_document_image_bottom">Supprimer l\'image</label><br /><br />';
  436. }
  437. ?>
  438. <?= $form->field($model, 'document_infos_quotation')
  439. ->textarea(['rows' => 8]) ?>
  440. <?= $form->field($model, 'document_infos_invoice')
  441. ->textarea(['rows' => 8]) ?>
  442. <?= $form->field($model, 'document_infos_delivery_note')
  443. ->textarea(['rows' => 8]) ?>
  444. </div>
  445. </div>
  446. <div v-show="currentSection == 'software'" class="panel panel-default">
  447. <div class="panel-body">
  448. <h4>Opendistrib</h4>
  449. <?= $form->field($model, 'option_display_message_new_opendistrib_version')
  450. ->dropDownList(Dropdown::noYesChoices()); ?>
  451. <?= $form->field($model, 'agree_contact_about_software_development')
  452. ->dropDownList(Dropdown::noYesChoices()); ?>
  453. <?php $urlAboutPage = Yii::$app->urlManagerFrontend->createAbsoluteUrl(['site/about']); ?>
  454. <?= $form->field($model, 'option_testimony')
  455. ->textarea(['rows' => 7])
  456. ->hint("Écrivez ici votre témoignage concernant l'utilisation du logiciel. Il sera publié sur la page <a href=\"" . $urlAboutPage . "\" target=\"_blanck\">À propos</a> du site."); ?>
  457. <?= $form->field($model, 'option_time_saved')
  458. ->dropDownList([
  459. null => '--',
  460. 0.5 => '30 minutes',
  461. 1 => '1 heure',
  462. 2 => '2 heures',
  463. 3 => '3 heures',
  464. 4 => '4 heures',
  465. 5 => '5 heures',
  466. 6 => '6 heures',
  467. 7 => '7 heures',
  468. 8 => '8 heures',
  469. ])
  470. ->hint("Sélectionnez le temps que vous estimez gagner chaque semaine en utilisant ce logiciel. Cette donnée sera utilisée sur la page <a href=\"" . $urlAboutPage . "\" target=\"_blanck\">À propos</a> du site."); ?>
  471. </div>
  472. </div>
  473. <div class="form-group form-actions">
  474. <?= Html::submitButton('Mettre à jour', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
  475. </div>
  476. </div>
  477. <?php ActiveForm::end(); ?>
  478. </div>
  479. </div>