{ | { | ||||
$distributionModule = $this-> getDistributionModule(); | $distributionModule = $this-> getDistributionModule(); | ||||
$pointSaleModule = $this->getPointSaleModule(); | $pointSaleModule = $this->getPointSaleModule(); | ||||
$model = PointSale::find() | |||||
->with('userPointSale') | |||||
->where(['id' => $id]) | |||||
->one(); | |||||
$model = $this->findModel($id); | |||||
foreach ($model->userPointSale as $userPointSale) { | foreach ($model->userPointSale as $userPointSale) { | ||||
$model->users[] = $userPointSale->id_user; | $model->users[] = $userPointSale->id_user; | ||||
*/ | */ | ||||
protected function findModel(int $id) | protected function findModel(int $id) | ||||
{ | { | ||||
if (($model = PointSale::findOne($id)) !== null) { | |||||
return $model; | |||||
} else { | |||||
throw new NotFoundHttpException('The requested page does not exist.'); | |||||
$model = PointSale::find() | |||||
->with('userPointSale') | |||||
->where(['id' => $id]) | |||||
->one(); | |||||
if(!$model || $model->id_producer != $this->getProducerCurrent()->id) { | |||||
throw new NotFoundHttpException('Le point de vente demandé est introuvable.'); | |||||
} | } | ||||
return $model; | |||||
} | } | ||||
} | } |
]; | ]; | ||||
} | } | ||||
public function actionOnline() | |||||
{ | |||||
$usersWithStatusProducerOnlineArray = $this->getUserModule()->getRepository()->findUsersStatusProducerOnline(); | |||||
return $this->render('@backend/views/producer-admin/online', [ | |||||
'usersWithStatusProducerOnlineArray' => $usersWithStatusProducerOnlineArray, | |||||
]); | |||||
} | |||||
/** | /** | ||||
* Liste les producteurs. | * Liste les producteurs. | ||||
* | * |
$subscriptionModule = $this->getSubscriptionModule(); | $subscriptionModule = $this->getSubscriptionModule(); | ||||
$orderModule = $this->getOrderModule(); | $orderModule = $this->getOrderModule(); | ||||
$subscription = $subscriptionModule->findOneSubscriptionById($id); | |||||
$subscriptionModule->getOrderManager()->deleteOrdersIncomingDistributionsFromSubscription($subscription); | |||||
$subscriptionModule->deleteSubscription($subscription); | |||||
$subscription = $subscriptionModule->getRepository()->findOneSubscriptionById($id); | |||||
$this->setFlash('success', 'Abonnement supprimé'); | |||||
if($subscription) { | |||||
$subscriptionModule->getOrderManager()->deleteOrdersIncomingDistributionsFromSubscription($subscription); | |||||
$subscriptionModule->deleteSubscription($subscription); | |||||
$this->setFlash('success', 'Abonnement supprimé'); | |||||
} | |||||
else { | |||||
$this->setFlash('danger', 'Abonnement introuvable'); | |||||
} | |||||
return $this->redirect(['subscription/index']); | return $this->redirect(['subscription/index']); | ||||
} | } |
?> | ?> | ||||
<div class="dashboard-index"> | <div class="dashboard-index"> | ||||
<div <?php if($adminSettingBag->get('forumFlarumUrl')): ?>class="col-md-8"<?php endif; ?>> | <div <?php if($adminSettingBag->get('forumFlarumUrl')): ?>class="col-md-8"<?php endif; ?>> | ||||
<?php if(Yii::$app->request->get('error_products_points_sale')): ?> | <?php if(Yii::$app->request->get('error_products_points_sale')): ?> | ||||
<div class="alert alert-warning"> | <div class="alert alert-warning"> |
return $deliveryNoteModule->getAmountWithTax($deliveryNote, Order::INVOICE_AMOUNT_TOTAL, true); | return $deliveryNoteModule->getAmountWithTax($deliveryNote, Order::INVOICE_AMOUNT_TOTAL, true); | ||||
} | } | ||||
], | ], | ||||
[ | |||||
'attribute' => 'is_sent', | |||||
'header' => 'Envoyé', | |||||
'format' => 'raw', | |||||
'headerOptions' => ['class' => 'column-hide-on-mobile'], | |||||
'filterOptions' => ['class' => 'column-hide-on-mobile'], | |||||
'contentOptions' => ['class' => 'column-hide-on-mobile'], | |||||
'value' => function ($model) { | |||||
if ($model->is_sent) { | |||||
return '<span class="label label-success">Oui</span>'; | |||||
} else { | |||||
return '<span class="label label-default">Non</span>'; | |||||
} | |||||
} | |||||
], | |||||
[ | [ | ||||
'class' => 'yii\grid\ActionColumn', | 'class' => 'yii\grid\ActionColumn', | ||||
'template' => '{validate} {update} {delete} {send} {download}', | 'template' => '{validate} {update} {delete} {send} {download}', |
class="table table-bordered"> | class="table table-bordered"> | ||||
<thead> | <thead> | ||||
<tr> | <tr> | ||||
<th></th> | |||||
<th> | |||||
<input type="checkbox" class="check-all-checkboxes" data-selector=".checkbox-delivery-note" /> | |||||
</th> | |||||
<th>Libellé</th> | <th>Libellé</th> | ||||
<th v-if="taxRateProducer != 0">Montant (TTC)</th> | <th v-if="taxRateProducer != 0">Montant (TTC)</th> | ||||
<th v-else>Montant</th> | <th v-else>Montant</th> | ||||
</thead> | </thead> | ||||
<tbody> | <tbody> | ||||
<tr v-for="deliveryNote in deliveryNoteCreateArray"> | <tr v-for="deliveryNote in deliveryNoteCreateArray"> | ||||
<td><input type="checkbox" name="Invoice[deliveryNotes][]" | |||||
:value="deliveryNote.id"/></td> | |||||
<td><input type="checkbox" class="checkbox-delivery-note" name="Invoice[deliveryNotes][]" :value="deliveryNote.id"/></td> | |||||
<td>{{ deliveryNote.name }}</td> | <td>{{ deliveryNote.name }}</td> | ||||
<td>{{ formatPrice(deliveryNote.total) }}</td> | <td>{{ formatPrice(deliveryNote.total) }}</td> | ||||
</tr> | </tr> |
termes. | termes. | ||||
*/ | */ | ||||
use yii\helpers\Html; | |||||
use yii\widgets\Breadcrumbs; | use yii\widgets\Breadcrumbs; | ||||
use dmstr\widgets\Alert; | use dmstr\widgets\Alert; | ||||
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
$producerModule = $this->getProducerModule(); | $producerModule = $this->getProducerModule(); | ||||
$adminSettingBag = $this->getSettingModule()->getAdminSettingBag(); | |||||
?> | ?> | ||||
<div class="content-wrapper"> | <div class="content-wrapper"> | ||||
<section class="content"> | <section class="content"> | ||||
<?= $this->renderFile('@common/views/alert_message.php', [ | |||||
'display' => $adminSettingBag->get('adminAlertMessageDisplay'), | |||||
'type' => $adminSettingBag->get('adminAlertMessageType'), | |||||
'title' => $adminSettingBag->get('adminAlertMessageTitle'), | |||||
'icon' => $adminSettingBag->get('adminAlertMessageIcon'), | |||||
'message' => $adminSettingBag->get('adminAlertMessage'), | |||||
]) ?> | |||||
<?php $producer = GlobalParam::getCurrentProducer(); ?> | <?php $producer = GlobalParam::getCurrentProducer(); ?> | ||||
<?php if($producer && !$producerModule->isUpToDateWithOpendistribVersion($producer) && $producer->option_display_message_new_opendistrib_version): ?> | <?php if($producer && !$producerModule->isUpToDateWithOpendistribVersion($producer) && $producer->option_display_message_new_opendistrib_version): ?> | ||||
<div class="alert alert-warning"> | |||||
<div class="alert alert-success"> | |||||
<p>Opendistrib a été mis à jour vers la version <?= GlobalParam::getOpendistribVersion() ?> ! <a class="alert-link" href="<?= Yii::$app->urlManager->createUrl(['development/index']) ?>">Découvrir les nouveautés</a></p> | <p>Opendistrib a été mis à jour vers la version <?= GlobalParam::getOpendistribVersion() ?> ! <a class="alert-link" href="<?= Yii::$app->urlManager->createUrl(['development/index']) ?>">Découvrir les nouveautés</a></p> | ||||
<a href="<?= Yii::$app->urlManager->createUrl(['producer/update-opendistrib-version']) ?>" class="close"><span aria-hidden="true">×</span></a> | <a href="<?= Yii::$app->urlManager->createUrl(['producer/update-opendistrib-version']) ?>" class="close"><span aria-hidden="true">×</span></a> | ||||
</div> | </div> |
} | } | ||||
$developerOnlineLabel = ''; | $developerOnlineLabel = ''; | ||||
if($adminSettingBag->get('supportDeveloperOnline')) { | |||||
if($adminSettingBag->get('supportOnline')) { | |||||
$developerOnlineLabel = '<small class="label pull-right bg-green"><i class="fa fa-phone"></i></small>'; | $developerOnlineLabel = '<small class="label pull-right bg-green"><i class="fa fa-phone"></i></small>'; | ||||
} | } | ||||
$sumUserProducerCreditsLabel = ''; | $sumUserProducerCreditsLabel = ''; | ||||
//$sumUserProducerCreditsLabel = '<span class="pull-right-container"><small class="label pull-right '.($sumUserProducerCredits >= 0 ? 'bg-green' : 'bg-red') .'">'.number_format($sumUserProducerCredits, 2).' €</small></span>'; | //$sumUserProducerCreditsLabel = '<span class="pull-right-container"><small class="label pull-right '.($sumUserProducerCredits >= 0 ? 'bg-green' : 'bg-red') .'">'.number_format($sumUserProducerCredits, 2).' €</small></span>'; | ||||
$countUsersWithStatusProducerOnline = $userModule->getRepository()->countUsersStatusProducerOnline(); | |||||
$countUsersWithStatusProducerOnlineLabel = ''; | |||||
if($countUsersWithStatusProducerOnline) { | |||||
$countUsersWithStatusProducerOnlineLabel = '<span class="pull-right-container"><small class="label pull-right bg-blue">'.$countUsersWithStatusProducerOnline.'</small></span>'; | |||||
} | |||||
?> | ?> | ||||
<?= dmstr\widgets\Menu::widget( | <?= dmstr\widgets\Menu::widget( | ||||
], | ], | ||||
['label' => 'Administration', 'options' => ['class' => 'header'], 'visible' => $isUserCurrentGrantedAsAdministrator], | ['label' => 'Administration', 'options' => ['class' => 'header'], 'visible' => $isUserCurrentGrantedAsAdministrator], | ||||
[ | [ | ||||
'label' => 'Tickets', | |||||
'label' => 'En ligne', | |||||
'icon' => 'wifi', | |||||
'url' => ['producer-admin/online'], | |||||
'visible' => $isUserCurrentGrantedAsAdministrator, | |||||
'template' => '<a href="{url}">{icon} {label}' . $countUsersWithStatusProducerOnlineLabel . '</a>' | |||||
], | |||||
[ | |||||
'label' => 'Support', | |||||
'icon' => 'comments', | 'icon' => 'comments', | ||||
'url' => ['support-admin/index'], | 'url' => ['support-admin/index'], | ||||
'visible' => $isUserCurrentGrantedAsAdministrator, | 'visible' => $isUserCurrentGrantedAsAdministrator, | ||||
], | ], | ||||
] | ] | ||||
) ?> | ) ?> | ||||
</section> | </section> | ||||
</aside> | </aside> |
<?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 yii\helpers\Html; | |||||
use yii\grid\GridView; | |||||
use common\logic\User\User\Model\User; | |||||
use common\logic\Producer\Producer\Model\Producer; | |||||
use common\helpers\Price; | |||||
$producerModule = $this->getProducerModule(); | |||||
$userModule = $this->getUserModule(); | |||||
$this->setTitle('Producteurs en ligne'); | |||||
$this->addBreadcrumb($this->getTitle()); | |||||
?> | |||||
<div class="producer-admin-online"> | |||||
<?php if($usersWithStatusProducerOnlineArray && count($usersWithStatusProducerOnlineArray) > 0): ?> | |||||
<?php foreach ($usersWithStatusProducerOnlineArray as $userWithStatusProducerOnline): ?> | |||||
<?php $producer = $userWithStatusProducerOnline->producer; ?> | |||||
<div class="col-md-3"> | |||||
<div class="box box-primary"> | |||||
<div class="box-body box-profile"> | |||||
<?php if ($producer->logo && Image::isPhotoExist($producer->logo)): ?> | |||||
<img class="profile-user-img img-responsive img-circle" | |||||
src="<?= Yii::$app->urlManagerProducer->getHostInfo() . '/' . Yii::$app->urlManagerProducer->baseUrl; ?>/uploads/<?= $producer->logo; ?>" | |||||
alt="Logo <?= Html::encode($producer->name) ?>"> | |||||
<?php endif; ?> | |||||
<h3 class="profile-username text-center"> | |||||
<?= $producer->name; ?> | |||||
</h3> | |||||
<p class="text-muted text-center"> | |||||
<?= $userModule->getSolver()->getUsername($userWithStatusProducerOnline); ?><br/> | |||||
</p> | |||||
<!--<ul class="list-group list-group-unbordered"> | |||||
<li class="list-group-item"> | |||||
<b>Téléphone</b> <a class="pull-right">06 00 00 00 00</a> | |||||
</li> | |||||
</ul> | |||||
<a href="#" class="btn btn-primary btn-block"><b>Bouton</b></a>--> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<?php endforeach; ?> | |||||
<div class="clr"></div> | |||||
<?php else: ?> | |||||
<div class="alert alert-info">Aucun producteur en ligne actuellement.</div> | |||||
<?php endif; ?> | |||||
</div> |
<?= $form->field($model, 'postcode') ?> | <?= $form->field($model, 'postcode') ?> | ||||
<?= $form->field($model, 'city') ?> | <?= $form->field($model, 'city') ?> | ||||
<h4>Contact</h4> | |||||
<?= $form->field($model, 'contact_email') ?> | |||||
<?= $form->field($model, 'website') ?> | |||||
<h4>Apparence</h4> | <h4>Apparence</h4> | ||||
<?= $form->field($model, 'background_color_logo') ?> | <?= $form->field($model, 'background_color_logo') ?> | ||||
<?= $form->field($model, 'logoFile')->fileInput() ?> | <?= $form->field($model, 'logoFile')->fileInput() ?> |
function field($form, $model, $settingDetail) { | function field($form, $model, $settingDetail) { | ||||
$field = $form->field($model, $settingDetail->getName()); | $field = $form->field($model, $settingDetail->getName()); | ||||
if($settingDetail->getFormType() == 'checkbox') { | if($settingDetail->getFormType() == 'checkbox') { | ||||
return $field->checkbox(); | |||||
$field = $field->checkbox(); | |||||
} | } | ||||
elseif($settingDetail->getFormType() == 'toggle') { | elseif($settingDetail->getFormType() == 'toggle') { | ||||
return $form->field($model, $settingDetail->getName(), ['options' => ['class' => 'form-group form-toggle']])->widget(Toggle::class, ['options' => ['data-on' => 'Oui', 'data-off' => 'Non', 'data-offstyle' => 'danger']]); | |||||
$field = $form->field($model, $settingDetail->getName(), ['options' => ['class' => 'form-group form-toggle']])->widget(Toggle::class, ['options' => ['data-on' => 'Oui', 'data-off' => 'Non', 'data-offstyle' => 'danger']]); | |||||
} | } | ||||
elseif($settingDetail->getFormType() == 'select') { | elseif($settingDetail->getFormType() == 'select') { | ||||
return $field->dropDownList($settingDetail->getOptions()); | |||||
$field = $field->dropDownList($settingDetail->getOptions()); | |||||
} | } | ||||
elseif($settingDetail->getFormType() == 'textarea') { | elseif($settingDetail->getFormType() == 'textarea') { | ||||
return $field->textarea(['rows' => 4]); | |||||
$field = $field->textarea(['rows' => 4]); | |||||
} | } | ||||
elseif($settingDetail->getFormType() == 'input') { | elseif($settingDetail->getFormType() == 'input') { | ||||
return $field->textInput(); | |||||
$field = $field->textInput(); | |||||
} | } | ||||
else { | else { | ||||
return '<div class="form-group"><span class="glyphicon glyphicon-alert"></span> Type de champ non défini pour le paramètre "'.$settingDetail->getName().'"</div>'; | return '<div class="form-group"><span class="glyphicon glyphicon-alert"></span> Type de champ non défini pour le paramètre "'.$settingDetail->getName().'"</div>'; | ||||
} | } | ||||
if($settingDetail->getHelpMessage()) { | |||||
$field->hint($settingDetail->getHelpMessage()); | |||||
} | |||||
return $field; | |||||
} | } | ||||
?> | ?> |
* termes. | * termes. | ||||
*/ | */ | ||||
use common\helpers\Image; | |||||
use common\logic\Ticket\Ticket\Model\Ticket; | use common\logic\Ticket\Ticket\Model\Ticket; | ||||
use common\logic\Ticket\Ticket\Module\TicketModule; | use common\logic\Ticket\Ticket\Module\TicketModule; | ||||
use yii\helpers\Html; | use yii\helpers\Html; | ||||
* @var $this common\components\ViewBackend | * @var $this common\components\ViewBackend | ||||
*/ | */ | ||||
$userModule = $this->getUserModule(); | |||||
$ticketModule = TicketModule::getInstance(); | $ticketModule = TicketModule::getInstance(); | ||||
$adminSettingBag = $this->getSettingModule()->getAdminSettingBag(); | $adminSettingBag = $this->getSettingModule()->getAdminSettingBag(); | ||||
$userCurrent = $this->getUserCurrent(); | $userCurrent = $this->getUserCurrent(); | ||||
$this->setTitle('Support & contact'); | $this->setTitle('Support & contact'); | ||||
$this->addBreadcrumb($this->getTitle()); | $this->addBreadcrumb($this->getTitle()); | ||||
$supportDeveloperOnline = $adminSettingBag->get('supportDeveloperOnline'); | |||||
$supportOnline = $adminSettingBag->get('supportOnline'); | |||||
?> | ?> | ||||
<div class="support-index"> | <div class="support-index"> | ||||
<?php if($context == 'producer'): ?> | |||||
<?php if ($context == 'producer'): ?> | |||||
<div class="callout callout-info"> | |||||
<p><i class="icon fa fa-info-circle"></i> Pour toutes vos questions, remarques, suggestions et remontées de bugs.</p> | |||||
</div> | |||||
<div> | |||||
<div class="col-md-6 col-left"> | |||||
<div class="info-box"> | |||||
<span class="info-box-icon <?php if($supportDeveloperOnline): ?>bg-green<?php else: ?>bg-yellow<?php endif; ?>"><i class="fa fa-phone"></i></span> | |||||
<div class="info-box-content"> | |||||
<?= $this->renderFile('@common/views/alert_message.php', [ | |||||
'display' => $adminSettingBag->get('adminSupportAlertMessageDisplay'), | |||||
'type' => $adminSettingBag->get('adminSupportAlertMessageType'), | |||||
'title' => $adminSettingBag->get('adminSupportAlertMessageTitle'), | |||||
'icon' => $adminSettingBag->get('adminSupportAlertMessageIcon'), | |||||
'message' => $adminSettingBag->get('adminSupportAlertMessage'), | |||||
]) ?> | |||||
<div class="callout callout-info"> | |||||
<p><i class="icon fa fa-info-circle"></i> Pour toutes vos questions, remarques, suggestions et remontées de | |||||
bugs.</p> | |||||
</div> | |||||
<div> | |||||
<div class="col-md-6 col-left"> | |||||
<div class="info-box"> | |||||
<span class="info-box-icon <?php if ($supportOnline): ?>bg-green<?php else: ?>bg-yellow<?php endif; ?>"><i | |||||
class="fa fa-phone"></i></span> | |||||
<div class="info-box-content"> | |||||
<span class="info-box-text"> | <span class="info-box-text"> | ||||
Me contacter directement | Me contacter directement | ||||
<?php if($supportDeveloperOnline): ?> | |||||
<br /><span class="label label-success">Disponible</span> | |||||
<?php if ($supportOnline): ?> | |||||
<br/><span class="label label-success">Disponible</span> | |||||
<?php endif; ?> | <?php endif; ?> | ||||
</span> | </span> | ||||
<span class="info-box-text"> | |||||
<span class="info-box-text"> | |||||
<br/> | <br/> | ||||
<strong><?= $adminSettingBag->get('administratorPhoneNumber'); ?></strong> | <strong><?= $adminSettingBag->get('administratorPhoneNumber'); ?></strong> | ||||
</span> | </span> | ||||
</div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | |||||
<div class="col-md-6 col-right"> | |||||
<div class="info-box"> | |||||
<span class="info-box-icon bg-yellow"><i class="fa fa-calendar"></i></span> | |||||
<div class="info-box-content"> | |||||
<div class="col-md-6 col-right"> | |||||
<div class="info-box"> | |||||
<span class="info-box-icon bg-yellow"><i class="fa fa-calendar"></i></span> | |||||
<div class="info-box-content"> | |||||
<span class="info-box-text"><br/> | <span class="info-box-text"><br/> | ||||
<?= Html::a('Prendre rendez-vous', Yii::$app->parameterBag->get('appointmentUrl'), ['class' => 'btn btn-sm btn-default', 'target' => '_blank']); ?> | <?= Html::a('Prendre rendez-vous', Yii::$app->parameterBag->get('appointmentUrl'), ['class' => 'btn btn-sm btn-default', 'target' => '_blank']); ?> | ||||
</span> | </span> | ||||
</div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | |||||
<div class="col-md-6 col-left"> | |||||
<div class="info-box"> | |||||
<span class="info-box-icon bg-yellow"><i class="fa fa-comments"></i></span> | |||||
<div class="info-box-content"> | |||||
<span class="info-box-text"><br/><?= Html::a('Ouvrir un ticket', ['support/create'], ['class' => 'btn btn-sm btn-default']); ?></span> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="col-md-6 col-right"> | |||||
<div class="info-box"> | |||||
<span class="info-box-icon bg-yellow"><i class="fa fa-envelope"></i></span> | |||||
<div class="info-box-content"> | |||||
<span class="info-box-text"><br/><?= Html::a("M'envoyer un email", 'mailto:'.$adminSettingBag->get('administratorEmail'), ['class' => 'btn btn-sm btn-default']); ?></span> | |||||
<div class="col-md-6 col-left"> | |||||
<div class="info-box"> | |||||
<span class="info-box-icon bg-yellow"><i class="fa fa-comments"></i></span> | |||||
<div class="info-box-content"> | |||||
<span class="info-box-text"><br/><?= Html::a('Ouvrir un ticket', ['support/create'], ['class' => 'btn btn-sm btn-default']); ?></span> | |||||
</div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | |||||
<?php if($adminSettingBag->get('forumFlarumUrl')): ?> | |||||
<div class="col-md-6 col-left"> | |||||
<div class="col-md-6 col-right"> | |||||
<div class="info-box"> | <div class="info-box"> | ||||
<span class="info-box-icon bg-yellow"><i class="fa fa-users"></i></span> | |||||
<span class="info-box-icon bg-yellow"><i class="fa fa-envelope"></i></span> | |||||
<div class="info-box-content"> | <div class="info-box-content"> | ||||
<span class="info-box-text"><br/><?= Html::a("Ouvrir une discussion sur le forum", $adminSettingBag->get('forumFlarumUrl'), ['class' => 'btn btn-sm btn-default', 'target' => '_blank']); ?></span> | |||||
<span class="info-box-text"><br/><?= Html::a("M'envoyer un email", 'mailto:' . $adminSettingBag->get('administratorEmail'), ['class' => 'btn btn-sm btn-default']); ?></span> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<?php endif; ?> | |||||
</div> | |||||
<div class="clr"></div> | |||||
<?php if ($adminSettingBag->get('forumFlarumUrl')): ?> | |||||
<div class="col-md-6 col-left"> | |||||
<div class="info-box"> | |||||
<span class="info-box-icon bg-yellow"><i class="fa fa-users"></i></span> | |||||
<div class="info-box-content"> | |||||
<span class="info-box-text"><br/><?= Html::a("Ouvrir une discussion sur le forum", $adminSettingBag->get('forumFlarumUrl'), ['class' => 'btn btn-sm btn-default', 'target' => '_blank']); ?></span> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<?php endif; ?> | |||||
</div> | |||||
<div class="clr"></div> | |||||
<?php endif; ?> | <?php endif; ?> | ||||
<div class="nav-tabs-custom ticket-list"> | <div class="nav-tabs-custom ticket-list"> | ||||
'format' => 'raw', | 'format' => 'raw', | ||||
'value' => function ($ticket) use ($ticketModule, $userCurrent) { | 'value' => function ($ticket) use ($ticketModule, $userCurrent) { | ||||
if($ticketModule->isTicketUnread($ticket, $userCurrent)) { | |||||
if ($ticketModule->isTicketUnread($ticket, $userCurrent)) { | |||||
$firstTicketMessageUnread = $ticketModule->getFirstTicketMessageUnread($ticket, $userCurrent); | $firstTicketMessageUnread = $ticketModule->getFirstTicketMessageUnread($ticket, $userCurrent); | ||||
$link = '<strong>'.Html::a($ticket->subject, ['view', 'id' => $ticket->id, '#' => $firstTicketMessageUnread->id]).'</strong>'; | |||||
} | |||||
else { | |||||
$link = '<strong>' . Html::a($ticket->subject, ['view', 'id' => $ticket->id, '#' => $firstTicketMessageUnread->id]) . '</strong>'; | |||||
} else { | |||||
$link = Html::a($ticket->subject, ['view', 'id' => $ticket->id]); | $link = Html::a($ticket->subject, ['view', 'id' => $ticket->id]); | ||||
} | } | ||||
'headerOptions' => ['class' => 'column-actions'], | 'headerOptions' => ['class' => 'column-actions'], | ||||
'contentOptions' => ['class' => 'column-actions'], | 'contentOptions' => ['class' => 'column-actions'], | ||||
'buttons' => [ | 'buttons' => [ | ||||
'view' => function ($url, $ticket) { | |||||
'view' => function ($url, $ticket) { | |||||
$url = ['view', 'id' => $ticket->id]; | $url = ['view', 'id' => $ticket->id]; | ||||
return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', $url, [ | return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', $url, [ | ||||
'title' => 'Voir le ticket', 'class' => 'btn btn-default' | 'title' => 'Voir le ticket', 'class' => 'btn btn-default' | ||||
} | } | ||||
]; | ]; | ||||
if($context == 'producer') { | |||||
if ($context == 'producer') { | |||||
$columns = [ | $columns = [ | ||||
$columnCreatedAt, | $columnCreatedAt, | ||||
$columnSubject, | $columnSubject, | ||||
$columnMessages, | $columnMessages, | ||||
$columnButtonActions | $columnButtonActions | ||||
]; | ]; | ||||
} | |||||
elseif($context == 'admin') { | |||||
} elseif ($context == 'admin') { | |||||
$columns = [ | $columns = [ | ||||
$columnCreatedAt, | $columnCreatedAt, | ||||
$columnProducer, | $columnProducer, |
body.skin-black .content-wrapper .alert .close { | body.skin-black .content-wrapper .alert .close { | ||||
font-size: 30px; | font-size: 30px; | ||||
position: relative; | position: relative; | ||||
top: -15px; | |||||
top: -25px; | |||||
text-decoration: none; | text-decoration: none; | ||||
color: white; | color: white; | ||||
opacity: 0.6; | opacity: 0.6; | ||||
padding-left: 25px; | padding-left: 25px; | ||||
} | } | ||||
/* line 4, ../sass/support/_index.scss */ | |||||
/* line 3, ../sass/support/_index.scss */ | |||||
.support-index .col-left { | .support-index .col-left { | ||||
padding-left: 0px; | padding-left: 0px; | ||||
} | } | ||||
/* line 7, ../sass/support/_index.scss */ | |||||
/* line 6, ../sass/support/_index.scss */ | |||||
.support-index .col-right { | .support-index .col-right { | ||||
padding-right: 0px; | padding-right: 0px; | ||||
} | } | ||||
/* line 13, ../sass/support/_index.scss */ | |||||
/* line 12, ../sass/support/_index.scss */ | |||||
.support-index .ticket-list .nav-tabs .label { | .support-index .ticket-list .nav-tabs .label { | ||||
position: relative; | position: relative; | ||||
top: -2px; | top: -2px; | ||||
left: 2px; | left: 2px; | ||||
padding: 0.3em 0.6em 0.2em 0.6em; | padding: 0.3em 0.6em 0.2em 0.6em; | ||||
} | } | ||||
/* line 22, ../sass/support/_index.scss */ | |||||
/* line 21, ../sass/support/_index.scss */ | |||||
.support-index .ticket-list .table .filters { | .support-index .ticket-list .table .filters { | ||||
display: none; | display: none; | ||||
} | } | ||||
/* line 26, ../sass/support/_index.scss */ | |||||
/* line 25, ../sass/support/_index.scss */ | |||||
.support-index .ticket-list .table .td-created-at, | .support-index .ticket-list .table .td-created-at, | ||||
.support-index .ticket-list .table .td-last-message, | .support-index .ticket-list .table .td-last-message, | ||||
.support-index .ticket-list .table .td-messages { | .support-index .ticket-list .table .td-messages { | ||||
width: 100px; | width: 100px; | ||||
} | } | ||||
/* line 31, ../sass/support/_index.scss */ | |||||
/* line 30, ../sass/support/_index.scss */ | |||||
.support-index .ticket-list .table .td-producer { | .support-index .ticket-list .table .td-producer { | ||||
width: 200px; | width: 200px; | ||||
} | } | ||||
margin-top: 5px; | margin-top: 5px; | ||||
} | } | ||||
/* line 3, ../sass/producer-admin/_online.scss */ | |||||
.producer-admin-online .box { | |||||
height: 250px; | |||||
} | |||||
/* line 6, ../sass/producer-admin/_online.scss */ | |||||
.producer-admin-online .box .profile-username { | |||||
font-family: 'Source Sans Pro',sans-serif; | |||||
font-weight: normal; | |||||
font-size: 18px; | |||||
} | |||||
/* line 4, ../sass/feature-admin/_index.scss */ | /* line 4, ../sass/feature-admin/_index.scss */ | ||||
.feature-admin-index table th.only-for-selected-producers, | .feature-admin-index table th.only-for-selected-producers, | ||||
.feature-admin-index table td.only-for-selected-producers { | .feature-admin-index table td.only-for-selected-producers { |
opendistrib_user_form(); | opendistrib_user_form(); | ||||
opendistrib_features_index(); | opendistrib_features_index(); | ||||
opendistrib_point_sale_form(); | opendistrib_point_sale_form(); | ||||
opendistrib_check_all_checkboxes(); | |||||
}); | }); | ||||
var UrlManager = { | var UrlManager = { | ||||
} | } | ||||
}; | }; | ||||
function opendistrib_check_all_checkboxes() { | |||||
$('.check-all-checkboxes').change(function() { | |||||
var selector = $(this).data('selector'); | |||||
var checked = $(this).prop('checked'); | |||||
$(selector).prop('checked', checked); | |||||
if(checked){ | |||||
$(selector).unbind('change').change(function() { | |||||
if(!$(this).prop('checked')) { | |||||
$('.check-all-checkboxes').prop('checked', false); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
function opendistrib_point_sale_form() { | function opendistrib_point_sale_form() { | ||||
if($('.point-sale-form').length) { | if($('.point-sale-form').length) { | ||||
opendistrib_point_sale_form_days_distribution_event(); | opendistrib_point_sale_form_days_distribution_event(); |
} else { | } else { | ||||
app.document.address = ''; | app.document.address = ''; | ||||
} | } | ||||
setTimeout("opendistrib_check_all_checkboxes();", 500); | |||||
}); | }); | ||||
}, | }, | ||||
deleteDeliveryNoteFromInvoice: function(event) { | deleteDeliveryNoteFromInvoice: function(event) { |
.close { | .close { | ||||
font-size: 30px; | font-size: 30px; | ||||
position: relative; | position: relative; | ||||
top: -15px; | |||||
top: -25px; | |||||
text-decoration: none; | text-decoration: none; | ||||
color: white; | color: white; | ||||
opacity: 0.6; | opacity: 0.6; |
.producer-admin-online { | |||||
.box { | |||||
height: 250px; | |||||
.profile-username { | |||||
font-family: 'Source Sans Pro',sans-serif; | |||||
font-weight: normal; | |||||
font-size: 18px; | |||||
} | |||||
} | |||||
} |
@import "support/_index.scss"; | @import "support/_index.scss"; | ||||
@import "support/_view.scss"; | @import "support/_view.scss"; | ||||
@import "producer-admin/_index.scss"; | @import "producer-admin/_index.scss"; | ||||
@import "producer-admin/_online.scss"; | |||||
@import "feature-admin/_index.scss"; | @import "feature-admin/_index.scss"; | ||||
@import "setting/_form.scss"; | @import "setting/_form.scss"; | ||||
@import "_responsive.scss" ; | @import "_responsive.scss" ; |
.support-index { | .support-index { | ||||
.col-left { | .col-left { | ||||
padding-left: 0px; | padding-left: 0px; | ||||
} | } |
*/ | */ | ||||
return [ | return [ | ||||
'version' => '24.1.B', | |||||
'version' => '24.2.A', | |||||
'maintenanceMode' => false, | 'maintenanceMode' => false, | ||||
'siteName' => 'Opendistrib', | 'siteName' => 'Opendistrib', | ||||
'adminEmail' => 'contact@opendistrib.net', | 'adminEmail' => 'contact@opendistrib.net', |
$pointSale = null; | $pointSale = null; | ||||
$arrayUserPointSale = $this->userPointSaleRepository->findUserPointSalesByUser($user, $distribution); | $arrayUserPointSale = $this->userPointSaleRepository->findUserPointSalesByUser($user, $distribution); | ||||
if (count($arrayUserPointSale) == 1) { | |||||
if (count($arrayUserPointSale) == 1 && $arrayUserPointSale[0]->id_point_sale) { | |||||
$pointSale = $this->pointSaleRepository->findOnePointSaleById($arrayUserPointSale[0]->id_point_sale); | $pointSale = $this->pointSaleRepository->findOnePointSaleById($arrayUserPointSale[0]->id_point_sale); | ||||
} else { | } else { | ||||
$lastOrder = $this->findOneOrderLastByUser($user); | $lastOrder = $this->findOneOrderLastByUser($user); |
'admin_comment', | 'admin_comment', | ||||
'export_shopping_cart_labels_format', | 'export_shopping_cart_labels_format', | ||||
'document_image_bottom', | 'document_image_bottom', | ||||
'website' | |||||
], | ], | ||||
'string' | 'string' | ||||
], | ], | ||||
'option_document_display_price_unit_reference' => "Afficher les prix au kilogramme", | 'option_document_display_price_unit_reference' => "Afficher les prix au kilogramme", | ||||
'id_user_group_default' => "Groupe utilisateur par défaut attribué à l'inscription", | 'id_user_group_default' => "Groupe utilisateur par défaut attribué à l'inscription", | ||||
'option_check_by_default_prevent_user_credit' => "Par défaut, prévenir l'utilisateur quand on crédite son compte", | 'option_check_by_default_prevent_user_credit' => "Par défaut, prévenir l'utilisateur quand on crédite son compte", | ||||
'delivery_note_automatic_validation' => 'Validation automatique des bons de livraison' | |||||
'delivery_note_automatic_validation' => 'Validation automatique des bons de livraison', | |||||
'website' => 'Site web' | |||||
]; | ]; | ||||
} | } | ||||
); | ); | ||||
} | } | ||||
public function getMaximumNumberProducers(): ?int | |||||
{ | |||||
return $this->adminSettingBag->get('maximumNumberProducers'); | |||||
} | |||||
public function isProducerSignupOpen(): bool | public function isProducerSignupOpen(): bool | ||||
{ | { | ||||
return $this->adminSettingBag->get('maximumNumberProducers') | |||||
> $this->producerRepository->countCacheProducersActiveWithTurnover(); | |||||
$maximumNumberProducers = $this->getMaximumNumberProducers(); | |||||
return !$maximumNumberProducers | |||||
|| $maximumNumberProducers > $this->producerRepository->countCacheProducersActiveWithTurnover(); | |||||
} | } | ||||
public function getProducerSignupRemainingPlaces(): int | public function getProducerSignupRemainingPlaces(): int | ||||
{ | { | ||||
return max($this->adminSettingBag->get('maximumNumberProducers') | |||||
return max($this->getMaximumNumberProducers() | |||||
- $this->producerRepository->countCacheProducersActiveWithTurnover(), 0); | - $this->producerRepository->countCacheProducersActiveWithTurnover(), 0); | ||||
} | } | ||||
} | } |
namespace common\logic\Setting\SettingDetails\Admin; | namespace common\logic\Setting\SettingDetails\Admin; | ||||
use common\logic\Setting\SettingDefinition; | use common\logic\Setting\SettingDefinition; | ||||
use common\logic\Setting\SettingDetails\Admin\AlertMessage\AdminAlertMessageIconSetting; | |||||
use common\logic\Setting\SettingDetails\Admin\AlertMessage\AdminAlertMessageSetting; | |||||
use common\logic\Setting\SettingDetails\Admin\AlertMessage\AdminAlertMessageTitleSetting; | |||||
use common\logic\Setting\SettingDetails\Admin\AlertMessage\AdminAlertMessageTypeSetting; | |||||
use common\logic\Setting\SettingDetails\Admin\AlertMessage\AdminSupportAlertMessageDisplaySetting; | |||||
use common\logic\Setting\SettingDetails\Admin\AlertMessage\AdminSupportAlertMessageIconSetting; | |||||
use common\logic\Setting\SettingDetails\Admin\AlertMessage\AdminSupportAlertMessageSetting; | |||||
use common\logic\Setting\SettingDetails\Admin\AlertMessage\AdminSupportAlertMessageTitleSetting; | |||||
use common\logic\Setting\SettingDetails\Admin\AlertMessage\AdminSupportAlertMessageTypeSetting; | |||||
use common\logic\Setting\SettingDetails\Admin\General\AdministratorEmailAdminSetting; | use common\logic\Setting\SettingDetails\Admin\General\AdministratorEmailAdminSetting; | ||||
use common\logic\Setting\SettingDetails\Admin\General\AdministratorPhoneNumberAdminSetting; | use common\logic\Setting\SettingDetails\Admin\General\AdministratorPhoneNumberAdminSetting; | ||||
use common\logic\Setting\SettingDetails\Admin\General\ForumFlarumUrlAdminSetting; | use common\logic\Setting\SettingDetails\Admin\General\ForumFlarumUrlAdminSetting; | ||||
use common\logic\Setting\SettingDetails\Admin\General\MaximumNumberProducersAdminSetting; | use common\logic\Setting\SettingDetails\Admin\General\MaximumNumberProducersAdminSetting; | ||||
use common\logic\Setting\SettingDetails\Admin\General\SupportDeveloperOnlineAdminSetting; | |||||
use common\logic\Setting\SettingDetails\Admin\General\SupportOnlineAdminSetting; | |||||
use common\logic\Setting\SettingDetails\Admin\AlertMessage\AdminAlertMessageDisplaySetting; | |||||
class AdminSettingDefinition extends SettingDefinition | class AdminSettingDefinition extends SettingDefinition | ||||
{ | { | ||||
const SECTION_GENERAL = 'general'; | const SECTION_GENERAL = 'general'; | ||||
const SUBSECTION_GENERAL = 'general.main'; | const SUBSECTION_GENERAL = 'general.main'; | ||||
const SECTION_ALERT_MESSAGE = 'alertmessage'; | |||||
const SUBSECTION_ALERT_MESSAGE_GLOBAL = 'alertmessage.global'; | |||||
const SUBSECTION_ALERT_MESSAGE_SUPPORT = 'alertmessage.support'; | |||||
public function getSettingDetails(): array | public function getSettingDetails(): array | ||||
{ | { | ||||
return [ | return [ | ||||
self::SECTION_GENERAL => [ | self::SECTION_GENERAL => [ | ||||
self::SUBSECTION_GENERAL => [ | self::SUBSECTION_GENERAL => [ | ||||
new SupportDeveloperOnlineAdminSetting(), | |||||
new SupportOnlineAdminSetting(), | |||||
new AdministratorEmailAdminSetting(), | new AdministratorEmailAdminSetting(), | ||||
new AdministratorPhoneNumberAdminSetting(), | new AdministratorPhoneNumberAdminSetting(), | ||||
new MaximumNumberProducersAdminSetting(), | new MaximumNumberProducersAdminSetting(), | ||||
new ForumFlarumUrlAdminSetting(), | new ForumFlarumUrlAdminSetting(), | ||||
] | ] | ||||
], | ], | ||||
self::SECTION_ALERT_MESSAGE => [ | |||||
self::SUBSECTION_ALERT_MESSAGE_GLOBAL => [ | |||||
new AdminAlertMessageDisplaySetting(), | |||||
new AdminAlertMessageTypeSetting(), | |||||
new AdminAlertMessageIconSetting(), | |||||
new AdminAlertMessageTitleSetting(), | |||||
new AdminAlertMessageSetting(), | |||||
], | |||||
self::SUBSECTION_ALERT_MESSAGE_SUPPORT => [ | |||||
new AdminSupportAlertMessageDisplaySetting(), | |||||
new AdminSupportAlertMessageTypeSetting(), | |||||
new AdminSupportAlertMessageIconSetting(), | |||||
new AdminSupportAlertMessageTitleSetting(), | |||||
new AdminSupportAlertMessageSetting(), | |||||
], | |||||
] | |||||
]; | ]; | ||||
} | } | ||||
return [ | return [ | ||||
self::SECTION_GENERAL => 'General', | self::SECTION_GENERAL => 'General', | ||||
self::SUBSECTION_GENERAL => 'General', | self::SUBSECTION_GENERAL => 'General', | ||||
self::SECTION_ALERT_MESSAGE => 'Message d\'alerte', | |||||
self::SUBSECTION_ALERT_MESSAGE_GLOBAL => 'Global', | |||||
self::SUBSECTION_ALERT_MESSAGE_SUPPORT => 'Support' | |||||
]; | ]; | ||||
} | } | ||||
<?php | |||||
namespace common\logic\Setting\SettingDetails\Admin\AlertMessage; | |||||
use common\logic\Setting\SettingDetails\AbstractSettingDetail; | |||||
class AdminAlertMessageDisplaySetting extends AbstractSettingDetail | |||||
{ | |||||
public function __construct() | |||||
{ | |||||
$this | |||||
->setName('adminAlertMessageDisplay') | |||||
->setLabel("Afficher") | |||||
->setTypeBoolean() | |||||
->setFormTypeToggle(); | |||||
} | |||||
} |
<?php | |||||
namespace common\logic\Setting\SettingDetails\Admin\AlertMessage; | |||||
use common\logic\Setting\SettingDetails\AbstractSettingDetail; | |||||
class AdminAlertMessageIconSetting extends AbstractSettingDetail | |||||
{ | |||||
public function __construct() | |||||
{ | |||||
$this | |||||
->setName('adminAlertMessageIcon') | |||||
->setLabel("Icône") | |||||
->setTypeString() | |||||
->setFormTypeInput() | |||||
->setHelpMessage('<a href="https://adminlte.io/themes/AdminLTE/pages/UI/icons.html" target="_blank">Icônes disponibles</a>'); | |||||
} | |||||
} |
<?php | |||||
namespace common\logic\Setting\SettingDetails\Admin\AlertMessage; | |||||
use common\logic\Setting\SettingDetails\AbstractSettingDetail; | |||||
class AdminAlertMessageSetting extends AbstractSettingDetail | |||||
{ | |||||
public function __construct() | |||||
{ | |||||
$this | |||||
->setName('adminAlertMessage') | |||||
->setLabel("Message") | |||||
->setTypeText() | |||||
->setFormTypeTextarea(); | |||||
} | |||||
} |
<?php | |||||
namespace common\logic\Setting\SettingDetails\Admin\AlertMessage; | |||||
use common\logic\Setting\SettingDetails\AbstractSettingDetail; | |||||
class AdminAlertMessageTitleSetting extends AbstractSettingDetail | |||||
{ | |||||
public function __construct() | |||||
{ | |||||
$this | |||||
->setName('adminAlertMessageTitle') | |||||
->setLabel("Titre") | |||||
->setTypeString() | |||||
->setFormTypeInput(); | |||||
} | |||||
} |
<?php | |||||
namespace common\logic\Setting\SettingDetails\Admin\AlertMessage; | |||||
use common\logic\Setting\SettingDetails\AbstractSettingDetail; | |||||
class AdminAlertMessageTypeSetting extends AbstractSettingDetail | |||||
{ | |||||
public function __construct() | |||||
{ | |||||
$this | |||||
->setName('adminAlertMessageType') | |||||
->setLabel("Type") | |||||
->setTypeString() | |||||
->setFormTypeSelect([ | |||||
'success' => 'Succès', | |||||
'info' => 'Information', | |||||
'warning' => 'Warning', | |||||
'danger' => 'Danger' | |||||
]); | |||||
} | |||||
} |
<?php | |||||
namespace common\logic\Setting\SettingDetails\Admin\AlertMessage; | |||||
use common\logic\Setting\SettingDetails\AbstractSettingDetail; | |||||
class AdminSupportAlertMessageDisplaySetting extends AbstractSettingDetail | |||||
{ | |||||
public function __construct() | |||||
{ | |||||
$this | |||||
->setName('adminSupportAlertMessageDisplay') | |||||
->setLabel("Afficher") | |||||
->setTypeBoolean() | |||||
->setFormTypeToggle(); | |||||
} | |||||
} |
<?php | |||||
namespace common\logic\Setting\SettingDetails\Admin\AlertMessage; | |||||
use common\logic\Setting\SettingDetails\AbstractSettingDetail; | |||||
class AdminSupportAlertMessageIconSetting extends AbstractSettingDetail | |||||
{ | |||||
public function __construct() | |||||
{ | |||||
$this | |||||
->setName('adminSupportAlertMessageIcon') | |||||
->setLabel("Icône") | |||||
->setTypeString() | |||||
->setFormTypeInput() | |||||
->setHelpMessage('<a href="https://adminlte.io/themes/AdminLTE/pages/UI/icons.html" target="_blank">Icônes disponibles</a>'); | |||||
} | |||||
} |
<?php | |||||
namespace common\logic\Setting\SettingDetails\Admin\AlertMessage; | |||||
use common\logic\Setting\SettingDetails\AbstractSettingDetail; | |||||
class AdminSupportAlertMessageSetting extends AbstractSettingDetail | |||||
{ | |||||
public function __construct() | |||||
{ | |||||
$this | |||||
->setName('adminSupportAlertMessage') | |||||
->setLabel("Message") | |||||
->setTypeText() | |||||
->setFormTypeTextarea(); | |||||
} | |||||
} |
<?php | |||||
namespace common\logic\Setting\SettingDetails\Admin\AlertMessage; | |||||
use common\logic\Setting\SettingDetails\AbstractSettingDetail; | |||||
class AdminSupportAlertMessageTitleSetting extends AbstractSettingDetail | |||||
{ | |||||
public function __construct() | |||||
{ | |||||
$this | |||||
->setName('adminSupportAlertMessageTitle') | |||||
->setLabel("Titre") | |||||
->setTypeString() | |||||
->setFormTypeInput(); | |||||
} | |||||
} |
<?php | |||||
namespace common\logic\Setting\SettingDetails\Admin\AlertMessage; | |||||
use common\logic\Setting\SettingDetails\AbstractSettingDetail; | |||||
class AdminSupportAlertMessageTypeSetting extends AbstractSettingDetail | |||||
{ | |||||
public function __construct() | |||||
{ | |||||
$this | |||||
->setName('adminSupportAlertMessageType') | |||||
->setLabel("Type") | |||||
->setTypeString() | |||||
->setFormTypeSelect([ | |||||
'success' => 'Succès', | |||||
'info' => 'Information', | |||||
'warning' => 'Warning', | |||||
'danger' => 'Danger' | |||||
]); | |||||
} | |||||
} |
use common\logic\Setting\SettingDetails\AbstractSettingDetail; | use common\logic\Setting\SettingDetails\AbstractSettingDetail; | ||||
class SupportDeveloperOnlineAdminSetting extends AbstractSettingDetail | |||||
class SupportOnlineAdminSetting extends AbstractSettingDetail | |||||
{ | { | ||||
public function __construct() | public function __construct() | ||||
{ | { | ||||
$this | $this | ||||
->setName('supportDeveloperOnline') | |||||
->setLabel("Support : développeur disponible") | |||||
->setName('supportOnline') | |||||
->setLabel("Support : disponible") | |||||
->setTypeBoolean() | ->setTypeBoolean() | ||||
->setFormTypeToggle(); | ->setFormTypeToggle(); | ||||
} | } |
namespace common\logic\User\User\Model; | namespace common\logic\User\User\Model; | ||||
use common\logic\Order\Order\Model\Order; | use common\logic\Order\Order\Model\Order; | ||||
use common\logic\Producer\Producer\Model\Producer; | |||||
use common\logic\User\UserProducer\Model\UserProducer; | use common\logic\User\UserProducer\Model\UserProducer; | ||||
use common\logic\User\UserUserGroup\Model\UserUserGroup; | use common\logic\User\UserUserGroup\Model\UserUserGroup; | ||||
use yii\base\NotSupportedException; | use yii\base\NotSupportedException; | ||||
* Relations | * Relations | ||||
*/ | */ | ||||
public function getProducer() | |||||
{ | |||||
return $this->hasOne(Producer::class, ['id' => 'id_producer']); | |||||
} | |||||
public function getUserProducer() | public function getUserProducer() | ||||
{ | { | ||||
return $this->hasMany(UserProducer::class, ['id_user' => 'id']); | return $this->hasMany(UserProducer::class, ['id_user' => 'id']); |
$userProducer = $this->userProducerRepository->findOneUserProducer($user); | $userProducer = $this->userProducerRepository->findOneUserProducer($user); | ||||
return $userProducer ? $userProducer->active : false; | return $userProducer ? $userProducer->active : false; | ||||
} | } | ||||
public function findUsersStatusProducerOnline(): array | |||||
{ | |||||
return $this->createDefaultQuery() | |||||
->isStatusProducer() | |||||
->filterByDateLastConnectionLessThanFewMinutes() | |||||
->find(); | |||||
} | |||||
public function countUsersStatusProducerOnline(): int | |||||
{ | |||||
return count($this->findUsersStatusProducerOnline()); | |||||
} | |||||
} | } |
{ | { | ||||
return $this->filterByStatus(User::STATUS_PRODUCER); | return $this->filterByStatus(User::STATUS_PRODUCER); | ||||
} | } | ||||
public function filterByDateLastConnectionLessThanFewMinutes(): self | |||||
{ | |||||
$date = new \DateTime('-5 minutes'); | |||||
$this->andWhere('user.date_last_connection >= :date') | |||||
->addParams(['date' => $date->format('Y-m-d H:i:s')]); | |||||
return $this; | |||||
} | |||||
} | } |
<?php | |||||
require_once dirname(__FILE__).'/_macros.php'; | |||||
version( | |||||
'05/02/2024', | |||||
[ | |||||
[ | |||||
"[Administration] Bons de livraison > liste : ajout colonne 'Envoyé'", | |||||
"[Administration] Factures > création : sélection de tous les BL en un clic", | |||||
"[Site & boutique] Producteurs : lien vers site internet" | |||||
], | |||||
[ | |||||
] | |||||
], | |||||
[ | |||||
[ | |||||
"[Administration] Producteurs en ligne", | |||||
"[Administration] Message général aux producteurs", | |||||
], | |||||
[ | |||||
] | |||||
], | |||||
$userCurrent | |||||
); | |||||
?> |
<?php | |||||
use yii\helpers\Html; | |||||
?> | |||||
<?php if($display && $message): ?> | |||||
<div class="alert alert-<?= $type ?>"> | |||||
<?php if($title): ?> | |||||
<h4> | |||||
<?php if($icon): ?> | |||||
<i class="icon fa fa-<?= $icon ?>"></i> | |||||
<?php endif; ?> | |||||
<?= $title ?> | |||||
</h4> | |||||
<?php endif; ?> | |||||
<p> | |||||
<?php if(!$title && $icon): ?> | |||||
<i class="icon fa fa-<?= $icon ?>"></i> | |||||
<?php endif; ?> | |||||
<?= nl2br(Html::encode($message)); ?> | |||||
</p> | |||||
</div> | |||||
<?php endif; ?> |
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
use common\logic\Producer\Producer\Model\Producer; | use common\logic\Producer\Producer\Model\Producer; | ||||
use common\logic\Producer\Producer\Module\ProducerModule; | |||||
use common\logic\User\User\Module\UserModule; | use common\logic\User\User\Module\UserModule; | ||||
use yii\bootstrap\Nav; | use yii\bootstrap\Nav; | ||||
use yii\helpers\Html; | use yii\helpers\Html; | ||||
$userModule = UserModule::getInstance(); | $userModule = UserModule::getInstance(); | ||||
$producerModule = ProducerModule::getInstance(); | |||||
$userCurrent = GlobalParam::getCurrentUser(); | $userCurrent = GlobalParam::getCurrentUser(); | ||||
$isUserCurrentGrantedAsProducer = $userModule->getAuthorizationChecker()->isGrantedAsProducer($userCurrent); | $isUserCurrentGrantedAsProducer = $userModule->getAuthorizationChecker()->isGrantedAsProducer($userCurrent); | ||||
$producer = null; | $producer = null; | ||||
if ($isUserCurrentGrantedAsProducer) { | |||||
$producer = Producer::searchOne(['id' => \Yii::$app->user->identity->id_producer]); | |||||
if ($isUserCurrentGrantedAsProducer && $userCurrent->id_producer) { | |||||
$producer = $producerModule->getRepository()->findOneProducerById($userCurrent->id_producer); | |||||
} | } | ||||
?> | ?> |
<?php | |||||
use yii\db\Migration; | |||||
use yii\db\Schema; | |||||
/** | |||||
* Class m240131_142637_producer_add_column_website | |||||
*/ | |||||
class m240131_142637_producer_add_column_website extends Migration | |||||
{ | |||||
/** | |||||
* {@inheritdoc} | |||||
*/ | |||||
public function safeUp() | |||||
{ | |||||
$this->addColumn('producer', 'website', Schema::TYPE_STRING); | |||||
} | |||||
/** | |||||
* {@inheritdoc} | |||||
*/ | |||||
public function safeDown() | |||||
{ | |||||
$this->dropColumn('producer', 'website'); | |||||
} | |||||
} |
use common\logic\User\User\Module\UserModule; | use common\logic\User\User\Module\UserModule; | ||||
use yii\helpers\Html; | use yii\helpers\Html; | ||||
use yii\bootstrap\Nav; | use yii\bootstrap\Nav; | ||||
use common\logic\Producer\Producer\Model\Producer; | |||||
\common\assets\CommonAsset::register($this); | \common\assets\CommonAsset::register($this); | ||||
\frontend\assets\AppAsset::register($this); | \frontend\assets\AppAsset::register($this); | ||||
$userCurrent = GlobalParam::getCurrentUser(); | $userCurrent = GlobalParam::getCurrentUser(); | ||||
$isUserCurrentGrantedAsProducer = $userModule->getAuthorizationChecker()->isGrantedAsProducer($userCurrent); | $isUserCurrentGrantedAsProducer = $userModule->getAuthorizationChecker()->isGrantedAsProducer($userCurrent); | ||||
$isHome = (Yii::$app->controller->id == 'site' && \Yii::$app->controller->action->id == 'index'); | $isHome = (Yii::$app->controller->id == 'site' && \Yii::$app->controller->action->id == 'index'); | ||||
$producer = null; | |||||
if ($isUserCurrentGrantedAsProducer) { | |||||
$producer = Producer::searchOne(['id' => \Yii::$app->user->identity->id_producer]); | |||||
} | |||||
$settingModule = SettingModule::getInstance(); | $settingModule = SettingModule::getInstance(); | ||||
$adminSettingBag = $settingModule->getAdminSettingBag(); | $adminSettingBag = $settingModule->getAdminSettingBag(); | ||||
<?php | <?php | ||||
$producerModule = $this->getProducerModule(); | |||||
$producerSignupRemainingPlaces = $producerModule->getManager()->getProducerSignupRemainingPlaces(); | |||||
$producerManager = $this->getProducerModule()->getManager(); | |||||
$producerSignupRemainingPlaces = $producerManager->getProducerSignupRemainingPlaces(); | |||||
if (Yii::$app->user->isGuest): ?> | if (Yii::$app->user->isGuest): ?> | ||||
<?php if($producerModule->getManager()->isProducerSignupOpen()): ?> | |||||
<?php if($producerManager->isProducerSignupOpen()): ?> | |||||
<a class="btn btn-primary" | <a class="btn btn-primary" | ||||
href="<?= \Yii::$app->urlManagerFrontend->createUrl(['site/signup']); ?>"> | href="<?= \Yii::$app->urlManagerFrontend->createUrl(['site/signup']); ?>"> | ||||
<span class="glyphicon glyphicon-user"></span> Je crée mon espace producteur | <span class="glyphicon glyphicon-user"></span> Je crée mon espace producteur | ||||
</a><br /> | </a><br /> | ||||
<strong><?= ($producerSignupRemainingPlaces); ?></strong> | |||||
place<?php if($producerSignupRemainingPlaces > 1): ?>s<?php endif; ?> restante<?php if($producerSignupRemainingPlaces > 1): ?>s<?php endif; ?> | |||||
<?php if($producerManager->getMaximumNumberProducers()): ?> | |||||
<strong><?= ($producerSignupRemainingPlaces); ?></strong> | |||||
place<?php if($producerSignupRemainingPlaces > 1): ?>s<?php endif; ?> restante<?php if($producerSignupRemainingPlaces > 1): ?>s<?php endif; ?> | |||||
<?php endif; ?> | |||||
<?php else: ?> | <?php else: ?> | ||||
<div class="label label-warning label-producer-signup-closed"> | <div class="label label-warning label-producer-signup-closed"> | ||||
La plateforme n'accueille pas de nouveaux producteurs pour le moment | La plateforme n'accueille pas de nouveaux producteurs pour le moment |
<span class="glyphicon glyphicon-map-marker"></span> | <span class="glyphicon glyphicon-map-marker"></span> | ||||
<span class="location"><?= Html::encode($producer->postcode.' '.$producer->city); ?></span> | <span class="location"><?= Html::encode($producer->postcode.' '.$producer->city); ?></span> | ||||
<?php endif; ?> | <?php endif; ?> | ||||
<?php if($producer->website): ?> | |||||
<a href="<?= Html::encode($producer->website); ?>" target="_blank" class="btn btn-default"> | |||||
<span class="glyphicon glyphicon-globe"></span> | |||||
Site web | |||||
</a> | |||||
<?php endif; ?> | |||||
</p> | </p> | ||||
</div> | </div> | ||||
<?php if($producer->logo): ?> | <?php if($producer->logo): ?> | ||||
<div class="col-md-4 col-sm-4"> | <div class="col-md-4 col-sm-4"> | ||||
<div class="logo"<?php if (!is_null($producer->background_color_logo) && strlen($producer->background_color_logo)): ?> style="background-color:<?= Html::encode($producer->background_color_logo); ?>"<?php endif; ?>> | <div class="logo"<?php if (!is_null($producer->background_color_logo) && strlen($producer->background_color_logo)): ?> style="background-color:<?= Html::encode($producer->background_color_logo); ?>"<?php endif; ?>> | ||||
<img class="img-logo" | <img class="img-logo" | ||||
src="<?= Yii::$app->urlManagerProducer->getHostInfo() . '/' . Yii::$app->urlManagerProducer->baseUrl; ?>uploads/<?= $producer->logo; ?>" | |||||
src="<?= Yii::$app->urlManagerProducer->getHostInfo() . '/' . Yii::$app->urlManagerProducer->baseUrl; ?>/uploads/<?= $producer->logo; ?>" | |||||
alt="Logo <?= Html::encode($producer->name) ?>"> | alt="Logo <?= Html::encode($producer->name) ?>"> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<?php endif; ?> | <?php endif; ?> | ||||
</div> | </div> | ||||
<div class="panel-footer"> | <div class="panel-footer"> | ||||
<?= Html::a('Visiter',Yii::$app->urlManagerProducer->createAbsoluteUrl(['site/index', 'slug_producer' => $producer->slug]), ['class'=>'btn btn-primary']) ; ?> | |||||
<?= Html::a('Visiter',Yii::$app->urlManagerProducer->createAbsoluteUrl(['site/index', 'slug_producer' => $producer->slug]), ['class'=>'btn btn-primary float-right']) ; ?> | |||||
<?php if($userCurrent): ?> | <?php if($userCurrent): ?> | ||||
<?php $this->getLogic()->setProducerContext($producer); ?> | <?php $this->getLogic()->setProducerContext($producer); ?> | ||||
<?php if($userProducerModule->isProducerBookmarked($userCurrent)): ?> | <?php if($userProducerModule->isProducerBookmarked($userCurrent)): ?> | ||||
<?= Html::a('<span class="glyphicon glyphicon-star"></span>', ['bookmark/remove', 'idProducer' => $producer->id], ['class'=>'btn btn-default float-right', 'data-toggle' => 'tooltip', 'data-placement' => 'bottom', 'data-original-title' => 'Supprimer de ma liste de producteurs']) ; ?> | |||||
<?= Html::a('<span class="glyphicon glyphicon-star"></span>', ['bookmark/remove', 'idProducer' => $producer->id], ['class'=>'btn btn-default', 'data-toggle' => 'tooltip', 'data-placement' => 'bottom', 'data-original-title' => 'Supprimer de ma liste de producteurs']) ; ?> | |||||
<?php else: ?> | <?php else: ?> | ||||
<?= Html::a('<span class="glyphicon glyphicon-star-empty"></span>', ['bookmark/add', 'idProducer' => $producer->id], ['class'=>'btn btn-default float-right', 'data-toggle' => 'tooltip', 'data-placement' => 'bottom', 'data-original-title' => 'Ajouter à ma liste de producteurs']) ; ?> | |||||
<?= Html::a('<span class="glyphicon glyphicon-star-empty"></span>', ['bookmark/add', 'idProducer' => $producer->id], ['class'=>'btn btn-default', 'data-toggle' => 'tooltip', 'data-placement' => 'bottom', 'data-original-title' => 'Ajouter à ma liste de producteurs']) ; ?> | |||||
<?php endif; ?> | <?php endif; ?> | ||||
<?php endif; ?> | <?php endif; ?> | ||||
</div> | </div> |
-webkit-border-radius: 0px; | -webkit-border-radius: 0px; | ||||
border-radius: 0px 0px 8px 8px; | border-radius: 0px 0px 8px 8px; | ||||
border: 0px none; | border: 0px none; | ||||
padding: 10px 30px; | |||||
} | } | ||||
/* line 881, ../sass/screen.scss */ | /* line 881, ../sass/screen.scss */ | ||||
.site-producers #producers-list .panel .logo { | .site-producers #producers-list .panel .logo { |
.panel-footer { | .panel-footer { | ||||
@include border-radius(0px 0px 8px 8px); | @include border-radius(0px 0px 8px 8px); | ||||
border: 0px none; | border: 0px none; | ||||
//text-align: right; | |||||
padding: 10px 30px; | |||||
} | } | ||||
.logo { | .logo { |
return $this->render('contact', [ | return $this->render('contact', [ | ||||
'model' => $model, | 'model' => $model, | ||||
'producer' => $this->getProducerCurrent() | |||||
]); | ]); | ||||
} | } | ||||
public function actionBookmarks(string $action) | public function actionBookmarks(string $action) | ||||
{ | { | ||||
$producer = $this->getProducerCurrent(); | $producer = $this->getProducerCurrent(); | ||||
$userProducer = $this->getUserProducerModule() | |||||
->createUserProducerIfNotExist(GlobalParam::getCurrentUser(), $producer); | |||||
if ($action == 'add') { | |||||
$userProducer->bookmark = 1; | |||||
$this->setFlash( | |||||
'success', | |||||
'Le producteur <strong>' . Html::encode($producer->name) . '</strong> vient d\'être ajouté à vos favoris.' | |||||
); | |||||
} else { | |||||
$userProducer->bookmark = 0; | |||||
$this->setFlash( | |||||
'success', | |||||
'Le producteur <strong>' . Html::encode($producer->name) . '</strong> vient d\'être supprimé de vos favoris.' | |||||
); | |||||
$userCurrent = $this->getUserCurrent(); | |||||
if($userCurrent) { | |||||
$userProducer = $this->getUserProducerModule() | |||||
->createUserProducerIfNotExist($userCurrent, $producer); | |||||
if ($action == 'add') { | |||||
$userProducer->bookmark = 1; | |||||
$this->setFlash( | |||||
'success', | |||||
'Le producteur <strong>' . Html::encode($producer->name) . '</strong> vient d\'être ajouté à vos favoris.' | |||||
); | |||||
} else { | |||||
$userProducer->bookmark = 0; | |||||
$this->setFlash( | |||||
'success', | |||||
'Le producteur <strong>' . Html::encode($producer->name) . '</strong> vient d\'être supprimé de vos favoris.' | |||||
); | |||||
} | |||||
$userProducer->save(); | |||||
} | } | ||||
$userProducer->save(); | |||||
return $this->redirect(['site/index']); | return $this->redirect(['site/index']); | ||||
} | } |
} | } | ||||
$subscriptionModule = $this->getSubscriptionModule(); | $subscriptionModule = $this->getSubscriptionModule(); | ||||
$subscription = $subscriptionModule->findOneSubscriptionById($id); | |||||
$subscriptionModule->deleteSubscription($subscription); | |||||
$subscription = $subscriptionModule->getRepository()->findOneSubscriptionById($id); | |||||
if($subscription) { | |||||
$subscriptionModule->getBuilder()->deleteSubscription($subscription); | |||||
// @TODO : gérer via événements | |||||
$this->getSubscriptionModule()->getOrderManager() | |||||
->deleteOrdersIncomingDistributionsFromSubscription($subscription); | |||||
// @TODO : gérer via événements | |||||
$this->getSubscriptionModule()->getOrderManager() | |||||
->deleteOrdersIncomingDistributionsFromSubscription($subscription); | |||||
$this->setFlash('success', 'Abonnement supprimé'); | |||||
} | |||||
else { | |||||
$this->setFlash('error', 'Abonnement introuvable'); | |||||
} | |||||
$this->setFlash('success', 'Abonnement supprimé'); | |||||
return $this->redirect(['subscription/index']); | return $this->redirect(['subscription/index']); | ||||
} | } |
?> | ?> | ||||
<div class="site-contact"> | <div class="site-contact"> | ||||
<div class="row"> | <div class="row"> | ||||
<div class="col-lg-5"> | |||||
<div class="col-lg-6"> | |||||
<?php $form = ActiveForm::begin(['id' => 'contact-form', 'enableClientValidation' => false,]); ?> | <?php $form = ActiveForm::begin(['id' => 'contact-form', 'enableClientValidation' => false,]); ?> | ||||
<?= $form->field($model, 'name') ?> | <?= $form->field($model, 'name') ?> | ||||
<?= $form->field($model, 'email') ?> | <?= $form->field($model, 'email') ?> | ||||
<?= $form->field($model, 'subject') ?> | <?= $form->field($model, 'subject') ?> | ||||
<?= $form->field($model, 'body')->textArea(['rows' => 6]) ?> | <?= $form->field($model, 'body')->textArea(['rows' => 6]) ?> | ||||
<?php echo $form->field($model, 'verifyCode')->widget(yii\captcha\Captcha::className(), [ | <?php echo $form->field($model, 'verifyCode')->widget(yii\captcha\Captcha::className(), [ | ||||
'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>', | ||||
]); ?> | ]); ?> | ||||
</div> | </div> | ||||
<?php ActiveForm::end(); ?> | <?php ActiveForm::end(); ?> | ||||
</div> | </div> | ||||
<div class="col-lg-6"> | |||||
<?php if($producer->website): ?> | |||||
<br /> | |||||
<a href="<?= Html::encode($producer->website); ?>" target="_blank" class="btn btn-default"> | |||||
<span class="glyphicon glyphicon-globe"></span> | |||||
Site web | |||||
</a> | |||||
<?php endif; ?> | |||||
</div> | |||||
</div> | </div> | ||||
</div> | </div> |