// Fix accordion for bootsrap and better bulk action for warehouse
This commit is contained in:
1 parent
a175e603ef
commit
0247550a0a
2 files changed
+26
-59
No files matched your search
@@ -36,9 +36,7 @@
|
|||||||
<p>{l s='Please choose the warehouses associated with this product. You must also select a default warehouse. '}</p>
|
<p>{l s='Please choose the warehouses associated with this product. You must also select a default warehouse. '}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<a class="btn btn-default confirm_leave" href="{$link->getAdminLink('AdminWarehouses')|escape:'htmlall':'UTF-8'}&addwarehouse">
|
<a class="btn btn-link confirm_leave" href="{$link->getAdminLink('AdminWarehouses')|escape:'htmlall':'UTF-8'}&addwarehouse">{l s='Create a new warehouse'} <i class="icon-external-link-sign"></i></a>
|
||||||
<i class="icon-plus-sign"></i> {l s='Create a new warehouse'}
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="panel-group" id="warehouse-accordion">
|
<div class="panel-group" id="warehouse-accordion">
|
||||||
@@ -51,12 +49,15 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="warehouse-{$warehouse['name']}" class="panel-collapse collapse{if $smarty.foreach.data.first} in{/if}">
|
<div id="warehouse-{$warehouse['name']}" class="panel-collapse collapse{if $smarty.foreach.data.first} in{/if}">
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<table cellpadding="10" cellspacing="0" class="table">
|
<table class="table">
|
||||||
<tr>
|
<thead>
|
||||||
<th width="100">{l s='Stored'}</th>
|
<tr>
|
||||||
<th>{l s='Product'}</th>
|
<th class="fixed-width-xs" align="center"><span class="title_box">{l s='Stored'}</span></th>
|
||||||
<th width="150">{l s='Location (optional)'}</th>
|
<th><span class="title_box">{l s='Product'}</span></th>
|
||||||
</tr>
|
<th><span class="title_box">{l s='Location (optional)'}</span></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
{foreach $attributes AS $index => $attribute}
|
{foreach $attributes AS $index => $attribute}
|
||||||
{assign var=location value=''}
|
{assign var=location value=''}
|
||||||
{assign var=selected value=''}
|
{assign var=selected value=''}
|
||||||
@@ -67,7 +68,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{/foreach}
|
{/foreach}
|
||||||
<tr {if $index is odd}class="alt_row"{/if}>
|
<tr {if $index is odd}class="alt_row"{/if}>
|
||||||
<td><input type="checkbox"
|
<td class="fixed-width-xs" align="center"><input type="checkbox"
|
||||||
name="check_warehouse_{$warehouse['id_warehouse']}_{$attribute['id_product']}_{$attribute['id_product_attribute']}"
|
name="check_warehouse_{$warehouse['id_warehouse']}_{$attribute['id_product']}_{$attribute['id_product_attribute']}"
|
||||||
{if $selected == true}checked="checked"{/if}
|
{if $selected == true}checked="checked"{/if}
|
||||||
value="1" />
|
value="1" />
|
||||||
@@ -79,17 +80,15 @@
|
|||||||
size="20" />
|
size="20" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
<tr>
|
|
||||||
<td colspan="3"> </td>
|
|
||||||
</tr>
|
|
||||||
{if $attributes|@count gt 1}
|
|
||||||
<tr>
|
|
||||||
<td><input type="checkbox" class="check_all_warehouse" value="check_warehouse_{$warehouse['id_warehouse']}" /></td>
|
|
||||||
<td colspan="2"><i>{l s='Mark all products as stored in this warehouse.'}</i></td>
|
|
||||||
</tr>
|
|
||||||
{/if}
|
|
||||||
</table>
|
</table>
|
||||||
|
{if $attributes|@count gt 1}
|
||||||
|
<button type="button" class="btn btn-default check_all_warehouse" value="check_warehouse_{$warehouse['id_warehouse']}"><i class="icon-check-sign"></i> {l s='Mark / Unmark all products as stored in this warehouse.'}</button>
|
||||||
|
<!--<tr>
|
||||||
|
<td><input type="checkbox" class="check_all_warehouse" value="check_warehouse_{$warehouse['id_warehouse']}" /></td>
|
||||||
|
<td colspan="2"><i></i></td>
|
||||||
|
</tr>-->
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+7
-39
@@ -1320,25 +1320,6 @@ product_tabs['Suppliers'] = new function(){
|
|||||||
//manage default supplier check
|
//manage default supplier check
|
||||||
self.manageDefaultSupplier();
|
self.manageDefaultSupplier();
|
||||||
});
|
});
|
||||||
|
|
||||||
// @TODO: a better way to fix the accordion wrong size bug when the selected page is this page
|
|
||||||
setTimeout(function() {
|
|
||||||
$('#suppliers_accordion').accordion({
|
|
||||||
collapsible: true,
|
|
||||||
autoHeight: true,
|
|
||||||
heightStyle: "content"
|
|
||||||
});
|
|
||||||
}, 1000);
|
|
||||||
|
|
||||||
// Resize the accordion once the page is visible because of the bug with accordions initialized
|
|
||||||
// inside a display:none block not having the correct size.
|
|
||||||
$('#suppliers_accordion').parents('.product-tab-content').bind('displayed', function(){
|
|
||||||
$('#suppliers_accordion').accordion({
|
|
||||||
collapsible: true,
|
|
||||||
autoHeight: true,
|
|
||||||
heightStyle: "content"
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1418,9 +1399,9 @@ product_tabs['Warehouses'] = new function(){
|
|||||||
|
|
||||||
this.onReady = function(){
|
this.onReady = function(){
|
||||||
$('.check_all_warehouse').click(function() {
|
$('.check_all_warehouse').click(function() {
|
||||||
var check = $(this);
|
|
||||||
//get all checkboxes of current warehouse
|
//get all checkboxes of current warehouse
|
||||||
var checkboxes = $('input[name*="'+check.val()+'"]');
|
var checkboxes = $('input[name*="'+$(this).val()+'"]');
|
||||||
|
var checked = false;
|
||||||
|
|
||||||
for (i=0; i<checkboxes.length; i++)
|
for (i=0; i<checkboxes.length; i++)
|
||||||
{
|
{
|
||||||
@@ -1433,27 +1414,14 @@ product_tabs['Warehouses'] = new function(){
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
item.attr("checked", true);
|
item.attr("checked", true);
|
||||||
|
checked = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
// @TODO: a better way to fix the accordion wrong size bug when the selected page is this page
|
if (checked)
|
||||||
setTimeout(function() {
|
$(this).find('i').removeClass('icon-check-sign').addClass('icon-check-empty');
|
||||||
$('#warehouse_accordion').accordion({
|
else
|
||||||
collapsible: true,
|
$(this).find('i').removeClass('icon-check-empty').addClass('icon-check-sign');
|
||||||
autoHeight: true,
|
|
||||||
heightStyle: "content"
|
|
||||||
});
|
|
||||||
}, 1000);
|
|
||||||
|
|
||||||
// Resize the accordion once the page is visible because of the bug with accordions initialized
|
|
||||||
// inside a display:none block not having the correct size.
|
|
||||||
$('#warehouse_accordion').parents('.product-tab-content').bind('displayed', function(){
|
|
||||||
$('#warehouse_accordion').accordion({
|
|
||||||
collapsible: true,
|
|
||||||
autoHeight: true,
|
|
||||||
heightStyle: "content"
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user