@@ -401,7 +401,7 @@ class UserController extends BackendController | |||
$creditForm = new CreditForm(); | |||
if ($creditForm->load(\Yii::$app->request->post()) && $creditForm->validate()) { | |||
$paymentModule->getUtils() | |||
$paymentModule->getManager() | |||
->creditOrDebitUser( | |||
$creditForm->type, | |||
$user, |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace common\logic; | |||
abstract class AbstractManager extends AbstractService implements ManagerInterface | |||
{ | |||
} |
@@ -19,7 +19,7 @@ abstract class AbstractService extends AbstractSingleton implements ServiceInter | |||
NotifierInterface::class, | |||
ResolverInterface::class, | |||
GeneratorInterface::class, | |||
UtilsInterface::class, | |||
ManagerInterface::class, | |||
]; | |||
} | |||
@@ -70,26 +70,6 @@ abstract class AbstractService extends AbstractSingleton implements ServiceInter | |||
FactoryInterface, SolverInterface ou BuilderInterface au service.'); | |||
} | |||
protected function isSolver(): bool | |||
{ | |||
return $this->classImplementsInterface(SolverInterface::class); | |||
} | |||
protected function isBuilder(): bool | |||
{ | |||
return $this->classImplementsInterface(BuilderInterface::class); | |||
} | |||
protected function isResolver(): bool | |||
{ | |||
return $this->classImplementsInterface(ResolverInterface::class); | |||
} | |||
protected function isUtils(): bool | |||
{ | |||
return $this->classImplementsInterface(UtilsInterface::class); | |||
} | |||
protected function classImplementsInterface(string $interface, $object = null) | |||
{ | |||
if(is_null($object)) { |
@@ -1,8 +0,0 @@ | |||
<?php | |||
namespace common\logic; | |||
abstract class AbstractUtils extends AbstractService implements UtilsInterface | |||
{ | |||
} |
@@ -3,18 +3,17 @@ | |||
namespace common\logic\Document\Document\Module; | |||
use common\logic\AbstractModule; | |||
use common\logic\DefinitionInterface; | |||
use common\logic\Document\Document\Repository\DocumentRepository; | |||
use common\logic\Document\Document\Service\DocumentBuilder; | |||
use common\logic\Document\Document\Service\DocumentDefinition; | |||
use common\logic\Document\Document\Service\DocumentSolver; | |||
use common\logic\Document\Document\Service\DocumentUtils; | |||
use common\logic\Document\Document\Service\DocumentManager; | |||
/** | |||
* @mixin DocumentDefinition | |||
* @mixin DocumentSolver | |||
* @mixin DocumentBuilder | |||
* @mixin DocumentUtils | |||
* @mixin DocumentManager | |||
*/ | |||
class DocumentModule extends AbstractModule | |||
{ | |||
@@ -25,7 +24,7 @@ class DocumentModule extends AbstractModule | |||
DocumentSolver::class, | |||
DocumentRepository::class, | |||
DocumentBuilder::class, | |||
DocumentUtils::class, | |||
DocumentManager::class, | |||
]; | |||
} | |||
@@ -49,8 +48,8 @@ class DocumentModule extends AbstractModule | |||
return DocumentBuilder::getInstance(); | |||
} | |||
public function getUtils() | |||
public function getManager() | |||
{ | |||
return DocumentUtils::getInstance(); | |||
return DocumentManager::getInstance(); | |||
} | |||
} |
@@ -2,16 +2,14 @@ | |||
namespace common\logic\Document\Document\Service; | |||
use common\helpers\GlobalParam; | |||
use common\logic\AbstractService; | |||
use common\logic\AbstractManager; | |||
use common\logic\Document\Document\Model\DocumentInterface; | |||
use common\logic\Producer\Producer\Service\ProducerSolver; | |||
use common\logic\UtilsInterface; | |||
use kartik\mpdf\Pdf; | |||
use yii\base\ErrorException; | |||
use yii\helpers\Html; | |||
class DocumentUtils extends AbstractService implements UtilsInterface | |||
class DocumentManager extends AbstractManager | |||
{ | |||
protected DocumentSolver $documentSolver; | |||
protected DocumentBuilder $documentBuilder; |
@@ -2,7 +2,7 @@ | |||
namespace common\logic; | |||
interface UtilsInterface | |||
interface ManagerInterface | |||
{ | |||
} |
@@ -3,22 +3,22 @@ | |||
namespace common\logic\Opinion\Module; | |||
use common\logic\AbstractModule; | |||
use common\logic\Opinion\Service\OpinionUtils; | |||
use common\logic\Opinion\Service\OpinionManager; | |||
/** | |||
* @mixin OpinionUtils | |||
* @mixin OpinionManager | |||
*/ | |||
class OpinionModule extends AbstractModule | |||
{ | |||
public function getServices(): array | |||
{ | |||
return [ | |||
OpinionUtils::class | |||
OpinionManager::class | |||
]; | |||
} | |||
public function getUtils(): OpinionUtils | |||
public function getManager(): OpinionManager | |||
{ | |||
return OpinionUtils::getInstance(); | |||
return OpinionManager::getInstance(); | |||
} | |||
} |
@@ -2,11 +2,11 @@ | |||
namespace common\logic\Opinion\Service; | |||
use common\logic\AbstractUtils; | |||
use common\logic\AbstractManager; | |||
use common\logic\User\User\Model\User; | |||
use common\logic\User\User\Service\UserSolver; | |||
class OpinionUtils extends AbstractUtils | |||
class OpinionManager extends AbstractManager | |||
{ | |||
protected UserSolver $userSolver; | |||
@@ -7,7 +7,7 @@ use common\logic\Order\Order\Repository\OrderRepository; | |||
use common\logic\Order\Order\Service\OrderBuilder; | |||
use common\logic\Order\Order\Service\OrderDefinition; | |||
use common\logic\Order\Order\Service\OrderSolver; | |||
use common\logic\Order\Order\Service\OrderUtils; | |||
use common\logic\Order\Order\Service\OrderManager; | |||
/** | |||
* @mixin OrderDefinition | |||
@@ -24,7 +24,7 @@ class OrderModule extends AbstractModule | |||
OrderSolver::class, | |||
OrderRepository::class, | |||
OrderBuilder::class, | |||
OrderUtils::class | |||
OrderManager::class | |||
]; | |||
} | |||
@@ -48,8 +48,8 @@ class OrderModule extends AbstractModule | |||
return OrderBuilder::getInstance(); | |||
} | |||
public function getUtils(): OrderUtils | |||
public function getUtils(): OrderManager | |||
{ | |||
return OrderUtils::getInstance(); | |||
return OrderManager::getInstance(); | |||
} | |||
} |
@@ -0,0 +1,11 @@ | |||
<?php | |||
namespace common\logic\Order\Order\Service; | |||
use common\logic\AbstractService; | |||
use common\logic\ManagerInterface; | |||
class OrderManager extends AbstractService implements ManagerInterface | |||
{ | |||
} |
@@ -1,11 +0,0 @@ | |||
<?php | |||
namespace common\logic\Order\Order\Service; | |||
use common\logic\AbstractService; | |||
use common\logic\UtilsInterface; | |||
class OrderUtils extends AbstractService implements UtilsInterface | |||
{ | |||
} |
@@ -5,7 +5,7 @@ namespace common\logic\Payment\Module; | |||
use common\logic\AbstractModule; | |||
use common\logic\Payment\Repository\PaymentRepository; | |||
use common\logic\Payment\Service\PaymentNotifier; | |||
use common\logic\Payment\Service\PaymentUtils; | |||
use common\logic\Payment\Service\PaymentManager; | |||
use common\logic\Payment\Service\PaymentBuilder; | |||
use common\logic\Payment\Service\PaymentDefinition; | |||
use common\logic\Payment\Service\PaymentSolver; | |||
@@ -15,7 +15,7 @@ use common\logic\Payment\Service\PaymentSolver; | |||
* @mixin PaymentSolver | |||
* @mixin PaymentRepository | |||
* @mixin PaymentBuilder | |||
* @mixin PaymentUtils | |||
* @mixin PaymentManager | |||
*/ | |||
class PaymentModule extends AbstractModule | |||
{ | |||
@@ -27,7 +27,7 @@ class PaymentModule extends AbstractModule | |||
PaymentBuilder::class, | |||
PaymentRepository::class, | |||
PaymentNotifier::class, | |||
PaymentUtils::class, | |||
PaymentManager::class, | |||
]; | |||
} | |||
@@ -56,8 +56,8 @@ class PaymentModule extends AbstractModule | |||
return PaymentNotifier::getInstance(); | |||
} | |||
public function getUtils(): PaymentUtils | |||
public function getManager(): PaymentManager | |||
{ | |||
return PaymentUtils::getInstance(); | |||
return PaymentManager::getInstance(); | |||
} | |||
} |
@@ -10,10 +10,10 @@ use common\logic\Payment\Model\Payment; | |||
use common\logic\Producer\Producer\Service\ProducerSolver; | |||
use common\logic\User\User\Model\User; | |||
use common\logic\User\User\Repository\UserRepository; | |||
use common\logic\UtilsInterface; | |||
use common\logic\ManagerInterface; | |||
use yii\base\ErrorException; | |||
class PaymentUtils extends AbstractService implements UtilsInterface | |||
class PaymentManager extends AbstractService implements ManagerInterface | |||
{ | |||
protected PaymentBuilder $paymentBuilder; | |||
protected OrderSolver $orderSolver; |
@@ -9,14 +9,14 @@ use common\logic\Producer\Producer\Service\ProducerBuilder; | |||
use common\logic\Producer\Producer\Service\ProducerDefinition; | |||
use common\logic\Producer\Producer\Service\ProducerPageSizer; | |||
use common\logic\Producer\Producer\Service\ProducerSolver; | |||
use common\logic\Producer\Producer\Service\ProducerUtils; | |||
use common\logic\Producer\Producer\Service\ProducerManager; | |||
/** | |||
* @mixin ProducerDefinition | |||
* @mixin ProducerSolver | |||
* @mixin ProducerRepository | |||
* @mixin ProducerBuilder | |||
* @mixin ProducerUtils | |||
* @mixin ProducerManager | |||
* @mixin ProducerPageSizer | |||
* @mixin DolibarrProducerUtils | |||
*/ | |||
@@ -29,7 +29,7 @@ class ProducerModule extends AbstractModule | |||
ProducerSolver::class, | |||
ProducerRepository::class, | |||
ProducerBuilder::class, | |||
ProducerUtils::class, | |||
ProducerManager::class, | |||
ProducerPageSizer::class, | |||
DolibarrProducerUtils::class, | |||
]; | |||
@@ -55,9 +55,9 @@ class ProducerModule extends AbstractModule | |||
return ProducerBuilder::getInstance(); | |||
} | |||
public function getUtils(): ProducerUtils | |||
public function getUtils(): ProducerManager | |||
{ | |||
return ProducerUtils::getInstance(); | |||
return ProducerManager::getInstance(); | |||
} | |||
public function getProducerPageSizer(): ProducerPageSizer |
@@ -3,13 +3,13 @@ | |||
namespace common\logic\Producer\Producer\Service; | |||
use common\components\DolibarrApi; | |||
use common\logic\AbstractUtils; | |||
use common\logic\AbstractManager; | |||
use common\logic\Producer\Producer\Model\Producer; | |||
use common\logic\Producer\Producer\Repository\ProducerRepository; | |||
use common\logic\Producer\ProducerPriceRange\Repository\ProducerPriceRangeRepository; | |||
use yii\base\ErrorException; | |||
class DolibarrProducerUtils extends AbstractUtils | |||
class DolibarrProducerUtils extends AbstractManager | |||
{ | |||
protected DolibarrApi $dolibarrApi; | |||
protected ProducerPriceRangeRepository $producerPriceRangeRepository; |
@@ -4,9 +4,9 @@ namespace common\logic\Producer\Producer\Service; | |||
use common\logic\AbstractService; | |||
use common\logic\Producer\Producer\Model\Producer; | |||
use common\logic\UtilsInterface; | |||
use common\logic\ManagerInterface; | |||
class ProducerUtils extends AbstractService implements UtilsInterface | |||
class ProducerManager extends AbstractService implements ManagerInterface | |||
{ | |||
public function sendEmailNewProducer(Producer $producer): void | |||
{ |
@@ -3,10 +3,10 @@ | |||
namespace common\logic\Producer\Producer\Service; | |||
use common\components\PageSizer; | |||
use common\logic\AbstractUtils; | |||
use common\logic\AbstractManager; | |||
use common\logic\Producer\Producer\Model\Producer; | |||
class ProducerPageSizer extends AbstractUtils | |||
class ProducerPageSizer extends AbstractManager | |||
{ | |||
protected ProducerSolver $producerSolver; | |||
protected ProducerBuilder $producerBuilder; |
@@ -2,10 +2,10 @@ | |||
namespace common\logic\User\User\Service; | |||
use common\logic\AbstractUtils; | |||
use common\logic\AbstractManager; | |||
use common\logic\User\User\Model\User; | |||
class AuthorizationChecker extends AbstractUtils | |||
class AuthorizationChecker extends AbstractManager | |||
{ | |||
protected UserSolver $userSolver; | |||
@@ -6,9 +6,9 @@ use common\logic\AbstractService; | |||
use common\logic\User\User\Model\User; | |||
use common\logic\User\UserProducer\Repository\UserProducerRepository; | |||
use common\logic\User\UserProducer\Service\UserProducerBuilder; | |||
use common\logic\UtilsInterface; | |||
use common\logic\ManagerInterface; | |||
class NewsletterManager extends AbstractService implements UtilsInterface | |||
class NewsletterManager extends AbstractService implements ManagerInterface | |||
{ | |||
protected UserProducerRepository $userProducerRepository; | |||
protected UserProducerBuilder $userProducerBuilder; |
@@ -7,9 +7,9 @@ use common\logic\AbstractNotifier; | |||
use common\logic\Producer\Producer\Model\Producer; | |||
use common\logic\Ticket\Ticket\Model\Ticket; | |||
use common\logic\User\User\Model\User; | |||
use common\logic\UtilsInterface; | |||
use common\logic\ManagerInterface; | |||
class UserNotifier extends AbstractNotifier implements UtilsInterface | |||
class UserNotifier extends AbstractNotifier implements ManagerInterface | |||
{ | |||
protected UserSolver $userSolver; | |||
@@ -504,7 +504,8 @@ class SiteController extends FrontendController | |||
$opinionFormModel = new OpinionForm(); | |||
$opinionSent = false; | |||
if ($opinionFormModel->load(Yii::$app->request->post()) && $opinionFormModel->validate()) { | |||
$this->getOpinionModule()->sendOpinionEmailAdmin($opinionFormModel, $this->getUserCurrent()); | |||
$this->getOpinionModule()->getManager() | |||
->sendOpinionEmailAdmin($opinionFormModel, $this->getUserCurrent()); | |||
$opinionSent = true; | |||
} | |||
@@ -57,7 +57,7 @@ $this->setIcon('console'); | |||
<?= block_feature("cog", "Une administration complète et intuitive pour gérer votre activité de producteur."); ?> | |||
<div class="clr"></div> | |||
<?= block_feature("calendar", "Planification des jours de distributions."); ?> | |||
<?= block_feature("download-alt", "Accès à un récapitulatif des commandes par jour de distribution."); ?> | |||
<?= block_feature("download-alt", "Récapitulatif des commandes par jour de distribution (PDF et CSV).<br />Génération d'étiquettes (PDF)."); ?> | |||
<?= block_feature("cutlery", "Gestion des produits, catégories et prix spécifiques."); ?> | |||
<?= block_feature("map-marker", "Gestion des points de vente."); ?> | |||
<?= block_feature("repeat", "Gestion des abonnements pour les commandes récurrentes."); ?> |