Browse Source

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

refactoring
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

use yii\filters\VerbFilter; use yii\filters\VerbFilter;
use common\models\User; use common\models\User;
use common\models\UserPointSale; use common\models\UserPointSale;
use common\models\Order ;
use yii\helpers\Html;


/** /**
* PointVenteController implements the CRUD actions for PointVente model. * PointVenteController implements the CRUD actions for PointVente model.
$model->processPointProduction(); $model->processPointProduction();
$model->processRestrictedAccess(); $model->processRestrictedAccess();
Distribution::linkPointSaleIncomingDistributions($model) ; Distribution::linkPointSaleIncomingDistributions($model) ;
Yii::$app->getSession()->setFlash('success', 'Point de vente modifié.');
return $this->redirect(['index']); return $this->redirect(['index']);
} else { } else {
return $this->render('update', array_merge($this->initForm($id), [ return $this->render('update', array_merge($this->initForm($id), [
* @param integer $id * @param integer $id
* @return mixed * @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']); return $this->redirect(['index']);
} }



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

body.skin-black .content-wrapper .alert a { body.skin-black .content-wrapper .alert a {
color: white; 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 { body.skin-black .content-wrapper .callout h4 .fa {
margin-right: 7px; margin-right: 7px;
} }
/* line 132, ../sass/_adminlte.scss */
/* line 136, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .callout a { body.skin-black .content-wrapper .callout a {
color: white; color: white;
} }
/* line 135, ../sass/_adminlte.scss */
/* line 139, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .callout .btn { body.skin-black .content-wrapper .callout .btn {
color: #333; color: #333;
text-decoration: none; text-decoration: none;
} }
/* line 142, ../sass/_adminlte.scss */
/* line 146, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .table th { body.skin-black .content-wrapper .table th {
font-size: 13px; 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 { body.skin-black .content-wrapper .table th.column-actions, body.skin-black .content-wrapper .table td.column-actions {
width: 150px; width: 150px;
text-align: right; 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 { body.skin-black .content-wrapper .table td.text-small, body.skin-black .content-wrapper .table th.text-small {
font-size: 12px; 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 { 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; background-color: #FF7F00;
border: solid 1px #FF7F00; border: solid 1px #FF7F00;
color: white; 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 { body.skin-black .content-wrapper .pagination > li > a, body.skin-black .content-wrapper .pagination > li > span {
color: #FF7F00; 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 { body.skin-black .content-wrapper .pagination > li > a:hover, body.skin-black .content-wrapper .pagination > li > span:hover {
color: #cc6600; color: #cc6600;
} }
/* line 168, ../sass/_adminlte.scss */
/* line 172, ../sass/_adminlte.scss */
body.skin-black .main-footer a { body.skin-black .main-footer a {
color: #FF7F00; color: #FF7F00;
} }


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

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

a { a {
color: white ; color: white ;
} }
a.btn {
color: #333 ;
text-decoration: none ;
}
} }
.callout { .callout {

Loading…
Cancel
Save