?> | ?> | ||||
<div class="dashboard-index"> | <div class="dashboard-index"> | ||||
<div class="alert alert-success"> | |||||
<h4><i class="icon fa fa-ban"></i> Congés</h4> | |||||
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad atque aut doloremque earum excepturi fugiat natus, | |||||
omnis voluptatibus? A cum cumque distinctio eveniet hic minima neque officiis pariatur reiciendis, vitae. | |||||
</div> | |||||
<div class="alert alert-warning"> | |||||
test | |||||
</div> | |||||
<div class="alert alert-danger"> | |||||
test | |||||
</div> | |||||
<div class="alert alert-info"> | |||||
test | |||||
</div> | |||||
<div <?php if($adminSettingBag->get('forumFlarumUrl')): ?>class="col-md-8"<?php endif; ?>> | <div <?php if($adminSettingBag->get('forumFlarumUrl')): ?>class="col-md-8"<?php endif; ?>> | ||||
<?php if(Yii::$app->request->get('error_products_points_sale')): ?> | <?php if(Yii::$app->request->get('error_products_points_sale')): ?> | ||||
<div class="alert alert-warning"> | <div class="alert alert-warning"> |
termes. | termes. | ||||
*/ | */ | ||||
use yii\helpers\Html; | |||||
use yii\widgets\Breadcrumbs; | use yii\widgets\Breadcrumbs; | ||||
use dmstr\widgets\Alert; | use dmstr\widgets\Alert; | ||||
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
$producerModule = $this->getProducerModule(); | $producerModule = $this->getProducerModule(); | ||||
$adminSettingBag = $this->getSettingModule()->getAdminSettingBag(); | |||||
?> | ?> | ||||
<div class="content-wrapper"> | <div class="content-wrapper"> | ||||
<section class="content"> | <section class="content"> | ||||
<?= $this->renderFile('@common/views/alert_message.php', [ | |||||
'display' => $adminSettingBag->get('adminAlertMessageDisplay'), | |||||
'type' => $adminSettingBag->get('adminAlertMessageType'), | |||||
'title' => $adminSettingBag->get('adminAlertMessageTitle'), | |||||
'icon' => $adminSettingBag->get('adminAlertMessageIcon'), | |||||
'message' => $adminSettingBag->get('adminAlertMessage'), | |||||
]) ?> | |||||
<?php $producer = GlobalParam::getCurrentProducer(); ?> | <?php $producer = GlobalParam::getCurrentProducer(); ?> | ||||
<?php if($producer && !$producerModule->isUpToDateWithOpendistribVersion($producer) && $producer->option_display_message_new_opendistrib_version): ?> | <?php if($producer && !$producerModule->isUpToDateWithOpendistribVersion($producer) && $producer->option_display_message_new_opendistrib_version): ?> | ||||
<div class="alert alert-warning"> | |||||
<div class="alert alert-success"> | |||||
<p>Opendistrib a été mis à jour vers la version <?= GlobalParam::getOpendistribVersion() ?> ! <a class="alert-link" href="<?= Yii::$app->urlManager->createUrl(['development/index']) ?>">Découvrir les nouveautés</a></p> | <p>Opendistrib a été mis à jour vers la version <?= GlobalParam::getOpendistribVersion() ?> ! <a class="alert-link" href="<?= Yii::$app->urlManager->createUrl(['development/index']) ?>">Découvrir les nouveautés</a></p> | ||||
<a href="<?= Yii::$app->urlManager->createUrl(['producer/update-opendistrib-version']) ?>" class="close"><span aria-hidden="true">×</span></a> | <a href="<?= Yii::$app->urlManager->createUrl(['producer/update-opendistrib-version']) ?>" class="close"><span aria-hidden="true">×</span></a> | ||||
</div> | </div> |
} | } | ||||
$developerOnlineLabel = ''; | $developerOnlineLabel = ''; | ||||
if($adminSettingBag->get('supportDeveloperOnline')) { | |||||
if($adminSettingBag->get('supportOnline')) { | |||||
$developerOnlineLabel = '<small class="label pull-right bg-green"><i class="fa fa-phone"></i></small>'; | $developerOnlineLabel = '<small class="label pull-right bg-green"><i class="fa fa-phone"></i></small>'; | ||||
} | } | ||||
function field($form, $model, $settingDetail) { | function field($form, $model, $settingDetail) { | ||||
$field = $form->field($model, $settingDetail->getName()); | $field = $form->field($model, $settingDetail->getName()); | ||||
if($settingDetail->getFormType() == 'checkbox') { | if($settingDetail->getFormType() == 'checkbox') { | ||||
return $field->checkbox(); | |||||
$field = $field->checkbox(); | |||||
} | } | ||||
elseif($settingDetail->getFormType() == 'toggle') { | elseif($settingDetail->getFormType() == 'toggle') { | ||||
return $form->field($model, $settingDetail->getName(), ['options' => ['class' => 'form-group form-toggle']])->widget(Toggle::class, ['options' => ['data-on' => 'Oui', 'data-off' => 'Non', 'data-offstyle' => 'danger']]); | |||||
$field = $form->field($model, $settingDetail->getName(), ['options' => ['class' => 'form-group form-toggle']])->widget(Toggle::class, ['options' => ['data-on' => 'Oui', 'data-off' => 'Non', 'data-offstyle' => 'danger']]); | |||||
} | } | ||||
elseif($settingDetail->getFormType() == 'select') { | elseif($settingDetail->getFormType() == 'select') { | ||||
return $field->dropDownList($settingDetail->getOptions()); | |||||
$field = $field->dropDownList($settingDetail->getOptions()); | |||||
} | } | ||||
elseif($settingDetail->getFormType() == 'textarea') { | elseif($settingDetail->getFormType() == 'textarea') { | ||||
return $field->textarea(['rows' => 4]); | |||||
$field = $field->textarea(['rows' => 4]); | |||||
} | } | ||||
elseif($settingDetail->getFormType() == 'input') { | elseif($settingDetail->getFormType() == 'input') { | ||||
return $field->textInput(); | |||||
$field = $field->textInput(); | |||||
} | } | ||||
else { | else { | ||||
return '<div class="form-group"><span class="glyphicon glyphicon-alert"></span> Type de champ non défini pour le paramètre "'.$settingDetail->getName().'"</div>'; | return '<div class="form-group"><span class="glyphicon glyphicon-alert"></span> Type de champ non défini pour le paramètre "'.$settingDetail->getName().'"</div>'; | ||||
} | } | ||||
if($settingDetail->getHelpMessage()) { | |||||
$field->hint($settingDetail->getHelpMessage()); | |||||
} | |||||
return $field; | |||||
} | } | ||||
?> | ?> |
$this->setTitle('Support & contact'); | $this->setTitle('Support & contact'); | ||||
$this->addBreadcrumb($this->getTitle()); | $this->addBreadcrumb($this->getTitle()); | ||||
$supportDeveloperOnline = $adminSettingBag->get('supportDeveloperOnline'); | |||||
$supportOnline = $adminSettingBag->get('supportOnline'); | |||||
?> | ?> | ||||
<div class="support-index"> | <div class="support-index"> | ||||
<?php if ($context == 'producer'): ?> | <?php if ($context == 'producer'): ?> | ||||
<?= $this->renderFile('@common/views/alert_message.php', [ | |||||
'display' => $adminSettingBag->get('adminSupportAlertMessageDisplay'), | |||||
'type' => $adminSettingBag->get('adminSupportAlertMessageType'), | |||||
'title' => $adminSettingBag->get('adminSupportAlertMessageTitle'), | |||||
'icon' => $adminSettingBag->get('adminSupportAlertMessageIcon'), | |||||
'message' => $adminSettingBag->get('adminSupportAlertMessage'), | |||||
]) ?> | |||||
<div class="callout callout-info"> | <div class="callout callout-info"> | ||||
<p><i class="icon fa fa-info-circle"></i> Pour toutes vos questions, remarques, suggestions et remontées de | <p><i class="icon fa fa-info-circle"></i> Pour toutes vos questions, remarques, suggestions et remontées de | ||||
bugs.</p> | bugs.</p> | ||||
<div> | <div> | ||||
<div class="col-md-6 col-left"> | <div class="col-md-6 col-left"> | ||||
<div class="info-box"> | <div class="info-box"> | ||||
<span class="info-box-icon <?php if ($supportDeveloperOnline): ?>bg-green<?php else: ?>bg-yellow<?php endif; ?>"><i | |||||
<span class="info-box-icon <?php if ($supportOnline): ?>bg-green<?php else: ?>bg-yellow<?php endif; ?>"><i | |||||
class="fa fa-phone"></i></span> | class="fa fa-phone"></i></span> | ||||
<div class="info-box-content"> | <div class="info-box-content"> | ||||
<span class="info-box-text"> | <span class="info-box-text"> | ||||
Me contacter directement | Me contacter directement | ||||
<?php if ($supportDeveloperOnline): ?> | |||||
<?php if ($supportOnline): ?> | |||||
<br/><span class="label label-success">Disponible</span> | <br/><span class="label label-success">Disponible</span> | ||||
<?php endif; ?> | <?php endif; ?> | ||||
</span> | </span> |
body.skin-black .content-wrapper .alert .close { | body.skin-black .content-wrapper .alert .close { | ||||
font-size: 30px; | font-size: 30px; | ||||
position: relative; | position: relative; | ||||
top: -15px; | |||||
top: -25px; | |||||
text-decoration: none; | text-decoration: none; | ||||
color: white; | color: white; | ||||
opacity: 0.6; | opacity: 0.6; |
.close { | .close { | ||||
font-size: 30px; | font-size: 30px; | ||||
position: relative; | position: relative; | ||||
top: -15px; | |||||
top: -25px; | |||||
text-decoration: none; | text-decoration: none; | ||||
color: white; | color: white; | ||||
opacity: 0.6; | opacity: 0.6; |
namespace common\logic\Setting\SettingDetails\Admin; | namespace common\logic\Setting\SettingDetails\Admin; | ||||
use common\logic\Setting\SettingDefinition; | use common\logic\Setting\SettingDefinition; | ||||
use common\logic\Setting\SettingDetails\Admin\AlertMessage\AdminAlertMessageIconSetting; | |||||
use common\logic\Setting\SettingDetails\Admin\AlertMessage\AdminAlertMessageSetting; | |||||
use common\logic\Setting\SettingDetails\Admin\AlertMessage\AdminAlertMessageTitleSetting; | |||||
use common\logic\Setting\SettingDetails\Admin\AlertMessage\AdminAlertMessageTypeSetting; | |||||
use common\logic\Setting\SettingDetails\Admin\AlertMessage\AdminSupportAlertMessageDisplaySetting; | |||||
use common\logic\Setting\SettingDetails\Admin\AlertMessage\AdminSupportAlertMessageIconSetting; | |||||
use common\logic\Setting\SettingDetails\Admin\AlertMessage\AdminSupportAlertMessageSetting; | |||||
use common\logic\Setting\SettingDetails\Admin\AlertMessage\AdminSupportAlertMessageTitleSetting; | |||||
use common\logic\Setting\SettingDetails\Admin\AlertMessage\AdminSupportAlertMessageTypeSetting; | |||||
use common\logic\Setting\SettingDetails\Admin\General\AdministratorEmailAdminSetting; | use common\logic\Setting\SettingDetails\Admin\General\AdministratorEmailAdminSetting; | ||||
use common\logic\Setting\SettingDetails\Admin\General\AdministratorPhoneNumberAdminSetting; | use common\logic\Setting\SettingDetails\Admin\General\AdministratorPhoneNumberAdminSetting; | ||||
use common\logic\Setting\SettingDetails\Admin\General\ForumFlarumUrlAdminSetting; | use common\logic\Setting\SettingDetails\Admin\General\ForumFlarumUrlAdminSetting; | ||||
use common\logic\Setting\SettingDetails\Admin\General\MaximumNumberProducersAdminSetting; | use common\logic\Setting\SettingDetails\Admin\General\MaximumNumberProducersAdminSetting; | ||||
use common\logic\Setting\SettingDetails\Admin\General\SupportDeveloperOnlineAdminSetting; | |||||
use common\logic\Setting\SettingDetails\Admin\General\SupportOnlineAdminSetting; | |||||
use common\logic\Setting\SettingDetails\Admin\AlertMessage\AdminAlertMessageDisplaySetting; | |||||
class AdminSettingDefinition extends SettingDefinition | class AdminSettingDefinition extends SettingDefinition | ||||
{ | { | ||||
const SECTION_GENERAL = 'general'; | const SECTION_GENERAL = 'general'; | ||||
const SUBSECTION_GENERAL = 'general.main'; | const SUBSECTION_GENERAL = 'general.main'; | ||||
const SECTION_ALERT_MESSAGE = 'alertmessage'; | |||||
const SUBSECTION_ALERT_MESSAGE_GLOBAL = 'alertmessage.global'; | |||||
const SUBSECTION_ALERT_MESSAGE_SUPPORT = 'alertmessage.support'; | |||||
public function getSettingDetails(): array | public function getSettingDetails(): array | ||||
{ | { | ||||
return [ | return [ | ||||
self::SECTION_GENERAL => [ | self::SECTION_GENERAL => [ | ||||
self::SUBSECTION_GENERAL => [ | self::SUBSECTION_GENERAL => [ | ||||
new SupportDeveloperOnlineAdminSetting(), | |||||
new SupportOnlineAdminSetting(), | |||||
new AdministratorEmailAdminSetting(), | new AdministratorEmailAdminSetting(), | ||||
new AdministratorPhoneNumberAdminSetting(), | new AdministratorPhoneNumberAdminSetting(), | ||||
new MaximumNumberProducersAdminSetting(), | new MaximumNumberProducersAdminSetting(), | ||||
new ForumFlarumUrlAdminSetting(), | new ForumFlarumUrlAdminSetting(), | ||||
] | ] | ||||
], | ], | ||||
self::SECTION_ALERT_MESSAGE => [ | |||||
self::SUBSECTION_ALERT_MESSAGE_GLOBAL => [ | |||||
new AdminAlertMessageDisplaySetting(), | |||||
new AdminAlertMessageTypeSetting(), | |||||
new AdminAlertMessageIconSetting(), | |||||
new AdminAlertMessageTitleSetting(), | |||||
new AdminAlertMessageSetting(), | |||||
], | |||||
self::SUBSECTION_ALERT_MESSAGE_SUPPORT => [ | |||||
new AdminSupportAlertMessageDisplaySetting(), | |||||
new AdminSupportAlertMessageTypeSetting(), | |||||
new AdminSupportAlertMessageIconSetting(), | |||||
new AdminSupportAlertMessageTitleSetting(), | |||||
new AdminSupportAlertMessageSetting(), | |||||
], | |||||
] | |||||
]; | ]; | ||||
} | } | ||||
return [ | return [ | ||||
self::SECTION_GENERAL => 'General', | self::SECTION_GENERAL => 'General', | ||||
self::SUBSECTION_GENERAL => 'General', | self::SUBSECTION_GENERAL => 'General', | ||||
self::SECTION_ALERT_MESSAGE => 'Message d\'alerte', | |||||
self::SUBSECTION_ALERT_MESSAGE_GLOBAL => 'Global', | |||||
self::SUBSECTION_ALERT_MESSAGE_SUPPORT => 'Support' | |||||
]; | ]; | ||||
} | } | ||||
<?php | |||||
namespace common\logic\Setting\SettingDetails\Admin\AlertMessage; | |||||
use common\logic\Setting\SettingDetails\AbstractSettingDetail; | |||||
class AdminAlertMessageDisplaySetting extends AbstractSettingDetail | |||||
{ | |||||
public function __construct() | |||||
{ | |||||
$this | |||||
->setName('adminAlertMessageDisplay') | |||||
->setLabel("Afficher") | |||||
->setTypeBoolean() | |||||
->setFormTypeToggle(); | |||||
} | |||||
} |
<?php | |||||
namespace common\logic\Setting\SettingDetails\Admin\AlertMessage; | |||||
use common\logic\Setting\SettingDetails\AbstractSettingDetail; | |||||
class AdminAlertMessageIconSetting extends AbstractSettingDetail | |||||
{ | |||||
public function __construct() | |||||
{ | |||||
$this | |||||
->setName('adminAlertMessageIcon') | |||||
->setLabel("Icône") | |||||
->setTypeString() | |||||
->setFormTypeInput() | |||||
->setHelpMessage('<a href="https://adminlte.io/themes/AdminLTE/pages/UI/icons.html" target="_blank">Icônes disponibles</a>'); | |||||
} | |||||
} |
<?php | |||||
namespace common\logic\Setting\SettingDetails\Admin\AlertMessage; | |||||
use common\logic\Setting\SettingDetails\AbstractSettingDetail; | |||||
class AdminAlertMessageSetting extends AbstractSettingDetail | |||||
{ | |||||
public function __construct() | |||||
{ | |||||
$this | |||||
->setName('adminAlertMessage') | |||||
->setLabel("Message") | |||||
->setTypeText() | |||||
->setFormTypeTextarea(); | |||||
} | |||||
} |
<?php | |||||
namespace common\logic\Setting\SettingDetails\Admin\AlertMessage; | |||||
use common\logic\Setting\SettingDetails\AbstractSettingDetail; | |||||
class AdminAlertMessageTitleSetting extends AbstractSettingDetail | |||||
{ | |||||
public function __construct() | |||||
{ | |||||
$this | |||||
->setName('adminAlertMessageTitle') | |||||
->setLabel("Titre") | |||||
->setTypeString() | |||||
->setFormTypeInput(); | |||||
} | |||||
} |
<?php | |||||
namespace common\logic\Setting\SettingDetails\Admin\AlertMessage; | |||||
use common\logic\Setting\SettingDetails\AbstractSettingDetail; | |||||
class AdminAlertMessageTypeSetting extends AbstractSettingDetail | |||||
{ | |||||
public function __construct() | |||||
{ | |||||
$this | |||||
->setName('adminAlertMessageType') | |||||
->setLabel("Type") | |||||
->setTypeString() | |||||
->setFormTypeSelect([ | |||||
'success' => 'Succès', | |||||
'info' => 'Information', | |||||
'warning' => 'Warning', | |||||
'danger' => 'Danger' | |||||
]); | |||||
} | |||||
} |
<?php | |||||
namespace common\logic\Setting\SettingDetails\Admin\AlertMessage; | |||||
use common\logic\Setting\SettingDetails\AbstractSettingDetail; | |||||
class AdminSupportAlertMessageDisplaySetting extends AbstractSettingDetail | |||||
{ | |||||
public function __construct() | |||||
{ | |||||
$this | |||||
->setName('adminSupportAlertMessageDisplay') | |||||
->setLabel("Afficher") | |||||
->setTypeBoolean() | |||||
->setFormTypeToggle(); | |||||
} | |||||
} |
<?php | |||||
namespace common\logic\Setting\SettingDetails\Admin\AlertMessage; | |||||
use common\logic\Setting\SettingDetails\AbstractSettingDetail; | |||||
class AdminSupportAlertMessageIconSetting extends AbstractSettingDetail | |||||
{ | |||||
public function __construct() | |||||
{ | |||||
$this | |||||
->setName('adminSupportAlertMessageIcon') | |||||
->setLabel("Icône") | |||||
->setTypeString() | |||||
->setFormTypeInput() | |||||
->setHelpMessage('<a href="https://adminlte.io/themes/AdminLTE/pages/UI/icons.html" target="_blank">Icônes disponibles</a>'); | |||||
} | |||||
} |
<?php | |||||
namespace common\logic\Setting\SettingDetails\Admin\AlertMessage; | |||||
use common\logic\Setting\SettingDetails\AbstractSettingDetail; | |||||
class AdminSupportAlertMessageSetting extends AbstractSettingDetail | |||||
{ | |||||
public function __construct() | |||||
{ | |||||
$this | |||||
->setName('adminSupportAlertMessage') | |||||
->setLabel("Message") | |||||
->setTypeText() | |||||
->setFormTypeTextarea(); | |||||
} | |||||
} |
<?php | |||||
namespace common\logic\Setting\SettingDetails\Admin\AlertMessage; | |||||
use common\logic\Setting\SettingDetails\AbstractSettingDetail; | |||||
class AdminSupportAlertMessageTitleSetting extends AbstractSettingDetail | |||||
{ | |||||
public function __construct() | |||||
{ | |||||
$this | |||||
->setName('adminSupportAlertMessageTitle') | |||||
->setLabel("Titre") | |||||
->setTypeString() | |||||
->setFormTypeInput(); | |||||
} | |||||
} |
<?php | |||||
namespace common\logic\Setting\SettingDetails\Admin\AlertMessage; | |||||
use common\logic\Setting\SettingDetails\AbstractSettingDetail; | |||||
class AdminSupportAlertMessageTypeSetting extends AbstractSettingDetail | |||||
{ | |||||
public function __construct() | |||||
{ | |||||
$this | |||||
->setName('adminSupportAlertMessageType') | |||||
->setLabel("Type") | |||||
->setTypeString() | |||||
->setFormTypeSelect([ | |||||
'success' => 'Succès', | |||||
'info' => 'Information', | |||||
'warning' => 'Warning', | |||||
'danger' => 'Danger' | |||||
]); | |||||
} | |||||
} |
use common\logic\Setting\SettingDetails\AbstractSettingDetail; | use common\logic\Setting\SettingDetails\AbstractSettingDetail; | ||||
class SupportDeveloperOnlineAdminSetting extends AbstractSettingDetail | |||||
class SupportOnlineAdminSetting extends AbstractSettingDetail | |||||
{ | { | ||||
public function __construct() | public function __construct() | ||||
{ | { | ||||
$this | $this | ||||
->setName('supportDeveloperOnline') | |||||
->setLabel("Support : développeur disponible") | |||||
->setName('supportOnline') | |||||
->setLabel("Support : disponible") | |||||
->setTypeBoolean() | ->setTypeBoolean() | ||||
->setFormTypeToggle(); | ->setFormTypeToggle(); | ||||
} | } |
<?php | |||||
use yii\helpers\Html; | |||||
?> | |||||
<?php if($display && $message): ?> | |||||
<div class="alert alert-<?= $type ?>"> | |||||
<?php if($title): ?> | |||||
<h4> | |||||
<?php if($icon): ?> | |||||
<i class="icon fa fa-<?= $icon ?>"></i> | |||||
<?php endif; ?> | |||||
<?= $title ?> | |||||
</h4> | |||||
<?php endif; ?> | |||||
<p> | |||||
<?php if(!$title && $icon): ?> | |||||
<i class="icon fa fa-<?= $icon ?>"></i> | |||||
<?php endif; ?> | |||||
<?= nl2br(Html::encode($message)); ?> | |||||
</p> | |||||
</div> | |||||
<?php endif; ?> |