Commit 462cc36c authored by Aster's avatar Aster Committed by waltermazza
Browse files

General Bug Fixes and Improvements

parent 90ce92ca
......@@ -15,19 +15,19 @@ SubCommunities can be created under another community domain.
Add community requirement in your composer.json:
```
"elitedivision/amos-community": "dev-master",
"arter/amos-community": "dev-master",
```
Enable the Community modules in modules-amos.php, add :
```
'community' => [
'class' => 'elitedivision\amos\community\AmosCommunity',
'class' => 'arter\amos\community\AmosCommunity',
],
```
add community migrations to console modules (console/config/migrations-amos.php):
```
'@vendor/elitedivision/amos-community/src/migrations'
'@vendor/arter/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' => 'elitedivision\amos\community\AmosCommunity',
'class' => 'arter\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' => 'elitedivision\amos\community\AmosCommunity',
'communityType' => \elitedivision\amos\community\models\CommunityType::COMMUNITY_TYPE_CLOSED,
'class' => 'arter\amos\community\AmosCommunity',
'communityType' => \arter\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' => 'elitedivision\amos\community\AmosCommunity',
'class' => 'arter\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' => 'elitedivision\amos\community\AmosCommunity',
'class' => 'arter\amos\community\AmosCommunity',
'communityRequiredFields' => [
'model/class/path',
]
......
{
"name": "elitedivision/amos-community",
"name": "arter/amos-community",
"description": "Sistema AMOS per le community",
"keywords": ["amos", "yii2", "community"],
"homepage": "http://git.elitedivision.it/elitedivision/amos-community",
"homepage": "http://git.arter.it/arter/amos-community",
"type": "component",
"license": "BSD-3-Clause",
"proscription": "BSD-3-Clause",
"support": {
"issues": "http://git.elitedivision.it/elitedivision/amos-community/issues",
"issues": "http://git.arter.it/arter/amos-community/issues",
"forum": "http://www.example.com/forum/",
"wiki": "http://git.elitedivision.it/elitedivision/amos-community/wikis/home",
"source": "http://git.elitedivision.it/elitedivision/amos-community/tree/master"
"wiki": "http://git.arter.it/arter/amos-community/wikis/home",
"source": "http://git.arter.it/arter/amos-community/tree/master"
},
"require": {
"php": ">=5.4.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",
"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",
"yiidoc/yii2-redactor": "*",
"moonlandsoft/yii2-phpexcel": "*"
},
......@@ -36,7 +36,7 @@
},
"autoload": {
"psr-4": {
"elitedivision\\amos\\community\\": "src"
"arter\\amos\\community\\": "src"
}
},
"require-dev": {
......
<?php
/**
* Lombardia Informatica S.p.A.
* OPEN 2.0
* Emilia Romagna Open Innovation
* Arter
*
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package elitedivision\amos\community
* @package arter\amos\community
* @category CategoryName
* @author Lombardia Informatica S.p.A.
*/
namespace elitedivision\amos\community;
namespace arter\amos\community;
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 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 yii\db\ActiveQuery;
use yii\log\Logger;
/**
* Class AmosCommunity
* community module definition class
* @package elitedivision\amos\community
* @package arter\amos\community
*/
class AmosCommunity extends AmosModule implements ModuleInterface, SearchModuleInterface, CmsModuleInterface, InvitationExternalInterface
{
......@@ -57,7 +53,7 @@ class AmosCommunity extends AmosModule implements ModuleInterface, SearchModuleI
/**
* @inheritdoc
*/
public $controllerNamespace = 'elitedivision\amos\community\controllers';
public $controllerNamespace = 'arter\amos\community\controllers';
public $newFileMode = 0666;
public $name = 'Community';
......@@ -119,9 +115,9 @@ class AmosCommunity extends AmosModule implements ModuleInterface, SearchModuleI
* @var array $hideContentsModels - hide this models in tab contents
*/
public $hideContentsModels = [
'elitedivision\amos\showcaseprojects\models\ShowcaseProject',
'elitedivision\amos\een\models\EenPartnershipProposal',
'elitedivision\amos\events\models\Event',
'arter\amos\showcaseprojects\models\ShowcaseProject',
'arter\amos\een\models\EenPartnershipProposal',
'arter\amos\events\models\Event',
];
/**
......@@ -230,7 +226,7 @@ class AmosCommunity extends AmosModule implements ModuleInterface, SearchModuleI
public function init()
{
parent::init();
\Yii::setAlias('@elitedivision/amos/' . static::getModuleName() . '/controllers', __DIR__ . '/controllers/');
\Yii::setAlias('@arter/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);
......@@ -292,7 +288,7 @@ class AmosCommunity extends AmosModule implements ModuleInterface, SearchModuleI
* @param string $context
* @param string $managerRole
* @param string $description
* @param \elitedivision\amos\core\record\Record|null $model
* @param \arter\amos\core\record\Record|null $model
* @param string $managerStatus
* @param int|null $managerId
* @return int
......
<?php
/**
* Lombardia Informatica S.p.A.
* OPEN 2.0
* Emilia Romagna Open Innovation
* Arter
*
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package elitedivision\amos\
* @package arter\amos\
* @category CategoryName
* @author Lombardia Informatica S.p.A.
*/
/* @var $this \yii\web\View */
<?php
/**
* Lombardia Informatica S.p.A.
* OPEN 2.0
* Emilia Romagna Open Innovation
* Arter
*
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package elitedivision\amos\community
* @package arter\amos\community
* @category CategoryName
* @author Lombardia Informatica S.p.A.
*/
namespace elitedivision\amos\community\assets;
namespace arter\amos\community\assets;
use yii\web\AssetBundle;
use elitedivision\amos\core\widget\WidgetAbstract;
use arter\amos\core\widget\WidgetAbstract;
/**
* Class AmosCommunityAsset
* @package elitedivision\amos\community\assets
* @package arter\amos\community\assets
*/
class AmosCommunityAsset extends AssetBundle
{
public $sourcePath = '@vendor/elitedivision/amos-community/src/assets/web';
public $sourcePath = '@vendor/arter/amos-community/src/assets/web';
public $js = [
'js/community.js'
......@@ -46,13 +42,13 @@ class AmosCommunityAsset extends AssetBundle
if(!empty($moduleL))
{
$this->depends [] = 'elitedivision\amos\layout\assets\BaseAsset';
$this->depends [] = 'elitedivision\amos\layout\assets\SpinnerWaitAsset';
$this->depends [] = 'arter\amos\layout\assets\BaseAsset';
$this->depends [] = 'arter\amos\layout\assets\SpinnerWaitAsset';
}
else
{
$this->depends [] = 'elitedivision\amos\core\views\assets\AmosCoreAsset';
$this->depends [] = 'elitedivision\amos\core\views\assets\SpinnerWaitAsset';
$this->depends [] = 'arter\amos\core\views\assets\AmosCoreAsset';
$this->depends [] = 'arter\amos\core\views\assets\SpinnerWaitAsset';
}
parent::init();
}
......
/**
IMPORT AMOS-LAYOUT VARIABLES
*/
@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 (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 STYLE-CUSTOM
*/
......
/**
IMPORT AMOS-LAYOUT VARIABLES
*/
@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 (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 STYLE-CUSTOM
......
<?php
/**
* Lombardia Informatica S.p.A.
* OPEN 2.0
* Emilia Romagna Open Innovation
* Arter
*
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package elitedivision\amos\community\components
* @package arter\amos\community\components
* @category CategoryName
* @author Lombardia Informatica S.p.A.
*/
namespace elitedivision\amos\community\components;
namespace arter\amos\community\components;
use elitedivision\amos\community\AmosCommunity;
use elitedivision\amos\community\models\Community;
use elitedivision\amos\core\components\PartQuestionarioAbstract;
use arter\amos\community\AmosCommunity;
use arter\amos\community\models\Community;
use arter\amos\core\components\PartQuestionarioAbstract;
use Yii;
use yii\helpers\ArrayHelper;
......@@ -25,7 +21,7 @@ use yii\helpers\ArrayHelper;
* Class PartsFormCommunity
*
* defines the steps for creation/update of community instances
* @package elitedivision\amos\community\components
* @package arter\amos\community\components
*/
class PartsFormCommunity extends PartQuestionarioAbstract
{
......
<?php
/**
* Lombardia Informatica S.p.A.
* OPEN 2.0
* Emilia Romagna Open Innovation
* Arter
*
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package elitedivision\amos\community
* @package arter\amos\community
* @category CategoryName
* @author Lombardia Informatica S.p.A.
*/
return [
......
<?php
/**
* Lombardia Informatica S.p.A.
* OPEN 2.0
* Emilia Romagna Open Innovation
* Arter
*
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package elitedivision\amos\community
* @package arter\amos\community
* @category CategoryName
* @author Lombardia Informatica S.p.A.
*/
namespace elitedivision\amos\community\controllers;
use elitedivision\amos\admin\models\UserProfile;
use elitedivision\amos\community\AmosCommunity;
use elitedivision\amos\community\models\Community;
use elitedivision\amos\community\models\CommunityType;
use elitedivision\amos\community\models\CommunityUserMm;
use elitedivision\amos\community\models\RegisterForm;
use elitedivision\amos\community\rbac\UpdateOwnCommunityProfile;
use elitedivision\amos\community\utilities\CommunityUtil;
use elitedivision\amos\community\utilities\EmailUtil;
use elitedivision\amos\community\widgets\icons\WidgetIconAdminAllCommunity;
use elitedivision\amos\community\widgets\icons\WidgetIconCommunity;
use elitedivision\amos\community\widgets\icons\WidgetIconCreatedByCommunities;
use elitedivision\amos\community\widgets\icons\WidgetIconMyCommunities;
use elitedivision\amos\community\widgets\icons\WidgetIconMyCommunitiesWithTags;
use elitedivision\amos\community\widgets\icons\WidgetIconToValidateCommunities;
use elitedivision\amos\core\forms\editors\m2mWidget\controllers\M2MWidgetControllerTrait;
use elitedivision\amos\core\forms\editors\m2mWidget\M2MEventsEnum;
use elitedivision\amos\core\helpers\Html;
use elitedivision\amos\core\icons\AmosIcons;
use elitedivision\amos\core\module\BaseAmosModule;
use elitedivision\amos\core\user\User;
use elitedivision\amos\core\utilities\Email;
use elitedivision\amos\core\utilities\SpreadSheetFactory;
namespace arter\amos\community\controllers;
use arter\amos\admin\models\UserProfile;
use arter\amos\community\AmosCommunity;
use arter\amos\community\models\Community;
use arter\amos\community\models\CommunityType;
use arter\amos\community\models\CommunityUserMm;
use arter\amos\community\models\RegisterForm;
use arter\amos\community\rbac\UpdateOwnCommunityProfile;
use arter\amos\community\utilities\CommunityUtil;
use arter\amos\community\utilities\EmailUtil;
use arter\amos\community\widgets\icons\WidgetIconAdminAllCommunity;
use arter\amos\community\widgets\icons\WidgetIconCommunity;
use arter\amos\community\widgets\icons\WidgetIconCreatedByCommunities;
use arter\amos\community\widgets\icons\WidgetIconMyCommunities;
use arter\amos\community\widgets\icons\WidgetIconMyCommunitiesWithTags;
use arter\amos\community\widgets\icons\WidgetIconToValidateCommunities;
use arter\amos\core\forms\editors\m2mWidget\controllers\M2MWidgetControllerTrait;
use arter\amos\core\forms\editors\m2mWidget\M2MEventsEnum;
use arter\amos\core\helpers\Html;
use arter\amos\core\icons\AmosIcons;
use arter\amos\core\module\BaseAmosModule;
use arter\amos\core\user\User;
use arter\amos\core\utilities\Email;
use arter\amos\core\utilities\SpreadSheetFactory;
use PhpOffice\PhpSpreadsheet\Style\Fill;
use Yii;
use yii\filters\AccessControl;
......@@ -48,11 +44,11 @@ use yii\web\NotFoundHttpException;
/**
* Class CommunityController
* This is the class for controller "CommunityController".
* @package elitedivision\amos\community\controllers
* @package arter\amos\community\controllers
*
* @property \elitedivision\amos\community\models\Community $model
* @property \arter\amos\community\models\Community $model
*/
class CommunityController extends \elitedivision\amos\community\controllers\base\CommunityController
class CommunityController extends \arter\amos\community\controllers\base\CommunityController
{
/**
......@@ -426,7 +422,7 @@ class CommunityController extends \elitedivision\amos\community\controllers\base
// if the visualization is a table show the community tree, else show all community fathers without subcommunities
if (!empty($this->getCurrentView()['name']) && $this->getCurrentView()['name'] == 'grid') {
$modelsearch = new \elitedivision\amos\community\models\search\CommunitySearch();
$modelsearch = new \arter\amos\community\models\search\CommunitySearch();
if(empty(\Yii::$app->request->get()['CommunitySearch']['name'])) {
$communitiesTree = $modelsearch->searchCommunityTreeOrder($dataProvider->query);
......@@ -1077,7 +1073,7 @@ class CommunityController extends \elitedivision\amos\community\controllers\base
public function sendMail($from, $to, $subject, $text, $files, $bcc)
{
/** @var \elitedivision\amos\emailmanager\AmosEmail $mailModule */
/** @var \arter\amos\emailmanager\AmosEmail $mailModule */
$mailModule = Yii::$app->getModule("email");
if (isset($mailModule)) {
if (is_null($from)) {
......
<?php
/**
* Lombardia Informatica S.p.A.
* OPEN 2.0
* Emilia Romagna Open Innovation
* Arter
*
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package elitedivision\amos\community\controllers
* @author Lombardia Informatica S.p.A.
* @package arter\amos\community\controllers
*/
namespace elitedivision\amos\community\controllers;
namespace arter\amos\community\controllers;
/**
* Class CommunityUserFieldController
* This is the class for controller "CommunityUserFieldController".
* @package elitedivision\amos\community\controllers
* @package arter\amos\community\controllers
*/
class CommunityUserFieldController extends \elitedivision\amos\community\controllers\base\CommunityUserFieldController
class CommunityUserFieldController extends \arter\amos\community\controllers\base\CommunityUserFieldController
{
......
<?php
/**
* Lombardia Informatica S.p.A.
* OPEN 2.0
* Emilia Romagna Open Innovation
* Arter
*
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package elitedivision\amos\community\controllers
* @author Lombardia Informatica S.p.A.
* @package arter\amos\community\controllers
*/
namespace elitedivision\amos\community\controllers;
namespace arter\amos\community\controllers;
/**
* Class CommunityUserFieldDefaultValController
* This is the class for controller "CommunityUserFieldDefaultValController".
* @package elitedivision\amos\community\controllers
* @package arter\amos\community\controllers
*/
class CommunityUserFieldDefaultValController extends \elitedivision\amos\community\controllers\base\CommunityUserFieldDefaultValController
class CommunityUserFieldDefaultValController extends \arter\amos\community\controllers\base\CommunityUserFieldDefaultValController
{
}
<?php
/**
* Lombardia Informatica S.p.A.
* OPEN 2.0
* Emilia Romagna Open Innovation
* Arter
*
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package elitedivision\amos\community
* @package arter\amos\community
* @category CategoryName
* @author Lombardia Informatica S.p.A.
*/
namespace elitedivision\amos\community\controllers;
use elitedivision\amos\community\AmosCommunity;
use elitedivision\amos\community\components\PartsFormCommunity;
use elitedivision\amos\community\models\Community;
use elitedivision\amos\community\models\CommunityUserMm;
use elitedivision\amos\community\models\search\CommunitySearch;
use elitedivision\amos\core\controllers\CrudController;
use elitedivision\amos\core\module\BaseAmosModule;
use elitedivision\amos\cwh\models\CwhAuthAssignment;
use elitedivision\amos\community\assets\AmosCommunityAsset;
namespace arter\amos\community\controllers;
use arter\amos\community\AmosCommunity;
use arter\amos\community\components\PartsFormCommunity;
use arter\amos\community\models\Community;
use arter\amos\community\models\CommunityUserMm;
use arter\amos\community\models\search\CommunitySearch;
use arter\amos\core\controllers\CrudController;
use arter\amos\core\module\BaseAmosModule;
use arter\amos\cwh\models\CwhAuthAssignment;
use arter\amos\community\assets\AmosCommunityAsset;
use Yii;
use yii\filters\AccessControl;
use yii\filters\VerbFilter;
......@@ -378,7 +374,7 @@ class CommunityWizardController extends CrudController
$module = \Yii::$app->getModule('layout');
if (empty($module)) {
if (strpos($this->layout, '@') === false) {
$this->layout = '@vendor/elitedivision/amos-core/views/layouts/'.(!empty($layout) ? $layout : $this->layout);
$this->layout = '@vendor/arter/amos-core/views/layouts/'.(!empty($layout) ? $layout : $this->layout);
}
return true;
}
......
<?php
/**
* Lombardia Informatica S.p.A.
* OPEN 2.0
* Emilia Romagna Open Innovation
* Arter
*
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package elitedivision\amos\community
* @package arter\amos\community
* @category CategoryName
* @author Lombardia Informatica S.p.A.
*/
namespace elitedivision\amos\community\controllers;
use elitedivision\amos\community\AmosCommunity;