}
}
+/* remove unchecked data so each
+ * funcion doesn't to check what's been checked or not.
+ */
+function filter_data(&$data) {
+ if(!isset($data['detail'])) return;
+ $new_details = array();
+ foreach(@$data['detail'] as $detail_id => $values) {
+ if(@$values['check'] === 'on') $new_details[$detail_id]=$values;
+ }
+ $data['detail'] = $new_details;
+}
+
function post_to_detail_ids() {
$detail_ids = array();
foreach($_POST['detail'] as $detail_id => $values) {
$date_fields = array('hold_until_date', 'required_date', 'expiry_date', 'priority');
foreach($_POST['detail'] as $detail_id => $values) {
$set = array();
- if($comment = $values['comment']) array_push($set, " comment='$comment' ");
+ $comment=$values['comment'];
+ array_push($set, " comment='$comment' "); // erase comment if needed.
foreach($date_fields as $date_field) {
if(isset($values[$date_field])) {
$input_date = trim($values[$date_field]);
$_SESSION['page_title'] = _($help_context = "Edit lines extra parameters");
// Process POST
+filter_data($_POST);
update_extra_order_details();
split_order_details();
}
customer_list_cells(_("Select a customer: "), 'customer_id', $customer_id, true, true);
-if($customer_id !== null) {
+if($customer_id != null) {
if(!isset($_POST['item_like'])) {
if(isset($_GET['item_like'])) {
$item_like = $_GET['item_like'];