<?php
-
+/**********************************************************************
+ Copyright (C) FrontAccounting, LLC.
+ Released under the terms of the GNU General Public License, GPL,
+ as published by the Free Software Foundation, either version 3
+ of the License, or (at your option) any later version.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
+***********************************************************************/
$page_security = 2;
$path_to_root="../..";
-include($path_to_root . "/sales/includes/sales_ui.inc");
include($path_to_root . "/includes/db_pager.inc");
-include_once($path_to_root . "/reporting/includes/reporting.inc");
include($path_to_root . "/includes/session.inc");
+include($path_to_root . "/sales/includes/sales_ui.inc");
+include_once($path_to_root . "/reporting/includes/reporting.inc");
$js = "";
if ($use_popup_windows)
function prt_link($row)
{
- return print_document_link($row['order_no'], _("Print"), true, 30);
+ return print_document_link($row['order_no'], _("Print"), true, 30, ICON_PRINT);
}
function edit_link($row)
{
return pager_link( _("Edit"),
- "/sales/sales_order_entry.php?" . SID . "ModifyOrderNumber=" . $row['order_no']);
+ "/sales/sales_order_entry.php?ModifyOrderNumber=" . $row['order_no'], ICON_EDIT);
}
function dispatch_link($row)
{
return pager_link( _("Dispatch"),
- "/sales/customer_delivery.php?" . SID . "OrderNumber=" .$row['order_no']);
+ "/sales/customer_delivery.php?OrderNumber=" .$row['order_no'], ICON_DOC);
}
function invoice_link($row)
{
return pager_link( _("Invoice"),
- "/sales/sales_order_entry.php?" . SID . "NewInvoice=" .$row["order_no"]);
+ "/sales/sales_order_entry.php?NewInvoice=" .$row["order_no"], ICON_DOC);
}
function delivery_link($row)
{
return pager_link( _("Delivery"),
- "/sales/sales_order_entry.php?" . SID . "NewDelivery=" .$row['order_no']);
+ "/sales/sales_order_entry.php?NewDelivery=" .$row['order_no'], ICON_DOC);
}
function tmpl_checkbox($row)
{
$name = "chgtpl" .$row['order_no'];
- $value = $row['type'] ? ' checked' : '';
-
- return "<input $value type='checkbox' name='$name' value='1'"
- ." onclick='JsHttpRequest.request(\"_{$name}_update\", this.form);'"
- ." title='"._('Set this order as a template for direct deliveries/invoices')
- ."' >"
-// add also old checkbox name+value for check after 'Update'
- ."<input name='last[".$row['order_no']."]' type='hidden' value='"
- .($row['type'] ? 1 : 0)."'>\n";
+ $value = $row['type'] ? 1:0;
+
+// save also in hidden field for testing during 'Update'
+
+ return checkbox(null, $name, $value, true,
+ _('Set this order as a template for direct deliveries/invoices'))
+ . hidden('last['.$row['order_no'].']', $value, false);
}
//---------------------------------------------------------------------------------------------
// Update db record if respective checkbox value has changed.
if ($id != -1)
change_tpl_flag($id);
-if (isset($_POST['Update'])) {
+if (isset($_POST['Update']) && isset($_POST['last'])) {
foreach($_POST['last'] as $id => $value)
if ($value != check_value('chgtpl'.$id))
change_tpl_flag($id);
$Ajax->activate('orders_tbl');
}
-start_form(false, false, $_SERVER['PHP_SELF'] .SID);
+start_form();
start_table("class='tablestyle_noborder'");
start_row();
stock_items_list_cells(_("Item:"), 'SelectStockFromList', null, true);
-submit_cells('SearchOrders', _("Search"),'',_('Select documents'), true);
+submit_cells('SearchOrders', _("Search"),'',_('Select documents'), 'default');
hidden('order_view_mode', $_POST['order_view_mode']);
end_table(1);
end_form();
-
//---------------------------------------------------------------------------------------------
// Orders inquiry table
//
_("Order #") => array('fun'=>'view_link'),
_("Customer"),
_("Branch"),
- _("Comments"),
+ _("Cust Order Ref"),
_("Order Date") => 'date',
_("Required By") =>array('type'=>'date', 'ord'=>''),
_("Delivery To"),
);
if ($_POST['order_view_mode'] == 'OutstandingOnly') {
- array_replace($cols, 3, 1, _("Cust Order Ref"));
+ //array_replace($cols, 3, 1, _("Cust Order Ref"));
array_append($cols, array(array('insert'=>true, 'fun'=>'dispatch_link')));
} elseif ($_POST['order_view_mode'] == 'InvoiceTemplates') {
$table =& new_db_pager('orders_tbl', $sql, $cols);
$table->set_marker('check_overdue', _("Marked items are overdue."));
-
-if (get_post('SearchOrders'))
-{
+if (get_post('SearchOrders')) {
$table->set_sql($sql);
$table->set_columns($cols);
- $Ajax->activate('orders_tbl');
-}
- start_form();
- display_db_pager($table);
+}
+$table->width = "80%";
+start_form();
+
+display_db_pager($table);
+submit_center('Update', _("Update"), true, '', null);
- submit_center('Update', _("Update"), true, '', null);
- end_form();
+end_form();
end_page();
?>
\ No newline at end of file