Browse Source

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

feature/souke
Guillaume Bourgeois 9 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

@@ -75,10 +75,9 @@ $this->render('@backend/views/user/_menu_filter.php',[
<?php //$form->field($mailForm, 'message')->textarea(['rows' => '15']) ; ?>
<?= $form->field($mailForm, 'message')->widget(letyii\tinymce\Tinymce::class, [
'configs' => [
'plugins' => Yii::$app->parameterBag->get('tinyMcePlugins'),
]
'plugins' => Yii::$app->parameterBag->get('tinyMcePlugins')
],
]); ?>

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

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

@@ -3285,4 +3285,15 @@ termes.
.distribution-index #orders table .column-delivery-note {
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

@@ -58,6 +58,7 @@ $(document).ready(function () {
opendistrib_point_sale_form();
opendistrib_check_all_checkboxes();
opendistrib_dashboard_admin_statistics();
opendistrib_tinymce_responsive();
});

var UrlManager = {
@@ -69,6 +70,15 @@ 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() {
var selector = '#dashboard-admin-statistics-html';
if($(selector).length) {

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

@@ -169,4 +169,15 @@ termes.
}
}
}

.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

@@ -105,6 +105,20 @@ class PointSaleSolver extends AbstractService implements SolverInterface
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
{
if($pointSale->restricted_access || ($pointSale->code && strlen($pointSale->code))) {

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

@@ -94,7 +94,9 @@ $this->setTitle('Confirmation de commande') ;
<?php if($order->pointSale->is_bread_box && $order->pointSale->bread_box_code): ?>
(Code : <strong><?= $order->pointSale->bread_box_code; ?></strong>)
<?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; ?>
</li>
<?php

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

@@ -40,6 +40,7 @@ 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;
@@ -49,6 +50,7 @@ use yii\helpers\Html;
$productModule = ProductModule::getInstance();
$producerModule = ProducerModule::getInstance();
$distributionModule = DistributionModule::getInstance();
$pointSaleModule = PointSaleModule::getInstance();

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

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

Loading…
Cancel
Save