ソースを参照

Refactoring/traduction vues backend/views/development

refactoring
コミット
6f28ada1f6
4個のファイルの変更42行の追加48行の削除
  1. +9
    -13
      backend/views/development/_form.php
  2. +1
    -1
      backend/views/development/create.php
  3. +31
    -33
      backend/views/development/index.php
  4. +1
    -1
      backend/views/development/update.php

backend/views/developpement/_form.php → backend/views/development/_form.php ファイルの表示

@@ -45,29 +45,25 @@ use common\models\Developpement ;
/* @var $form yii\widgets\ActiveForm */
?>

<div class="developpement-form">
<div class="development-form">

<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'type')->dropDownList([
Developpement::TYPE_EVOLUTION => 'Évolution',
Developpement::TYPE_BUG => 'Anomalie',
Development::TYPE_EVOLUTION => 'Évolution',
Development::TYPE_BUG => 'Anomalie',
]) ?>
<?= $form->field($model, 'statut')->dropDownList([
Developpement::STATUT_OPEN => 'Ouvert',
Developpement::STATUT_CLOSED => 'Fermé',
Development::STATUS_OPEN => 'Ouvert',
Development::STATUS_CLOSED => 'Fermé',
]) ?>
<?= $form->field($model, 'objet')->textInput(['maxlength' => true]) ?>

<?= $form->field($model, 'subject')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'description')->textarea(['rows' => 6]) ?>

<?= $form->field($model, 'estimation_temps')->textInput() ?>

<?= $form->field($model, 'avancement')->textInput() ?>
<?= $form->field($model, 'date_livraison')->textInput() ?>
<?= $form->field($model, 'time_estimate')->textInput() ?>
<?= $form->field($model, 'progress')->textInput() ?>
<?= $form->field($model, 'date_delivery')->textInput() ?>

<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? 'Ajouter' : 'Modifier', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>

backend/views/developpement/create.php → backend/views/development/create.php ファイルの表示

@@ -46,7 +46,7 @@ $this->title = 'Ajouter un développement';
$this->params['breadcrumbs'][] = ['label' => 'Développement', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="developpement-create">
<div class="development-create">

<h1><?= Html::encode($this->title) ?></h1>


backend/views/developpement/index.php → backend/views/development/index.php ファイルの表示

@@ -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
]);

backend/views/developpement/update.php → backend/views/development/update.php ファイルの表示

@@ -46,7 +46,7 @@ $this->params['breadcrumbs'][] = ['label' => 'Développement', 'url' => ['index'
$this->params['breadcrumbs'][] = ['label' => '#'.$model->id, 'url' => ['update', 'id' => $model->id]];
$this->params['breadcrumbs'][] = 'Modifier';
?>
<div class="developpement-update">
<div class="development-update">

<h1><?= Html::encode($this->title) ?></h1>


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