Commit 801861b1 authored by Aster's avatar Aster Committed by waltermazza
Browse files

General Bug Fixes and Improvements

parent a3eadfa8
{ {
"name": "elitedivision/amos-notify", "name": "arter/amos-notify",
"description": "Modulo di gestione notifiche - plugin", "description": "Modulo di gestione notifiche - plugin",
"keywords": [ "keywords": [
"amos", "amos",
"notifiche", "notifiche",
"yii2" "yii2"
], ],
"homepage": "http://www.elitedivision.it/", "homepage": "http://www.arter.it/",
"type": "component", "type": "component",
"license": "BSD-3-Clause", "proscription": "BSD-3-Clause",
"support": { "support": {
"issues": "https://github.com/yiisoft/yii2/issues?state=open", "issues": "https://github.com/yiisoft/yii2/issues?state=open",
"forum": "http://www.yiiframework.com/forum/", "forum": "http://www.yiiframework.com/forum/",
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
}, },
"require": { "require": {
"php": ">=7.0", "php": ">=7.0",
"elitedivision/amos-admin": "^2.2.0", "arter/amos-admin": "^2.2.0",
"elitedivision/amos-core": "^1.19.0", "arter/amos-core": "^1.19.0",
"elitedivision/amos-email-manager": "^1.1.19", "arter/amos-email-manager": "^1.1.19",
"elitedivision/amos-workflow": "^1.0" "arter/amos-workflow": "^1.0"
}, },
"config": { "config": {
"process-timeout": 1800, "process-timeout": 1800,
...@@ -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"
} }
} }
<?php <?php
/** /**
* Lombardia Informatica S.p.A. * Emilia Romagna Open Innovation
* OPEN 2.0 * Arter
* *
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
* *
* @package elitedivision\amos\notify * @package arter\amos\notify
* @category CategoryName * @category CategoryName
* @author Lombardia Informatica S.p.A.
*/ */
namespace elitedivision\amos\notificationmanager; namespace arter\amos\notificationmanager;
/** /**
* Plugin per la gestione delle notifiche. * Plugin per la gestione delle notifiche.
...@@ -50,14 +46,14 @@ namespace elitedivision\amos\notificationmanager; ...@@ -50,14 +46,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;
...@@ -66,7 +62,7 @@ use yii\log\Logger; ...@@ -66,7 +62,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
{ {
...@@ -81,11 +77,11 @@ class AmosNotify extends AmosModule implements \yii\base\BootstrapInterface, Not ...@@ -81,11 +77,11 @@ class AmosNotify extends AmosModule implements \yii\base\BootstrapInterface, Not
]; ];
public $orderEmailSummary = [ public $orderEmailSummary = [
'elitedivision\amos\events\models\Event', 'arter\amos\events\models\Event',
'elitedivision\amos\news\models\News', 'arter\amos\news\models\News',
'elitedivision\amos\partnershipprofiles\models\PartnershipProfile', 'arter\amos\partnershipprofiles\models\PartnershipProfile',
'elitedivision\amos\discussioni\models\DiscussioniTopic', 'arter\amos\discussioni\models\DiscussioniTopic',
'elitedivision\amos\sondaggi\models\Sondaggi', 'arter\amos\sondaggi\models\Sondaggi',
]; ];
/** @var bool */ /** @var bool */
...@@ -99,7 +95,7 @@ class AmosNotify extends AmosModule implements \yii\base\BootstrapInterface, Not ...@@ -99,7 +95,7 @@ class AmosNotify extends AmosModule implements \yii\base\BootstrapInterface, Not
/** /**
* @var array * @var array
* $personalizedValidatedEmail => [ * $personalizedValidatedEmail => [
* "elitedivision\amos\admin\models\UserProfile" => [ * "arter\amos\admin\models\UserProfile" => [
'class' => 'backend\modules\poiadmin\utility\PoiAdminEmailUtility', 'class' => 'backend\modules\poiadmin\utility\PoiAdminEmailUtility',
'method' => 'sendEmailUserValidated' 'method' => 'sendEmailUserValidated'
] ]
...@@ -110,8 +106,8 @@ class AmosNotify extends AmosModule implements \yii\base\BootstrapInterface, Not ...@@ -110,8 +106,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',
* ] * ]
* *
*/ */
...@@ -120,8 +116,8 @@ class AmosNotify extends AmosModule implements \yii\base\BootstrapInterface, Not ...@@ -120,8 +116,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 = [];
...@@ -157,7 +153,7 @@ class AmosNotify extends AmosModule implements \yii\base\BootstrapInterface, Not ...@@ -157,7 +153,7 @@ class AmosNotify extends AmosModule implements \yii\base\BootstrapInterface, Not
/** /**
* @inheritdoc * @inheritdoc
*/ */
public $controllerNamespace = 'elitedivision\amos\notificationmanager\controllers'; public $controllerNamespace = 'arter\amos\notificationmanager\controllers';
/** /**
* If set to true it enables the sending of segmented notifications * If set to true it enables the sending of segmented notifications
...@@ -211,7 +207,7 @@ class AmosNotify extends AmosModule implements \yii\base\BootstrapInterface, Not ...@@ -211,7 +207,7 @@ class AmosNotify extends AmosModule implements \yii\base\BootstrapInterface, Not
if (isset(Yii::$app->params['layoutMailConfigurations']['textContrastBgPrimaryDark'])) { if (isset(Yii::$app->params['layoutMailConfigurations']['textContrastBgPrimaryDark'])) {
$this->mailThemeColor['textContrastBgPrimaryDark'] = Yii::$app->params['layoutMailConfigurations']['textContrastBgPrimaryDark']; $this->mailThemeColor['textContrastBgPrimaryDark'] = Yii::$app->params['layoutMailConfigurations']['textContrastBgPrimaryDark'];
} }
\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'));
$this->orderEmailSummary = array_unique($this->orderEmailSummary); $this->orderEmailSummary = array_unique($this->orderEmailSummary);
...@@ -223,7 +219,7 @@ class AmosNotify extends AmosModule implements \yii\base\BootstrapInterface, Not ...@@ -223,7 +219,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 {
if (self::$registerEvent == false) { if (self::$registerEvent == false) {
self::$registerEvent = true; self::$registerEvent = true;
......
...@@ -6,25 +6,25 @@ You need to require this package and enable the module in your configuration. ...@@ -6,25 +6,25 @@ You need to require this package and enable the module in your configuration.
add to composer requirements in composer.json add to composer requirements in composer.json
``` ```
"elitedivision/amos-news": "dev-master", "arter/amos-news": "dev-master",
``` ```
or run command bash: or run command bash:
```bash ```bash
composer require "elitedivision/amos-news:dev-master" composer require "arter/amos-news:dev-master"
``` ```
Enable the Notify modules in common modules-amos.php, add : Enable the Notify modules in common modules-amos.php, add :
```php ```php
'notify' => [ 'notify' => [
'class' => 'elitedivision\amos\news\AmosNews', 'class' => 'arter\amos\news\AmosNews',
], ],
``` ```
add news migrations to console modules (console/config/migrations-amos.php): add news migrations to console modules (console/config/migrations-amos.php):
``` ```
'@vendor/elitedivision/amos-notify/src/migrations' '@vendor/arter/amos-notify/src/migrations'
``` ```
...@@ -45,11 +45,11 @@ for reports: ...@@ -45,11 +45,11 @@ for reports:
``` ```
'report' => [ 'report' => [
'class' => 'elitedivision\amos\report\AmosReport', 'class' => 'arter\amos\report\AmosReport',
'modelsEnabled' => [ 'modelsEnabled' => [
. .
. .
'elitedivision\amos\news\models\News', //line to add 'arter\amos\news\models\News', //line to add
. .
. .
] ]
...@@ -62,9 +62,9 @@ for reports: ...@@ -62,9 +62,9 @@ for reports:
- If you want to personalize the views of the contents in the notification email summary you have to put the module in /common/config/modules-amos - If you want to personalize the views of the contents in the notification email summary you have to put the module in /common/config/modules-amos
``` ```
'news' => [ 'news' => [
'class' => 'elitedivision\amos\news\AmosNews', 'class' => 'arter\amos\news\AmosNews',
'viewPathEmailSummary' => '@vendor/elitedivision/amos-news/src/views/email/notify_summary' 'viewPathEmailSummary' => '@vendor/arter/amos-news/src/views/email/notify_summary'
'viewPathEmailSummaryNetwork' => '@vendor/elitedivision/amos-news/src/views/email/notify_summary_network' 'viewPathEmailSummaryNetwork' => '@vendor/arter/amos-news/src/views/email/notify_summary_network'
] ]
], ],
``` ```
...@@ -79,11 +79,11 @@ for reports: ...@@ -79,11 +79,11 @@ for reports:
-Is used to define their order in the email summury -Is used to define their order in the email summury
```php ```php
public $orderEmailSummary = [ public $orderEmailSummary = [
'elitedivision\amos\events\models\Event', 'arter\amos\events\models\Event',
'elitedivision\amos\news\models\News', 'arter\amos\news\models\News',
'elitedivision\amos\partnershipprofiles\models', 'arter\amos\partnershipprofiles\models',
'elitedivision\amos\discussioni\models\DiscussioniTopic', 'arter\amos\discussioni\models\DiscussioniTopic',
'elitedivision\amos\sondaggi\models\Sondaggi', 'arter\amos\sondaggi\models\Sondaggi',
]; ];
``` ```
......
<?php <?php
/** /**
* Lombardia Informatica S.p.A. * Emilia Romagna Open Innovation
* OPEN 2.0 * Arter
* *
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
* *
* @package elitedivision\amos\notificationmanager\base\builder * @package arter\amos\notificationmanager\base\builder
* @category CategoryName * @category CategoryName
* @author Lombardia Informatica S.p.A.
*/ */
namespace elitedivision\amos\notificationmanager\assets; namespace arter\amos\notificationmanager\assets;
use yii\web\AssetBundle; use yii\web\AssetBundle;
/** /**
* Class NotifyAsset * Class NotifyAsset
* @package elitedivision\amos\notificationmanager\assets * @package arter\amos\notificationmanager\assets
*/ */
class NotifyAsset extends AssetBundle class NotifyAsset extends AssetBundle
{ {
/** /**
* @inheritdoc * @inheritdoc
*/ */
public $sourcePath = '@vendor/elitedivision/amos-notify/src/assets/web'; public $sourcePath = '@vendor/arter/amos-notify/src/assets/web';
/** /**
* @inheritdoc * @inheritdoc
...@@ -55,9 +51,9 @@ class NotifyAsset extends AssetBundle ...@@ -55,9 +51,9 @@ class NotifyAsset extends AssetBundle
{ {
$moduleL = \Yii::$app->getModule('layout'); $moduleL = \Yii::$app->getModule('layout');
if (!is_null($moduleL)) { if (!is_null($moduleL)) {
$this->depends [] = 'elitedivision\amos\layout\assets\BaseAsset'; $this->depends [] = 'arter\amos\layout\assets\BaseAsset';
} else { } else {
$this->depends [] = 'elitedivision\amos\core\views\assets\AmosCoreAsset'; $this->depends [] = 'arter\amos\core\views\assets\AmosCoreAsset';
} }
parent::init(); parent::init();
} }
......
/** /**
IMPORT AMOS-LAYOUT VARIABLES IMPORT AMOS-LAYOUT VARIABLES
*/ */
@import (optional) "../../vendor/elitedivision/amos-layout/src/assets/resources/base/less/variables.less"; @import (optional) "../../vendor/arter/amos-layout/src/assets/resources/base/less/variables.less";
@import (optional) "../../vendor/elitedivision/amos-layout/src/assets/resources/base/less/utility.less"; @import (optional) "../../vendor/arter/amos-layout/src/assets/resources/base/less/utility.less";
/** /**
IMPORT STYLE-CUSTOM IMPORT STYLE-CUSTOM
*/ */
......
<?php <?php
/** /**
* Lombardia Informatica S.p.A. * Emilia Romagna Open Innovation
* OPEN 2.0 * Arter
* *
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
* *
* @package elitedivision\amos\notificationmanager\base * @package arter\amos\notificationmanager\base
* @category CategoryName * @category CategoryName
* @author Lombardia Informatica S.p.A.
*/ */
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
{ {
......
<?php <?php
/** /**
* Lombardia Informatica S.p.A. * Emilia Romagna Open Innovation
* OPEN 2.0 * Arter
* *
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
* *
* @package elitedivision\amos\notificationmanager\base * @package arter\amos\notificationmanager\base
* @category CategoryName * @category CategoryName
* @author Lombardia Informatica S.p.A.
*/ */
namespace elitedivision\amos\notificationmanager\base; namespace arter\amos\notificationmanager\base;
use elitedivision\amos\notificationmanager\base\builder\ContactAcceptedMailBuilder; use arter\amos\notificationmanager\base\builder\ContactAcceptedMailBuilder;
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\NewsletterBuilder; use arter\amos\notificationmanager\base\builder\NewsletterBuilder;
use elitedivision\amos\notificationmanager\base\builder\SleepingUserMailBuilder; use arter\amos\notificationmanager\base\builder\SleepingUserMailBuilder;
use elitedivision\amos\notificationmanager\base\builder\SuccessfulContentMailBuilder; use arter\amos\notificationmanager\base\builder\SuccessfulContentMailBuilder;
use elitedivision\amos\notificationmanager\base\builder\SuccessfulUserMailBuilder; use arter\amos\notificationmanager\base\builder\SuccessfulUserMailBuilder;
use elitedivision\amos\notificationmanager\base\builder\SuggestedLinkMailBuilder; use arter\amos\notificationmanager\base\builder\SuggestedLinkMailBuilder;
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 * Class BuilderFactory
* @package elitedivision\amos\notificationmanager\base * @package arter\amos\notificationmanager\base
*/ */
class BuilderFactory extends BaseObject class BuilderFactory extends BaseObject
{ {
......
<?php <?php
/** /**
* Lombardia Informatica S.p.A. * Emilia Romagna Open Innovation
* OPEN 2.0 * Arter
* *
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
* *
* @package elitedivision\amos\notify * @package arter\amos\notify
* @category CategoryName * @category CategoryName
* @author Lombardia Informatica S.p.A.
*/ */
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;
...@@ -32,7 +28,7 @@ use yii\log\Logger; ...@@ -32,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
{ {
......
<?php <?php
/** /**
* Lombardia Informatica S.p.A. * Emilia Romagna Open Innovation
* OPEN 2.0 * Arter
* *
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
* *
* @package piattaforma-openinnovation * @package piattaforma-openinnovation
* @category CategoryName * @category CategoryName
* @author Lombardia Informatica S.p.A.
*/ */
namespace elitedivision\amos\notificationmanager\base; namespace arter\amos\notificationmanager\base;
interface NotifyWidget interface NotifyWidget
......
<?php <?php
/** /**
* Lombardia Informatica S.p.A. * Emilia Romagna Open Innovation
* OPEN 2.0 * Arter
*