Commit b3449a87 authored by Aster's avatar Aster Committed by waltermazza
Browse files

General Bug Fixes and Improvements

parent 084a7764
......@@ -14,13 +14,13 @@ Installation
Either run
```bash
composer require arter/amos-workflow
composer require elitedivision/amos-workflow
```
or add this row
```
"arter/amos-workflow": "dev-master"
"elitedivision/amos-workflow": "dev-master"
```
to the require section of your `composer.json` file.
......@@ -31,7 +31,7 @@ to the require section of your `composer.json` file.
'modules' => [
'workflow' => [
'class' => 'arter\amos\workflow\AmosWorkflow',
'class' => 'elitedivision\amos\workflow\AmosWorkflow',
],
],
```
......@@ -40,7 +40,7 @@ to the require section of your `composer.json` file.
a. amos-workflow migrations
```bash
php yii migrate/up --migrationPath=@vendor/arter/amos-workflow/src/migrations
php yii migrate/up --migrationPath=@vendor/elitedivision/amos-workflow/src/migrations
```
or add this row to your migrations config in console:
......@@ -50,7 +50,7 @@ to the require section of your `composer.json` file.
.
.
.
'@vendor/arter/amos-workflow/src/migrations',
'@vendor/elitedivision/amos-workflow/src/migrations',
.
.
.
......@@ -117,7 +117,7 @@ Amos Workflow provides three Widgets:
//TODO explain/example of use for new widgets above
* **WorkflowTransitionWidget** *arter\amos\workflow\widgets\WorkflowTransitionWidget*
* **WorkflowTransitionWidget** *elitedivision\amos\workflow\widgets\WorkflowTransitionWidget*
Draws a section containing model current status and the buttons with possible status to change starting from the current one (reading from sw_metadata).
***Comment / notes on status change***
If needed, it is possible to show a popup to insert comment/notes on status change; to enable the functionality add in sw_metadata for the transition final status the metadata: key ='comment', value = 1
......
{
"name": "arter/amos-workflow",
"name": "elitedivision/amos-workflow",
"description": "Sistema AMOS per il workflow",
"keywords": ["amos", "yii2", "workflow"],
"homepage": "http://www.arter.it/",
"homepage": "http://www.elitedivision.it/",
"type": "component",
"license": "BSD-3-Clause",
"support": {
"issues": "http://www.example.com/",
"forum": "http://www.example.com/forum/",
"wiki": "http://www.example.com/wiki/",
"source": "https://github.com/arter/amos-workflow"
"source": "https://github.com/elitedivision/amos-workflow"
},
"minimum-stability": "stable",
"require": {
"php": ">=5.4.0",
"arter/amos-core":"^1.9.50",
"elitedivision/amos-core":"^1.9.50",
"raoul2000/yii2-workflow": "^1.1.0",
"cornernote/yii2-workflow-manager": "^1.0.1"
},
......@@ -26,7 +26,7 @@
},
"autoload": {
"psr-4": {
"arter\\amos\\workflow\\": "src"
"elitedivision\\amos\\workflow\\": "src"
}
}
}
<?php
/**
* Copyright 2020 Art-ER S. Cons. P.A.
* EROI - Emilia Romagna Open Innovation is based on:
* https://www.open2.0.regione.lombardia.it
* Lombardia Informatica S.p.A.
* OPEN 2.0
*
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package arter\amos\workflow
* @package elitedivision\amos\workflow
* @category CategoryName
* @author Elite Division S.r.l.
* @author Lombardia Informatica S.p.A.
*/
namespace arter\amos\workflow;
namespace elitedivision\amos\workflow;
use arter\amos\core\module\Module;
use arter\amos\core\module\ModuleInterface;
use arter\amos\core\record\Record;
use arter\amos\workflow\components\events\SimpleWorkFlowEventsListener;
use elitedivision\amos\core\module\Module;
use elitedivision\amos\core\module\ModuleInterface;
use elitedivision\amos\core\record\Record;
use elitedivision\amos\workflow\components\events\SimpleWorkFlowEventsListener;
use raoul2000\workflow\base\SimpleWorkflowBehavior;
use Yii;
use yii\base\Event;
/**
* Class AmosWorkflow
* @package arter\amos\workflow
* @package elitedivision\amos\workflow
*/
class AmosWorkflow extends Module implements ModuleInterface
{
......
<?php
/**
* Copyright 2020 Art-ER S. Cons. P.A.
* EROI - Emilia Romagna Open Innovation is based on:
* https://www.open2.0.regione.lombardia.it
* Lombardia Informatica S.p.A.
* OPEN 2.0
*
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package arter\amos\workflow\behaviors
* @package elitedivision\amos\workflow\behaviors
* @category CategoryName
* @author Elite Division S.r.l.
* @author Lombardia Informatica S.p.A.
*/
namespace arter\amos\workflow\behaviors;
namespace elitedivision\amos\workflow\behaviors;
use arter\amos\core\record\Record;
use arter\amos\workflow\components\events\SimpleWorkFlowEventsListener;
use arter\amos\workflow\models\WorkflowTransitionsLog;
use elitedivision\amos\core\record\Record;
use elitedivision\amos\workflow\components\events\SimpleWorkFlowEventsListener;
use elitedivision\amos\workflow\models\WorkflowTransitionsLog;
use yii\base\Behavior;
use yii\helpers\Json;
/**
* Class WorkflowLogFunctionsBehavior
* @package arter\amos\workflow\behaviors
* @package elitedivision\amos\workflow\behaviors
*/
class WorkflowLogFunctionsBehavior extends Behavior
{
......
<?php
/**
* Copyright 2020 Art-ER S. Cons. P.A.
* EROI - Emilia Romagna Open Innovation is based on:
* https://www.open2.0.regione.lombardia.it
* Lombardia Informatica S.p.A.
* OPEN 2.0
*
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package arter\amos\workflow
* @package elitedivision\amos\workflow
* @category CategoryName
* @author Elite Division S.r.l.
* @author Lombardia Informatica S.p.A.
*/
namespace arter\amos\workflow\components\events;
namespace elitedivision\amos\workflow\components\events;
use arter\amos\workflow\models\WorkflowTransitionsLog;
use arter\amos\core\record\Record;
use elitedivision\amos\workflow\models\WorkflowTransitionsLog;
use elitedivision\amos\core\record\Record;
use raoul2000\workflow\events\WorkflowEvent;
use yii\base\Component;
use yii\db\ActiveQuery;
......
<?php
/**
* Copyright 2020 Art-ER S. Cons. P.A.
* EROI - Emilia Romagna Open Innovation is based on:
* https://www.open2.0.regione.lombardia.it
* Lombardia Informatica S.p.A.
* OPEN 2.0
*
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package arter\amos\workflow
* @package elitedivision\amos\workflow
* @category CategoryName
* @author Elite Division S.r.l.
* @author Lombardia Informatica S.p.A.
*/
return [
......
<?php
/**
* Copyright 2020 Art-ER S. Cons. P.A.
* EROI - Emilia Romagna Open Innovation is based on:
* https://www.open2.0.regione.lombardia.it
* Lombardia Informatica S.p.A.
* OPEN 2.0
*
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package arter\amos\workflow\migrations
* @package elitedivision\amos\workflow\migrations
* @category CategoryName
* @author Elite Division S.r.l.
* @author Lombardia Informatica S.p.A.
*/
use yii\db\Migration;
......
<?php
/**
* Copyright 2020 Art-ER S. Cons. P.A.
* EROI - Emilia Romagna Open Innovation is based on:
* https://www.open2.0.regione.lombardia.it
* Lombardia Informatica S.p.A.
* OPEN 2.0
*
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package arter\amos\workflow\migrations
* @package elitedivision\amos\workflow\migrations
* @category CategoryName
* @author Elite Division S.r.l.
* @author Lombardia Informatica S.p.A.
*/
use yii\db\Migration;
......
<?php
/**
* Copyright 2020 Art-ER S. Cons. P.A.
* EROI - Emilia Romagna Open Innovation is based on:
* https://www.open2.0.regione.lombardia.it
* Lombardia Informatica S.p.A.
* OPEN 2.0
*
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package arter\amos\workflow
* @package elitedivision\amos\workflow
* @category CategoryName
* @author Elite Division S.r.l.
* @author Lombardia Informatica S.p.A.
*/
namespace arter\amos\workflow\models;
namespace elitedivision\amos\workflow\models;
use arter\amos\workflow\models\base\WorkflowTransitionsLog as WorkflowTransitionsLogBase;
use elitedivision\amos\workflow\models\base\WorkflowTransitionsLog as WorkflowTransitionsLogBase;
/**
* This is the model class for table "workflow_transitions_log".
*/
......
<?php
/**
* Copyright 2020 Art-ER S. Cons. P.A.
* EROI - Emilia Romagna Open Innovation is based on:
* https://www.open2.0.regione.lombardia.it
* Lombardia Informatica S.p.A.
* OPEN 2.0
*
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package arter\amos\workflow
* @package elitedivision\amos\workflow
* @category CategoryName
* @author Elite Division S.r.l.
* @author Lombardia Informatica S.p.A.
*/
namespace arter\amos\workflow\models\base;
namespace elitedivision\amos\workflow\models\base;
use Yii;
use yii\helpers\Json;
......@@ -35,7 +35,7 @@ use yii\helpers\Json;
* @property integer $updated_by
* @property integer $deleted_by
*/
class WorkflowTransitionsLog extends \arter\amos\core\record\Record
class WorkflowTransitionsLog extends \elitedivision\amos\core\record\Record
{
/**
......
<?php
/**
* Copyright 2020 Art-ER S. Cons. P.A.
* EROI - Emilia Romagna Open Innovation is based on:
* https://www.open2.0.regione.lombardia.it
* Lombardia Informatica S.p.A.
* OPEN 2.0
*
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package arter\amos\workflow\widgets
* @package elitedivision\amos\workflow\widgets
* @category CategoryName
* @author Elite Division S.r.l.
* @author Lombardia Informatica S.p.A.
*/
namespace arter\amos\workflow\widgets;
namespace elitedivision\amos\workflow\widgets;
use DOMDocument;
use arter\amos\core\controllers\CrudController;
use arter\amos\core\forms\ActiveField;
use arter\amos\core\forms\ActiveForm;
use arter\amos\core\forms\CloseSaveButtonWidget;
use arter\amos\core\helpers\Html;
use arter\amos\core\module\AmosModule;
use arter\amos\core\record\ContentModel;
use arter\amos\core\record\Record;
use arter\amos\core\utilities\ModalUtility;
use arter\amos\core\utilities\WorkflowTransitionWidgetUtility;
use arter\amos\workflow\AmosWorkflow;
use elitedivision\amos\core\controllers\CrudController;
use elitedivision\amos\core\forms\ActiveField;
use elitedivision\amos\core\forms\ActiveForm;
use elitedivision\amos\core\forms\CloseSaveButtonWidget;
use elitedivision\amos\core\helpers\Html;
use elitedivision\amos\core\module\AmosModule;
use elitedivision\amos\core\record\ContentModel;
use elitedivision\amos\core\record\Record;
use elitedivision\amos\core\utilities\ModalUtility;
use elitedivision\amos\core\utilities\WorkflowTransitionWidgetUtility;
use elitedivision\amos\workflow\AmosWorkflow;
use kartik\base\Widget;
use raoul2000\workflow\base\Status;
use raoul2000\workflow\base\Transition;
......@@ -36,7 +36,7 @@ use yii\helpers\ArrayHelper;
/**
* Class WorkflowTransitionButtonsWidget
* Renders the widget useful to change a model workflow status.
* @package arter\amos\workflow\widgets
* @package elitedivision\amos\workflow\widgets
*/
class WorkflowTransitionButtonsWidget extends Widget
{
......@@ -683,14 +683,14 @@ class WorkflowTransitionButtonsWidget extends Widget
{
$notifyModule = \Yii::$app->getModule('notify');
if (!empty($notifyModule)
&& $this->model instanceof \arter\amos\notificationmanager\record\NotifyRecord
&& $this->model instanceof \arter\amos\core\interfaces\WorkflowModelInterface
&& $this->model instanceof \elitedivision\amos\notificationmanager\record\NotifyRecord
&& $this->model instanceof \elitedivision\amos\core\interfaces\WorkflowModelInterface
&& $this->model instanceof ContentModel
) {
if ($this->model->hasProperty('saveNotificationSendEmail') && !empty($notifyModule->confirmEmailNotification) && $notifyModule->confirmEmailNotification == true) {
$validatedStatus = $this->model->getValidatedStatus();
$isValidatedOnce = $this->model->getValidatedOnce();
$emailNotificated = \arter\amos\notificationmanager\models\NotificationSendEmail::findOne(['classname' => get_class($this->model), 'content_id' => $this->model->id]);
$emailNotificated = \elitedivision\amos\notificationmanager\models\NotificationSendEmail::findOne(['classname' => get_class($this->model), 'content_id' => $this->model->id]);
if (empty($emailNotificated)) {
// the modal is shown if you click (Validate/publish) or after the validation if you have not selected yes on send notification
// the first time you click for submit open the modal enc do the prevent default, if in the modal click yes, trigger again the submit without open the modal
......
<?php
/**
* Copyright 2020 Art-ER S. Cons. P.A.
* EROI - Emilia Romagna Open Innovation is based on:
* https://www.open2.0.regione.lombardia.it
* Lombardia Informatica S.p.A.
* OPEN 2.0
*
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package arter\amos\workflow\widgets
* @package elitedivision\amos\workflow\widgets
* @category CategoryName
* @author Elite Division S.r.l.
* @author Lombardia Informatica S.p.A.
*/
namespace arter\amos\workflow\widgets;
namespace elitedivision\amos\workflow\widgets;
use DOMDocument;
use arter\amos\core\forms\CloseSaveButtonWidget;
use arter\amos\core\module\BaseAmosModule;
use arter\amos\core\record\Record;
use elitedivision\amos\core\forms\CloseSaveButtonWidget;
use elitedivision\amos\core\module\BaseAmosModule;
use elitedivision\amos\core\record\Record;
use raoul2000\workflow\base\Status;
use yii\base\InvalidConfigException;
......@@ -27,7 +27,7 @@ use yii\base\InvalidConfigException;
* Renders the widget useful to change a model workflow status showing
* only a save button for the user.
*
* @package arter\amos\workflow\widgets
* @package elitedivision\amos\workflow\widgets
*/
class WorkflowTransitionSimplifiedButtonsWidget extends WorkflowTransitionButtonsWidget
{
......@@ -177,7 +177,7 @@ class WorkflowTransitionSimplifiedButtonsWidget extends WorkflowTransitionButton
$inState = $this->model->status;
if (!is_array($this->transitionStatuses)) {
throw new InvalidConfigException("\\arter\amos\workflow\widgets\WorkflowTransitionSimplifiedButtonsWidget:\n the param transitionStatuses must be an array.");
throw new InvalidConfigException("\\elitedivision\amos\workflow\widgets\WorkflowTransitionSimplifiedButtonsWidget:\n the param transitionStatuses must be an array.");
}
$saveButton = [];
......
<?php
/**
* Copyright 2020 Art-ER S. Cons. P.A.
* EROI - Emilia Romagna Open Innovation is based on:
* https://www.open2.0.regione.lombardia.it
* Lombardia Informatica S.p.A.
* OPEN 2.0
*
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package arter\amos\workflow\widgets
* @package elitedivision\amos\workflow\widgets
* @category CategoryName
* @author Elite Division S.r.l.
* @author Lombardia Informatica S.p.A.
*/
namespace arter\amos\workflow\widgets;
namespace elitedivision\amos\workflow\widgets;
use arter\amos\core\controllers\CrudController;
use arter\amos\core\forms\ActiveForm;
use arter\amos\core\module\AmosModule;
use arter\amos\core\module\BaseAmosModule;
use arter\amos\core\record\Record;
use arter\amos\core\utilities\WorkflowTransitionWidgetUtility;
use elitedivision\amos\core\controllers\CrudController;
use elitedivision\amos\core\forms\ActiveForm;
use elitedivision\amos\core\module\AmosModule;
use elitedivision\amos\core\module\BaseAmosModule;
use elitedivision\amos\core\record\Record;
use elitedivision\amos\core\utilities\WorkflowTransitionWidgetUtility;
use kartik\base\Widget;
use raoul2000\workflow\base\Status;
......@@ -28,7 +28,7 @@ use raoul2000\workflow\base\Status;
* Class WorkflowTransitionStateDescriptorWidget
* Renders the widget useful to view the workflow status of a model.
*
* @package arter\amos\core\forms
* @package elitedivision\amos\core\forms
*/
class WorkflowTransitionStateDescriptorWidget extends Widget
{
......
<?php
/**
* Copyright 2020 Art-ER S. Cons. P.A.
* EROI - Emilia Romagna Open Innovation is based on:
* https://www.open2.0.regione.lombardia.it
* Lombardia Informatica S.p.A.
* OPEN 2.0
*
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package arter\amos\core\forms
* @package elitedivision\amos\core\forms
* @category CategoryName
* @author Elite Division S.r.l.
* @author Lombardia Informatica S.p.A.
*/
namespace arter\amos\workflow\widgets;
namespace elitedivision\amos\workflow\widgets;
use arter\amos\core\controllers\CrudController;
use arter\amos\core\forms\CloseSaveButtonWidget;
use arter\amos\core\icons\AmosIcons;
use arter\amos\core\module\AmosModule;
use arter\amos\core\module\BaseAmosModule;
use arter\amos\core\record\Record;
use elitedivision\amos\core\controllers\CrudController;
use elitedivision\amos\core\forms\CloseSaveButtonWidget;
use elitedivision\amos\core\icons\AmosIcons;
use elitedivision\amos\core\module\AmosModule;
use elitedivision\amos\core\module\BaseAmosModule;
use elitedivision\amos\core\record\Record;
use kartik\base\Widget;
use kartik\select2\Select2;
use raoul2000\workflow\base\Status;
......@@ -32,7 +32,7 @@ use yii\db\ActiveRecord;
* Class WorkflowStateWidget
* Renders the widget useful to change a model workflow status.
*
* @package arter\amos\core\forms
* @package elitedivision\amos\core\forms
*/
class WorkflowTransitionWidget extends Widget
{
......
<?php
/**
* Copyright 2020 Art-ER S. Cons. P.A.
* EROI - Emilia Romagna Open Innovation is based on:
* https://www.open2.0.regione.lombardia.it
* Lombardia Informatica S.p.A.
* OPEN 2.0
*
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package arter\amos\core\forms
* @package elitedivision\amos\core\forms
* @category CategoryName
* @author Elite Division S.r.l.
* @author Lombardia Informatica S.p.A.
*/
/**
......
Supports Markdown
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