瀏覽代碼

[Administration] Message général aux producteurs

feature/souke
Guillaume Bourgeois 9 月之前
父節點
當前提交
3c31d2f77c
共有 20 個文件被更改,包括 299 次插入17 次删除
  1. +18
    -0
      backend/views/dashboard/index.php
  2. +11
    -1
      backend/views/layouts/content.php
  3. +1
    -1
      backend/views/layouts/left.php
  4. +11
    -5
      backend/views/setting-admin/index.php
  5. +11
    -3
      backend/views/support/index.php
  6. +1
    -1
      backend/web/css/screen.css
  7. +1
    -1
      backend/web/sass/_adminlte.scss
  8. +36
    -2
      common/logic/Setting/SettingDetails/Admin/AdminSettingDefinition.php
  9. +17
    -0
      common/logic/Setting/SettingDetails/Admin/AlertMessage/AdminAlertMessageDisplaySetting.php
  10. +18
    -0
      common/logic/Setting/SettingDetails/Admin/AlertMessage/AdminAlertMessageIconSetting.php
  11. +17
    -0
      common/logic/Setting/SettingDetails/Admin/AlertMessage/AdminAlertMessageSetting.php
  12. +17
    -0
      common/logic/Setting/SettingDetails/Admin/AlertMessage/AdminAlertMessageTitleSetting.php
  13. +22
    -0
      common/logic/Setting/SettingDetails/Admin/AlertMessage/AdminAlertMessageTypeSetting.php
  14. +17
    -0
      common/logic/Setting/SettingDetails/Admin/AlertMessage/AdminSupportAlertMessageDisplaySetting.php
  15. +18
    -0
      common/logic/Setting/SettingDetails/Admin/AlertMessage/AdminSupportAlertMessageIconSetting.php
  16. +17
    -0
      common/logic/Setting/SettingDetails/Admin/AlertMessage/AdminSupportAlertMessageSetting.php
  17. +17
    -0
      common/logic/Setting/SettingDetails/Admin/AlertMessage/AdminSupportAlertMessageTitleSetting.php
  18. +22
    -0
      common/logic/Setting/SettingDetails/Admin/AlertMessage/AdminSupportAlertMessageTypeSetting.php
  19. +3
    -3
      common/logic/Setting/SettingDetails/Admin/General/SupportOnlineAdminSetting.php
  20. +24
    -0
      common/views/alert_message.php

+ 18
- 0
backend/views/dashboard/index.php 查看文件

@@ -59,6 +59,24 @@ $this->setTitle('Tableau de bord');
?>
<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; ?>>
<?php if(Yii::$app->request->get('error_products_points_sale')): ?>
<div class="alert alert-warning">

+ 11
- 1
backend/views/layouts/content.php 查看文件

@@ -36,11 +36,13 @@ pris connaissance de la licence CeCILL, et que vous en avez accepté les
termes.
*/

use yii\helpers\Html;
use yii\widgets\Breadcrumbs;
use dmstr\widgets\Alert;
use common\helpers\GlobalParam;

$producerModule = $this->getProducerModule();
$adminSettingBag = $this->getSettingModule()->getAdminSettingBag();

?>
<div class="content-wrapper">
@@ -79,9 +81,17 @@ $producerModule = $this->getProducerModule();

<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 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>
<a href="<?= Yii::$app->urlManager->createUrl(['producer/update-opendistrib-version']) ?>" class="close"><span aria-hidden="true">&times;</span></a>
</div>

+ 1
- 1
backend/views/layouts/left.php 查看文件

@@ -72,7 +72,7 @@ $isUserCurrentGrantedAsProducer = $userModule->getAuthorizationChecker()->isGran
}

$developerOnlineLabel = '';
if($adminSettingBag->get('supportDeveloperOnline')) {
if($adminSettingBag->get('supportOnline')) {
$developerOnlineLabel = '<small class="label pull-right bg-green"><i class="fa fa-phone"></i></small>';
}


+ 11
- 5
backend/views/setting-admin/index.php 查看文件

@@ -90,23 +90,29 @@ $this->addBreadcrumb($this->getTitle());
function field($form, $model, $settingDetail) {
$field = $form->field($model, $settingDetail->getName());
if($settingDetail->getFormType() == 'checkbox') {
return $field->checkbox();
$field = $field->checkbox();
}
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') {
return $field->dropDownList($settingDetail->getOptions());
$field = $field->dropDownList($settingDetail->getOptions());
}
elseif($settingDetail->getFormType() == 'textarea') {
return $field->textarea(['rows' => 4]);
$field = $field->textarea(['rows' => 4]);
}
elseif($settingDetail->getFormType() == 'input') {
return $field->textInput();
$field = $field->textInput();
}
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>';
}

if($settingDetail->getHelpMessage()) {
$field->hint($settingDetail->getHelpMessage());
}

return $field;
}

?>

+ 11
- 3
backend/views/support/index.php 查看文件

@@ -53,13 +53,21 @@ $userCurrent = $this->getUserCurrent();
$this->setTitle('Support & contact');
$this->addBreadcrumb($this->getTitle());

$supportDeveloperOnline = $adminSettingBag->get('supportDeveloperOnline');
$supportOnline = $adminSettingBag->get('supportOnline');

?>

