|
|
@@ -38,8 +38,8 @@ termes. |
|
|
|
|
|
|
|
use yii\helpers\Html; |
|
|
|
use yii\grid\GridView; |
|
|
|
use common\models\Developpement; |
|
|
|
use common\models\DeveloppementPriorite; |
|
|
|
use common\models\Development; |
|
|
|
use common\models\DevelopmentPriority; |
|
|
|
use common\models\User; |
|
|
|
use common\helpers\Url; |
|
|
|
|
|
|
@@ -49,7 +49,7 @@ use common\helpers\Url; |
|
|
|
$this->title = 'Développement'; |
|
|
|
$this->params['breadcrumbs'][] = $this->title; |
|
|
|
?> |
|
|
|
<div class="developpement-index"> |
|
|
|
<div class="development-index"> |
|
|
|
|
|
|
|
<h1><?= Html::encode($this->title) ?> <?= Html::a('Ajouter', ['create'], ['class' => 'btn btn-success']) ?></h1> |
|
|
|
|
|
|
@@ -64,9 +64,9 @@ $this->params['breadcrumbs'][] = $this->title; |
|
|
|
} |
|
|
|
?> |
|
|
|
|
|
|
|
<ul id="tabs-statuts-developpements" class="nav nav-tabs" role="tablist"> |
|
|
|
<li role="presentation" class="<?php if($statut == Developpement::STATUT_OPEN): ?>active<?php endif; ?>"><a href="<?= Yii::$app->urlManager->createUrl(['developpement/index','statut' => Developpement::STATUT_OPEN]); ?>" id="" aria-controls="" role="tab">Ouvert</a></li> |
|
|
|
<li role="presentation" class="<?php if($statut == Developpement::STATUT_CLOSED): ?>active<?php endif; ?>"><a href="<?= Yii::$app->urlManager->createUrl(['developpement/index','statut' => Developpement::STATUT_CLOSED]); ?>" id="" aria-controls="" role="tab">Fermé</a></li> |
|
|
|
<ul id="tab-status-developments" class="nav nav-tabs" role="tablist"> |
|
|
|
<li role="presentation" class="<?php if($status == Development::STATUS_OPEN): ?>active<?php endif; ?>"><a href="<?= Yii::$app->urlManager->createUrl(['development/index','status' => Development::STATUS_OPEN]); ?>" id="" aria-controls="" role="tab">Ouvert</a></li> |
|
|
|
<li role="presentation" class="<?php if($status == Development::STATUS_CLOSED): ?>active<?php endif; ?>"><a href="<?= Yii::$app->urlManager->createUrl(['development/index','status' => Development::STATUS_CLOSED]); ?>" id="" aria-controls="" role="tab">Fermé</a></li> |
|
|
|
</ul> |
|
|
|
|
|
|
|
<?php |
|
|
@@ -83,7 +83,7 @@ $this->params['breadcrumbs'][] = $this->title; |
|
|
|
'header' => 'Type', |
|
|
|
'format' => 'raw', |
|
|
|
'value' => function($model) { |
|
|
|
if($model->type == Developpement::TYPE_EVOLUTION) { |
|
|
|
if($model->type == Develoement::TYPE_EVOLUTION) { |
|
|
|
return '<span class="label label-success">Évolution</span>' ; |
|
|
|
} |
|
|
|
else { |
|
|
@@ -94,7 +94,7 @@ $this->params['breadcrumbs'][] = $this->title; |
|
|
|
[ 'attribute' => 'sujet', |
|
|
|
'format' => 'raw', |
|
|
|
'value' => function($model) { |
|
|
|
$html = '<strong>'.Html::encode($model->objet).'</strong>' ; |
|
|
|
$html = '<strong>'.Html::encode($model->subject).'</strong>' ; |
|
|
|
if(strlen($model->description)) |
|
|
|
$html .= '<br />'.nl2br(Html::encode($model->description)) ; |
|
|
|
return $html ; |
|
|
@@ -103,59 +103,57 @@ $this->params['breadcrumbs'][] = $this->title; |
|
|
|
'header' => 'Estimation', |
|
|
|
'format' => 'raw', |
|
|
|
'value' => function($model) { |
|
|
|
return intval($model->estimation_temps).' h' ; |
|
|
|
return intval($model->time_estimate).' h' ; |
|
|
|
}], |
|
|
|
[ 'attribute' => 'avancement', |
|
|
|
'format' => 'raw', |
|
|
|
'value' => function($model) { |
|
|
|
if($model->avancement) |
|
|
|
if($model->progress) |
|
|
|
return '<div class="progress"> |
|
|
|
<div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="'.intval($model->avancement).'" aria-valuemin="0" aria-valuemax="100" style="width: '.intval($model->avancement).'%;"> |
|
|
|
<span class="sr-only">'.intval($model->avancement).'% effectué</span> |
|
|
|
<div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="'.intval($model->progress).'" aria-valuemin="0" aria-valuemax="100" style="width: '.intval($model->progress).'%;"> |
|
|
|
<span class="sr-only">'.intval($model->progress).'% effectué</span> |
|
|
|
</div> |
|
|
|
</div> ' ; |
|
|
|
else |
|
|
|
return '' ; |
|
|
|
}], |
|
|
|
[ 'attribute' => 'date_livraison', |
|
|
|
[ 'attribute' => 'date_delivery', |
|
|
|
'format' => 'raw', |
|
|
|
'value' => function($model) { |
|
|
|
if(strlen($model->date_livraison)) |
|
|
|
return date('d/m/Y',strtotime($model->date_livraison)) ; |
|
|
|
if(strlen($model->date_delivery)) |
|
|
|
return date('d/m/Y',strtotime($model->date_delivery)) ; |
|
|
|
else |
|
|
|
return '' ; |
|
|
|
}], |
|
|
|
] ; |
|
|
|
|
|
|
|
|
|
|
|
if(Yii::$app->user->identity->status == USER::STATUS_ADMIN |
|
|
|
|| Yii::$app->user->identity->status == USER::STATUS_BOULANGER) { |
|
|
|
if(User::hasAccessBackend()) { |
|
|
|
|
|
|
|
$columns[] = [ |
|
|
|
'header' => 'Priorité', |
|
|
|
'format' => 'raw', |
|
|
|
'value' => function($model) { |
|
|
|
|
|
|
|
|
|
|
|
$current_priorite = (isset($model->developpementPrioriteCurrentEtablissement)) ? $model->developpementPrioriteCurrentEtablissement->getStrPriorite() : 'Non' ; |
|
|
|
$style_bouton = (isset($model->developpementPrioriteCurrentEtablissement)) ? $model->developpementPrioriteCurrentEtablissement->getClassCssStyleBouton() : 'default' ; |
|
|
|
$currentPriority = (isset($model->developmentPrioritYCurrentProducer)) ? $model->developmentPriorityCurrentProducer->getStrPriority() : 'Non' ; |
|
|
|
$styleButton = (isset($model->developmentPriorityCurrentProducer)) ? $model->developmentPriorityCurrentProducer->getClassCssStyleButton() : 'default' ; |
|
|
|
|
|
|
|
$html = '<div class="btn-group btn-group-priorite"> |
|
|
|
<button type="button" class="btn btn-priorite btn-sm btn-'.$style_bouton.' dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
|
|
|
'.$current_priorite.' <span class="caret"></span> |
|
|
|
<button type="button" class="btn btn-priorite btn-sm btn-'.$styleButton.' dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
|
|
|
'.$currentPriority.' <span class="caret"></span> |
|
|
|
</button> |
|
|
|
<ul class="dropdown-menu"> |
|
|
|
<li><a href="'.Yii::$app->urlManager->createUrl(['developpement/priorite','id_developpement'=>$model->id]).'">Non</a></li> |
|
|
|
<li><a href="'.Yii::$app->urlManager->createUrl(['developpement/priorite','id_developpement'=>$model->id, 'priorite' => DeveloppementPriorite::PRIORITE_BASSE]).'">Basse</a></li> |
|
|
|
<li><a href="'.Yii::$app->urlManager->createUrl(['developpement/priorite','id_developpement'=>$model->id, 'priorite' => DeveloppementPriorite::PRIORITE_NORMALE]).'">Normale</a></li> |
|
|
|
<li><a href="'.Yii::$app->urlManager->createUrl(['developpement/priorite','id_developpement'=>$model->id, 'priorite' => DeveloppementPriorite::PRIORITE_HAUTE]).'">Haute</a></li> |
|
|
|
<li><a href="'.Yii::$app->urlManager->createUrl(['development/priority','id_development' => $model->id]).'">Non</a></li> |
|
|
|
<li><a href="'.Yii::$app->urlManager->createUrl(['development/priority','id_development' => $model->id, 'priorite' => DevelopmentPriority::PRIORITY_LOW]).'">Basse</a></li> |
|
|
|
<li><a href="'.Yii::$app->urlManager->createUrl(['development/priority','id_development' => $model->id, 'priorite' => DevelopmentPriority::PRIORITY_NORMAL]).'">Normale</a></li> |
|
|
|
<li><a href="'.Yii::$app->urlManager->createUrl(['development/priority','id_development' => $model->id, 'priorite' => DevelopmentPriority::PRIORITY_HIGH]).'">Haute</a></li> |
|
|
|
</ul> |
|
|
|
</div><br />' ; |
|
|
|
|
|
|
|
if(isset($model->developpementPriorite) && count($model->developpementPriorite)) { |
|
|
|
foreach($model->developpementPriorite as $developpement_priorite) { |
|
|
|
if($developpement_priorite->id_etablissement != Yii::$app->user->identity->id_etablissement) |
|
|
|
$html .= '<div class="label label-priorite label-sm label-'.$developpement_priorite->getClassCssStyleBouton().'">'.Html::encode($developpement_priorite->etablissement->nom).'</div> ' ; |
|
|
|
if(isset($model->developmentPriority) && count($model->developmentPriority)) { |
|
|
|
foreach($model->developmentPriority as $developmentPriority) { |
|
|
|
if($developmentPriority->id_producer != Producer::getId()) |
|
|
|
$html .= '<div class="label label-priorite label-sm label-'.$developmentPriority->getClassCssStyleButton().'">'.Html::encode($developmentPriority->etablissement->name).'</div> ' ; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@@ -164,7 +162,7 @@ $this->params['breadcrumbs'][] = $this->title; |
|
|
|
] ; |
|
|
|
} |
|
|
|
|
|
|
|
if(Yii::$app->user->identity->status == USER::STATUS_ADMIN) { |
|
|
|
if(User::getStatus() == USER::STATUS_ADMIN) { |
|
|
|
$columns[] = [ |
|
|
|
'class' => 'yii\grid\ActionColumn', |
|
|
|
'template' => '{update}', |
|
|
@@ -178,7 +176,7 @@ $this->params['breadcrumbs'][] = $this->title; |
|
|
|
<span class="sr-only">Toggle Dropdown</span> |
|
|
|
</button> |
|
|
|
<ul class="dropdown-menu"> |
|
|
|
<li><a href="'.Yii::$app->urlManager->createUrl(['developpement/delete','id' => $model->id]).'" class=""><span class="glyphicon glyphicon-trash"></span> Supprimer</a></li> |
|
|
|
<li><a href="'.Yii::$app->urlManager->createUrl(['development/delete','id' => $model->id]).'" class=""><span class="glyphicon glyphicon-trash"></span> Supprimer</a></li> |
|
|
|
</ul> |
|
|
|
</div>' ; |
|
|
|
}, |
|
|
@@ -190,7 +188,7 @@ $this->params['breadcrumbs'][] = $this->title; |
|
|
|
|
|
|
|
<?= |
|
|
|
GridView::widget([ |
|
|
|
'id' => 'tab-developpements', |
|
|
|
'id' => 'tab-developments', |
|
|
|
'dataProvider' => $dataProvider, |
|
|
|
'columns' => $columns |
|
|
|
]); |