ソースを参照

[Administration] Raccourci création ticket pour chaque producteur

feature/souke
Guillaume Bourgeois 9ヶ月前
コミット
32f9f6c300
6個のファイルの変更75行の追加19行の削除
  1. +4
    -1
      backend/controllers/SiteController.php
  2. +7
    -7
      backend/views/layouts/left.php
  3. +30
    -7
      backend/views/producer-admin/index.php
  4. +4
    -2
      backend/views/producer/update.php
  5. +26
    -0
      console/migrations/m240227_073149_add_column_producer_agree_contact_software_development.php
  6. +4
    -2
      domain/Producer/Producer/Producer.php

+ 4
- 1
backend/controllers/SiteController.php ファイルの表示

@@ -136,13 +136,16 @@ class SiteController extends BackendController
* Change le producteur courant de l'utilisateur connecté.
* Permet de passer d'un producteur à un autre en tant qu'administrateur.
*/
public function actionSwitchProducer(int $id)
public function actionSwitchProducer(int $id, bool $createTicket = false)
{
$user = $this->getUserCurrent();
$producer = $this->getProducerModule()->getRepository()->findOneProducerById($id);

if($producer) {
$this->getUserModule()->getBuilder()->switchProducer($user, $producer);
if($createTicket) {
return $this->redirect($this->getUrlManagerBackend()->createUrl(['support/create']));
}
}
else {
$this->addFlash('error', 'Producteur introuvable.');

+ 7
- 7
backend/views/layouts/left.php ファイルの表示

@@ -126,13 +126,6 @@ $isUserCurrentGrantedAsProducer = $userModule->getAuthorizationChecker()->isGran
'url' => ['dashboard-admin/index'],
'visible' => $isUserCurrentGrantedAsAdministrator,
],
[
'label' => 'En ligne',
'icon' => 'wifi',
'url' => ['online-admin/index'],
'visible' => $isUserCurrentGrantedAsAdministrator,
'template' => '<a href="{url}">{icon} {label}' . $countUsersProducersOnlineLabel . '</a>'
],
[
'label' => 'Support',
'icon' => 'comments',
@@ -149,6 +142,13 @@ $isUserCurrentGrantedAsProducer = $userModule->getAuthorizationChecker()->isGran
'items' => [
['label' => 'Chiffre d\'affaire', 'icon' => 'line-chart', 'url' => ['/stats-admin/turnover'], 'visible' => $isUserCurrentGrantedAsAdministrator],
['label' => 'Commandes clients', 'icon' => 'line-chart', 'url' => ['/stats-admin/customer-orders'], 'visible' => $isUserCurrentGrantedAsAdministrator],
[
'label' => 'En ligne',
'icon' => 'wifi',
'url' => ['online-admin/index'],
'visible' => $isUserCurrentGrantedAsAdministrator,
//'template' => '<a href="{url}">{icon} {label}' . $countUsersProducersOnlineLabel . '</a>'
],
['label' => 'Matomo', 'icon' => 'line-chart', 'url' => ['/stats-admin/matomo'], 'visible' => $isUserCurrentGrantedAsAdministrator],
],
],

+ 30
- 7
backend/views/producer-admin/index.php ファイルの表示

@@ -65,15 +65,18 @@ $this->addButton(['label' => 'Nouveau producteur <span class="glyphicon glyphico
$html .= '<span class="label label-danger">Hors-ligne</span>' ;
}

if(strlen($model->code))
{
$html .= ' <span class="glyphicon glyphicon-lock" data-toggle="tooltip" data-placement="bottom" data-original-title="'.Html::encode($model->code).'"></span>' ;
if(strlen($model->code)) {
$html .= ' <span class="glyphicon glyphicon-lock" data-toggle="tooltip" data-placement="bottom" title="'.Html::encode($model->code).'"></span>' ;
}

if($model->is_new) {
$html .= ' <span class="label label-info">Nouveau</span>' ;
}

if(!$model->agree_contact_about_software_development) {
$html .= ' <span class="label label-danger">Développement</span>';
}

return $html ;
}
],
@@ -103,7 +106,6 @@ $this->addButton(['label' => 'Nouveau producteur <span class="glyphicon glyphico
.'<br />'.Html::encode($u->phone) ;
}
}

}
}
],
@@ -111,7 +113,6 @@ $this->addButton(['label' => 'Nouveau producteur <span class="glyphicon glyphico
'label' => 'Facturation',
'format' => 'raw',
'value' => function($producer) use ($producerModule) {

$str = '';
$str .= '<ul style="margin: 0px;padding-left: 15px;">';

@@ -143,7 +144,9 @@ $this->addButton(['label' => 'Nouveau producteur <span class="glyphicon glyphico
}
$str .= '</li>';

$str .= '<li>Facturation '.strtolower(Producer::$billingFrequencyArray[$producer->option_billing_frequency]).'</li>';
if(!$isBillingFrequencyMonthly) {
$str .= '<li>Facturation '.strtolower(Producer::$billingFrequencyArray[$producer->option_billing_frequency]).'</li>';
}
}

if($producer->option_billing_permanent_transfer) {
@@ -175,7 +178,7 @@ $this->addButton(['label' => 'Nouveau producteur <span class="glyphicon glyphico
],
[
'class' => 'yii\grid\ActionColumn',
'template' => '{update} {billing} {dolibarr} {alwaysdata}',
'template' => '{update} {switch} {create-ticket} {billing} {dolibarr} {alwaysdata}',
'headerOptions' => ['class' => 'column-actions'],
'contentOptions' => ['class' => 'column-actions'],
'buttons' => [
@@ -189,6 +192,26 @@ $this->addButton(['label' => 'Nouveau producteur <span class="glyphicon glyphico
]
);
},
'switch' => function ($url, $model) {
return Html::a(
'<span class="glyphicon glyphicon-hand-up"></span>',
Yii::$app->urlManager->createUrl(['site/switch-producer', 'id' => $model->id]),
[
'title' => 'Aller sur le compte de ce producteur',
'class' => 'btn btn-default'
]
);
},
'create-ticket' => function ($url, $model) {
return Html::a(
'<span class="glyphicon glyphicon-comment"></span>',
Yii::$app->urlManager->createUrl(['site/switch-producer', 'id' => $model->id, 'createTicket' => true]),
[
'title' => 'Créer un ticket',
'class' => 'btn btn-default'
]
);
},
'dolibarr' => function ($url, $model) {
return Html::a(
'<span class="glyphicon glyphicon-paste"></span>',

+ 4
- 2
backend/views/producer/update.php ファイルの表示

@@ -495,6 +495,10 @@ $this->addBreadcrumb($this->getTitle());
<div v-show="currentSection == 'software'" class="panel panel-default">
<div class="panel-body">
<h4>Opendistrib</h4>
<?= $form->field($model, 'option_display_message_new_opendistrib_version')
->dropDownList(Dropdown::noYesChoices()); ?>
<?= $form->field($model, 'agree_contact_about_software_development')
->dropDownList(Dropdown::noYesChoices()); ?>
<?php $urlAboutPage = Yii::$app->urlManagerFrontend->createAbsoluteUrl(['site/about']); ?>
<?= $form->field($model, 'option_testimony')
->textarea(['rows' => 7])
@@ -513,8 +517,6 @@ $this->addBreadcrumb($this->getTitle());
8 => '8 heures',
])
->hint("Sélectionnez le temps que vous estimez gagner chaque semaine en utilisant ce logiciel. Cette donnée sera utilisée sur la page <a href=\"" . $urlAboutPage . "\" target=\"_blanck\">À propos</a> du site."); ?>
<?= $form->field($model, 'option_display_message_new_opendistrib_version')
->dropDownList(Dropdown::noYesChoices()); ?>
</div>
</div>


+ 26
- 0
console/migrations/m240227_073149_add_column_producer_agree_contact_software_development.php ファイルの表示

@@ -0,0 +1,26 @@
<?php

use yii\db\Migration;
use yii\db\Schema;

/**
* Class m240227_073149_add_column_producer_agree_contact_software_development
*/
class m240227_073149_add_column_producer_agree_contact_software_development extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->addColumn('producer', 'agree_contact_about_software_development', Schema::TYPE_BOOLEAN.' DEFAULT 1');
}

/**
* {@inheritdoc}
*/
public function safeDown()
{
$this->dropColumn('producer', 'agree_contact_about_software_development');
}
}

+ 4
- 2
domain/Producer/Producer/Producer.php ファイルの表示

@@ -298,7 +298,8 @@ class Producer extends ActiveRecordCommon
'option_document_display_price_unit_reference',
'option_check_by_default_prevent_user_credit',
'delivery_note_automatic_validation',
'is_new'
'is_new',
'agree_contact_about_software_development'
],
'boolean'
],
@@ -528,7 +529,8 @@ class Producer extends ActiveRecordCommon
'tiller_refresh_token' => 'Tiller : refresh token',
'tiller_redirect_uri' => 'Tiller : callback URL',
'tiller_store_id' => 'Tiller : store ID',
'is_new' => 'Nouveau'
'is_new' => 'Nouveau',
'agree_contact_about_software_development' => "J'accepte d'être contacté dans le cadre de l'amélioration du logiciel"
];
}


読み込み中…
キャンセル
保存