$userProducerModule = $this->getUserProducerModule(); | $userProducerModule = $this->getUserProducerModule(); | ||||
$ticketModule = $this->getTicketModule(); | $ticketModule = $this->getTicketModule(); | ||||
$featureChecker = $this->getFeatureModule()->getChecker(); | $featureChecker = $this->getFeatureModule()->getChecker(); | ||||
$adminSettingBag = $this->getSettingModule()->getAdminSettingBag(); | |||||
$producer = GlobalParam::getCurrentProducer(); | $producer = GlobalParam::getCurrentProducer(); | ||||
$userCurrent = GlobalParam::getCurrentUser(); | $userCurrent = GlobalParam::getCurrentUser(); | ||||
$countTicketsProducerUnreadLabel = ''; | $countTicketsProducerUnreadLabel = ''; | ||||
$countTicketsProducerUnread = $ticketModule->countTicketsUnreadByUser($this->getUserCurrent()); | $countTicketsProducerUnread = $ticketModule->countTicketsUnreadByUser($this->getUserCurrent()); | ||||
if($countTicketsProducerUnread && !$isUserCurrentGrantedAsAdministrator) { | if($countTicketsProducerUnread && !$isUserCurrentGrantedAsAdministrator) { | ||||
$countTicketsProducerUnreadLabel = '<span class="pull-right-container"><small class="label pull-right bg-green">'.$countTicketsProducerUnread.'</small></span>'; | |||||
$countTicketsProducerUnreadLabel = '<small class="label pull-right bg-blue">'.$countTicketsProducerUnread.'</small>'; | |||||
} | |||||
$developerOnlineLabel = ''; | |||||
if($adminSettingBag->get('supportDeveloperOnline')) { | |||||
$developerOnlineLabel = '<small class="label pull-right bg-green"><i class="fa fa-phone"></i></small>'; | |||||
} | } | ||||
$countTicketsAdminUnreadLabel = ''; | $countTicketsAdminUnreadLabel = ''; | ||||
'items' => [ | 'items' => [ | ||||
['label' => "Besoin d'aide ?", 'options' => ['class' => 'header'], 'visible' => $isUserCurrentGrantedAsProducer], | ['label' => "Besoin d'aide ?", 'options' => ['class' => 'header'], 'visible' => $isUserCurrentGrantedAsProducer], | ||||
[ | [ | ||||
'label' => 'Support', | |||||
'label' => 'Support', | |||||
'icon' => 'comments', | 'icon' => 'comments', | ||||
'url' => ['support/index'], | 'url' => ['support/index'], | ||||
'visible' => $isUserCurrentGrantedAsProducer, | 'visible' => $isUserCurrentGrantedAsProducer, | ||||
'template' => '<a href="{url}">{icon} {label}' . $countTicketsProducerUnreadLabel . '</a>' | |||||
'template' => '<a href="{url}">{icon} {label} <span class="pull-right-container">' . $developerOnlineLabel . $countTicketsProducerUnreadLabel . '</span></a>' | |||||
], | ], | ||||
['label' => $producer->name, 'options' => ['class' => 'header'], 'visible' => $isUserCurrentGrantedAsProducer], | ['label' => $producer->name, 'options' => ['class' => 'header'], 'visible' => $isUserCurrentGrantedAsProducer], | ||||
['label' => 'Tableau de bord', 'icon' => 'dashboard', 'url' => ['/dashboard/index'], 'visible' => $isUserCurrentGrantedAsProducer], | ['label' => 'Tableau de bord', 'icon' => 'dashboard', 'url' => ['/dashboard/index'], 'visible' => $isUserCurrentGrantedAsProducer], |
return $field->checkbox(); | return $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' => 'default']]); | |||||
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']]); | |||||
} | } | ||||
elseif($settingDetail->getFormType() == 'select') { | elseif($settingDetail->getFormType() == 'select') { | ||||
return $field->dropDownList($settingDetail->getOptions()); | return $field->dropDownList($settingDetail->getOptions()); |
$this->setTitle('Support & contact'); | $this->setTitle('Support & contact'); | ||||
$this->addBreadcrumb($this->getTitle()); | $this->addBreadcrumb($this->getTitle()); | ||||
$supportDeveloperOnline = $adminSettingBag->get('supportDeveloperOnline'); | |||||
?> | ?> | ||||
<div class="support-index"> | <div class="support-index"> | ||||
<?php if($context == 'producer'): ?> | <?php if($context == 'producer'): ?> | ||||
<div class="callout callout-info"> | <div class="callout callout-info"> | ||||
<p><i class="icon fa fa-info-circle"></i> Pour toutes vos remarques, suggestions et remontées de bugs.</p> | |||||
<p><i class="icon fa fa-info-circle"></i> Pour toutes vos questions, remarques, suggestions et remontées de bugs.</p> | |||||
</div> | </div> | ||||
<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 bg-yellow"><i class="fa fa-phone"></i></span> | |||||
<span class="info-box-icon <?php if($supportDeveloperOnline): ?>bg-green<?php else: ?>bg-yellow<?php endif; ?>"><i class="fa fa-phone"></i></span> | |||||
<div class="info-box-content"> | <div class="info-box-content"> | ||||
<span class="info-box-text">Me contacter directement</span> | |||||
<span class="info-box-text"> | |||||
Me contacter directement | |||||
<?php if($supportDeveloperOnline): ?> | |||||
<br /><span class="label label-success">Disponible</span> | |||||
<?php endif; ?> | |||||
</span> | |||||
<span class="info-box-text"> | <span class="info-box-text"> | ||||
<br/> | <br/> | ||||
<strong><?= $adminSettingBag->get('administratorPhoneNumber'); ?></strong> | <strong><?= $adminSettingBag->get('administratorPhoneNumber'); ?></strong> |
top: -1px; | top: -1px; | ||||
margin-right: 3px; | margin-right: 3px; | ||||
} | } | ||||
/* line 30, ../sass/setting/_form.scss */ | |||||
/* line 29, ../sass/setting/_form.scss */ | |||||
.setting-form .form-group.form-toggle .control-label { | .setting-form .form-group.form-toggle .control-label { | ||||
position: relative; | |||||
/*position: relative; | |||||
top: 7px; | top: 7px; | ||||
left: 10px; | |||||
left: 10px;*/ | |||||
} | } | ||||
/* line 36, ../sass/setting/_form.scss */ | |||||
/* line 35, ../sass/setting/_form.scss */ | |||||
.setting-form .form-group.form-toggle .toggle { | .setting-form .form-group.form-toggle .toggle { | ||||
-moz-border-radius: 20px; | |||||
-webkit-border-radius: 20px; | |||||
border-radius: 20px; | |||||
float: left; | |||||
-moz-border-radius: 5px; | |||||
-webkit-border-radius: 5px; | |||||
border-radius: 5px; | |||||
display: block; | |||||
} | } | ||||
/* line 41, ../sass/setting/_form.scss */ | |||||
/* line 40, ../sass/setting/_form.scss */ | |||||
.setting-form .form-group.form-toggle .toggle .toggle-group .btn.toggle-on { | .setting-form .form-group.form-toggle .toggle .toggle-group .btn.toggle-on { | ||||
color: white; | color: white; | ||||
} | } | ||||
/* line 45, ../sass/setting/_form.scss */ | |||||
/* line 43, ../sass/setting/_form.scss */ | |||||
.setting-form .form-group.form-toggle .toggle .toggle-group .btn.toggle-off { | .setting-form .form-group.form-toggle .toggle .toggle-group .btn.toggle-off { | ||||
border-color: white; | |||||
color: white; | |||||
} | } | ||||
/** | /** |
} | } | ||||
&.form-toggle { | &.form-toggle { | ||||
.control-label { | .control-label { | ||||
position: relative; | |||||
/*position: relative; | |||||
top: 7px; | top: 7px; | ||||
left: 10px; | |||||
left: 10px;*/ | |||||
} | } | ||||
.toggle { | .toggle { | ||||
@include border-radius(20px); | |||||
float: left; | |||||
@include border-radius(5px); | |||||
display: block; | |||||
.toggle-group { | .toggle-group { | ||||
.btn.toggle-on { | .btn.toggle-on { | ||||
//border-color: white; | |||||
color: white; | color: white; | ||||
} | } | ||||
.btn.toggle-off { | .btn.toggle-off { | ||||
border-color: white; | |||||
color: white; | |||||
} | } | ||||
} | } | ||||
} | } |
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; | |||||
class AdminSettingDefinition extends SettingDefinition | class AdminSettingDefinition extends SettingDefinition | ||||
{ | { | ||||
return [ | return [ | ||||
self::SECTION_GENERAL => [ | self::SECTION_GENERAL => [ | ||||
self::SUBSECTION_GENERAL => [ | self::SUBSECTION_GENERAL => [ | ||||
new SupportDeveloperOnlineAdminSetting(), | |||||
new AdministratorEmailAdminSetting(), | new AdministratorEmailAdminSetting(), | ||||
new AdministratorPhoneNumberAdminSetting(), | new AdministratorPhoneNumberAdminSetting(), | ||||
new MaximumNumberProducersAdminSetting(), | new MaximumNumberProducersAdminSetting(), |
<?php | |||||
namespace common\logic\Setting\SettingDetails\Admin\General; | |||||
use common\logic\Setting\SettingDetails\AbstractSettingDetail; | |||||
class SupportDeveloperOnlineAdminSetting extends AbstractSettingDetail | |||||
{ | |||||
public function __construct() | |||||
{ | |||||
$this | |||||
->setName('supportDeveloperOnline') | |||||
->setLabel("Support : développeur disponible") | |||||
->setTypeBoolean() | |||||
->setFormTypeToggle(); | |||||
} | |||||
} |