}, | }, | ||||
'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' | |||||
'title' => Yii::t('app', 'Supprimer'), 'class' => 'btn btn-default btn-confirm-delete' | |||||
]); | ]); | ||||
} | } | ||||
], | ], |
opendistrib_tooltip() ; | opendistrib_tooltip() ; | ||||
opendistrib_ordre_produits() ; | opendistrib_ordre_produits() ; | ||||
opendistrib_products() ; | opendistrib_products() ; | ||||
opendistrib_confirm_delete() ; | |||||
}) ; | }) ; | ||||
var UrlManager = { | var UrlManager = { | ||||
} | } | ||||
}; | }; | ||||
function opendistrib_confirm_delete() { | |||||
$('.btn-confirm-delete').click(function(event) { | |||||
if(!confirm('Souhaitez-vous vraiment supprimer cette entrée ?')) { | |||||
event.stopPropagation() ; | |||||
return false ; | |||||
} | |||||
}) ; | |||||
} | |||||
function opendistrib_products() { | function opendistrib_products() { | ||||
if($('.product-create').size() || $('.product-update').size()) { | if($('.product-create').size() || $('.product-update').size()) { | ||||
opendistrib_products_event_unit(false) ; | opendistrib_products_event_unit(false) ; |