Commit c776663f authored by Aster's avatar Aster Committed by waltermazza
Browse files

General Bug Fixes and Improvements

parent b5ff3147
{
"name": "arter/amos-sondaggi",
"description": "Sistema AMOS per gestire i sondaggi",
"keywords": [
"amos",
"yii2",
"sondaggi"
],
"keywords": ["amos", "yii2", "sondaggi"],
"homepage": "http://www.arter.it/",
"type": "component",
"license": "BSD-3-Clause",
......@@ -17,18 +13,19 @@
},
"require": {
"php": ">=5.4.0",
"arter/amos-admin": ">=1.8",
"arter/amos-core": "^1.9.57",
"arter/amos-dashboard": "^1.8",
"arter/amos-attachments": "^1.1.11",
"arter/amos-email-manager": "^1.1",
"ext-json": "*",
"arter/amos-admin":"^2.2.0",
"arter/amos-attachments":"^1.1.11",
"arter/amos-core":"^1.19.0",
"arter/amos-dashboard":"^1.9",
"arter/amos-email-manager": "^1.1.19",
"arter/amos-upload": "*",
"kartik-v/yii2-detail-view": "*",
"kartik-v/yii2-widget-fileinput": "*"
},
"autoload": {
"psr-4": {
"psr-4": {
"arter\\amos\\sondaggi\\": "src"
}
}
}
\ No newline at end of file
}
......@@ -4,7 +4,7 @@
* EROI - Emilia Romagna Open Innovation is based on:
* https://www.open2.0.regione.lombardia.it
*
* @see https://repo.art-er.it Developers' community
* @see http://example.com Developers'community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
......@@ -15,6 +15,7 @@
namespace arter\amos\sondaggi;
use arter\amos\core\interfaces\CmsModuleInterface;
use arter\amos\core\module\AmosModule;
use arter\amos\core\module\ModuleInterface;
use arter\amos\sondaggi\widgets\icons\WidgetIconAmministraSondaggi;
......@@ -29,7 +30,7 @@ use yii\helpers\ArrayHelper;
* Class AmosSondaggi
* @package arter\amos\sondaggi
*/
class AmosSondaggi extends AmosModule implements ModuleInterface
class AmosSondaggi extends AmosModule implements ModuleInterface, CmsModuleInterface
{
public static $CONFIG_FOLDER = 'config';
public $controllerNamespace = 'arter\amos\sondaggi\controllers';
......@@ -84,6 +85,20 @@ class AmosSondaggi extends AmosModule implements ModuleInterface
* @var bool|false $hideWidgetGraphicsActions
*/
public $hideWidgetGraphicsActions = false;
/**
* @var array $viewPathEmailSummary
*/
public $viewPathEmailSummary = [
'arter\amos\sondaggi\models\Sondaggi' => '@vendor/arter/amos-sondaggi/src/views/email/notify_summary'
];
/**
* @var array $viewPathEmailSummaryNetwork
*/
public $viewPathEmailSummaryNetwork = [
'arter\amos\sondaggi\models\Sondaggi' => '@vendor/arter/amos-sondaggi/src/views/email/notify_summary_network'
];
/**
* @inheritdoc
......@@ -135,6 +150,44 @@ class AmosSondaggi extends AmosModule implements ModuleInterface
*/
protected function getDefaultModels()
{
return [];
return [
'Sondaggi' => __NAMESPACE__ . '\\' . 'models\Sondaggi',
'SondaggiSearch' => __NAMESPACE__ . '\\' . 'models\search\SondaggiSearch',
];
}
/**
*
* @return string
*/
public static function getModelClassName()
{
return AmosSondaggi::instance()->model('Sondaggi');
}
/**
*
* @return string
*/
public static function getModelSearchClassName()
{
return AmosSondaggi::instance()->model('SondaggiSearch');
}
/**
*
* @return string
*/
public function getFrontEndMenu($dept = 1)
{
$menu = "";
$app = \Yii::$app;
if ((is_null($app->user) || $app->user->id == $app->params['platformConfigurations']['guestUserId'])) {
//$menu .= $this->addFrontEndMenu(AmosSondaggi::t('amossondaggi','Gestione sondaggi'), AmosSondaggi::toUrlModule('/sondaggi'));
}else{
$menu .= $this->addFrontEndMenu(AmosSondaggi::t('amossondaggi','#menu_front_sondaggi'), AmosSondaggi::toUrlModule('/sondaggi'));
}
return $menu;
}
}
......@@ -8,11 +8,12 @@
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package arter\amos\sondaggi\assets
* @package arter
* @category CategoryName
* @author Elite Division S.r.l.
*/
namespace arter\amos\sondaggi\assets;
use yii\web\AssetBundle;
......
......@@ -8,11 +8,12 @@
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package arter\amos\sondaggi\assets
* @package arter
* @category CategoryName
* @author Elite Division S.r.l.
*/
namespace arter\amos\sondaggi\assets;
use yii\web\AssetBundle;
......
......@@ -8,11 +8,12 @@
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package arter\amos\sondaggi\assets
* @package arter
* @category CategoryName
* @author Elite Division S.r.l.
*/
namespace arter\amos\sondaggi\assets;
use yii\web\AssetBundle;
......@@ -38,7 +39,7 @@ class ModuleSondaggiAsset extends AssetBundle
{
$moduleL = \Yii::$app->getModule('layout');
if(!empty(\Yii::$app->params['dashboardEngine']) && \Yii::$app->params['dashboardEngine'] == WidgetAbstract::ENGINE_ROWS){
$this->css = ['less/sondaggi-fullsize.less'];
$this->css = ['less/sondaggi-fullsize.less','less/sondaggi-be-come-fe.less'];
}
if(!empty($moduleL))
{ $this->depends [] = 'arter\amos\layout\assets\BaseAsset'; }
......
......@@ -8,11 +8,12 @@
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package arter\amos\sondaggi\assets
* @package arter
* @category CategoryName
* @author Elite Division S.r.l.
*/
namespace arter\amos\sondaggi\assets;
use yii\web\AssetBundle;
......
......@@ -8,11 +8,12 @@
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package arter\amos\sondaggi\assets
* @package arter
* @category CategoryName
* @author Elite Division S.r.l.
*/
namespace arter\amos\sondaggi\assets;
use yii\web\AssetBundle;
......
......@@ -16,11 +16,14 @@ var Sondaggi = {
$('#selezioni-minime-massime').show();
$('#selezioni-minime-massime-label').show();
$('#selezione-classe-validatrice').hide();
$('#selezione-modello').hide();
} else {
if (tipologiaSalv == 9) {
if (tipologiaSalv == 9 || tipologiaSalv == 14) {
$('#selezione-classe-validatrice').show();
$('#selezione-modello').show();
} else {
$('#selezione-classe-validatrice').hide();
$('#selezione-modello').hide();
}
$('#selezioni-minime-massime').hide();
$('#selezioni-minime-massime-label').hide();
......@@ -30,6 +33,7 @@ var Sondaggi = {
var risp = $('#sondaggidomande-sondaggi_domande_tipologie_id').val();
if (risp == 5 || risp == 6) {
$('#selezione-classe-validatrice').hide();
$('#selezione-modello').hide();
$(this.submitSelector).prop('disabled', false);
$('#sondaggidomande-inline').prop('disabled', true);
$(this.submitSelector).show();
......@@ -37,6 +41,7 @@ var Sondaggi = {
$('#selezioni-minime-massime-label').hide();
} else if (risp == 3 || risp == 4) {
$('#selezione-classe-validatrice').hide();
$('#selezione-modello').hide();
$('#sondaggidomande-inline').prop('disabled', true);
$(this.submitSelector).prop('disabled', true);
$(this.submitSelector).hide();
......@@ -52,12 +57,14 @@ var Sondaggi = {
$(this.submitSelector).prop('disabled', true);
$(this.submitSelector).hide();
$('#selezione-classe-validatrice').hide();
$('#selezione-modello').hide();
if (risp == 1) {
$('#selezioni-minime-massime').show();
$('#selezioni-minime-massime-label').show();
} else {
if (risp == 9) {
if (risp == 9 || risp == 14) {
$('#selezione-classe-validatrice').show();
$('#selezione-modello').show();
}
$('#selezioni-minime-massime').hide();
$('#selezioni-minime-massime-label').hide();
......
......@@ -6,7 +6,7 @@ $(document).ready(function () {
//allineo i bottoni a quelli del frontend
$("button.btn.btn-navigation-primary").addClass("btn-default");
//chiodato cambio layout del sondaggio pagina in base a id
// $(".pagid-23").addClass("fullsize-forced-js");
//activate tooltip
$('[data-toggle="tooltip"]').tooltip();
});
\ No newline at end of file
/**
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 STYLE-CUSTOM
*/
@import (optional) "../../backend/web/less/style_custom.less";
//COMMON
>.sondaggi-index {
flex-grow: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
&.sondaggi-success {
background: @success-color;
padding: 20px;
h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
a:not(.btn),
.am {
color: contrast(@success-color);
}
}
&.sondaggi-warning {
background: @warning-color;
padding: 20px;
h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
a:not(.btn),
.am {
color: contrast(@warning-color);
}
}
}
.btn.btn-secondary,
.btn.btn-navigation-primary {
font-size: 20px;
text-transform: uppercase;
}
.btn.btn-file {
padding: 6px 12px;
}
.input-group.date {
.kv-date-picker {
background: @brand-primary-color;
color: contrast(@brand-primary-color);
border-radius: 0;
border: 1px solid @brand-primary-color;
}
}
.file-caption-main {
>.file-caption {
//height: 42px;
}
}
.select2-selection__clear {
top: -2px
}
textarea {
max-width: 100% !important;
font-size: 18px !important;
}
.select2-container--krajee .select2-selection {
border-radius: 0 !important;
}
.select2-container--krajee .select2-selection--single {
padding-left: 0 !important;
}
.select2-selection__arrow {
border: none !important;
}
.select2-container--krajee .select2-selection--single .select2-selection__arrow b {
border-top-color: @black-color !important;
}
.select2-container--krajee .select2-selection--single .select2-selection__rendered {
color: @black-color;
.select2-selection__placeholder,
.select2-selection__clear,
.presentation {
color: @black-color;
opacity: initial;
}
}
.select2-container--krajee .select2-selection--multiple .select2-selection__choice {
background: @light-background-primary-color !important;
color: contrast(@light-background-primary-color) !important;
border-radius: 0 !important;
margin: 0;
white-space: normal;
}
.select2-container--krajee .select2-selection--multiple .select2-selection__clear {
position: relative;
color: @black-color;
opacity: 1;
font-size: 0;
&::after {
content: "Delete selected";
font-size: 14px;
font-weight: normal;
}
}
.s2-togall-select .s2-select-label,
.s2-togall-unselect .s2-unselect-label {
color: @black-color;
}
.select2-container--krajee .select2-selection,
.form-control:not(textarea) {
border-radius: 0 !important;
border: none !important;
box-shadow: none !important;
background: transparent !important;
padding-left: 0 !important;
@media screen and (min-width:992px) {
border-bottom: 1px solid #000 !important;
}
}
.select2-container--krajee .select2-dropdown {
border: none !important;
box-shadow: none !important;
border-radius: 0 !important;
.select2-results {
border-bottom: 2px solid @brand-primary-color;
}
}
.select2-container--krajee .select2-results__option[aria-selected="true"] {
background: @light-background-primary-color !important;
color: contrast(@light-background-primary-color) !important;
}
.select2-container--krajee .select2-results__option--highlighted[aria-selected] {
border-color: @brand-primary-color !important;
background: @brand-primary-color !important;
color: contrast(@brand-primary-color) !important;
box-shadow: none !important;
border-radius: 0 !important;
}
.form-group.required .control-label::after {
content: '*';
}
.form-control:focus {
background: @white-color;
}
.has-success .form-control {
color: @success-color;
}
.help-block {
font-size: 14px;
margin: 0;
}
@media screen and (max-width: 991px) {
// .radio-inline {
// padding-left: 10px;
// }
// .radio-inline input[type="radio"] {
// margin-left: 0;
// margin-top: -10px;
// }
// div[role='radiogroup'] {
// display: flex;
// flex-direction: column;
// justify-content: flex-end;
// margin-bottom: 10px;
// }
.form-group {
margin: 0 0 30px;
border-bottom: 1px solid #ccc;
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between;
width: 100%;
>div:last-child:not(.row) {
margin-right: auto;
}
}
}
//FORM
.sondaggi-compilazione {
.radio {
margin-right: 20px;
}
.radio+.radio {
margin-top: 10px;
}
.sondaggi-form {
h3 {
font-size: 2em;
font-weight: bold;
}
.row {
width: 100%;
margin: 0;
>div.col-xs-12 {
padding: 0;
}
}
.control-label {
font-weight: normal;
width: 100%;
+div {
text-align: right;
margin-top: 10px;
}
}
.testo-introduttivo {
background: @light-background-primary-color;
border-left: 15px solid @brand-primary-color;
}
// @media screen and (max-width:991px) {
// div[id^="div-domanda"]:not(.testo-introduttivo) {
// padding: 0;
// }
// }
@media screen and (min-width:992px) {
form>.row {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
}
}
&.fullsize-forced-js {
@media screen and (min-width:992px) {
form>.row {
display: flex;
flex-direction: row;
flex-wrap: wrap;
>div[id^="div-domanda"] {
width: 100% !important;
}
}
.form-group {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
>.control-label {
width: 50%;
+div {
margin-top: 0;
}
}
}
}
}
}
.bk-btnFormContainer {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
flex-wrap: wrap;
padding-top: 20px !important;
padding-bottom: 50px !important;
//border-top: 1px solid darken(@light-background-color, 10%);
*:not(:first-child) {
margin-left: auto;
}
}
.sondaggi-index {
.am {
font-size: 8vw;
margin-bottom: 15px;
+h2 {
margin: 0;
font-size: 3vw;
line-height: 0.8;
font-weight: bold;
+h3 {
margin: 0;
font-size: 2vw;
+.btn {
width: fit-content;
max-width: 300px;
margin-top: 30px;
}