- if ($form->{type} eq 'purchase_order') {
- $type = qq|<select name=formname>
- <option value=purchase_order $form->{PD}{purchase_order}>|
- . $locale->text('Purchase Order') . qq|
- <option value=bin_list $form->{PD}{bin_list}>|
- . $locale->text('Bin List');
- }
-
- if ($form->{type} eq 'credit_note') {
- $type = qq|<select name=formname>
- <option value=credit_note $form->{PD}{credit_note}>|
- . $locale->text('Credit Note');
- }
-
- if ($form->{type} eq 'sales_order') {
- $type = qq|<select name=formname>
- <option value=sales_order $form->{PD}{sales_order}>|
- . $locale->text('Confirmation') . qq|
- <option value=proforma $form->{PD}{proforma}>|
- . $locale->text('Proforma Invoice') . qq|
- <option value=pick_list $form->{PD}{pick_list}>|
- . $locale->text('Pick List') . qq|
- <option value=packing_list $form->{PD}{packing_list}>|
- . $locale->text('Packing List');
- }
-
- if ($form->{type} =~ /_quotation$/) {
- $type = qq|<select name=formname>
- <option value="$`_quotation" $form->{PD}{"$`_quotation"}>|
- . $locale->text('Quotation');
- }
-
- if ($form->{type} eq 'invoice') {
- $type = qq|<select name=formname>
- <option value=invoice $form->{PD}{invoice}>|
- . $locale->text('Invoice') . qq|
- <option value=proforma $form->{PD}{proforma}>|
- . $locale->text('Proforma Invoice') . qq|
- <option value=packing_list $form->{PD}{packing_list}>|
- . $locale->text('Packing List');
- }
-
- if ($form->{type} eq 'invoice' && $form->{storno}) {
- $type = qq|<select name=formname>
- <option value=storno_invoice $form->{PD}{storno_invoice}>|
- . $locale->text('Storno Invoice') . qq|
- <option value=storno_packing_list $form->{PD}{storno_packing_list}>|
- . $locale->text('Storno Packing List');
- }
-
- if ($form->{type} eq 'credit_note') {
- $type = qq|<select name=formname>
- <option value=credit_note $form->{PD}{credit_note}>|
- . $locale->text('Credit Note');
- }
-
- if ($form->{type} eq 'ship_order') {
- $type = qq|<select name=formname>
- <option value=pick_list $form->{PD}{pick_list}>|
- . $locale->text('Pick List') . qq|
- <option value=packing_list $form->{PD}{packing_list}>|
- . $locale->text('Packing List');
- }
-
- if ($form->{type} eq 'receive_order') {
- $type = qq|<select name=formname>
- <option value=bin_list $form->{PD}{bin_list}>|
- . $locale->text('Bin List');
- }
-
- if ($form->{media} eq 'email') {
- $media = qq|<select name=sendmode>
- <option value=attachment $form->{SM}{attachment}>|
- . $locale->text('Attachment') . qq|
- <option value=inline $form->{SM}{inline}>| . $locale->text('In-line');
- } else {
- $media = qq|<select name=media>
- <option value=screen $form->{OP}{screen}>| . $locale->text('Screen');
- if (scalar(keys (%{ $form->{printers} })) !=0 && $latex_templates) {
- $media .= qq|
- <option value=printer $form->{OP}{printer}>|
- . $locale->text('Printer');
- }
- if ($latex_templates) {
- $media .= qq|
- <option value=queue $form->{OP}{queue}>| . $locale->text('Queue');
- }
- }
-
- $format = qq|<select name=format>|;
- if ($opendocument_templates && $openofficeorg_writer_bin &&
- $xvfb_bin && (-x $openofficeorg_writer_bin) && (-x $xvfb_bin)) {
- $format .= qq|<option value=opendocument_pdf | .
- $form->{DF}{"opendocument_pdf"} . qq|>| .
- $locale->text("PDF (OpenDocument/OASIS)") . qq|</option>|;
- }
-
- if ($latex_templates) {
- $format .= qq|<option value=pdf $form->{DF}{pdf}>| .
- $locale->text('PDF') . qq|</option>|;
- }
-
- $format .= qq|<option value=html $form->{DF}{html}>HTML</option>|;
-
- if ($latex_templates) {
- $format .= qq|<option value=postscript $form->{DF}{postscript}>| .
- $locale->text('Postscript') . qq|</option>|;
- }
-
- if ($opendocument_templates) {
- $format .= qq|<option value=opendocument $form->{DF}{opendocument}>| .
- $locale->text("OpenDocument/OASIS") . qq|</option>|;
- }
- $format .= qq|</select>|;
-
- if (scalar(keys (%{ $form->{languages} })) !=0) {
- $language_select = qq|<select name=language_id>
- <option value=""></option>}|;
- foreach $item (@{ $form->{languages} }) {
- if ($form->{language_id} eq $item->{id}) {
- $language_select .= qq|<option value="$item->{id}" selected>$item->{description}</option>|;
- } else {
- $language_select .= qq|<option value="$item->{id}">$item->{description}</option>|;
- }
- }
- }
-
- if (scalar(keys (%{ $form->{printers} })) !=0) {
-
- $printer_select = qq|<select name=printer_id>
- <option value=""></option>|;
- foreach $item (@{ $form->{printers} }) {
- $printer_select .= qq|<option value="$item->{id}">$item->{printer_description}</option>|;
- }
- }
-
-
-
- print qq|
-<table width=100% cellspacing=0 cellpadding=0>
- <tr>
- <td>
- <table>
- <tr>
- <td>$type</select></td>|;
- if (scalar(keys (%{ $form->{languages} })) !=0) {
- print qq|
- <td>${language_select}</select></td>|;
- }
- print qq|
- <td>$format</select></td>
- <td>$media</select></td>|;
- if (scalar(keys (%{ $form->{printers} })) !=0) {
- print qq|
- <td>$printer_select</select></td>
-|;
- }
-
- if (scalar(keys (%{ $form->{printers} })) !=0 && $latex_templates && $form->{media} ne 'email') {
- print qq|
- <td>| . $locale->text('Copies') . qq|
- <input name=copies size=2 value=$form->{copies}></td>
-|;
- }