@@ -40,7 +40,7 @@ use yii\helpers\Html ; | |||
use yii\widgets\ActiveForm; | |||
$this->setTitle('Envoyer un email') ; | |||
$this->addBreadcrumb(['label' => 'Communiquer', 'url' => ['user/index']]) ; | |||
$this->addBreadcrumb(['label' => 'Communication', 'url' => ['user/index']]) ; | |||
$this->addBreadcrumb($this->getTitle()) ; | |||
?> |
@@ -38,8 +38,8 @@ termes. | |||
use yii\helpers\Html ; | |||
$this->setTitle('Communiquer par papier') ; | |||
$this->addBreadcrumb('Communiquer') ; | |||
$this->setTitle('Communication par papier') ; | |||
$this->addBreadcrumb('Communication') ; | |||
?> | |||
@@ -245,7 +245,7 @@ $isUserCurrentGrantedAsProducer = $userModule->getAuthorizationChecker()->isGran | |||
], | |||
['label' => 'Abonnements', 'icon' => 'repeat', 'url' => ['/subscription/index'], 'visible' => $isUserCurrentGrantedAsProducer, 'active' => Yii::$app->controller->id == 'subscription'], | |||
[ | |||
'label' => 'Communiquer', | |||
'label' => 'Communication', | |||
'icon' => 'bullhorn', | |||
'url' => ['/communicate/email'], | |||
'visible' => $isUserCurrentGrantedAsProducer, |
@@ -184,6 +184,12 @@ function opendistrib_user_form_event($fieldUserEmail, $fieldSendMailWelcome) { | |||
} | |||
} | |||
function opendistrib_user_credit() { | |||
if($('body.user-credit').length) { | |||
$('#creditform-amount').focus(); | |||
} | |||
} | |||
function opendistrib_producers_admin() { | |||
$('.producer-admin-index .btn-alwaysdata, .producer-admin-index .btn-dolibarr').click(function () { | |||
var $button = $(this); |
@@ -67,7 +67,7 @@ class UrlManagerCommon extends UrlManager | |||
{ | |||
if ($this->_hostInfo === null) | |||
{ | |||
$secure = Yii::$app->getRequest()->getIsSecureConnection(); | |||
$secure = Yii::$app->getRequest()->isConsoleRequest ? false : Yii::$app->getRequest()->getIsSecureConnection(); | |||
$http = $secure ? 'https' : 'http'; | |||
if (isset($_SERVER['HTTP_HOST'])) { |
@@ -20,10 +20,14 @@ class AutomaticEmailResolver extends AbstractResolver | |||
public function getMatchedDistribution(AutomaticEmail $automaticEmail): ?Distribution | |||
{ | |||
$date = (new \DateTime('+'.$automaticEmail->getDelayBeforeDistribution().' days'))->format('Y-m-d'); | |||
$distribution = $this->distributionRepository->findOneDistribution($date); | |||
$date = (new \DateTime('+'.$automaticEmail->getDelayBeforeDistribution().' days')); | |||
$dateFormat = $date->format('Y-m-d'); | |||
$distribution = $this->distributionRepository->findOneDistribution($dateFormat); | |||
if($distribution && $distribution->active && !$this->producerSolver->isOnLeavePeriodByDistribution($distribution)) { | |||
if($distribution | |||
&& $distribution->active | |||
&& $date->format('N') == $automaticEmail->getDay() | |||
&& !$this->producerSolver->isOnLeavePeriodByDistribution($distribution)) { | |||
return $distribution; | |||
} | |||
@@ -170,10 +170,6 @@ class OrderController extends ProducerBaseController | |||
$idProducer = $producer->id; | |||
$order = new Order; | |||
if ($idProducer) { | |||
$this->_verifyProducerActive($idProducer); | |||
} | |||
if ($order->load($posts)) { | |||
$user = $this->getUserCurrent(); | |||