소스 검색

Afficher les commandes annulées dans l'historique client

refactoring
부모
커밋
b3c6609df2
2개의 변경된 파일29개의 추가작업 그리고 17개의 파일을 삭제
  1. +0
    -1
      producer/controllers/CommandeController.php
  2. +29
    -16
      producer/views/commande/historique.php

+ 0
- 1
producer/controllers/CommandeController.php 파일 보기

@@ -233,7 +233,6 @@ class CommandeController extends ProducerBaseController
'id_user' => Yii::$app->user->id,
'production.id_etablissement' => $this->getProducer()->id
])
->andWhere('date_delete IS NULL')
->orderBy('production.date DESC'),
'pagination' => [
'pageSize' => 10,

+ 29
- 16
producer/views/commande/historique.php 파일 보기

@@ -96,24 +96,37 @@ GridView::widget([
'label' => 'Statut',
'format' => 'raw',
'value' => function($c) {
if($c->getEtat() == Commande::ETAT_LIVREE) {
return 'Livrée' ;
$html = '' ;
if($c->date_delete) {
$html .= '<span class="label label-danger">Annulée</span><br />' ;
if($c->getEtat() == Commande::ETAT_MODIFIABLE) {
$html .= '<a href="'.Yii::$app->urlManager->createUrl(['commande/update','id'=>$c->id, 'id_etablissement'=>$c->production->etablissement->id]).'" class="btn btn-default"><span class="glyphicon glyphicon-pencil"></span> Modifier</a>' ;
}
}
elseif($c->getEtat() == Commande::ETAT_PREPARATION) {
return 'En préparation' ;
}
elseif($c->getEtat() == Commande::ETAT_MODIFIABLE) {
return '<div class="btn-group">
<a href="'.Yii::$app->urlManager->createUrl(['commande/update','id'=>$c->id, 'id_etablissement'=>$c->production->etablissement->id]).'" class="btn btn-default"><span class="glyphicon glyphicon-pencil"></span> Modifier</a>
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="'.Yii::$app->urlManager->createUrl(['commande/annuler','id'=>$c->id]).'"><span class="glyphicon glyphicon-trash"></span> Annuler la commande</a></li>
</ul>
</div>' ;
else {
if($c->getEtat() == Commande::ETAT_LIVREE) {
$html .= '<span class="label label-success">Livrée</span>' ;
}
elseif($c->getEtat() == Commande::ETAT_PREPARATION) {
$html .= '<span class="label label-warning">En préparation</span>' ;
}
elseif($c->getEtat() == Commande::ETAT_MODIFIABLE) {
$html .= '<span class="label label-default">Ouverte</span><br />' ;
$html .= '<div class="btn-group">
<a href="'.Yii::$app->urlManager->createUrl(['commande/update','id'=>$c->id, 'id_etablissement'=>$c->production->etablissement->id]).'" class="btn btn-default"><span class="glyphicon glyphicon-pencil"></span> Modifier</a>
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="'.Yii::$app->urlManager->createUrl(['commande/annuler','id'=>$c->id]).'"><span class="glyphicon glyphicon-trash"></span> Annuler la commande</a></li>
</ul>
</div>' ;
}
}
return $html ;
}
],
]

Loading…
취소
저장