Browse Source

[Boutique] Points de vente : affichage adresse complète

feature/souke
Guillaume Bourgeois 8 months ago
parent
commit
6c8e19f984
7 changed files with 55 additions and 6 deletions
  1. +2
    -3
      backend/views/communicate/email.php
  2. +11
    -0
      backend/web/css/screen.css
  3. +10
    -0
      backend/web/js/backend.js
  4. +11
    -0
      backend/web/sass/_responsive.scss
  5. +14
    -0
      domain/PointSale/PointSale/PointSaleSolver.php
  6. +3
    -1
      producer/views/order/confirm.php
  7. +4
    -2
      producer/views/site/index.php

+ 2
- 3
backend/views/communicate/email.php View File

<?php //$form->field($mailForm, 'message')->textarea(['rows' => '15']) ; ?> <?php //$form->field($mailForm, 'message')->textarea(['rows' => '15']) ; ?>
<?= $form->field($mailForm, 'message')->widget(letyii\tinymce\Tinymce::class, [ <?= $form->field($mailForm, 'message')->widget(letyii\tinymce\Tinymce::class, [
'configs' => [ 'configs' => [
'plugins' => Yii::$app->parameterBag->get('tinyMcePlugins'),
]
'plugins' => Yii::$app->parameterBag->get('tinyMcePlugins')
],
]); ?> ]); ?>

<div class="form-group form-buttons"> <div class="form-group form-buttons">
<?= Html::submitButton( 'Envoyer', ['class' => 'btn btn-primary']) ?> <?= Html::submitButton( 'Envoyer', ['class' => 'btn btn-primary']) ?>
</div> </div>

+ 11
- 0
backend/web/css/screen.css View File

.distribution-index #orders table .column-delivery-note { .distribution-index #orders table .column-delivery-note {
display: none; display: none;
} }

/* line 173, ../sass/_responsive.scss */
.communicate-email {
/*#mailform-message {
display: block !important;
height: 250px;
}
.tox-tinymce {
display: none;
}*/
}
} }

+ 10
- 0
backend/web/js/backend.js View File

opendistrib_point_sale_form(); opendistrib_point_sale_form();
opendistrib_check_all_checkboxes(); opendistrib_check_all_checkboxes();
opendistrib_dashboard_admin_statistics(); opendistrib_dashboard_admin_statistics();
opendistrib_tinymce_responsive();
}); });


var UrlManager = { var UrlManager = {
} }
}; };


function opendistrib_tinymce_responsive() {
// tinymce.activeEditor.mode.set('readonly');
//tinymce.activeEditor.hide();
//tinymce.EditorManager.execCommand('mceRemoveEditor',true, 'textarea#mailform-message');
//tinyMCE.init({readonly : 1});
//tinymce.activeEditor.getBody().setAttribute('contenteditable', false);
//tinyMCE.get('mailform-message').getBody().setAttribute('contenteditable', false);
}

function opendistrib_dashboard_admin_statistics() { function opendistrib_dashboard_admin_statistics() {
var selector = '#dashboard-admin-statistics-html'; var selector = '#dashboard-admin-statistics-html';
if($(selector).length) { if($(selector).length) {

+ 11
- 0
backend/web/sass/_responsive.scss View File

} }
} }
} }

.communicate-email {
// désactivation de tinymce sur mobile car copier/coller impossible
/*#mailform-message {
display: block !important;
height: 250px;
}
.tox-tinymce {
display: none;
}*/
}
} }

+ 14
- 0
domain/PointSale/PointSale/PointSaleSolver.php View File

return $str; return $str;
} }


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

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>';
}
else {
$html .= Html::encode($pointSale->locality);
}

return $html;
}

public function isPublic(PointSale $pointSale): bool public function isPublic(PointSale $pointSale): bool
{ {
if($pointSale->restricted_access || ($pointSale->code && strlen($pointSale->code))) { if($pointSale->restricted_access || ($pointSale->code && strlen($pointSale->code))) {

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

<?php if($order->pointSale->is_bread_box && $order->pointSale->bread_box_code): ?> <?php if($order->pointSale->is_bread_box && $order->pointSale->bread_box_code): ?>
(Code : <strong><?= $order->pointSale->bread_box_code; ?></strong>) (Code : <strong><?= $order->pointSale->bread_box_code; ?></strong>)
<?php endif; ?> <?php endif; ?>
<br />&nbsp; &nbsp; &nbsp;<span class="locality">à <?= Html::encode($order->pointSale->locality) ?></span><?php endif; ?>
<span class="locality">à <?= $pointSaleModule->getSolver()->getLocalityWithAddressTooltip($order->pointSale) ?></span>
<?php endif; ?>

<?php endif; ?> <?php endif; ?>
</li> </li>
<?php <?php

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

use common\helpers\Price; use common\helpers\Price;
use domain\Distribution\Distribution\DistributionModule; use domain\Distribution\Distribution\DistributionModule;
use domain\Distribution\PointSaleDistribution\PointSaleDistribution; use domain\Distribution\PointSaleDistribution\PointSaleDistribution;
use domain\PointSale\PointSale\PointSaleModule;
use domain\Producer\Producer\Producer; use domain\Producer\Producer\Producer;
use domain\Producer\Producer\ProducerModule; use domain\Producer\Producer\ProducerModule;
use domain\Product\Product\ProductModule; use domain\Product\Product\ProductModule;
$productModule = ProductModule::getInstance(); $productModule = ProductModule::getInstance();
$producerModule = ProducerModule::getInstance(); $producerModule = ProducerModule::getInstance();
$distributionModule = DistributionModule::getInstance(); $distributionModule = DistributionModule::getInstance();
$pointSaleModule = PointSaleModule::getInstance();


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


'attribute' => 'name', 'attribute' => 'name',
'format' => 'raw', 'format' => 'raw',
'contentOptions' => ['class' => 'name'], 'contentOptions' => ['class' => 'name'],
'value' => function ($model) {
'value' => function ($model) use ($pointSaleModule) {
$html = '<span class="the-name">' . Html::encode($model->name) . '</span>'; $html = '<span class="the-name">' . Html::encode($model->name) . '</span>';
if (strlen($model->locality)) { if (strlen($model->locality)) {
$html .= '<br />à ' . Html::encode($model->locality);
$html .= '<br />à ' . $pointSaleModule->getSolver()->getLocalityWithAddressTooltip($model);
} }
return $html; return $html;
} }

Loading…
Cancel
Save