From: Janusz Dobrowolski Date: Sat, 19 Jul 2008 18:28:58 +0000 (+0000) Subject: Fixed page usability in non-js mode. X-Git-Tag: v2.4.2~19^2~1901 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=03f6bd7c439c43c18dabf268f93c2464bbfc78da;p=fa-stable.git Fixed page usability in non-js mode. --- diff --git a/sales/inquiry/sales_orders_view.php b/sales/inquiry/sales_orders_view.php index e797863c..bcf416ca 100644 --- a/sales/inquiry/sales_orders_view.php +++ b/sales/inquiry/sales_orders_view.php @@ -109,15 +109,21 @@ else unset($selected_stock_item); } -//--------------------------------------------------------------------------------------------- -if (isset($_POST['ChangeTmpl']) && $_POST['ChangeTmpl'] != 0) +function change_tpl_flag($id) { - $sql = "UPDATE ".TB_PREF."sales_orders SET type = !type WHERE order_no=".$_POST['ChangeTmpl']; + global $Ajax; + + $sql = "UPDATE ".TB_PREF."sales_orders SET type = !type WHERE order_no=$id"; db_query($sql, "Can't change sales order type"); $Ajax->activate('orders_tbl'); } //--------------------------------------------------------------------------------------------- +$id = find_submit('_chgtpl'); +if ($id != -1) + change_tpl_flag($id); + +//--------------------------------------------------------------------------------------------- $sql = "SELECT ".TB_PREF."sales_orders.order_no, ".TB_PREF."debtors_master.curr_code, ".TB_PREF."debtors_master.name, ".TB_PREF."cust_branch.br_name, ".TB_PREF."sales_orders.ord_date, ".TB_PREF."sales_orders.deliver_to, ".TB_PREF."sales_orders.delivery_date, @@ -204,6 +210,11 @@ if ($result) $view_page = get_customer_trans_view_str(systypes::sales_order(), $myrow["order_no"]); $formated_del_date = sql2date($myrow["delivery_date"]); $formated_order_date = sql2date($myrow["ord_date"]); + if (isset($_POST['Update']) && + check_value( "chgtpl".$myrow["order_no"]) != $myrow["type"]) { + change_tpl_flag($myrow["order_no"]); + $myrow['type'] = !$myrow['type']; + } // $not_closed = $myrow['type'] && ($myrow["TotDelivered"] < $myrow["TotQuantity"]); // if overdue orders, then highlight as so @@ -246,9 +257,8 @@ if ($result) } else { - echo ""; + check_cells( null, "chgtpl" .$myrow["order_no"], $myrow["type"], true, + _('Set this order as a template for direct deliveries/invoices')); $modify_page = $path_to_root . "/sales/sales_order_entry.php?" . SID . "ModifyOrderNumber=" . $myrow["order_no"]; label_cell("" . _("Edit") . ""); @@ -265,12 +275,14 @@ if ($result) //end of page full new headings if } //end of while loop - hidden('ChangeTmpl', 0); end_table(); if ($overdue_items) display_note(_("Marked items are overdue."), 0, 1, "class='overduefg'"); + else + echo '
'; div_end(); + submit_center('Update', _("Update"), true, '', null); end_form(); }