$disable_cols = array('status_id','item_price_out','item_customer', 'model_id','item_quantity');
if($this->db->map_unique('model_barcode', $_GET['barcode'], 'model_countable', 'model')) {
+ $multi_insert = true;
//$disable_cols[] = 'item_quantity';
$item_serial = '';
$item_quantity = $quantity_added = 1;
$action = $_SERVER['SCRIPT_NAME'].'/item/new';
} else {
+ $multi_insert = false;
$quantity_added = $_GET['quantity'];
if($quantity_added <= 0) $this->post_redirect_get("$URL_INTERNAL/1","Can't store non-possitive amount of items!");
if(!is_numeric($quantity_added)) $quantity_added = 1;
'item_author' => $this->db->auth->get_user_id()
));
- echo $this->html->render_insert_form('item', $columns, $selectbox, $current, $disable_cols, $action);
+ echo $this->html->render_insert_form('item', $columns, $selectbox, $current, $disable_cols, $action, $multi_insert);
break;
}
} else $hr = '<hr />';
//$args[] = false;
$args[] = $parts;
+
$html .= call_user_func_array(array($this, 'render_insert_form'), $args);
$html .= $hr;
}
return $this->html->render_insert_form($class, $columns, $selectbox);
}
- function render_form_edit($class, $id) {
+ function render_form_edit($class, $id, $multi_insert) {
$columns = $this->db->get_columns($class);
$selectbox = $this->db->columns_get_selectbox($columns, $class);
$current = $this->db->get_listing($class, $id, 1);
- return $this->html->render_insert_form($class, $columns, $selectbox, $current);
+ return $this->html->render_insert_form($class, $columns, $selectbox, $current, false, false, $multi_insert);
}
function render_single_record_details($class, $id) {
$html.=$this->render_listing_navigation($class, '*', $limit, $offset);
}
if($edit) {
- $html.= $this->render_form_edit($class, $id);
+ $html.= $this->render_form_edit($class, $id, false);
$action = $_SERVER['SCRIPT_NAME']."/$class/$id/delete";
$html.=$this->html->form($action,'POST',array(
array(false,'DELETE','submit'),