'<span class="glyphicon glyphicon-pencil"></span>', | '<span class="glyphicon glyphicon-pencil"></span>', | ||||
$url, | $url, | ||||
[ | [ | ||||
'title' => Yii::t('app', 'Modifier'), | |||||
'title' => 'Modifier', | |||||
'class' => 'btn btn-default' | 'class' => 'btn btn-default' | ||||
] | ] | ||||
); | ); | ||||
'<span class="glyphicon glyphicon-trash"></span>', | '<span class="glyphicon glyphicon-trash"></span>', | ||||
$url, | $url, | ||||
[ | [ | ||||
'title' => Yii::t('app', 'Supprimer'), | |||||
'title' => 'Supprimer', | |||||
'class' => 'btn btn-default' | 'class' => 'btn btn-default' | ||||
] | ] | ||||
); | ); |
'<span class="glyphicon glyphicon-pencil"></span>', | '<span class="glyphicon glyphicon-pencil"></span>', | ||||
$url, | $url, | ||||
[ | [ | ||||
'title' => Yii::t('app', 'Modifier'), | |||||
'title' => 'Modifier', | |||||
'class' => 'btn btn-default' | 'class' => 'btn btn-default' | ||||
] | ] | ||||
); | ); |
'buttons' => [ | 'buttons' => [ | ||||
'update' => function ($url, $model) { | 'update' => function ($url, $model) { | ||||
return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, [ | return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, [ | ||||
'title' => Yii::t('app', 'Modifier'), 'class' => 'btn btn-default' | |||||
'title' => 'Modifier', 'class' => 'btn btn-default' | |||||
]); | ]); | ||||
}, | }, | ||||
'delete' => function ($url, $model) { | 'delete' => function ($url, $model) { | ||||
return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, [ | return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, [ | ||||
'title' => Yii::t('app', 'Supprimer'), 'class' => 'btn btn-default' | |||||
'title' => 'Supprimer', 'class' => 'btn btn-default' | |||||
]); | ]); | ||||
} | } | ||||
], | ], |
'buttons' => [ | 'buttons' => [ | ||||
'update' => function ($url, $model) { | 'update' => function ($url, $model) { | ||||
return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, [ | return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, [ | ||||
'title' => Yii::t('app', 'Modifier'), 'class' => 'btn btn-default' | |||||
'title' => 'Modifier', 'class' => 'btn btn-default' | |||||
]); | ]); | ||||
}, | }, | ||||
'delete' => function ($url, $model) { | 'delete' => function ($url, $model) { | ||||
return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, [ | return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, [ | ||||
'title' => Yii::t('app', 'Supprimer'), 'class' => 'btn btn-default' | |||||
'title' => 'Supprimer', 'class' => 'btn btn-default' | |||||
]); | ]); | ||||
} | } | ||||
], | ], |
'buttons' => [ | 'buttons' => [ | ||||
'update' => function ($url, $model) { | 'update' => function ($url, $model) { | ||||
return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, [ | return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, [ | ||||
'title' => Yii::t('app', 'Modifier'), 'class' => 'btn btn-default' | |||||
'title' => 'Modifier', 'class' => 'btn btn-default' | |||||
]); | ]); | ||||
}, | }, | ||||
'delete' => function ($url, $model) { | 'delete' => function ($url, $model) { | ||||
return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, [ | return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, [ | ||||
'title' => Yii::t('app', 'Supprimer'), 'class' => 'btn btn-default' | |||||
'title' => 'Supprimer', 'class' => 'btn btn-default' | |||||
]); | ]); | ||||
} | } | ||||
], | ], |
'buttons' => [ | 'buttons' => [ | ||||
'update' => function ($url, $model) { | 'update' => function ($url, $model) { | ||||
return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, [ | return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, [ | ||||
'title' => Yii::t('app', 'Modifier'), 'class' => 'btn btn-default' | |||||
'title' => 'Modifier', 'class' => 'btn btn-default' | |||||
]); | ]); | ||||
}, | }, | ||||
'delete' => function ($url, $model) { | 'delete' => function ($url, $model) { | ||||
return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, [ | return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, [ | ||||
'title' => Yii::t('app', 'Supprimer'), 'class' => 'btn btn-default' | |||||
'title' => 'Supprimer', 'class' => 'btn btn-default' | |||||
]); | ]); | ||||
} | } | ||||
], | ], |
'buttons' => [ | 'buttons' => [ | ||||
'update' => function ($url, $model) { | 'update' => function ($url, $model) { | ||||
return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, [ | return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, [ | ||||
'title' => Yii::t('app', 'Modifier'), 'class' => 'btn btn-default' | |||||
'title' => 'Modifier', 'class' => 'btn btn-default' | |||||
]); | ]); | ||||
}, | }, | ||||
'delete' => function ($url, $model) { | 'delete' => function ($url, $model) { | ||||
return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, [ | return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, [ | ||||
'title' => Yii::t('app', 'Supprimer'), 'class' => 'btn btn-default' | |||||
'title' => 'Supprimer', 'class' => 'btn btn-default' | |||||
]); | ]); | ||||
} | } | ||||
], | ], |
'buttons' => [ | 'buttons' => [ | ||||
'update' => function ($url, $model) { | 'update' => function ($url, $model) { | ||||
return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, [ | return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, [ | ||||
'title' => Yii::t('app', 'Modifier'), 'class' => 'btn btn-default' | |||||
'title' => 'Modifier', 'class' => 'btn btn-default' | |||||
]); | ]); | ||||
}, | }, | ||||
'delete' => function ($url, $model) { | 'delete' => function ($url, $model) { | ||||
return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, [ | return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, [ | ||||
'title' => Yii::t('app', 'Supprimer'), 'class' => 'btn btn-default' | |||||
'title' => 'Supprimer', 'class' => 'btn btn-default' | |||||
]); | ]); | ||||
} | } | ||||
], | ], |
$html = ''; | $html = ''; | ||||
if ($countOrders) { | if ($countOrders) { | ||||
$html .= Html::a('<span class="glyphicon glyphicon-eye-open"></span> ' . $countOrders, $url, [ | $html .= Html::a('<span class="glyphicon glyphicon-eye-open"></span> ' . $countOrders, $url, [ | ||||
'title' => Yii::t('app', 'Commandes'), 'class' => 'btn btn-default ' | |||||
'title' => 'Commandes', 'class' => 'btn btn-default ' | |||||
]);; | ]);; | ||||
} else { | } else { | ||||
$html .= 'Aucune commande'; | $html .= 'Aucune commande'; | ||||
$url = Yii::$app->urlManager->createUrl(['user/update', 'id' => $model->id]); | $url = Yii::$app->urlManager->createUrl(['user/update', 'id' => $model->id]); | ||||
$user = User::find()->with('userProducer')->where(['id' => $model->id])->one(); | $user = User::find()->with('userProducer')->where(['id' => $model->id])->one(); | ||||
return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, [ | return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, [ | ||||
'title' => Yii::t('app', 'Modifier'), 'class' => 'btn btn-default' | |||||
'title' => 'Modifier', 'class' => 'btn btn-default' | |||||
]); | ]); | ||||
}, | }, | ||||
'delete' => function ($url, $model) { | 'delete' => function ($url, $model) { | ||||
return Html::a('<span class="glyphicon glyphicon-trash"></span>', Yii::$app->urlManager->createUrl(array_merge(['user/delete', 'id' => $model->id], Yii::$app->getRequest()->getQueryParams())), [ | return Html::a('<span class="glyphicon glyphicon-trash"></span>', Yii::$app->urlManager->createUrl(array_merge(['user/delete', 'id' => $model->id], Yii::$app->getRequest()->getQueryParams())), [ | ||||
'title' => Yii::t('app', 'Supprimer'), 'class' => 'btn btn-default btn-confirm-delete' | |||||
'title' => 'Supprimer', 'class' => 'btn btn-default btn-confirm-delete' | |||||
]); | ]); | ||||
} | } | ||||
], | ], |
'update' => function ($url, $model) { | 'update' => function ($url, $model) { | ||||
$url = Yii::$app->urlManager->createUrl(['distribution/index', 'idOrderUpdate' => $model->id]); | $url = Yii::$app->urlManager->createUrl(['distribution/index', 'idOrderUpdate' => $model->id]); | ||||
return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, [ | return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, [ | ||||
'title' => Yii::t('app', 'Modifier'), 'class' => 'btn btn-default' | |||||
'title' => 'Modifier', 'class' => 'btn btn-default' | |||||
]); | ]); | ||||
}, | }, | ||||
], | ], |