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.
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 :
```
'community' => [
'class' => 'arter\amos\community\AmosCommunity',
'class' => 'elitedivision\amos\community\AmosCommunity',
],
```
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.
......@@ -47,7 +47,7 @@ If some property default is not suitable for your project, you can configure it
```php
'community' => [
'class' => 'arter\amos\community\AmosCommunity',
'class' => 'elitedivision\amos\community\AmosCommunity',
'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
to change default, use constants in Community type model, eg:
```php
'community' => [
'class' => 'arter\amos\community\AmosCommunity',
'communityType' => \arter\amos\community\models\CommunityType::COMMUNITY_TYPE_CLOSED,
'class' => 'elitedivision\amos\community\AmosCommunity',
'communityType' => \elitedivision\amos\community\models\CommunityType::COMMUNITY_TYPE_CLOSED,
],
```
* **viewTabContents** - boolean, default = true
......@@ -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:
```php
'community' => [
'class' => 'arter\amos\community\AmosCommunity',
'class' => 'elitedivision\amos\community\AmosCommunity',
'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
Define the models class path to hide in view of content tab, overwrite hideContentsModels property as below:
```php
'community' => [
'class' => 'arter\amos\community\AmosCommunity',
'class' => 'elitedivision\amos\community\AmosCommunity',
'communityRequiredFields' => [
'model/class/path',
]
......@@ -116,3 +116,10 @@ It work in the some way of the previous param
* **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)
* **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",
"keywords": ["amos", "yii2", "community"],
"homepage": "http://git.arter.it/arter/amos-community",
"homepage": "http://git.elitedivision.it/elitedivision/amos-community",
"type": "component",
"license": "BSD-3-Clause",
"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/",
"wiki": "http://git.arter.it/arter/amos-community/wikis/home",
"source": "http://git.arter.it/arter/amos-community/tree/master"
"wiki": "http://git.elitedivision.it/elitedivision/amos-community/wikis/home",
"source": "http://git.elitedivision.it/elitedivision/amos-community/tree/master"
},
"require": {
"php": ">=5.4.0",
"arter/amos-admin": "^2.0.24",
"arter/amos-attachments": "^1.1.11",
"arter/amos-core": "^1.9.60",
"arter/amos-cwh": "^2.1.5",
"arter/amos-dashboard": "^1.8.16",
"arter/amos-layout": "^1.0.33",
"arter/amos-notify": "^1.4.13",
"arter/amos-seo": "^1.0",
"elitedivision/amos-admin": "^2.0.24",
"elitedivision/amos-attachments": "^1.1.11",
"elitedivision/amos-core": "^1.9.60",
"elitedivision/amos-cwh": "^2.1.5",
"elitedivision/amos-dashboard": "^1.8.16",
"elitedivision/amos-layout": "^1.0.33",
"elitedivision/amos-notify": "^1.4.13",
"elitedivision/amos-seo": "^1.0",
"yiidoc/yii2-redactor": "*",
"moonlandsoft/yii2-phpexcel": "*"
},
......@@ -36,7 +36,7 @@
},
"autoload": {
"psr-4": {
"arter\\amos\\community\\": "src"
"elitedivision\\amos\\community\\": "src"
}
},
"require-dev": {
......
<?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\community
* @package elitedivision\amos\community
* @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 arter\amos\community\exceptions\CommunityException;
use arter\amos\community\models\Community;
use arter\amos\community\models\CommunityInterface;
use arter\amos\community\models\CommunityUserMm;
use arter\amos\community\utilities\CommunityUtil;
use arter\amos\community\utilities\EmailUtil;
use arter\amos\community\widgets\icons\WidgetIconCommunity;
use arter\amos\community\widgets\icons\WidgetIconCommunityDashboard;
use arter\amos\community\widgets\icons\WidgetIconCreatedByCommunities;
use arter\amos\community\widgets\icons\WidgetIconMyCommunities;
use arter\amos\community\widgets\icons\WidgetIconToValidateCommunities;
use arter\amos\core\interfaces\CmsModuleInterface;
use arter\amos\core\interfaces\InvitationExternalInterface;
use arter\amos\core\interfaces\SearchModuleInterface;
use arter\amos\core\module\AmosModule;
use arter\amos\core\module\ModuleInterface;
use arter\amos\core\record\Record;
use arter\amos\core\user\User;
use elitedivision\amos\community\controllers\CommunityController;
use elitedivision\amos\community\exceptions\CommunityException;
use elitedivision\amos\community\models\Community;
use elitedivision\amos\community\models\CommunityInterface;
use elitedivision\amos\community\models\CommunityUserMm;
use elitedivision\amos\community\utilities\CommunityUtil;
use elitedivision\amos\community\utilities\EmailUtil;
use elitedivision\amos\community\widgets\icons\WidgetIconCommunity;
use elitedivision\amos\community\widgets\icons\WidgetIconCommunityDashboard;
use elitedivision\amos\community\widgets\icons\WidgetIconCreatedByCommunities;
use elitedivision\amos\community\widgets\icons\WidgetIconMyCommunities;
use elitedivision\amos\community\widgets\icons\WidgetIconToValidateCommunities;
use elitedivision\amos\core\interfaces\CmsModuleInterface;
use elitedivision\amos\core\interfaces\InvitationExternalInterface;
use elitedivision\amos\core\interfaces\SearchModuleInterface;
use elitedivision\amos\core\module\AmosModule;
use elitedivision\amos\core\module\ModuleInterface;
use elitedivision\amos\core\record\Record;
use elitedivision\amos\core\user\User;
use yii\db\ActiveQuery;
use yii\log\Logger;
/**
* Class AmosCommunity
* community module definition class
* @package arter\amos\community
* @package elitedivision\amos\community
*/
class AmosCommunity extends AmosModule implements ModuleInterface, SearchModuleInterface, CmsModuleInterface, InvitationExternalInterface
{
......@@ -57,7 +57,7 @@ class AmosCommunity extends AmosModule implements ModuleInterface, SearchModuleI
/**
* @inheritdoc
*/
public $controllerNamespace = 'arter\amos\community\controllers';
public $controllerNamespace = 'elitedivision\amos\community\controllers';
public $newFileMode = 0666;
public $name = 'Community';
......@@ -119,9 +119,9 @@ class AmosCommunity extends AmosModule implements ModuleInterface, SearchModuleI
* @var array $hideContentsModels - hide this models in tab contents
*/
public $hideContentsModels = [
'arter\amos\showcaseprojects\models\ShowcaseProject',
'arter\amos\een\models\EenPartnershipProposal',
'arter\amos\events\models\Event',
'elitedivision\amos\showcaseprojects\models\ShowcaseProject',
'elitedivision\amos\een\models\EenPartnershipProposal',
'elitedivision\amos\events\models\Event',
];
/**
......@@ -164,6 +164,11 @@ class AmosCommunity extends AmosModule implements ModuleInterface, SearchModuleI
*/
public $forceDefaultViewType = false;
/**
* @var bool $enableOpenJoin
*/
public $enableOpenJoin = false;
/**
* @var bool $enableUserJoinedReportDownload Enable to display the "download user joined report" button
*/
......@@ -206,6 +211,11 @@ class AmosCommunity extends AmosModule implements ModuleInterface, SearchModuleI
*/
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
*/
......@@ -220,10 +230,13 @@ class AmosCommunity extends AmosModule implements ModuleInterface, SearchModuleI
public function 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
\Yii::configure($this, require(__DIR__ . DIRECTORY_SEPARATOR . self::$CONFIG_FOLDER . DIRECTORY_SEPARATOR . 'config.php'));
$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
* @param string $context
* @param string $managerRole
* @param string $description
* @param \arter\amos\core\record\Record|null $model
* @param \elitedivision\amos\core\record\Record|null $model
* @param string $managerStatus
* @param int|null $managerId
* @return int
......
<?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\
* @package elitedivision\amos\
* @category CategoryName
* @author Elite Division S.r.l.
* @author Lombardia Informatica S.p.A.
*/
/* @var $this \yii\web\View */
<?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\community
* @package elitedivision\amos\community
* @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 arter\amos\core\widget\WidgetAbstract;
use elitedivision\amos\core\widget\WidgetAbstract;
/**
* Class AmosCommunityAsset
* @package arter\amos\community\assets
* @package elitedivision\amos\community\assets
*/
class AmosCommunityAsset extends AssetBundle
{
public $sourcePath = '@vendor/arter/amos-community/src/assets/web';
public $sourcePath = '@vendor/elitedivision/amos-community/src/assets/web';
public $js = [
'js/community.js'
......@@ -46,13 +46,13 @@ class AmosCommunityAsset extends AssetBundle
if(!empty($moduleL))
{
$this->depends [] = 'arter\amos\layout\assets\BaseAsset';
$this->depends [] = 'arter\amos\layout\assets\SpinnerWaitAsset';
$this->depends [] = 'elitedivision\amos\layout\assets\BaseAsset';
$this->depends [] = 'elitedivision\amos\layout\assets\SpinnerWaitAsset';
}
else
{
$this->depends [] = 'arter\amos\core\views\assets\AmosCoreAsset';
$this->depends [] = 'arter\amos\core\views\assets\SpinnerWaitAsset';
$this->depends [] = 'elitedivision\amos\core\views\assets\AmosCoreAsset';
$this->depends [] = 'elitedivision\amos\core\views\assets\SpinnerWaitAsset';
}
parent::init();
}
......
/**
IMPORT AMOS-LAYOUT VARIABLES
*/
@import (optional) "../../vendor/arter/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/variables.less";
@import (optional) "../../vendor/elitedivision/amos-layout/src/assets/resources/base/less/utility.less";
/**
IMPORT STYLE-CUSTOM
*/
......
/**
IMPORT AMOS-LAYOUT VARIABLES
*/
@import (optional) "../../vendor/arter/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/variables.less";
@import (optional) "../../vendor/elitedivision/amos-layout/src/assets/resources/base/less/v2/utility.less";
/**
IMPORT STYLE-CUSTOM
......@@ -27,9 +27,10 @@ COMMUNITY DASHBOARD
*/
.community-page {
background-color: darken(@widget-background-color-default, 10%);
.breadcrumb {
background-color: @widget-background-color-default;
padding: 30px 10% 15px;
padding: 15px 10%;
border-radius: 0;
}
}
......@@ -42,70 +43,94 @@ COMMUNITY DASHBOARD
.network-breadcrumb,
.community-dashboard-container {
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 {
.network-box {
min-height: unset;
> img {
>img {
position: absolute;
}
.network-infos {
position: relative;
.flexbox;
top: 0;
padding: 0 !important;
.container-custom {
.flexbox;
width: 100%;
@media (max-width: @smartphone-only) {
.flexbox-column;
}
.header-community {
.flexbox;
flex-direction: column;
//justify-content: space-between;
width: 33.333%;
background-color: rgba(0, 0, 0, 0.4);
padding: 30px 0 15px 0;
padding: 30px 30px 15px;
@media (min-width: @tablet) {
width: 70%;
}
// @media (min-width: @tablet) {
// width: 70%;
// }
@media (min-width: @desktop) {
width: 50%;
}
// @media (min-width: @desktop) {
// width: 50%;
// }
@media (min-width: @desktop-large) {
width: 33.333%;
}
// @media (min-width: @desktop-large) {
// width: 33.333%;
// }
@media (max-width: @smartphone-only) {
width: 100%;
padding: 15px 0;
}
.poster-community {
background: @white-color;
margin: 0 30px;
margin: 0;
@media (max-width: @smartphone-only) {
height: 40%;
}
}
.control-community {
padding: 0 30px 20px;
padding: 0;
}
.network-footer {
padding: 15px 30px 0 20px;
border-top: 1px solid #404040;
padding: 30px 0 0;
border: none;
.flexbox;
margin-top: auto;
margin: 0;
justify-content: space-between;
.back-to-dashboard + .btn.btn-icon,
align-items: center;
@media (max-width: @smartphone-only) {
padding: 15px;
flex-wrap: wrap;
}
.btn.btn-icon,
.wrap-icons .amos-tooltip,
.wrap-icons .report-dropdown .btn,
.wrap-icons .manage-network-scope .manage-menu {
color: #ffffff;
color: @white-color;
background: transparent;
border: none;
position: relative;
......@@ -115,7 +140,8 @@ COMMUNITY DASHBOARD
padding: 0;
display: block;
margin-top: 0;
> .ic {
>.ic {
width: 28px;
height: 28px;
display: block;
......@@ -134,23 +160,65 @@ COMMUNITY DASHBOARD
padding: 0px 5px;
left: 18px;
top: -8px;
+ .caret {
+.caret {
display: none;
}
}
}
.manage-network-scope {
width: 26px;
.ic-settings {
}
.ic-settings {}
}
}
}
.network-name > a {
.header-right-community {
background-color: rgba(0, 0, 0, 0.4);
padding: 30px 30px 15px;
width: 70%;
p > a{
color: @white-color;
}
@media (max-width: @smartphone-only) {
width: 100%;
padding: 15px;
}
}
.action-community {
width: 100%;
position: relative;
display: block;
margin: 0;
padding: 30px 0 0;
@media (max-width: @smartphone-only) {
width: 100%;
padding: 15px 0 0;
}
.back-to-dashboard {
width: 100%;
display: block;
text-align: center;
}
.enter-community{
background: #FFBB00;
color: contrast(#FFBB00);
padding: @padding-min @padding-default;
}
}
.network-name{
margin-top: 0;
}
.network-name>a {
font-size: 0.8em;
text-decoration: none;
}
.community-status {
text-transform: uppercase;
......@@ -181,12 +249,6 @@ COMMUNITY DASHBOARD
}
}
}
/*.btn {
font-size: 2em;
padding: 0;
line-height: 0;
color: @white-color;
}*/
}
}
}
......@@ -200,6 +262,7 @@ COMMUNITY INDEX
.hierarchy {
float: left;
margin-right: @margin-min;
.am-long-arrow-return {
transform: scaleX(-1);
-moz-transform: scaleX(-1);
......@@ -224,58 +287,72 @@ COMMUNITY CARD VIEW
border: solid @border-color-default 1px;
background: @white-color;
height: auto;
.icon-header {
height: 150px;
background-color: @community-card-background-header;
position: relative;
.manage {
margin: 0;
position: absolute;
right: 0;
z-index: 3;
background: @white-color;
.manage-menu {
color: @secondary-color;
padding-top: @padding-min;
padding-bottom: @padding-min;
&:hover {
border-radius: 0; /* override */
border-radius: 0;
/* override */
}
}
}
.community-image {
height: 200px;
overflow: hidden;
.img-responsive {
margin: 0 auto;
}
}
}
.icon-body {
padding: @padding-min @padding-medium;
text-align: left;