Commit 03762be8 authored by waltermazza's avatar waltermazza
Browse files

Arter namespace

parent b9913ac0
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"notifiche", "notifiche",
"yii2" "yii2"
], ],
"homepage": "http://www.elitedivision.it/", "homepage": "http://www.arter.it/",
"type": "component", "type": "component",
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
"support": { "support": {
...@@ -29,10 +29,10 @@ ...@@ -29,10 +29,10 @@
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"elitedivision\\amos\\notificationmanager\\": "src" "arter\\amos\\notificationmanager\\": "src"
} }
}, },
"scripts": { "scripts": {
"post-install-cmd": "php yii migrate --migrationPath=@vendor/elitedivision/amos-notify/migrations --interactive=0" "post-install-cmd": "php yii migrate --migrationPath=@vendor/arter/amos-notify/migrations --interactive=0"
} }
} }
\ No newline at end of file
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
* OPEN 2.0 * OPEN 2.0
* *
* *
* @package elitedivision\amos\notify * @package arter\amos\notify
* @category CategoryName * @category CategoryName
* @author Elite Division S.r.l. * @author Elite Division S.r.l.
*/ */
namespace elitedivision\amos\notificationmanager; namespace arter\amos\notificationmanager;
/** /**
* *
...@@ -48,14 +48,14 @@ namespace elitedivision\amos\notificationmanager; ...@@ -48,14 +48,14 @@ namespace elitedivision\amos\notificationmanager;
* CHANNEL_ALL -- Tutti i Canali * CHANNEL_ALL -- Tutti i Canali
*/ */
use elitedivision\amos\core\module\AmosModule; use arter\amos\core\module\AmosModule;
use elitedivision\amos\core\record\Record; use arter\amos\core\record\Record;
use elitedivision\amos\notificationmanager\base\NotifierRepository; use arter\amos\notificationmanager\base\NotifierRepository;
use elitedivision\amos\notificationmanager\base\NotifyWidget; use arter\amos\notificationmanager\base\NotifyWidget;
use elitedivision\amos\notificationmanager\listeners\NotifyWorkflowListener; use arter\amos\notificationmanager\listeners\NotifyWorkflowListener;
use elitedivision\amos\notificationmanager\models\NotificationChannels; use arter\amos\notificationmanager\models\NotificationChannels;
use elitedivision\amos\notificationmanager\models\NotificationsConfOpt; use arter\amos\notificationmanager\models\NotificationsConfOpt;
use elitedivision\amos\notificationmanager\utility\NotifyUtility; use arter\amos\notificationmanager\utility\NotifyUtility;
use raoul2000\workflow\base\SimpleWorkflowBehavior; use raoul2000\workflow\base\SimpleWorkflowBehavior;
use Yii; use Yii;
use yii\base\Event; use yii\base\Event;
...@@ -64,7 +64,7 @@ use yii\log\Logger; ...@@ -64,7 +64,7 @@ use yii\log\Logger;
/** /**
* Class AmosNotify * Class AmosNotify
* @package elitedivision\amos\notificationmanager * @package arter\amos\notificationmanager
*/ */
class AmosNotify extends AmosModule implements \yii\base\BootstrapInterface, NotifyWidget class AmosNotify extends AmosModule implements \yii\base\BootstrapInterface, NotifyWidget
{ {
...@@ -79,8 +79,8 @@ class AmosNotify extends AmosModule implements \yii\base\BootstrapInterface, Not ...@@ -79,8 +79,8 @@ class AmosNotify extends AmosModule implements \yii\base\BootstrapInterface, Not
/** /**
* @var null |string * @var null |string
* [ * [
* 'elitedivision\amos\admin\models\UserProfile' => '@common/mail/notify_validation/validator_user_profile', * 'arter\amos\admin\models\UserProfile' => '@common/mail/notify_validation/validator_user_profile',
* 'elitedivision\amos\news\models\News' => '@common/mail/notify_validation/validator_news', * 'arter\amos\news\models\News' => '@common/mail/notify_validation/validator_news',
* ] * ]
* *
*/ */
...@@ -89,8 +89,8 @@ class AmosNotify extends AmosModule implements \yii\base\BootstrapInterface, Not ...@@ -89,8 +89,8 @@ class AmosNotify extends AmosModule implements \yii\base\BootstrapInterface, Not
/** /**
* @var null |string * @var null |string
* [ * [
* 'elitedivision\amos\admin\models\UserProfile' => '@common/mail/notify_validation/validated_user_profile', * 'arter\amos\admin\models\UserProfile' => '@common/mail/notify_validation/validated_user_profile',
* 'elitedivision\amos\news\models\News' => '@common/mail/notify_validation/validated_news', * 'arter\amos\news\models\News' => '@common/mail/notify_validation/validated_news',
* ] * ]
*/ */
public $viewPathEmailNotifyValidated = []; public $viewPathEmailNotifyValidated = [];
...@@ -98,7 +98,7 @@ class AmosNotify extends AmosModule implements \yii\base\BootstrapInterface, Not ...@@ -98,7 +98,7 @@ class AmosNotify extends AmosModule implements \yii\base\BootstrapInterface, Not
/** /**
* @inheritdoc * @inheritdoc
*/ */
public $controllerNamespace = 'elitedivision\amos\notificationmanager\controllers'; public $controllerNamespace = 'arter\amos\notificationmanager\controllers';
/** /**
* @inheritdoc * @inheritdoc
...@@ -123,7 +123,7 @@ class AmosNotify extends AmosModule implements \yii\base\BootstrapInterface, Not ...@@ -123,7 +123,7 @@ class AmosNotify extends AmosModule implements \yii\base\BootstrapInterface, Not
public function init() public function init()
{ {
parent::init(); parent::init();
\Yii::setAlias('@elitedivision/amos/notificationmanager/commands', __DIR__ . '/commands/'); \Yii::setAlias('@arter/amos/notificationmanager/commands', __DIR__ . '/commands/');
// initialize the module with the configuration loaded from config.php // initialize the module with the configuration loaded from config.php
\Yii::configure($this, require(__DIR__ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.php')); \Yii::configure($this, require(__DIR__ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.php'));
} }
...@@ -134,7 +134,7 @@ class AmosNotify extends AmosModule implements \yii\base\BootstrapInterface, Not ...@@ -134,7 +134,7 @@ class AmosNotify extends AmosModule implements \yii\base\BootstrapInterface, Not
public function bootstrap($app) public function bootstrap($app)
{ {
if ($app instanceof \yii\console\Application) { if ($app instanceof \yii\console\Application) {
$this->controllerNamespace = 'elitedivision\amos\notificationmanager\commands'; $this->controllerNamespace = 'arter\amos\notificationmanager\commands';
} else { } else {
Event::on( Event::on(
Record::className(), Record::className(),
......
...@@ -5,18 +5,18 @@ ...@@ -5,18 +5,18 @@
* OPEN 2.0 * OPEN 2.0
* *
* *
* @package elitedivision\amos\notificationmanager\base * @package arter\amos\notificationmanager\base
* @category CategoryName * @category CategoryName
* @author Elite Division S.r.l. * @author Elite Division S.r.l.
*/ */
namespace elitedivision\amos\notificationmanager\base; namespace arter\amos\notificationmanager\base;
use elitedivision\amos\core\user\User; use arter\amos\core\user\User;
/** /**
* Interface Builder * Interface Builder
* @package elitedivision\amos\notificationmanager\base * @package arter\amos\notificationmanager\base
*/ */
interface Builder interface Builder
{ {
......
...@@ -5,19 +5,19 @@ ...@@ -5,19 +5,19 @@
* OPEN 2.0 * OPEN 2.0
* *
* *
* @package elitedivision\amos\notify * @package arter\amos\notify
* @category CategoryName * @category CategoryName
* @author Elite Division S.r.l. * @author Elite Division S.r.l.
*/ */
namespace elitedivision\amos\notificationmanager\base; namespace arter\amos\notificationmanager\base;
use elitedivision\amos\notificationmanager\base\builder\ContentImmediateMailBuilder; use arter\amos\notificationmanager\base\builder\ContentImmediateMailBuilder;
use elitedivision\amos\notificationmanager\base\builder\ContentMailBuilder; use arter\amos\notificationmanager\base\builder\ContentMailBuilder;
use elitedivision\amos\notificationmanager\base\builder\CustomMailBuilder; use arter\amos\notificationmanager\base\builder\CustomMailBuilder;
use elitedivision\amos\notificationmanager\base\builder\ValidatedMailBuilder; use arter\amos\notificationmanager\base\builder\ValidatedMailBuilder;
use elitedivision\amos\notificationmanager\base\builder\ValidatorsMailBuilder; use arter\amos\notificationmanager\base\builder\ValidatorsMailBuilder;
use elitedivision\amos\notificationmanager\models\ChangeStatusEmail; use arter\amos\notificationmanager\models\ChangeStatusEmail;
use yii\base\BaseObject; use yii\base\BaseObject;
class BuilderFactory extends BaseObject { class BuilderFactory extends BaseObject {
......
...@@ -5,19 +5,19 @@ ...@@ -5,19 +5,19 @@
* OPEN 2.0 * OPEN 2.0
* *
* *
* @package elitedivision\amos\notify * @package arter\amos\notify
* @category CategoryName * @category CategoryName
* @author Elite Division S.r.l. * @author Elite Division S.r.l.
*/ */
namespace elitedivision\amos\notificationmanager\base; namespace arter\amos\notificationmanager\base;
use elitedivision\amos\core\record\Record; use arter\amos\core\record\Record;
use elitedivision\amos\core\user\AmosUser; use arter\amos\core\user\AmosUser;
use elitedivision\amos\notificationmanager\AmosNotify; use arter\amos\notificationmanager\AmosNotify;
use elitedivision\amos\notificationmanager\models\Notification; use arter\amos\notificationmanager\models\Notification;
use elitedivision\amos\notificationmanager\models\NotificationChannels; use arter\amos\notificationmanager\models\NotificationChannels;
use elitedivision\amos\notificationmanager\models\NotificationsRead; use arter\amos\notificationmanager\models\NotificationsRead;
use Yii; use Yii;
use yii\db\ActiveQuery; use yii\db\ActiveQuery;
...@@ -28,7 +28,7 @@ use yii\log\Logger; ...@@ -28,7 +28,7 @@ use yii\log\Logger;
/** /**
* Class NotifierRepository * Class NotifierRepository
* @package elitedivision\amos\notificationmanager\base * @package arter\amos\notificationmanager\base
*/ */
class NotifierRepository class NotifierRepository
{ {
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* @author Elite Division S.r.l. * @author Elite Division S.r.l.
*/ */
namespace elitedivision\amos\notificationmanager\base; namespace arter\amos\notificationmanager\base;
interface NotifyWidget interface NotifyWidget
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* @author Elite Division S.r.l. * @author Elite Division S.r.l.
*/ */
namespace elitedivision\amos\notificationmanager\base; namespace arter\amos\notificationmanager\base;
class NotifyWidgetDoNothing implements NotifyWidget class NotifyWidgetDoNothing implements NotifyWidget
......
...@@ -5,24 +5,24 @@ ...@@ -5,24 +5,24 @@
* OPEN 2.0 * OPEN 2.0
* *
* *
* @package elitedivision\amos\notificationmanager\base\builder * @package arter\amos\notificationmanager\base\builder
* @category CategoryName * @category CategoryName
* @author Elite Division S.r.l. * @author Elite Division S.r.l.
*/ */
namespace elitedivision\amos\notificationmanager\base\builder; namespace arter\amos\notificationmanager\base\builder;
use elitedivision\amos\core\user\User; use arter\amos\core\user\User;
use elitedivision\amos\core\utilities\Email; use arter\amos\core\utilities\Email;
use elitedivision\amos\notificationmanager\AmosNotify; use arter\amos\notificationmanager\AmosNotify;
use elitedivision\amos\notificationmanager\base\Builder; use arter\amos\notificationmanager\base\Builder;
use elitedivision\amos\notificationmanager\models\NotificationConf; use arter\amos\notificationmanager\models\NotificationConf;
use Yii; use Yii;
use yii\base\BaseObject; use yii\base\BaseObject;
/** /**
* Class AMailBuilder * Class AMailBuilder
* @package elitedivision\amos\notificationmanager\base\builder * @package arter\amos\notificationmanager\base\builder
*/ */
abstract class AMailBuilder extends BaseObject implements Builder abstract class AMailBuilder extends BaseObject implements Builder
{ {
...@@ -92,7 +92,7 @@ abstract class AMailBuilder extends BaseObject implements Builder ...@@ -92,7 +92,7 @@ abstract class AMailBuilder extends BaseObject implements Builder
{ {
$module = \Yii::$app->getModule('translation'); $module = \Yii::$app->getModule('translation');
if ($module && !empty($module->enableUserLanguage) && $module->enableUserLanguage == true) { if ($module && !empty($module->enableUserLanguage) && $module->enableUserLanguage == true) {
/** @var \elitedivision\amos\translation\AmosTranslation $module */ /** @var \arter\amos\translation\AmosTranslation $module */
$lang = $module->getUserLanguage($userId); $lang = $module->getUserLanguage($userId);
$module->setAppLanguage($lang); $module->setAppLanguage($lang);
} }
......
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
* OPEN 2.0 * OPEN 2.0
* *
* *
* @package elitedivision\amos\notificationmanager\base\builder * @package arter\amos\notificationmanager\base\builder
* @category CategoryName * @category CategoryName
* @author Elite Division S.r.l. * @author Elite Division S.r.l.
*/ */
namespace elitedivision\amos\notificationmanager\base\builder; namespace arter\amos\notificationmanager\base\builder;
use elitedivision\amos\notificationmanager\AmosNotify; use arter\amos\notificationmanager\AmosNotify;
class ContentImmediateMailBuilder extends ContentMailBuilder class ContentImmediateMailBuilder extends ContentMailBuilder
{ {
...@@ -24,7 +24,7 @@ class ContentImmediateMailBuilder extends ContentMailBuilder ...@@ -24,7 +24,7 @@ class ContentImmediateMailBuilder extends ContentMailBuilder
{ {
$controller = \Yii::$app->controller; $controller = \Yii::$app->controller;
$contents_number = count($resultset); $contents_number = count($resultset);
$ris = $controller->renderPartial("@vendor/elitedivision/amos-" . AmosNotify::getModuleName() . "/src/views/email/content_immediate_email_header", [ $ris = $controller->renderPartial("@vendor/arter/amos-" . AmosNotify::getModuleName() . "/src/views/email/content_immediate_email_header", [
'contents_number' => $contents_number 'contents_number' => $contents_number
]); ]);
return $ris; return $ris;
......
...@@ -5,26 +5,26 @@ ...@@ -5,26 +5,26 @@
* OPEN 2.0 * OPEN 2.0
* *
* *
* @package elitedivision\amos\notificationmanager\base\builder * @package arter\amos\notificationmanager\base\builder
* @category CategoryName * @category CategoryName
* @author Elite Division S.r.l. * @author Elite Division S.r.l.
*/ */
namespace elitedivision\amos\notificationmanager\base\builder; namespace arter\amos\notificationmanager\base\builder;
use elitedivision\amos\core\interfaces\ModelLabelsInterface; use arter\amos\core\interfaces\ModelLabelsInterface;
use elitedivision\amos\core\models\ModelsClassname; use arter\amos\core\models\ModelsClassname;
use elitedivision\amos\core\record\Record; use arter\amos\core\record\Record;
use elitedivision\amos\core\user\User; use arter\amos\core\user\User;
use elitedivision\amos\notificationmanager\AmosNotify; use arter\amos\notificationmanager\AmosNotify;
use elitedivision\amos\notificationmanager\models\Notification; use arter\amos\notificationmanager\models\Notification;
use elitedivision\amos\notificationmanager\record\NotifyRecord; use arter\amos\notificationmanager\record\NotifyRecord;
use Yii; use Yii;
use yii\helpers\Console; use yii\helpers\Console;
/** /**
* Class ContentMailBuilder * Class ContentMailBuilder
* @package elitedivision\amos\notificationmanager\base\builder * @package arter\amos\notificationmanager\base\builder
*/ */
class ContentMailBuilder extends AMailBuilder class ContentMailBuilder extends AMailBuilder
{ {
...@@ -84,7 +84,7 @@ class ContentMailBuilder extends AMailBuilder ...@@ -84,7 +84,7 @@ class ContentMailBuilder extends AMailBuilder
protected function renderContent(Record $model, $user) protected function renderContent(Record $model, $user)
{ {
$controller = \Yii::$app->controller; $controller = \Yii::$app->controller;
$ris = $controller->renderPartial("@vendor/elitedivision/amos-" . AmosNotify::getModuleName() . "/src/views/email/content", [ $ris = $controller->renderPartial("@vendor/arter/amos-" . AmosNotify::getModuleName() . "/src/views/email/content", [
'model' => $model, 'model' => $model,
'profile' => $user->userProfile 'profile' => $user->userProfile
]); ]);
...@@ -98,7 +98,7 @@ class ContentMailBuilder extends AMailBuilder ...@@ -98,7 +98,7 @@ class ContentMailBuilder extends AMailBuilder
protected function renderContentTitle(ModelLabelsInterface $model) protected function renderContentTitle(ModelLabelsInterface $model)
{ {
$controller = \Yii::$app->controller; $controller = \Yii::$app->controller;
$ris = $controller->renderPartial("@vendor/elitedivision/amos-" . AmosNotify::getModuleName() . "/src/views/email/content_title", [ $ris = $controller->renderPartial("@vendor/arter/amos-" . AmosNotify::getModuleName() . "/src/views/email/content_title", [
'title' => $model->getGrammar()->getModelLabel(), 'title' => $model->getGrammar()->getModelLabel(),
]); ]);
return $ris; return $ris;
...@@ -112,7 +112,7 @@ class ContentMailBuilder extends AMailBuilder ...@@ -112,7 +112,7 @@ class ContentMailBuilder extends AMailBuilder
{ {
$controller = \Yii::$app->controller; $controller = \Yii::$app->controller;
$contents_number = count($resultset); $contents_number = count($resultset);
$ris = $controller->renderPartial("@vendor/elitedivision/amos-" . AmosNotify::getModuleName() . "/src/views/email/content_header", [ $ris = $controller->renderPartial("@vendor/arter/amos-" . AmosNotify::getModuleName() . "/src/views/email/content_header", [
'contents_number' => $contents_number 'contents_number' => $contents_number
]); ]);
return $ris; return $ris;
...@@ -125,7 +125,7 @@ class ContentMailBuilder extends AMailBuilder ...@@ -125,7 +125,7 @@ class ContentMailBuilder extends AMailBuilder
protected function renderContentFooter(array $resultset, User $user) protected function renderContentFooter(array $resultset, User $user)
{ {
$controller = \Yii::$app->controller; $controller = \Yii::$app->controller;
$ris = $controller->renderPartial("@vendor/elitedivision/amos-" . AmosNotify::getModuleName() . "/src/views/email/content_footer", ['user' => $user]); $ris = $controller->renderPartial("@vendor/arter/amos-" . AmosNotify::getModuleName() . "/src/views/email/content_footer", ['user' => $user]);
return $ris; return $ris;
} }
......
...@@ -5,23 +5,23 @@ ...@@ -5,23 +5,23 @@
* OPEN 2.0 * OPEN 2.0
* *
* *
* @package elitedivision\amos\notificationmanager\base\builder * @package arter\amos\notificationmanager\base\builder
* @category CategoryName * @category CategoryName
* @author Elite Division S.r.l. * @author Elite Division S.r.l.
*/ */
namespace elitedivision\amos\notificationmanager\base\builder; namespace arter\amos\notificationmanager\base\builder;
use elitedivision\amos\core\interfaces\ModelGrammarInterface; use arter\amos\core\interfaces\ModelGrammarInterface;
use elitedivision\amos\core\interfaces\ModelLabelsInterface; use arter\amos\core\interfaces\ModelLabelsInterface;
use elitedivision\amos\core\user\User; use arter\amos\core\user\User;
use elitedivision\amos\notificationmanager\AmosNotify; use arter\amos\notificationmanager\AmosNotify;
use elitedivision\amos\notificationmanager\models\ChangeStatusEmail; use arter\amos\notificationmanager\models\ChangeStatusEmail;
use Yii; use Yii;
/** /**
* Class CustomMailBuilder * Class CustomMailBuilder
* @package elitedivision\amos\notificationmanager\base\builder * @package arter\amos\notificationmanager\base\builder
*/ */
class CustomMailBuilder extends AMailBuilder class CustomMailBuilder extends AMailBuilder
{ {
...@@ -89,9 +89,9 @@ class CustomMailBuilder extends AMailBuilder ...@@ -89,9 +89,9 @@ class CustomMailBuilder extends AMailBuilder
if ($email->template) { if ($email->template) {
$this->setTemplate($email->template); $this->setTemplate($email->template);
} elseif ($email->toCreator) { } elseif ($email->toCreator) {
$this->setTemplate("@vendor/elitedivision/amos-" . AmosNotify::getModuleName() . "/src/views/email/validated"); $this->setTemplate("@vendor/arter/amos-" . AmosNotify::getModuleName() . "/src/views/email/validated");
} else { } else {
$this->setTemplate("@vendor/elitedivision/amos-" . AmosNotify::getModuleName() . "/src/views/email/validator"); $this->setTemplate("@vendor/arter/amos-" . AmosNotify::getModuleName() . "/src/views/email/validator");
} }
if (count($email->params)) { if (count($email->params)) {
$this->setParams($email->params); $this->setParams($email->params);
......
...@@ -5,22 +5,22 @@ ...@@ -5,22 +5,22 @@
* OPEN 2.0 * OPEN 2.0
* *
* *
* @package elitedivision\amos\notificationmanager\base\builder * @package arter\amos\notificationmanager\base\builder
* @category CategoryName * @category CategoryName
* @author Elite Division S.r.l. * @author Elite Division S.r.l.
*/ */
namespace elitedivision\amos\notificationmanager\base\builder; namespace arter\amos\notificationmanager\base\builder;
use elitedivision\amos\core\interfaces\ModelGrammarInterface; use arter\amos\core\interfaces\ModelGrammarInterface;
use elitedivision\amos\core\interfaces\ModelLabelsInterface; use arter\amos\core\interfaces\ModelLabelsInterface;
use elitedivision\amos\core\user\User; use arter\amos\core\user\User;
use elitedivision\amos\notificationmanager\AmosNotify; use arter\amos\notificationmanager\AmosNotify;
use Yii; use Yii;
/** /**
* Class ValidatedMailBuilder * Class ValidatedMailBuilder
* @package elitedivision\amos\notificationmanager\base\builder * @package arter\amos\notificationmanager\base\builder
*/ */
class ValidatedMailBuilder extends AMailBuilder class ValidatedMailBuilder extends AMailBuilder
{ {
...@@ -50,7 +50,7 @@ class ValidatedMailBuilder extends AMailBuilder ...@@ -50,7 +50,7 @@ class ValidatedMailBuilder extends AMailBuilder
$moduleNotify = Yii::$app->getModule('notify'); $moduleNotify = Yii::$app->getModule('notify');
try { try {
$viewValidatorPath = "@vendor/elitedivision/amos-" . AmosNotify::getModuleName() . "/src/views/email/validated"; $viewValidatorPath = "@vendor/arter/amos-" . AmosNotify::getModuleName() . "/src/views/email/validated";
if