瀏覽代碼

[Administration] Emails automatiques

feature/rotating_product
Guillaume Bourgeois 4 月之前
父節點
當前提交
03c035e693
共有 7 個檔案被更改,包括 18 行新增12 行删除
  1. +1
    -1
      backend/views/communicate-admin/index.php
  2. +2
    -2
      backend/views/communicate/paper.php
  3. +1
    -1
      backend/views/layouts/left.php
  4. +6
    -0
      backend/web/js/backend.js
  5. +1
    -1
      common/components/UrlManagerCommon.php
  6. +7
    -3
      domain/Communication/AutomaticEmail/AutomaticEmailResolver.php
  7. +0
    -4
      producer/controllers/OrderController.php

+ 1
- 1
backend/views/communicate-admin/index.php 查看文件

@@ -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()) ;

?>

+ 2
- 2
backend/views/communicate/paper.php 查看文件

@@ -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') ;

?>


+ 1
- 1
backend/views/layouts/left.php 查看文件

@@ -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,

+ 6
- 0
backend/web/js/backend.js 查看文件

@@ -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);

+ 1
- 1
common/components/UrlManagerCommon.php 查看文件

@@ -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'])) {

+ 7
- 3
domain/Communication/AutomaticEmail/AutomaticEmailResolver.php 查看文件

@@ -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;
}


+ 0
- 4
producer/controllers/OrderController.php 查看文件

@@ -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();


Loading…
取消
儲存