mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-05-24 08:20:54 -04:00
fix bulk_edit: don't remove supplier if none is selected, save category, removed confirm dialog (#393)
This commit is contained in:
@@ -473,15 +473,15 @@ class Items extends Secure_area implements iData_controller
|
||||
$item_data = array();
|
||||
|
||||
foreach($_POST as $key=>$value)
|
||||
{
|
||||
{
|
||||
//This field is nullable, so treat it differently
|
||||
if ($key == 'supplier_id')
|
||||
{
|
||||
$item_data["$key"]=$value == '' ? null : $value;
|
||||
if ($key == 'supplier_id' and $value != '')
|
||||
{
|
||||
$item_data["$key"] = $value;
|
||||
}
|
||||
elseif($value!='' and !(in_array($key, array('submit', 'item_ids', 'tax_names', 'tax_percents', 'category'))))
|
||||
elseif($value != '' and !(in_array($key, array('item_ids', 'tax_names', 'tax_percents'))))
|
||||
{
|
||||
$item_data["$key"]=$value;
|
||||
$item_data["$key"] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -157,26 +157,21 @@ $(document).ready(function()
|
||||
$('#item_form').validate($.extend({
|
||||
submitHandler:function(form)
|
||||
{
|
||||
if(confirm("<?php echo $this->lang->line('items_confirm_bulk_edit') ?>"))
|
||||
//Get the selected ids and create hidden fields to send with ajax submit.
|
||||
var selected_item_ids=get_selected_values();
|
||||
for(k=0;k<selected_item_ids.length;k++)
|
||||
{
|
||||
//Get the selected ids and create hidden fields to send with ajax submit.
|
||||
var selected_item_ids=get_selected_values();
|
||||
for(k=0;k<selected_item_ids.length;k++)
|
||||
{
|
||||
$(form).append("<input type='hidden' name='item_ids[]' value='"+selected_item_ids[k]+"' />");
|
||||
}
|
||||
|
||||
|
||||
$(form).ajaxSubmit({
|
||||
$(form).append("<input type='hidden' name='item_ids[]' value='"+selected_item_ids[k]+"' />");
|
||||
}
|
||||
|
||||
$(form).ajaxSubmit({
|
||||
success:function(response)
|
||||
{
|
||||
dialog_support.hide();
|
||||
post_bulk_form_submit(response);
|
||||
},
|
||||
dataType:'json'
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
rules:
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user