Added helper function for setting page_security for multiusage pages.
[fa-stable.git] / sales / sales_order_entry.php
index ff7945785279f3f00fc800787e513759b910197a..cd9e48b24ff36911a758b9bfb29b0342b51e59a1 100644 (file)
@@ -17,8 +17,8 @@
 //     Entry Direct Invoice
 //
 
-$page_security = 'SA_SALESORDER';
 $path_to_root = "..";
+$page_security = 'SA_SALESORDER';
 
 include_once($path_to_root . "/sales/includes/cart_class.inc");
 include_once($path_to_root . "/includes/session.inc");
@@ -27,6 +27,20 @@ include_once($path_to_root . "/sales/includes/ui/sales_order_ui.inc");
 include_once($path_to_root . "/sales/includes/sales_db.inc");
 include_once($path_to_root . "/sales/includes/db/sales_types_db.inc");
 include_once($path_to_root . "/reporting/includes/reporting.inc");
+
+set_page_security( @$_SESSION['Items']->trans_type,
+       array(  ST_SALESORDER=>'SA_SALESORDER',
+                       ST_SALESQUOTE => 'SA_SALESQUOTE',
+                       ST_CUSTDELIVERY => 'SA_SALESDELIVERY',
+                       ST_SALESINVOICE => 'SA_SALESINVOICE'),
+       array(  'NewOrder' => 'SA_SALESORDER',
+                       'ModifySalesOrder' => 'SA_SALESORDER',
+                       'NewQuotation' => 'SA_SALESQUOTE',
+                       'ModifyQuotationNumber' => 'SA_SALESQUOTE',
+                       'NewDelivery' => 'SA_SALESDELIVERY',
+                       'NewInvoice' => 'SA_SALESINVOICE')
+);
+
 $js = '';
 
 if ($use_popup_windows) {
@@ -162,6 +176,8 @@ if (isset($_GET['AddedID'])) {
 
        submenu_print(_("&Print Delivery Note"), ST_CUSTDELIVERY, $delivery, 'prtopt');
        submenu_print(_("&Email Delivery Note"), ST_CUSTDELIVERY, $delivery, null, 1);
+       submenu_print(_("P&rint as Packing Slip"), ST_CUSTDELIVERY, $delivery, 'prtopt', null, 1);
+       submenu_print(_("E&mail as Packing Slip"), ST_CUSTDELIVERY, $delivery, null, 1, 1);
        set_focus('prtopt');
 
        display_note(get_gl_view_str(ST_CUSTDELIVERY, $delivery, _("View the GL Journal Entries for this Dispatch")),0, 1);