arter/amos-report

There is no license information available for the latest version (1.0.7) of this package.

Sistema AMOS per le segnalazioni

Installs: 224

Dependents: 2

Suggesters: 0

Security: 0

Type:component

1.0.7 2022-05-04 16:00 UTC

This package is auto-updated.

Last update: 2022-09-16 16:13:51 UTC


README

Extension for report sending on contents like news, discussions, etc...

Installation

  1. The preferred way to install this extension is through composer.

Either run

composer require arter/amos-report

or add this row

"arter/amos-report": "dev-master"

to the require section of your composer.json file.

  1. Add module to your main config in backend:

        
     'modules' => [
         'comments' => [
             'class' => 'arter\amos\report\AmosReport',
             'modelsEnabled' => [
                 /**
                  * Add here the classnames of the models for whose you want to enable reports
                  * (i.e. 'arter\amos\news\models\News')
                  */
             ]
         ],
     ],
    
  2. To send report notification not only to the content creator but also to the content validator, installation of amos-workflow is needed too

    a. Add workflow to composer

     "arter/amos-workflow": "dev-master"
    

    b. check in config/main for 'workflow' in modules array, if present

     'workflow' => [
         'class' => 'cornernote\workflow\manager\Module',
     ],
    

    change the entry in:

     'workflow-manager' => [
         'class' => 'cornernote\workflow\manager\Module',
     ],
    

    c. add workflow entry (config/main in modules array):

    'workflow' => [
        'class' => 'arter\amos\workflow\AmosWorkflow',
    ],
    

    d. add 'workflow' entry to your bootstrap:

     'bootstrap' => [
         .
         .
         .
         'workflow',
         .
         .
         .
     ],
    
  3. Apply migrations

    a. amos-report migrations

     php yii migrate/up --migrationPath=@vendor/arter/amos-report/src/migrations
    

    or add this row to your migrations config in console:

     return [
         .
         .
         .
         '@vendor/arter/amos-report/src/migrations',
         .
         .
         .
     ];
    

    b. if workflow module is installed (see step 3), also add amos-workflow migrations:

     php yii migrate/up --migrationPath=@vendor/arter/amos-workflow/src/migrations
    

    or add this row to your migrations config in console:

     return [
         .
         .
         .
         '@vendor/arter/amos-workflow/src/migrations',
         .
         .
         .
     ];
    

Widgets

Amos Report provides two Widgets:

  • 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 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'.

Email Sending

After the creation of a new report on a content a mail is sent to:

  • Content creator
  • Content validator (if exixts)
  • Users having the REPORT_MONITOR role for that content type (if role exists)
    The role name must follow the general permission naming convention _REPORT_MONITOR as for eg. create and update permissions (MODELNAME_CREATE, MODELNAME_UPDATE).