Commit 2518563e authored by Marcello Pivanti's avatar Marcello Pivanti
Browse files

Added EROI

parent 67b96ed7
<?php
/**
* Art-ER Attrattività, ricerca e territorio dell’Emilia-Romagna
* OPEN 2.0
*
* @package backend\components
* @category CategoryName
* @author Elite Division S.r.l.
*/
namespace backend\components;
use arter\amos\admin\models\UserProfile;
use yii\base\BootstrapInterface;
use yii\web\Application;
use Yii;
/**
* Class LoginRequestInfoWizard
*/
class LoginRequestInfoWizard implements BootstrapInterface {
/**
* Bootstrap method to be called during application bootstrap stage.
* @param Application $app the application currently running
*/
public function bootstrap($app) {
Yii::$app->on(Application::EVENT_BEFORE_ACTION, [$this, 'startInfoRequest']);
}
/**
*
*/
public function startInfoRequest() {
/** @var \arter\amos\core\user\User $loggedUser */
$loggedUser = Yii::$app->getUser()->identity;
if (!empty($loggedUser)) {
/** @var \arter\amos\admin\models\UserProfile $loggedUserProfile */
$loggedUserProfile = $loggedUser->getProfile();
// control for infinite loop of redirect!
if (Yii::$app->controller->action->id != 'required-informations') {
if ($this->stopWithRequest($loggedUserProfile)) {
$destinationUrl = Yii::$app->request->url;
Yii::$app->controller->redirect(([
'/login-info-request/required-informations',
'id' => $loggedUserProfile->id,
'url' => $destinationUrl,
]));
Yii::$app->response->send();
}
}
}
}
/**
* @param $userProfile UserProfile
* @return bool
*/
private function stopWithRequest($userProfile) {
if (!$userProfile->privacy ) {
return true;
}
return false;
}
}
<?php
/**
* Art-ER Attrattività, ricerca e territorio dell’Emilia-Romagna
* OPEN 2.0
*
* @package arter\amos\basic\template
* @category CategoryName
* @author Elite Division S.r.l.
*/
$bootstrap = [];
$bootstrap[] = 'comments';
$bootstrap[] = 'arter\amos\core\bootstrap\Breadcrumb';
$bootstrap[] = 'workflow';
$bootstrap[] = 'translation';
$bootstrap[] = 'notify';
$bootstrap[] = 'arter\amos\translation\bootstrap\EventActiveRecordBootstrap';
//$bootstrap[] = 'arter\amos\translation\bootstrap\EventViewBootstrap';
$bootstrap[] = 'translatemanager';
$bootstrap[] = 'layout';
//$bootstrap[] = 'maintenanceMode';
$bootstrap[] = 'arter\amos\admin\bootstrap\RedirectAfterLogin';
$bootstrap[] = 'backend\components\LoginRequestInfoWizard';
return $bootstrap;
\ No newline at end of file
<?php
/**
* Art-ER Attrattività, ricerca e territorio dell’Emilia-Romagna
* OPEN 2.0
*
* @package arter\amos\basic\template
* @category CategoryName
* @author Elite Division S.r.l.
*/
return [
'view' => [
'class' => 'arter\amos\core\components\AmosView',
'theme' => [
'pathMap' => [
'@vendor/arter/amos-layout/src/views/layouts/parts/' => '@app/views/layouts/parts/',
'@vendor/lajax/yii2-translate-manager/views/language/' => '@vendor/arter/amos-translation/src/views/translatemanager/',
'@vendor/arter/amos-admin/src/views/first-access-wizard' => '@app/modules/aster_admin/views/first-access-wizard',
'@app/modules/aster_admin/views/first-access-wizard' => '@vendor/arter/amos-admin/src/views/first-access-wizard',
'@vendor/arter/amos-admin/src/views/user-profile' => '@app/modules/aster_admin/views/user-profile',
'@app/modules/aster_admin/views/user-profile' => '@vendor/arter/amos-admin/src/views/user-profile',
'@vendor/arter/amos-admin/src/views/security' => '@app/modules/aster_admin/views/security',
'@app/modules/aster_admin/views/security' => '@vendor/arter/amos-admin/src/views/security',
'@vendor/arter/amos-cwh/src/widgets/views' => '@app/modules/aster_cwh/widgets/views',
'@app/modules/aster_cwh/widgets/views' => '@vendor/arter/amos-cwh/src/widgets/views',
'@vendor/arter/amos-partnership-profiles/src/views' => '@app/modules/aster_partnership_profiles/views',
'@app/modules/aster_partnership_profiles/views' => '@vendor/arter/amos-partnership-profiles/src/views',
'@vendor/arter/amos-organizzazioni/src/views/profilo' => '@app/modules/aster_organizzazioni/views/profilo',
'@app/modules/aster_organizzazioni/views/profilo' => '@vendor/arter/amos-organizzazioni/src/views/profilo',
'@vendor/arter/amos-organizzazioni/src/views/profilo-sedi' => '@app/modules/aster_organizzazioni/views/profilo-sedi',
'@app/modules/aster_organizzazioni/views/profilo-sedi' => '@vendor/arter/amos-organizzazioni/src/views/profilo-sedi',
'@vendor/arter/amos-cwh/src/views/pubblicazione' => '@app/modules/aster_cwh/views/pubblicazione',
'@app/modules/aster_cwh/views/pubblicazione' => '@vendor/arter/amos-cwh/src/views/pubblicazione',
'@vendor/arter/amos-news/src/widgets/graphics/views/fullsize' => '@app/modules/aster_news/widgets/graphics/views',
'@app/modules/aster_news/widgets/graphics/views' => '@vendor/arter/amos-news/src/widgets/graphics/views/fullsize',
'@vendor/arter/amos-tag/src/widgets/views' => '@app/modules/aster_tag/widgets/views',
'@app/modules/aster_tag/widgets/views' => '@vendor/arter/amos-tag/src/widgets/views',
'@vendor/arter/amos-community/src/views/community' => '@backend/modules/aster_community/views/community',
'@backend/modules/aster_community/views/community' => '@vendor/arter/amos-community/src/views/community',
'@vendor/arter/amos-invitations/src/views/invitation' => '@backend/modules/aster_invitations/views',
'@backend/modules/aster_invitations/views' => '@vendor/arter/amos-invitations/src/views/invitation',
'@vendor/arter/amos-notify/src/views/email' => '@backend/modules/aster_notify/views/email',
'@backend/modules/aster_notify/views/email' => '@vendor/arter/amos-notify/src/views/email',
'@vendor/arter/amos-my-activities/src/views/my-activities' => '@backend/modules/aster_my_activities/views/my-activities',
'@backend/modules/aster_my_activities/views/my-activities' => '@vendor/arter/amos-my-activities/src/views/my-activities',
'@vendor/arter/amos-my-activities/src/widgets/views/fullsize' => '@app/modules/aster_my_activities/widgets/views/fullsize',
'@app/modules/aster_my_activities/widgets/views/fullsize' => '@vendor/arter/amos-my-activities/src/widgets/views/fullsize',
],
],
],
'wizflowManagerNewProject' => [
'class' => 'arter\amos\wizflow\WizflowManager',
'workflowName' => 'NewProjectWizardWorkflow',
'workflowSourceName' => 'workflowSource',
'skeyName' => '_new_project'
],
];
<?php
/**
* Art-ER Attrattività, ricerca e territorio dell’Emilia-Romagna
* OPEN 2.0
*
* @package arter\amos\basic\template
* @category CategoryName
* @author Elite Division S.r.l.
*/
return [
'errorHandler' => [
'errorAction' => 'site/error',
],
'eventSequence' => [
'class' => '\raoul2000\workflow\events\BasicEventSequence',
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
'logVars' => ['_SERVER'],
],
],
],/*
'maintenanceMode' => [
'class' => 'brussens\maintenance\MaintenanceMode',
'enabled' => false,
'route' => '/layout/maintenance/maintenance',
'message' => '',
// Allowed IP addresses
'ips' => [
'127.0.0.1',
],
],*/
'request' => [
'csrfParam' => '_csrf-backend',
],
'session' => [
// this is the name of the session cookie used for login on the backend
'name' => 'advanced-backend',
'class' => 'yii\web\DbSession',
],
'user' => [
'class' => 'arter\amos\core\user\AmosUser',
'identityClass' => 'arter\amos\core\user\User',
'loginUrl' => '/admin/security/login',
'enableAutoLogin' => true,
'identityCookie' => [
'name' => '_identity-backend',
'httpOnly' => true,
'secure' => true
],
],
'socialShare' => [
'class' => \arter\amos\core\components\ConfiguratorSocialShare::class,
],
];
<?php
/**
* Art-ER Attrattività, ricerca e territorio dell’Emilia-Romagna
* OPEN 2.0
*
* @package arter\amos\basic\template
* @category CategoryName
* @author Elite Division S.r.l.
*/
$common = require(__DIR__ . '/../../common/config/main.php');
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$modules = array_merge(
$common['modules'],
require(__DIR__ . '/modules-others.php'),
require(__DIR__ . '/modules-amos.php')
);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// TODO verificare che non ci siano index che non caricano bootstrap, in caso non ce ne siano, questa va eliminata
$bootstrap = array_merge(
$common['bootstrap'],
require(__DIR__ . '/bootstrap.php')
);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$components = array_merge(
$common['components'],
require(__DIR__ . '/components-others.php'),
require(__DIR__ . '/components-amos.php')
);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$params = array_merge(
$common['params'],
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if (isset($modules['chat'])) {
$bootstrap[] = 'chat';
}
if ($params['template-amos'] === true) {
$bootstrap[] = 'backend\bootstrap\AssignRolesAdmin';
}
if (isset($modules['tag'])) {
if (isset($modules['bestpractice'])) {
$modules['tag']['modelsEnabled'][] = 'arter\amos\best\practice\models\BestPractice';
}
if (isset($modules['community'])) {
$modules['tag']['modelsEnabled'][] = 'arter\amos\community\models\Community';
}
if (isset($modules['discussioni'])) {
$modules['tag']['modelsEnabled'][] = 'arter\amos\discussioni\models\DiscussioniTopic';
}
if (isset($modules['documenti'])) {
$modules['tag']['modelsEnabled'][] = 'arter\amos\documenti\models\Documenti';
}
if (isset($modules['events'])) {
$modules['tag']['modelsEnabled'][] = 'arter\amos\events\models\Event';
}
if (isset($modules['news'])) {
$modules['tag']['modelsEnabled'][] = 'arter\amos\news\models\News';
}
if (isset($modules['partnershipprofiles'])) {
$modules['tag']['modelsEnabled'][] = 'backend\modules\aster_partnership_profiles\models\PartnershipProfiles';
$modules['tag']['modelsEnabled'][] = 'arter\amos\partnershipprofiles\models\ExpressionsOfInterest';
}
if (isset($modules['organizzazioni'])) {
$modules['tag']['modelsEnabled'][] = 'arter\amos\organizzazioni\models\Profilo';
}
}
if (isset($modules['report'])) {
if (isset($modules['discussioni'])) {
$modules['tag']['modelsEnabled'][] = 'arter\amos\discussioni\models\DiscussioniTopic';
}
if (isset($modules['documenti'])) {
$modules['tag']['modelsEnabled'][] = 'arter\amos\documenti\models\Documenti';
}
if (isset($modules['events'])) {
$modules['tag']['modelsEnabled'][] = 'arter\amos\events\models\Event';
}
if (isset($modules['news'])) {
$modules['tag']['modelsEnabled'][] = 'arter\amos\news\models\News';
}
if (isset($modules['partnershipprofiles'])) {
$modules['report']['modelsEnabled'][] = 'backend\modules\aster_partnership_profiles\models\PartnershipProfiles';
}
}
if (isset($modules['comments'])) {
if (isset($modules['discussioni'])) {
$modules['comments']['modelsEnabled'][] = 'arter\amos\discussioni\models\DiscussioniTopic';
}
if (isset($modules['documenti'])) {
$modules['comments']['modelsEnabled'][] = 'arter\amos\documenti\models\Documenti';
}
if (isset($modules['events'])) {
$modules['comments']['modelsEnabled'][] = 'arter\amos\events\models\Event';
}
if (isset($modules['news'])) {
$modules['comments']['modelsEnabled'][] = 'arter\amos\news\models\News';
}
}
if (isset($modules['favorites'])) {
if (isset($modules['discussioni'])) {
$modules['favorites']['modelsEnabled'][] = 'arter\amos\discussioni\models\DiscussioniTopic';
}
if (isset($modules['documenti'])) {
$modules['favorites']['modelsEnabled'][] = 'arter\amos\documenti\models\Documenti';
}
if (isset($modules['news'])) {
$modules['favorites']['modelsEnabled'][] = 'arter\amos\news\models\News';
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
return [
'as access' => [
'class' => 'mdm\admin\components\AccessControl',
'allowActions' => [
'*',
'/build/'
],
],
'basePath' => dirname(__DIR__),
'controllerNamespace' => 'backend\controllers',
'defaultRoute' => '/admin/security/login',
'homeUrl' => '/dashboard',
'id' => 'app-backend',
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
'bootstrap' => $bootstrap,
'components' => $components,
'modules' => $modules,
'params' => $params,
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
];
<?php
/**
* Art-ER Attrattività, ricerca e territorio dell’Emilia-Romagna
* OPEN 2.0
*
* @package arter\amos\basic\template
* @category CategoryName
* @author Elite Division S.r.l.
*/
$modules = [
'amministra-utenti' => [
'class' => 'mdm\admin\Module',
'layout' => "@vendor/arter/amos-core/views/layouts/admin",
//'left-menu', // it can be '@path/to/your/layout'.
'controllerMap' => [
'assignment' => [
'class' => 'mdm\admin\controllers\AssignmentController',
'userClassName' => 'common\models\User',
'idField' => 'id'
],
],
'menus' => [
'assignment' => [
'label' => 'Gestisci Assegnazioni' // TODO translate
],
]
],
'chat' => [
'class' => 'arter\amos\chat\AmosChat',
'emailMessageContentAllowedTag' => 'p,div,a[href|target],br,img[width|height|alt|src]',
],
'comments' => [
'class' => 'arter\amos\comments\AmosComments',
'layoutInverted' => true,
'enableMailsNotification' => true,
'enableNotifyCommentForDiscussions' => false,
'modelsEnabled' => [
'arter\amos\discussioni\models\DiscussioniTopic',
'arter\amos\documenti\models\Documenti',
'arter\amos\news\models\News',
'arter\amos\ticket\models\Ticket', //line to add
],
],
'comuni' => [
'class' => 'arter\amos\comuni\AmosComuni',
],
'dashboard' => [
'class' => 'arter\amos\dashboard\AmosDashboard',
'useWidgetGraphicDashboardVisible' => true
],
'discussioni' => [
'class' => 'arter\amos\discussioni\AmosDiscussioni',
'notifyOnlyContributors' => true
],
/* 'documenti' => [
'class' => 'arter\amos\documenti\AmosDocumenti',
],*/
/* 'faq' => [
'class' => 'arter\amos\faq\AmosFaq',
], */
'favorites' => [
'class' => 'arter\amos\favorites\AmosFavorites',
'modelsEnabled' => [
'arter\amos\news\models\News',
'arter\amos\documenti\models\Documenti',
'arter\amos\discussioni\models\DiscussioniTopic',
]
],
'layout' => [
'class' => 'arter\amos\layout\Module'
],
'myactivities' => [
'class' => 'arter\amos\myactivities\AmosMyActivities',
],
'news' => [
'class' => 'arter\amos\news\AmosNews',
'filterCategoriesByRole' => false,
'newsRequiredFields' => ['news_categorie_id', 'titolo', 'status', 'descrizione_breve'],
'params' => [//only for Open2
'site_featured_enabled' => false,
'site_publish_enabled' => false,
],
//'defaultCategory' => 1
'numberListTag' => 5,
],
'partnershipprofiles' => [
'class' => 'backend\modules\aster_partnership_profiles\Module',
'viewPath' => '@vendor/arter/amos-partnership-profiles/src/views',
'communityOfReferenceRequired' => false,
'disablePartProfLongStringFieldsLimits' => true,
'hideAdminsInPartProfFacilitatorSelection' => true,
'defaultListViewsExprOfInt' => ['grid', 'list'],
'fieldsConfigurations' => [
'required' => [
'title',
'short_description',
'extended_description',
'partnership_profile_date',
'expected_contribution',
'expiration_in_months',
'attrPartnershipProfilesTypesMm'
],
'tabs' => [
'tab-more-information' => true,
'tab-attachments' => true
],
'fields' => [
//tab general
'title' => true,
'short_description' => true,
'extended_description' => true,
'advantages_innovative_aspects' => false,
'expected_contribution' => true,
'partnership_profile_date' => true,
'expiration_in_months' => true,
'attrPartnershipProfilesTypesMm' => true,
'other_prospect_desired_collab' => true,
'contact_person' => true,
// tab other information
'english_title' => true,
'english_short_description' => true,
'english_extended_description' => true,
'attrPartnershipProfilesCountriesMm' => true,
'willingness_foreign_partners' => true,
'work_language_id' => true,
'other_work_language' => true,
'development_stage_id' => true,
'other_development_stage' => true,
'intellectual_property_id' => true,
'other_intellectual_property' => true
],
],
'controllerMap' => [
'partnership-profiles' => 'backend\modules\aster_partnership_profiles\controllers\PartnershipProfilesController'
],
'modelMap' => [
'PartnershipProfiles' => 'backend\modules\aster_partnership_profiles\models\PartnershipProfiles',
],
],
'privileges' => [
'class' => 'arter\amos\privileges\AmosPrivileges',
'blackListModules' => ['proposte_collaborazione', 'proposte_collaborazione_een'],
],
// 'report' => [
// 'class' => 'arter\amos\report\AmosReport',
// 'modelsEnabled' => [
// 'arter\amos\best\practice\models\BestPractice',
// ]
// ],
'search' => [
'class' => 'arter\amos\search\AmosSearch',
'modulesToSearch' => [
'bestpractice' => 'arter\amos\best\practice\models\search\BestPracticeSearch'
]
],
'slideshow' => [
'class' => 'arter\amos\slideshow\AmosSlideshow',
],
/* 'sondaggi' => [
'class' => 'arter\amos\sondaggi\AmosSondaggi',
], */
'tickets' => [
'class' => 'backend\modules\tickets\Module'
],
'upload' => [
'class' => 'arter\amos\upload\AmosUpload',
],
'workflow' => [
'class' => 'arter\amos\workflow\AmosWorkflow',
],
'ticket' => [
'class' => 'arter\amos\ticket\AmosTicket',
'disableCategory' => false,
'disableInfoFields' => true,
'disableTicketOrganization' => true,
],
// 'mobilebridge' => [ 'class' => 'arter\amos\mobile\bridge\Module' ],
];
return $modules;
<?php
/**
* Art-ER Attrattività, ricerca e territorio dell’Emilia-Romagna
* OPEN 2.0
*
* @package arter\amos\basic\template
* @category CategoryName
* @author Elite Division S.r.l.
*/
use kartik\datecontrol\Module;
return [
'datecontrol' => [
'class' => 'kartik\datecontrol\Module',
'displaySettings' => [
Module::FORMAT_DATE => 'dd-MM-yyyy',
Module::FORMAT_TIME => 'HH:mm',
Module::FORMAT_DATETIME => 'php:d-m-Y H:i',
],
// format settings for saving each date attribute (PHP format example)
'saveSettings' => [
Module::FORMAT_DATE => 'php:Y-m-d', // saves as unix timestamp
Module::FORMAT_TIME => 'php:H:i:s',
Module::FORMAT_DATETIME => 'php:Y-m-d H:i:s',
],
// set your display timezone
'displayTimezone' => 'Europe/Rome',
// set your timezone for date saved to db
'saveTimezone' => 'Europe/Rome',
'autoWidgetSettings' => [
Module::FORMAT_DATE => ['type' => 2, 'pluginOptions' => ['autoclose' => true]], // example
//Module::FORMAT_TIME => 'php:H:i:s',
//Module::FORMAT_DATETIME => 'php:Y-m-d H:i:s',
],
'widgetSettings' => [
Module::FORMAT_DATE => [
'class' => 'yii\widgets\MaskedInput', // example
'options' => [
'mask' => '99/99/9999',
'options' => ['class' => 'form-control'],
]
]
]
],
'gridview' => [
'class' => '\kartik\grid\Module'
],