Browse Source

[backend] Demande de confirmation avant la suppression d'un point de vente

dev
Guillaume Bourgeois 5 years ago
parent
commit
71c23effa8
3 changed files with 45 additions and 22 deletions
  1. +19
    -5
      backend/controllers/PointSaleController.php
  2. +22
    -17
      backend/web/css/screen.css
  3. +4
    -0
      backend/web/sass/_adminlte.scss

+ 19
- 5
backend/controllers/PointSaleController.php View File

@@ -47,6 +47,8 @@ use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use common\models\User;
use common\models\UserPointSale;
use common\models\Order ;
use yii\helpers\Html;

/**
* PointVenteController implements the CRUD actions for PointVente model.
@@ -136,6 +138,7 @@ class PointSaleController extends BackendController
$model->processPointProduction();
$model->processRestrictedAccess();
Distribution::linkPointSaleIncomingDistributions($model) ;
Yii::$app->getSession()->setFlash('success', 'Point de vente modifié.');
return $this->redirect(['index']);
} else {
return $this->render('update', array_merge($this->initForm($id), [
@@ -166,11 +169,22 @@ class PointSaleController extends BackendController
* @param integer $id
* @return mixed
*/
public function actionDelete($id)
{
$this->findModel($id)->delete();
UserPointSale::deleteAll(['id_point_sale' => $id]);
PointSaleDistribution::deleteAll(['id_point_sale' => $id]) ;
public function actionDelete($id, $confirm = false)
{
$pointSale = $this->findModel($id) ;
if($confirm) {
$pointSale->delete();
UserPointSale::deleteAll(['id_point_sale' => $id]);
PointSaleDistribution::deleteAll(['id_point_sale' => $id]) ;
Order::updateAll(['id_point_sale' => 0], 'id_point_sale = :id_point_sale', [':id_point_sale' => $id]) ;
Yii::$app->getSession()->setFlash('success', 'Point de vente <strong>'.Html::encode($pointSale->name).'</strong> supprimé.');
}
else {
Yii::$app->getSession()->setFlash('info', 'Souhaitez-vous vraiment supprimer le point de vente <strong>'.Html::encode($pointSale->name).'</strong> ? '
. Html::a('Oui',['point-sale/delete','id' => $id, 'confirm' => 1], ['class' => 'btn btn-default']).' '.Html::a('Non', ['point-sale/index'], ['class' => 'btn btn-default']));
}
return $this->redirect(['index']);
}


+ 22
- 17
backend/web/css/screen.css View File

@@ -1454,81 +1454,86 @@ body.skin-black .content-wrapper .btn-primary {
body.skin-black .content-wrapper .alert a {
color: white;
}
/* line 129, ../sass/_adminlte.scss */
/* line 126, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .alert a.btn {
color: #333;
text-decoration: none;
}
/* line 133, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .callout h4 .fa {
margin-right: 7px;
}
/* line 132, ../sass/_adminlte.scss */
/* line 136, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .callout a {
color: white;
}
/* line 135, ../sass/_adminlte.scss */
/* line 139, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .callout .btn {
color: #333;
text-decoration: none;
}
/* line 142, ../sass/_adminlte.scss */
/* line 146, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .table th {
font-size: 13px;
}
/* line 145, ../sass/_adminlte.scss */
/* line 149, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .table th.column-actions, body.skin-black .content-wrapper .table td.column-actions {
width: 150px;
text-align: right;
}
/* line 149, ../sass/_adminlte.scss */
/* line 153, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .table td.text-small, body.skin-black .content-wrapper .table th.text-small {
font-size: 12px;
}
/* line 154, ../sass/_adminlte.scss */
/* line 158, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .pagination > .active > a, body.skin-black .content-wrapper .pagination > .active > span, body.skin-black .content-wrapper .pagination > .active > a:hover, body.skin-black .content-wrapper .pagination > .active > span:hover, body.skin-black .content-wrapper .pagination > .active > a:focus, body.skin-black .content-wrapper .pagination > .active > span:focus {
background-color: #FF7F00;
border: solid 1px #FF7F00;
color: white;
}
/* line 159, ../sass/_adminlte.scss */
/* line 163, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .pagination > li > a, body.skin-black .content-wrapper .pagination > li > span {
color: #FF7F00;
}
/* line 161, ../sass/_adminlte.scss */
/* line 165, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .pagination > li > a:hover, body.skin-black .content-wrapper .pagination > li > span:hover {
color: #cc6600;
}
/* line 168, ../sass/_adminlte.scss */
/* line 172, ../sass/_adminlte.scss */
body.skin-black .main-footer a {
color: #FF7F00;
}

/* line 174, ../sass/_adminlte.scss */
/* line 178, ../sass/_adminlte.scss */
body.login-page {
background: none;
background-color: white;
}
/* line 178, ../sass/_adminlte.scss */
/* line 182, ../sass/_adminlte.scss */
body.login-page .login-box .login-logo {
text-align: center;
font-family: "comfortaalight";
}
/* line 181, ../sass/_adminlte.scss */
/* line 185, ../sass/_adminlte.scss */
body.login-page .login-box .login-logo img {
width: 50px;
}
/* line 186, ../sass/_adminlte.scss */
/* line 190, ../sass/_adminlte.scss */
body.login-page .login-box .login-box-body .btn-primary {
background-color: #FF7F00;
border-color: #FF7F00;
padding: 5px 10px;
}
/* line 191, ../sass/_adminlte.scss */
/* line 195, ../sass/_adminlte.scss */
body.login-page .login-box .login-box-body .btn-primary:active {
background-color: #ff8c1a;
border-color: #FF7F00;
}
/* line 197, ../sass/_adminlte.scss */
/* line 201, ../sass/_adminlte.scss */
body.login-page .login-box .login-box-body a {
color: #FF7F00;
}
/* line 199, ../sass/_adminlte.scss */
/* line 203, ../sass/_adminlte.scss */
body.login-page .login-box .login-box-body a:hover {
color: #ff8c1a;
}

+ 4
- 0
backend/web/sass/_adminlte.scss View File

@@ -123,6 +123,10 @@ body.skin-black {
a {
color: white ;
}
a.btn {
color: #333 ;
text-decoration: none ;
}
}
.callout {

Loading…
Cancel
Save