Commit 90ce92ca authored by Aster's avatar Aster Committed by waltermazza
Browse files

General Bug Fixes and Improvements

parent 5628153c
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
- Added possibility to configure the widgets the are contained inside the community dashboard
### Added
...@@ -15,19 +15,19 @@ SubCommunities can be created under another community domain. ...@@ -15,19 +15,19 @@ SubCommunities can be created under another community domain.
Add community requirement in your composer.json: Add community requirement in your composer.json:
``` ```
"arter/amos-community": "dev-master", "elitedivision/amos-community": "dev-master",
``` ```
Enable the Community modules in modules-amos.php, add : Enable the Community modules in modules-amos.php, add :
``` ```
'community' => [ 'community' => [
'class' => 'arter\amos\community\AmosCommunity', 'class' => 'elitedivision\amos\community\AmosCommunity',
], ],
``` ```
add community migrations to console modules (console/config/migrations-amos.php): add community migrations to console modules (console/config/migrations-amos.php):
``` ```
'@vendor/arter/amos-community/src/migrations' '@vendor/elitedivision/amos-community/src/migrations'
``` ```
The community is suitable to be used with cwh as network. The community is suitable to be used with cwh as network.
...@@ -47,7 +47,7 @@ If some property default is not suitable for your project, you can configure it ...@@ -47,7 +47,7 @@ If some property default is not suitable for your project, you can configure it
```php ```php
'community' => [ 'community' => [
'class' => 'arter\amos\community\AmosCommunity', 'class' => 'elitedivision\amos\community\AmosCommunity',
'showSubcommunities' => false, //changed property (default was true) 'showSubcommunities' => false, //changed property (default was true)
], ],
...@@ -65,8 +65,8 @@ null if all community types are enabled, to have a fixed community type set this ...@@ -65,8 +65,8 @@ null if all community types are enabled, to have a fixed community type set this
to change default, use constants in Community type model, eg: to change default, use constants in Community type model, eg:
```php ```php
'community' => [ 'community' => [
'class' => 'arter\amos\community\AmosCommunity', 'class' => 'elitedivision\amos\community\AmosCommunity',
'communityType' => \arter\amos\community\models\CommunityType::COMMUNITY_TYPE_CLOSED, 'communityType' => \elitedivision\amos\community\models\CommunityType::COMMUNITY_TYPE_CLOSED,
], ],
``` ```
* **viewTabContents** - boolean, default = true * **viewTabContents** - boolean, default = true
...@@ -81,7 +81,7 @@ Mandatory fields in community form: by default, community name, type and descrip ...@@ -81,7 +81,7 @@ Mandatory fields in community form: by default, community name, type and descrip
If in your platform, for example, you don't want community description to be a mandatory field, overwrite communityRequiredFields property as below: If in your platform, for example, you don't want community description to be a mandatory field, overwrite communityRequiredFields property as below:
```php ```php
'community' => [ 'community' => [
'class' => 'arter\amos\community\AmosCommunity', 'class' => 'elitedivision\amos\community\AmosCommunity',
'communityRequiredFields' => ['name', 'community_type_id'] 'communityRequiredFields' => ['name', 'community_type_id']
], ],
``` ```
...@@ -89,7 +89,7 @@ If in your platform, for example, you don't want community description to be a m ...@@ -89,7 +89,7 @@ If in your platform, for example, you don't want community description to be a m
Define the models class path to hide in view of content tab, overwrite hideContentsModels property as below: Define the models class path to hide in view of content tab, overwrite hideContentsModels property as below:
```php ```php
'community' => [ 'community' => [
'class' => 'arter\amos\community\AmosCommunity', 'class' => 'elitedivision\amos\community\AmosCommunity',
'communityRequiredFields' => [ 'communityRequiredFields' => [
'model/class/path', 'model/class/path',
] ]
...@@ -116,3 +116,10 @@ It work in the some way of the previous param ...@@ -116,3 +116,10 @@ It work in the some way of the previous param
* **enableUserJoinedReportDownload** - boolean, default = false * **enableUserJoinedReportDownload** - boolean, default = false
Enable to display the "User Reports" container in community view (this will also display the "download user joined report" button inside it) Enable to display the "User Reports" container in community view (this will also display the "download user joined report" button inside it)
* **enableConfigureCommunityDashboard** - boolean, default = false
Added possibility to configure the widgets the are contained inside the community dashboard
* **autoCommunityManagerRoles** - array, default = []
All the users with the platform roles in this array, when creating a community, are added as community managers.
{ {
"name": "arter/amos-community", "name": "elitedivision/amos-community",
"description": "Sistema AMOS per le community", "description": "Sistema AMOS per le community",
"keywords": ["amos", "yii2", "community"], "keywords": ["amos", "yii2", "community"],
"homepage": "http://git.arter.it/arter/amos-community", "homepage": "http://git.elitedivision.it/elitedivision/amos-community",
"type": "component", "type": "component",
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
"support": { "support": {
"issues": "http://git.arter.it/arter/amos-community/issues", "issues": "http://git.elitedivision.it/elitedivision/amos-community/issues",
"forum": "http://www.example.com/forum/", "forum": "http://www.example.com/forum/",
"wiki": "http://git.arter.it/arter/amos-community/wikis/home", "wiki": "http://git.elitedivision.it/elitedivision/amos-community/wikis/home",
"source": "http://git.arter.it/arter/amos-community/tree/master" "source": "http://git.elitedivision.it/elitedivision/amos-community/tree/master"
}, },
"require": { "require": {
"php": ">=5.4.0", "php": ">=5.4.0",
"arter/amos-admin": "^2.0.24", "elitedivision/amos-admin": "^2.0.24",
"arter/amos-attachments": "^1.1.11", "elitedivision/amos-attachments": "^1.1.11",
"arter/amos-core": "^1.9.60", "elitedivision/amos-core": "^1.9.60",
"arter/amos-cwh": "^2.1.5", "elitedivision/amos-cwh": "^2.1.5",
"arter/amos-dashboard": "^1.8.16", "elitedivision/amos-dashboard": "^1.8.16",
"arter/amos-layout": "^1.0.33", "elitedivision/amos-layout": "^1.0.33",
"arter/amos-notify": "^1.4.13", "elitedivision/amos-notify": "^1.4.13",
"arter/amos-seo": "^1.0", "elitedivision/amos-seo": "^1.0",
"yiidoc/yii2-redactor": "*", "yiidoc/yii2-redactor": "*",
"moonlandsoft/yii2-phpexcel": "*" "moonlandsoft/yii2-phpexcel": "*"
}, },
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"arter\\amos\\community\\": "src" "elitedivision\\amos\\community\\": "src"
} }
}, },
"require-dev": { "require-dev": {
......
<?php <?php
/** /**
* Copyright 2020 Art-ER S. Cons. P.A. * Lombardia Informatica S.p.A.
* EROI - Emilia Romagna Open Innovation is based on: * OPEN 2.0
* https://www.open2.0.regione.lombardia.it
* *
* @see http://example.com Developers'community * @see http://example.com Developers'community
* @license GPLv3 * @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3 * @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
* *
* @package arter\amos\community * @package elitedivision\amos\community
* @category CategoryName * @category CategoryName
* @author Elite Division S.r.l. * @author Lombardia Informatica S.p.A.
*/ */
namespace arter\amos\community; namespace elitedivision\amos\community;
use arter\amos\community\controllers\CommunityController; use elitedivision\amos\community\controllers\CommunityController;
use arter\amos\community\exceptions\CommunityException; use elitedivision\amos\community\exceptions\CommunityException;
use arter\amos\community\models\Community; use elitedivision\amos\community\models\Community;
use arter\amos\community\models\CommunityInterface; use elitedivision\amos\community\models\CommunityInterface;
use arter\amos\community\models\CommunityUserMm; use elitedivision\amos\community\models\CommunityUserMm;
use arter\amos\community\utilities\CommunityUtil; use elitedivision\amos\community\utilities\CommunityUtil;
use arter\amos\community\utilities\EmailUtil; use elitedivision\amos\community\utilities\EmailUtil;
use arter\amos\community\widgets\icons\WidgetIconCommunity; use elitedivision\amos\community\widgets\icons\WidgetIconCommunity;
use arter\amos\community\widgets\icons\WidgetIconCommunityDashboard; use elitedivision\amos\community\widgets\icons\WidgetIconCommunityDashboard;
use arter\amos\community\widgets\icons\WidgetIconCreatedByCommunities; use elitedivision\amos\community\widgets\icons\WidgetIconCreatedByCommunities;
use arter\amos\community\widgets\icons\WidgetIconMyCommunities; use elitedivision\amos\community\widgets\icons\WidgetIconMyCommunities;
use arter\amos\community\widgets\icons\WidgetIconToValidateCommunities; use elitedivision\amos\community\widgets\icons\WidgetIconToValidateCommunities;
use arter\amos\core\interfaces\CmsModuleInterface; use elitedivision\amos\core\interfaces\CmsModuleInterface;
use arter\amos\core\interfaces\InvitationExternalInterface; use elitedivision\amos\core\interfaces\InvitationExternalInterface;
use arter\amos\core\interfaces\SearchModuleInterface; use elitedivision\amos\core\interfaces\SearchModuleInterface;
use arter\amos\core\module\AmosModule; use elitedivision\amos\core\module\AmosModule;
use arter\amos\core\module\ModuleInterface; use elitedivision\amos\core\module\ModuleInterface;
use arter\amos\core\record\Record; use elitedivision\amos\core\record\Record;
use arter\amos\core\user\User; use elitedivision\amos\core\user\User;
use yii\db\ActiveQuery; use yii\db\ActiveQuery;
use yii\log\Logger; use yii\log\Logger;
/** /**
* Class AmosCommunity * Class AmosCommunity
* community module definition class * community module definition class
* @package arter\amos\community * @package elitedivision\amos\community
*/ */
class AmosCommunity extends AmosModule implements ModuleInterface, SearchModuleInterface, CmsModuleInterface, InvitationExternalInterface class AmosCommunity extends AmosModule implements ModuleInterface, SearchModuleInterface, CmsModuleInterface, InvitationExternalInterface
{ {
...@@ -57,7 +57,7 @@ class AmosCommunity extends AmosModule implements ModuleInterface, SearchModuleI ...@@ -57,7 +57,7 @@ class AmosCommunity extends AmosModule implements ModuleInterface, SearchModuleI
/** /**
* @inheritdoc * @inheritdoc
*/ */
public $controllerNamespace = 'arter\amos\community\controllers'; public $controllerNamespace = 'elitedivision\amos\community\controllers';
public $newFileMode = 0666; public $newFileMode = 0666;
public $name = 'Community'; public $name = 'Community';
...@@ -119,9 +119,9 @@ class AmosCommunity extends AmosModule implements ModuleInterface, SearchModuleI ...@@ -119,9 +119,9 @@ class AmosCommunity extends AmosModule implements ModuleInterface, SearchModuleI
* @var array $hideContentsModels - hide this models in tab contents * @var array $hideContentsModels - hide this models in tab contents
*/ */
public $hideContentsModels = [ public $hideContentsModels = [
'arter\amos\showcaseprojects\models\ShowcaseProject', 'elitedivision\amos\showcaseprojects\models\ShowcaseProject',
'arter\amos\een\models\EenPartnershipProposal', 'elitedivision\amos\een\models\EenPartnershipProposal',
'arter\amos\events\models\Event', 'elitedivision\amos\events\models\Event',
]; ];
/** /**
...@@ -164,6 +164,11 @@ class AmosCommunity extends AmosModule implements ModuleInterface, SearchModuleI ...@@ -164,6 +164,11 @@ class AmosCommunity extends AmosModule implements ModuleInterface, SearchModuleI
*/ */
public $forceDefaultViewType = false; public $forceDefaultViewType = false;
/**
* @var bool $enableOpenJoin
*/
public $enableOpenJoin = false;
/** /**
* @var bool $enableUserJoinedReportDownload Enable to display the "download user joined report" button * @var bool $enableUserJoinedReportDownload Enable to display the "download user joined report" button
*/ */
...@@ -206,6 +211,11 @@ class AmosCommunity extends AmosModule implements ModuleInterface, SearchModuleI ...@@ -206,6 +211,11 @@ class AmosCommunity extends AmosModule implements ModuleInterface, SearchModuleI
*/ */
public $autoCommunityManagerRoles = []; public $autoCommunityManagerRoles = [];
/**
* @var array $communityContextsToSearch In this array you can configure which communities you want to see in the plugin lists by configure the community contexts.
*/
public $communityContextsToSearch = [];
/** /**
* @inheritdoc * @inheritdoc
*/ */
...@@ -220,10 +230,13 @@ class AmosCommunity extends AmosModule implements ModuleInterface, SearchModuleI ...@@ -220,10 +230,13 @@ class AmosCommunity extends AmosModule implements ModuleInterface, SearchModuleI
public function init() public function init()
{ {
parent::init(); parent::init();
\Yii::setAlias('@arter/amos/' . static::getModuleName() . '/controllers', __DIR__ . '/controllers/'); \Yii::setAlias('@elitedivision/amos/' . static::getModuleName() . '/controllers', __DIR__ . '/controllers/');
// 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 . self::$CONFIG_FOLDER . DIRECTORY_SEPARATOR . 'config.php')); \Yii::configure($this, require(__DIR__ . DIRECTORY_SEPARATOR . self::$CONFIG_FOLDER . DIRECTORY_SEPARATOR . 'config.php'));
$this->autoCommunityManagerRoles = array_unique($this->autoCommunityManagerRoles); $this->autoCommunityManagerRoles = array_unique($this->autoCommunityManagerRoles);
if (empty($this->communityContextsToSearch)) {
$this->communityContextsToSearch = [$this->model('Community')];
}
} }
/** /**
...@@ -279,7 +292,7 @@ class AmosCommunity extends AmosModule implements ModuleInterface, SearchModuleI ...@@ -279,7 +292,7 @@ class AmosCommunity extends AmosModule implements ModuleInterface, SearchModuleI
* @param string $context * @param string $context
* @param string $managerRole * @param string $managerRole
* @param string $description * @param string $description
* @param \arter\amos\core\record\Record|null $model * @param \elitedivision\amos\core\record\Record|null $model
* @param string $managerStatus * @param string $managerStatus
* @param int|null $managerId * @param int|null $managerId
* @return int * @return int
......
<?php <?php
/** /**
* Copyright 2020 Art-ER S. Cons. P.A. * Lombardia Informatica S.p.A.
* EROI - Emilia Romagna Open Innovation is based on: * OPEN 2.0
* https://www.open2.0.regione.lombardia.it
* *
* @see http://example.com Developers'community * @see http://example.com Developers'community
* @license GPLv3 * @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3 * @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
* *
* @package arter\amos\ * @package elitedivision\amos\
* @category CategoryName * @category CategoryName
* @author Elite Division S.r.l. * @author Lombardia Informatica S.p.A.
*/ */
/* @var $this \yii\web\View */ /* @var $this \yii\web\View */
<?php <?php
/** /**
* Copyright 2020 Art-ER S. Cons. P.A. * Lombardia Informatica S.p.A.
* EROI - Emilia Romagna Open Innovation is based on: * OPEN 2.0
* https://www.open2.0.regione.lombardia.it
* *
* @see http://example.com Developers'community * @see http://example.com Developers'community
* @license GPLv3 * @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3 * @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
* *
* @package arter\amos\community * @package elitedivision\amos\community
* @category CategoryName * @category CategoryName
* @author Elite Division S.r.l. * @author Lombardia Informatica S.p.A.
*/ */
namespace arter\amos\community\assets; namespace elitedivision\amos\community\assets;
use yii\web\AssetBundle; use yii\web\AssetBundle;
use arter\amos\core\widget\WidgetAbstract; use elitedivision\amos\core\widget\WidgetAbstract;
/** /**
* Class AmosCommunityAsset * Class AmosCommunityAsset
* @package arter\amos\community\assets * @package elitedivision\amos\community\assets
*/ */
class AmosCommunityAsset extends AssetBundle class AmosCommunityAsset extends AssetBundle
{ {
public $sourcePath = '@vendor/arter/amos-community/src/assets/web'; public $sourcePath = '@vendor/elitedivision/amos-community/src/assets/web';
public $js = [ public $js = [
'js/community.js' 'js/community.js'
...@@ -46,13 +46,13 @@ class AmosCommunityAsset extends AssetBundle ...@@ -46,13 +46,13 @@ class AmosCommunityAsset extends AssetBundle
if(!empty($moduleL)) if(!empty($moduleL))
{ {
$this->depends [] = 'arter\amos\layout\assets\BaseAsset'; $this->depends [] = 'elitedivision\amos\layout\assets\BaseAsset';
$this->depends [] = 'arter\amos\layout\assets\SpinnerWaitAsset'; $this->depends [] = 'elitedivision\amos\layout\assets\SpinnerWaitAsset';
} }
else else
{ {
$this->depends [] = 'arter\amos\core\views\assets\AmosCoreAsset'; $this->depends [] = 'elitedivision\amos\core\views\assets\AmosCoreAsset';
$this->depends [] = 'arter\amos\core\views\assets\SpinnerWaitAsset'; $this->depends [] = 'elitedivision\amos\core\views\assets\SpinnerWaitAsset';
} }
parent::init(); parent::init();
} }
......
/** /**
IMPORT AMOS-LAYOUT VARIABLES IMPORT AMOS-LAYOUT VARIABLES
*/ */
@import (optional) "../../vendor/arter/amos-layout/src/assets/resources/base/less/variables.less"; @import (optional) "../../vendor/elitedivision/amos-layout/src/assets/resources/base/less/variables.less";
@import (optional) "../../vendor/arter/amos-layout/src/assets/resources/base/less/utility.less"; @import (optional) "../../vendor/elitedivision/amos-layout/src/assets/resources/base/less/utility.less";
/** /**
IMPORT STYLE-CUSTOM IMPORT STYLE-CUSTOM
*/ */
......
/** /**
IMPORT AMOS-LAYOUT VARIABLES IMPORT AMOS-LAYOUT VARIABLES
*/ */
@import (optional) "../../vendor/arter/amos-layout/src/assets/resources/base/less/v2/variables.less"; @import (optional) "../../vendor/elitedivision/amos-layout/src/assets/resources/base/less/v2/variables.less";
@import (optional) "../../vendor/arter/amos-layout/src/assets/resources/base/less/v2/utility.less"; @import (optional) "../../vendor/elitedivision/amos-layout/src/assets/resources/base/less/v2/utility.less";
/** /**
IMPORT STYLE-CUSTOM IMPORT STYLE-CUSTOM
...@@ -27,9 +27,10 @@ COMMUNITY DASHBOARD ...@@ -27,9 +27,10 @@ COMMUNITY DASHBOARD
*/ */
.community-page { .community-page {
background-color: darken(@widget-background-color-default, 10%); background-color: darken(@widget-background-color-default, 10%);
.breadcrumb { .breadcrumb {
background-color: @widget-background-color-default; background-color: @widget-background-color-default;
padding: 30px 10% 15px; padding: 15px 10%;
border-radius: 0; border-radius: 0;
} }
} }
...@@ -42,70 +43,94 @@ COMMUNITY DASHBOARD ...@@ -42,70 +43,94 @@ COMMUNITY DASHBOARD
.network-breadcrumb, .network-breadcrumb,
.community-dashboard-container { .community-dashboard-container {
background-color: #474145; background-color: #474145;
//background-color: rgba(0, 0, 0, 0.5);
@media screen and (min-width: 768px) {
> nav {
padding-top: 25px !important;
padding-bottom: 25px !important;
+ .sub-dashboard-graphics{
margin-top: 0;
}
}
}
} }
.community-network-container { .community-network-container {
.network-box { .network-box {
min-height: unset; min-height: unset;
> img {
>img {
position: absolute; position: absolute;
} }
.network-infos { .network-infos {
position: relative; position: relative;
.flexbox; .flexbox;
top: 0; top: 0;
padding: 0 !important; padding: 0 !important;
.container-custom { .container-custom {
.flexbox; .flexbox;
width: 100%; width: 100%;
@media (max-width: @smartphone-only) {
.flexbox-column;
}
.header-community { .header-community {
.flexbox; .flexbox;
flex-direction: column; flex-direction: column;
//justify-content: space-between; //justify-content: space-between;
width: 33.333%; width: 33.333%;
background-color: rgba(0, 0, 0, 0.4); background-color: rgba(0, 0, 0, 0.4);
padding: 30px 0 15px 0; padding: 30px 30px 15px;
@media (min-width: @tablet) { // @media (min-width: @tablet) {
width: 70%; // width: 70%;
} // }
@media (min-width: @desktop) { // @media (min-width: @desktop) {
width: 50%; // width: 50%;
} // }
@media (min-width: @desktop-large) { // @media (min-width: @desktop-large) {
width: 33.333%; // width: 33.333%;
} // }
@media (max-width: @smartphone-only) { @media (max-width: @smartphone-only) {
width: 100%; width: 100%;
padding: 15px 0;
} }
.poster-community { .poster-community {
background: @white-color; background: @white-color;
margin: 0 30px; margin: 0;
@media (max-width: @smartphone-only) { @media (max-width: @smartphone-only) {
height: 40%; height: 40%;
} }
} }
.control-community { .control-community {
padding: 0 30px 20px;