update message confirm for deletion ean

This commit is contained in:
Marion Muszynski 2016-04-04 15:54:18 +02:00
parent 7fbf095387
commit d658b0eab2

View File

@ -65,9 +65,7 @@ class AdminLabelGenerate extends AdminTab {
}
$this->_html .= '<p class="conf">Suppression terminée </p>';
}
}
if ($current_sale && !Tools::getValue('deleteEAN')) {
}elseif ($current_sale && !Tools::getValue('deleteEAN')) {
$sale = new Sale((int)$current_sale);
if(!Validate::isLoadedObject($sale)) {
@ -178,7 +176,7 @@ class AdminLabelGenerate extends AdminTab {
<br class="clear"/>
<br class="clear"/>
<button class="button" id="generateEAN">Générer les EANs</button>
<button class="button" id="deleteEAN" onclick="return confirm(\'Êtes cous sur de vouloir supprimer les eans de cette vente ?\');">Supprimer les EANs</button>
<button class="button" id="deleteEAN" >Supprimer les EANs</button>
</div>
</fieldset>
<br /><br />';
@ -201,20 +199,23 @@ class AdminLabelGenerate extends AdminTab {
$(".chosen-select").chosen().change( function() {});
$("#generateEAN").click(function(){
if($(".chosen-select").val() != 999999) {
if ($(".chosen-select").val() != 999999) {
$(\'#category_selector\').hide();
document.location.href=\'index.php?tab=AdminLabelGenerate&token='.Tools::getAdminTokenLite('AdminLabelGenerate').'&id_sale=\' + $(".chosen-select").val();
}
});
$("#deleteEAN").click(function(){
if($(".chosen-select").val() != 999999) {
console.log($(".chosen-select").val());
document.location.href=\'index.php?tab=AdminLabelGenerate&token='.Tools::getAdminTokenLite('AdminLabelGenerate').'&deleteEAN=1&id_sale=\' + $(".chosen-select").val();
ok = confirm("Êtes vous sur de vouloir supprimer les eans de cette vente ?")
if (ok == true){
if ($(".chosen-select").val() != 999999) {
document.location.href=\'index.php?tab=AdminLabelGenerate&token='.Tools::getAdminTokenLite('AdminLabelGenerate').'&deleteEAN=1&id_sale=\' + $(".chosen-select").val();
}
}
});
});
</script>';