<div class="support-index">
<?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">
<p><i class="icon fa fa-info-circle"></i> Pour toutes vos questions, remarques, suggestions et remontées de
bugs.</p>
@@ -67,12 +75,12 @@ $supportDeveloperOnline = $adminSettingBag->get('supportDeveloperOnline');
<div>
<div class="col-md-6 col-left">
<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>
<div class="info-box-content">
<span class="info-box-text">
Me contacter directement
<?php if ($supportDeveloperOnline): ?>
<?php if ($supportOnline): ?>
<br/><span class="label label-success">Disponible</span>
<?php endif; ?>
</span>

+ 1
- 1
backend/web/css/screen.css 查看文件

@@ -1766,7 +1766,7 @@ body.skin-black .content-wrapper .alert a.btn {
body.skin-black .content-wrapper .alert .close {
font-size: 30px;
position: relative;
top: -15px;
top: -25px;
text-decoration: none;
color: white;
opacity: 0.6;

+ 1
- 1
backend/web/sass/_adminlte.scss 查看文件

@@ -248,7 +248,7 @@ body.skin-black {
.close {
font-size: 30px;
position: relative;
top: -15px;
top: -25px;
text-decoration: none;
color: white;
opacity: 0.6;

+ 36
- 2
common/logic/Setting/SettingDetails/Admin/AdminSettingDefinition.php 查看文件

@@ -3,29 +3,59 @@
namespace common\logic\Setting\SettingDetails\Admin;

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\AdministratorPhoneNumberAdminSetting;
use common\logic\Setting\SettingDetails\Admin\General\ForumFlarumUrlAdminSetting;
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
{
const SECTION_GENERAL = 'general';
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
{
return [
self::SECTION_GENERAL => [
self::SUBSECTION_GENERAL => [
new SupportDeveloperOnlineAdminSetting(),
new SupportOnlineAdminSetting(),
new AdministratorEmailAdminSetting(),
new AdministratorPhoneNumberAdminSetting(),
new MaximumNumberProducersAdminSetting(),
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(),
],
]
];
}

@@ -34,6 +64,10 @@ class AdminSettingDefinition extends SettingDefinition
return [
self::SECTION_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'
];
}


+ 17
- 0
common/logic/Setting/SettingDetails/Admin/AlertMessage/AdminAlertMessageDisplaySetting.php 查看文件

@@ -0,0 +1,17 @@
<?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();
}
}

+ 18
- 0
common/logic/Setting/SettingDetails/Admin/AlertMessage/AdminAlertMessageIconSetting.php 查看文件

@@ -0,0 +1,18 @@
<?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>');
}
}

+ 17
- 0
common/logic/Setting/SettingDetails/Admin/AlertMessage/AdminAlertMessageSetting.php 查看文件

@@ -0,0 +1,17 @@
<?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();
}
}

+ 17
- 0
common/logic/Setting/SettingDetails/Admin/AlertMessage/AdminAlertMessageTitleSetting.php 查看文件

@@ -0,0 +1,17 @@
<?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();
}
}

+ 22
- 0
common/logic/Setting/SettingDetails/Admin/AlertMessage/AdminAlertMessageTypeSetting.php 查看文件

@@ -0,0 +1,22 @@
<?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'
]);
}
}

+ 17
- 0
common/logic/Setting/SettingDetails/Admin/AlertMessage/AdminSupportAlertMessageDisplaySetting.php 查看文件

@@ -0,0 +1,17 @@
<?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();
}
}

+ 18
- 0
common/logic/Setting/SettingDetails/Admin/AlertMessage/AdminSupportAlertMessageIconSetting.php 查看文件

@@ -0,0 +1,18 @@
<?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>');
}
}

+ 17
- 0
common/logic/Setting/SettingDetails/Admin/AlertMessage/AdminSupportAlertMessageSetting.php 查看文件

@@ -0,0 +1,17 @@
<?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();
}
}

+ 17
- 0
common/logic/Setting/SettingDetails/Admin/AlertMessage/AdminSupportAlertMessageTitleSetting.php 查看文件

@@ -0,0 +1,17 @@
<?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();
}
}

+ 22
- 0
common/logic/Setting/SettingDetails/Admin/AlertMessage/AdminSupportAlertMessageTypeSetting.php 查看文件

@@ -0,0 +1,22 @@
<?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'
]);
}
}

common/logic/Setting/SettingDetails/Admin/General/SupportDeveloperOnlineAdminSetting.php → common/logic/Setting/SettingDetails/Admin/General/SupportOnlineAdminSetting.php 查看文件

@@ -4,13 +4,13 @@ namespace common\logic\Setting\SettingDetails\Admin\General;

use common\logic\Setting\SettingDetails\AbstractSettingDetail;

class SupportDeveloperOnlineAdminSetting extends AbstractSettingDetail
class SupportOnlineAdminSetting extends AbstractSettingDetail
{
public function __construct()
{
$this
->setName('supportDeveloperOnline')
->setLabel("Support : développeur disponible")
->setName('supportOnline')
->setLabel("Support : disponible")
->setTypeBoolean()
->setFormTypeToggle();
}

+ 24
- 0
common/views/alert_message.php 查看文件

@@ -0,0 +1,24 @@
<?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; ?>

Loading…
取消
儲存