Boutton voir cette catégorie

This commit is contained in:
Alexandre Simonet 2016-03-15 15:31:05 +01:00
parent 18074c115b
commit d6e96411e9
2 changed files with 17 additions and 1 deletions

View File

@ -71,6 +71,11 @@ class AdminBraderie extends AdminTab
});
$("#category").change(function() {
$("#show_current_category_button").show();
});
$("#input_ean").change(function() {
$.ajax({
type: \'POST\',
@ -125,6 +130,16 @@ class AdminBraderie extends AdminTab
$("#hidden_product_id").val($product_id);
});
$("#show_current_category_button").click(function() {
$category = $("#category").val();
if ($category.length == 0) {
$("#error").empty().append("'.$this->l('Catégorie invalide').'");
return false;
}
window.location.href = "?tab=AdminCatalog&viewcategory&id_category=" + $category + "&token=" + $token;
return false;
});
});
</script>';
@ -169,6 +184,7 @@ class AdminBraderie extends AdminTab
<select class="chosen-select" id="category" name="category">
<option value=""></option>
</select>
<input type="submit" class="button" id="show_current_category_button" value="'.$this->l('Voir cette catégorie').'" style="margin-left: 20px; display: none">
</div>
<div class="margin-form" id="ean_input_group" style="display: none;">

View File

@ -23,7 +23,7 @@ class Braderie extends Module
$t = new Tab();
$t->id_parent = (int) Tab::getIdFromClassName('AdminCatalog');
$st->position = (int) Tab::getNewLastPosition($st->id_parent);
$st->position = (int) Tab::getNewLastPosition($t->id_parent);
$t->active = TRUE;
$t->module = 'braderie';
$t->class_name = 'AdminBraderie';