3 // Put this on the page only once, e.g. print_hidden_script(systypes::sales_order());
5 function print_hidden_script($type_no)
8 include_once($path_to_root . "/includes/types.inc");
10 $_POST['PARAM_0'] = $_POST['PARAM_1'] = 0; // the document no. is updated in print_document_link().
14 case systypes::sales_order() :
15 $action = "$path_to_root/reporting/rep109.php";
16 $_POST['PARAM_2'] = ""; // currency
17 $_POST['PARAM_3'] = ""; // bank account
18 $_POST['PARAM_4'] = 0; // email
19 $_POST['PARAM_5'] = 0; // quote
20 $_POST['PARAM_6'] = ""; // comments
23 case systypes::cust_dispatch() :
24 $action = "$path_to_root/reporting/rep110.php";
25 $_POST['PARAM_2'] = 0; // email
26 $_POST['PARAM_3'] = ""; // comments
29 case 10 : // Sales Invoice
30 case 11 : // Customer Credit Note
31 $action = "$path_to_root/reporting/rep107.php";
32 $_POST['PARAM_2'] = ""; // currency
33 $_POST['PARAM_3'] = ""; // bank account
34 $_POST['PARAM_4'] = 0; // email
35 $_POST['PARAM_5'] = ""; // paylink
36 $_POST['PARAM_6'] = ""; // comments
40 $action = "$path_to_root/reporting/rep209.php";
41 $_POST['PARAM_2'] = ""; // currency
42 $_POST['PARAM_3'] = ""; // bank account
43 $_POST['PARAM_4'] = 0; // email
44 $_POST['PARAM_5'] = ""; // comments
49 for ($i = 0; $i < $params; $i++)
51 $st .= "<input type='hidden' name='PARAM_".$i."' value='".$_POST['PARAM_'.$i]."' />";
53 $st = "<form method='post' name='pdf_form' action='$action'>" . $st . "</form>\n";
57 // Ex. label_cell(print_document_link($myrow['order_no'], _("Print")));
58 // or display_note(print_document_link($order_no, _("Print this order")));
60 // echo "<input type='button' name='button' value='"._("Print this order")."' onclick=\"".
61 // print_document_link($order_no, "", false)."\" class='inputsubmit' />\n";
63 function print_document_link($doc_no, $link_text, $link=true)
65 $st = "document.pdf_form.PARAM_0.value = '$doc_no';";
66 $st .= "document.pdf_form.PARAM_1.value = '$doc_no';";
67 $st .= "window.open('','REP_WINDOW','toolbar=no,scrollbar=no,resizable=yes,menubar=no');
68 document.pdf_form.target='REP_WINDOW';
69 document.pdf_form.submit();\n";
71 return "<a href=\"javascript:$st\">" . $link_text . "</a>";
73 return "javascript:$st";