Commit d85c95b5 authored by waltermazza's avatar waltermazza
Browse files

Arter namespace

parent 9141e3d5
......@@ -11,13 +11,13 @@ Installation
Either run
```bash
composer require elitedivision/amos-report
composer require arter/amos-report
```
or add this row
```
"elitedivision/amos-report": "dev-master"
"arter/amos-report": "dev-master"
```
to the require section of your `composer.json` file.
......@@ -28,11 +28,11 @@ to the require section of your `composer.json` file.
'modules' => [
'comments' => [
'class' => 'elitedivision\amos\report\AmosReport',
'class' => 'arter\amos\report\AmosReport',
'modelsEnabled' => [
/**
* Add here the classnames of the models for whose you want to enable reports
* (i.e. 'elitedivision\amos\news\models\News')
* (i.e. 'arter\amos\news\models\News')
*/
]
],
......@@ -44,7 +44,7 @@ to the require section of your `composer.json` file.
a. Add workflow to composer
```
"elitedivision/amos-workflow": "dev-master"
"arter/amos-workflow": "dev-master"
```
b. check in config/main for 'workflow' in modules array, if present
......@@ -63,7 +63,7 @@ to the require section of your `composer.json` file.
c. add workflow entry (config/main in modules array):
```php
'workflow' => [
'class' => 'elitedivision\amos\workflow\AmosWorkflow',
'class' => 'arter\amos\workflow\AmosWorkflow',
],
```
......@@ -85,7 +85,7 @@ to the require section of your `composer.json` file.
a. amos-report migrations
```bash
php yii migrate/up --migrationPath=@vendor/elitedivision/amos-report/src/migrations
php yii migrate/up --migrationPath=@vendor/arter/amos-report/src/migrations
```
or add this row to your migrations config in console:
......@@ -95,7 +95,7 @@ to the require section of your `composer.json` file.
.
.
.
'@vendor/elitedivision/amos-report/src/migrations',
'@vendor/arter/amos-report/src/migrations',
.
.
.
......@@ -104,7 +104,7 @@ to the require section of your `composer.json` file.
b. if workflow module is installed (see step 3), also add amos-workflow migrations:
```bash
php yii migrate/up --migrationPath=@vendor/elitedivision/amos-workflow/src/migrations
php yii migrate/up --migrationPath=@vendor/arter/amos-workflow/src/migrations
```
or add this row to your migrations config in console:
......@@ -113,7 +113,7 @@ to the require section of your `composer.json` file.
.
.
.
'@vendor/elitedivision/amos-workflow/src/migrations',
'@vendor/arter/amos-workflow/src/migrations',
.
.
.
......@@ -124,10 +124,10 @@ Widgets
-----------
Amos Report provides two Widgets:
* **ReportWidget** *elitedivision\amos\report\widgets\ReportWidget*
* **ReportWidget** *arter\amos\report\widgets\ReportWidget*
Draw a flag icon related to a model. On flag click, the system opens form to insert a new report on a modal popup.
* **TabReportsWidget** *elitedivision\amos\report\widgets\TabReportsWidget*
* **TabReportsWidget** *arter\amos\report\widgets\TabReportsWidget*
Draw the Report tab in a model view/form, containing the list of reports a specif content.
If a model has been enabled for reports, the tab is automatically injected in update phase (form) by AmosCore widget 'Tabs'.
......
# Deploy changes to elite division gitlab
# Deploy changes to arter gitlab
pipelines:
branches:
master:
- step:
script:
- git push --all git@git.elitedivision.it:mirror/amos-report.git
\ No newline at end of file
- git push --all git@git.arter.it:mirror/amos-report.git
\ No newline at end of file
......@@ -6,7 +6,7 @@
"yii2",
"report"
],
"homepage": "http://www.elitedivision.it/",
"homepage": "http://www.arter.it/",
"type": "component",
"license": "BSD-3-Clause",
"require": {
......@@ -32,7 +32,7 @@
},
"autoload": {
"psr-4": {
"elitedivision\\amos\\report\\": "src"
"arter\\amos\\report\\": "src"
}
},
"require-dev": {
......
......@@ -4,25 +4,25 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\report
* @package arter\amos\report
* @category CategoryName
* @author Elite Division S.r.l.
*/
namespace elitedivision\amos\report;
namespace arter\amos\report;
use elitedivision\amos\core\module\AmosModule;
use elitedivision\amos\core\module\ModuleInterface;
use elitedivision\amos\notificationmanager\models\Notification;
use elitedivision\amos\notificationmanager\models\NotificationsRead;
use elitedivision\amos\notificationmanager\models\NotificationChannels;
use elitedivision\amos\report\models\Report;
use arter\amos\core\module\AmosModule;
use arter\amos\core\module\ModuleInterface;
use arter\amos\notificationmanager\models\Notification;
use arter\amos\notificationmanager\models\NotificationsRead;
use arter\amos\notificationmanager\models\NotificationChannels;
use arter\amos\report\models\Report;
use Yii;
use yii\db\ActiveQuery;
/**
* Class AmosReport
* @package elitedivision\amos\report
* @package arter\amos\report
*/
class AmosReport extends AmosModule implements ModuleInterface
{
......@@ -35,7 +35,7 @@ class AmosReport extends AmosModule implements ModuleInterface
*/
public $layout = 'main';
public $name = 'Report';
public $controllerNamespace = 'elitedivision\amos\report\controllers';
public $controllerNamespace = 'arter\amos\report\controllers';
/**
* @var array
......@@ -47,13 +47,13 @@ class AmosReport extends AmosModule implements ModuleInterface
* This is the html used to render the subject of the e-mail.
* @var string
*/
public $htmlMailSubject = '@vendor/elitedivision/amos-report/src/views/report/email/report_notification_subject';
public $htmlMailSubject = '@vendor/arter/amos-report/src/views/report/email/report_notification_subject';
/**
* This is the html used to render the message of the e-mail.
* @var string
*/
public $htmlMailContent = '@vendor/elitedivision/amos-report/src/views/report/email/report_notification';
public $htmlMailContent = '@vendor/arter/amos-report/src/views/report/email/report_notification';
public static function getModuleName()
{
......@@ -64,7 +64,7 @@ class AmosReport extends AmosModule implements ModuleInterface
{
parent::init();
\Yii::setAlias('@elitedivision/amos/'.static::getModuleName().'/controllers', __DIR__.'/controllers');
\Yii::setAlias('@arter/amos/'.static::getModuleName().'/controllers', __DIR__.'/controllers');
// initialize the module with the configuration loaded from config.php
Yii::configure($this, require(__DIR__.DIRECTORY_SEPARATOR.self::$CONFIG_FOLDER.DIRECTORY_SEPARATOR.'config.php'));
}
......
......@@ -5,14 +5,14 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\news\controllers
* @package arter\amos\news\controllers
* @category CategoryName
* @author Elite Division S.r.l.
*/
namespace elitedivision\amos\report\controllers;
namespace arter\amos\report\controllers;
use elitedivision\amos\dashboard\controllers\base\DashboardController;
use arter\amos\dashboard\controllers\base\DashboardController;
use yii\helpers\Url;
class DefaultController extends DashboardController
......@@ -58,7 +58,7 @@ class DefaultController extends DashboardController
}
$module = \Yii::$app->getModule('layout');
if(empty($module)){
$this->layout = '@vendor/elitedivision/amos-core/views/layouts/' . (!empty($layout) ? $layout : $this->layout);
$this->layout = '@vendor/arter/amos-core/views/layouts/' . (!empty($layout) ? $layout : $this->layout);
return true;
}
$this->layout = (!empty($layout)) ? $layout : $this->layout;
......
......@@ -5,22 +5,22 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\report\controllers
* @package arter\amos\report\controllers
* @category Controller
* @author Elite Division S.r.l.
*/
namespace elitedivision\amos\report\controllers;
use elitedivision\amos\core\controllers\CrudController;
use elitedivision\amos\core\helpers\Html;
use elitedivision\amos\core\icons\AmosIcons;
use elitedivision\amos\core\user\User;
use elitedivision\amos\core\utilities\Email;
use elitedivision\amos\notificationmanager\models\NotificationsRead;
use elitedivision\amos\report\AmosReport;
use elitedivision\amos\report\models\Report;
use elitedivision\amos\report\models\search\ReportSearch;
namespace arter\amos\report\controllers;
use arter\amos\core\controllers\CrudController;
use arter\amos\core\helpers\Html;
use arter\amos\core\icons\AmosIcons;
use arter\amos\core\user\User;
use arter\amos\core\utilities\Email;
use arter\amos\notificationmanager\models\NotificationsRead;
use arter\amos\report\AmosReport;
use arter\amos\report\models\Report;
use arter\amos\report\models\search\ReportSearch;
use Yii;
use yii\filters\AccessControl;
use yii\filters\VerbFilter;
......@@ -29,7 +29,7 @@ use yii\helpers\Url;
/**
* Class ReportController
* @package elitedivision\amos\report\controllers
* @package arter\amos\report\controllers
*/
class ReportController extends CrudController
{
......@@ -145,7 +145,7 @@ class ReportController extends CrudController
$read_by = \Yii::$app->user->id;
$ok = true;
if (!empty($post['notification_id'])) {
$notificationRead = new \elitedivision\amos\notificationmanager\models\NotificationsRead();
$notificationRead = new \arter\amos\notificationmanager\models\NotificationsRead();
$notificationRead->user_id = $read_by;
$notificationRead->notification_id = $post['notification_id'];
$ok = $notificationRead->save(false);
......@@ -173,7 +173,7 @@ class ReportController extends CrudController
$model = $this->findModel($id);
$read_by = \Yii::$app->user->id;
$ok = true;
$notification = \elitedivision\amos\notificationmanager\models\Notification::findOne([
$notification = \arter\amos\notificationmanager\models\Notification::findOne([
'class_name' => Report::className(),
'content_id' => $model->id,
]);
......@@ -211,7 +211,7 @@ class ReportController extends CrudController
}
/**
* Set a view param used in \elitedivision\amos\core\forms\CreateNewButtonWidget
* Set a view param used in \arter\amos\core\forms\CreateNewButtonWidget
*/
private function setCreateNewBtnLabel()
{
......@@ -319,7 +319,7 @@ class ReportController extends CrudController
}
else {
$contentView = "@vendor/elitedivision/amos-report/src/views/report/email/report_notification";
$contentView = "@vendor/arter/amos-report/src/views/report/email/report_notification";
$contentViewSubject = $contentView . "_subject";
}
......@@ -352,7 +352,7 @@ class ReportController extends CrudController
*/
public function sendMail($from, $tos, $subject, $text, $files = [], $bcc = [])
{
/** @var \elitedivision\amos\emailmanager\AmosEmail $mailModule */
/** @var \arter\amos\emailmanager\AmosEmail $mailModule */
$mailModule = Yii::$app->getModule("email");
if (isset($mailModule)) {
if (is_null($from)) {
......@@ -360,7 +360,7 @@ class ReportController extends CrudController
//use default platform email assistance
$from = Yii::$app->params['email-assistenza'];
} else {
$from = 'assistenza@open20.it';
$from = 'assistenza@arter.it';
}
}
Email::sendMail($from, $tos, $subject, $text, $files, $bcc, [], 0, false);
......@@ -379,7 +379,7 @@ class ReportController extends CrudController
}
$module = \Yii::$app->getModule('layout');
if (empty($module)) {
$this->layout = '@vendor/elitedivision/amos-core/views/layouts/' . (!empty($layout) ? $layout : $this->layout);
$this->layout = '@vendor/arter/amos-core/views/layouts/' . (!empty($layout) ? $layout : $this->layout);
return true;
}
$this->layout = (!empty($layout)) ? $layout : $this->layout;
......
......@@ -5,7 +5,7 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\report\i18n\en-GB
* @package arter\amos\report\i18n\en-GB
* @category CategoryName
* @author Elite Division S.r.l.
*/
......
......@@ -5,7 +5,7 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\report\i18n\en-US
* @package arter\amos\report\i18n\en-US
* @category CategoryName
* @author Elite Division S.r.l.
*/
......
......@@ -5,7 +5,7 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\report\i18n\it-IT
* @package arter\amos\report\i18n\it-IT
* @category CategoryName
* @author Elite Division S.r.l.
*/
......
......@@ -5,12 +5,12 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\report\migrations
* @package arter\amos\report\migrations
* @category Migration
* @author Elite Division S.r.l.
*/
use elitedivision\amos\core\migration\AmosMigrationTableCreation;
use arter\amos\core\migration\AmosMigrationTableCreation;
/**
* Handles the creation of table `report`.
......
......@@ -5,12 +5,12 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\report\migrations
* @package arter\amos\report\migrations
* @category Migration
* @author Elite Division S.r.l.
*/
use elitedivision\amos\core\migration\AmosMigrationTableCreation;
use arter\amos\core\migration\AmosMigrationTableCreation;
/**
* Handles the creation of table `report`.
......
......@@ -4,12 +4,12 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\report\migrations
* @package arter\amos\report\migrations
* @category CategoryName
* @author Elite Division S.r.l.
*/
use elitedivision\amos\core\migration\AmosMigrationPermissions;
use arter\amos\core\migration\AmosMigrationPermissions;
use yii\helpers\ArrayHelper;
use yii\rbac\Permission;
......
......@@ -5,7 +5,7 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\report\migrations
* @package arter\amos\report\migrations
* @category CategoryName
* @author Elite Division S.r.l.
*/
......@@ -22,7 +22,7 @@ class m170607_153251_add_default_report_types extends Migration
*/
public function safeUp()
{
$reportType = new \elitedivision\amos\report\models\ReportType();
$reportType = new \arter\amos\report\models\ReportType();
$reportType->name = "Inappropriate contents";
$reportType->description = "Inappropriate contents";
$ok = $reportType->detachBehaviors();
......@@ -33,7 +33,7 @@ class m170607_153251_add_default_report_types extends Migration
return false;
}
$reportType = new \elitedivision\amos\report\models\ReportType();
$reportType = new \arter\amos\report\models\ReportType();
$reportType->name = "Errors";
$reportType->description = "Errors";
$ok = $reportType->detachBehaviors();
......
......@@ -5,12 +5,12 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\report\migrations
* @package arter\amos\report\migrations
* @category Migration
* @author Elite Division S.r.l.
*/
use elitedivision\amos\core\migration\AmosMigrationTranslations;
use arter\amos\core\migration\AmosMigrationTranslations;
/**
* Class m170615_132412_add_report_translations_IT
......
......@@ -5,12 +5,12 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\report\migrations
* @package arter\amos\report\migrations
* @category Migration
* @author Elite Division S.r.l.
*/
use elitedivision\amos\core\migration\AmosMigrationPermissions;
use arter\amos\core\migration\AmosMigrationPermissions;
/**
* Class m170615_160804_add_report_permission_to_basic_user
......
......@@ -5,12 +5,12 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\report\migrations
* @package arter\amos\report\migrations
* @category Migration
* @author Elite Division S.r.l.
*/
use elitedivision\amos\core\migration\AmosMigrationTranslations;
use arter\amos\core\migration\AmosMigrationTranslations;
/**
* Class m170616_150319_add_report_new_modal_title_translation_IT
......
......@@ -5,12 +5,12 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\report\migrations
* @package arter\amos\report\migrations
* @category Migration
* @author Elite Division S.r.l.
*/
use elitedivision\amos\report\models\Report;
use arter\amos\report\models\Report;
use yii\db\Migration;
/**
......
......@@ -10,12 +10,12 @@
*/
namespace elitedivision\amos\report\models;
namespace arter\amos\report\models;
use elitedivision\amos\notificationmanager\behaviors\NotifyBehavior;
use arter\amos\notificationmanager\behaviors\NotifyBehavior;
use yii\helpers\ArrayHelper;
class Report extends \elitedivision\amos\report\models\base\Report
class Report extends \arter\amos\report\models\base\Report
{
/**
* @see \yii\db\BaseActiveRecord::init() for more info.
......
......@@ -10,11 +10,11 @@
*/
namespace elitedivision\amos\report\models;
namespace arter\amos\report\models;
use yii\helpers\ArrayHelper;
class ReportType extends \elitedivision\amos\report\models\base\ReportType
class ReportType extends \arter\amos\report\models\base\ReportType
{
/**
* @see \yii\db\BaseActiveRecord::init() for more info.
......
......@@ -9,9 +9,9 @@
* @author Elite Division S.r.l.
*/
namespace elitedivision\amos\report\models\base;
namespace arter\amos\report\models\base;
use elitedivision\amos\report\AmosReport;
use arter\amos\report\AmosReport;
use yii\helpers\ArrayHelper;
/**
......@@ -36,12 +36,12 @@ use yii\helpers\ArrayHelper;
* @property integer $updated_by
* @property integer $deleted_by
*
* @property \elitedivision\amos\report\models\ReportType $reportType
* @property \elitedivision\amos\core\user\User $user
* @property \arter\amos\report\models\ReportType $reportType
* @property \arter\amos\core\user\User $user
*
* @package elitedivision\amos\report\models\base
* @package arter\amos\report\models\base
*/
class Report extends \elitedivision\amos\core\record\Record
class Report extends \arter\amos\core\record\Record
{
/**
* @see \yii\db\ActiveRecord::tableName() for more info.
......@@ -78,7 +78,7 @@ class Report extends \elitedivision\amos\core\record\Record
}
/**
* @see \elitedivision\amos\core\record\Record::attributeLabels() for more info.
* @see \arter\amos\core\record\Record::attributeLabels() for more info.
*/
public function attributeLabels()
{
......@@ -111,12 +111,12 @@ class Report extends \elitedivision\amos\core\record\Record
*/
public function getReportType()
{
return $this->hasOne(\elitedivision\amos\report\models\ReportType::className(), ['id' => 'type']);
return $this->hasOne(\arter\amos\report\models\ReportType::className(), ['id' => 'type']);
}
public function getUser()
{
return $this->hasOne(\elitedivision\amos\core\user\User::className(), ['id' => 'created_by']);
return $this->hasOne(\arter\amos\core\user\User::className(), ['id' => 'created_by']);
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment