-
-
- | . $locale->text('To') . qq| |
- |
- | . $locale->text('Cc') . qq| |
- |
-
-
- | . $locale->text('Subject') . qq| |
- |
- $bcc
-
+
-
-
- | . $locale->text('Message') . qq| |
-
-
- |
-
+
+
+ | . $locale->text('Message') . qq| |
+
+
+ |
+
@@ -1345,21 +1436,21 @@ sub e_mail {
# save all other variables
foreach $key (keys %$form) {
$form->{$key} =~ s/\"/"/g;
- print qq|\n|;
+ print qq|\n|;
}
print qq|
-
|
+
|
-
+
-
@@ -1383,230 +1474,109 @@ sub send_email {
$lxdebug->leave_sub();
}
+# generate the printing options displayed at the bottom of oe and is forms.
+# this function will attempt to guess what type of form is displayed, and will generate according options
+#
+# about the coding:
+# this version builds the arrays of options pretty directly. if you have trouble understanding how,
+# the opthash function builds hashrefs which are then pieced together for the template arrays.
+# unneeded options are "undef"ed out, and then grepped out.
+#
+# the inline options is untested, but intended to be used later in metatemplating
sub print_options {
- $lxdebug->enter_sub();
- $form->{sendmode} = "attachment";
+ $lxdebug->enter_sub() and my ($inline) = @_;
- $form->{"format"} =
- $form->{"format"} ? $form->{"format"} :
- $myconfig{"template_format"} ? $myconfig{"template_format"} :
- "pdf";
+ # names 3 parameters and returns a hashref, for use in templates
+ sub opthash { +{ value => shift, selected => shift, oname => shift } }
+ (@FORMNAME, @FORMNAME, @LANGUAGE_ID, @FORMAT, @SENDMODE, @MEDIA, @PRINTER_ID, @SELECTS) = ();
- $form->{"copies"} =
- $form->{"copies"} ? $form->{"copies"} :
- $myconfig{"copies"} ? $myconfig{"copies"} :
- 3;
+ # note: "||"-selection is only correct for values where "0" is _not_ a correct entry
+ $form->{sendmode} = "attachment";
+ $form->{format} = $form->{format} || $myconfig{template_format} || "pdf";
+ $form->{copies} = $form->{copies} || $myconfig{copies} || 3;
+ $form->{media} = $form->{media} || $myconfig{default_media} || "screen";
+ $form->{printer_id} = $form->{printer_id} || $myconfig{default_printer_id} || "";
$form->{PD}{ $form->{formname} } = "selected";
$form->{DF}{ $form->{format} } = "selected";
$form->{OP}{ $form->{media} } = "selected";
- $form->{SM}{ $form->{sendmode} } = "selected";
-
- if ($form->{type} eq 'purchase_order') {
- $type = qq| |
| . $locale->text('Phone') . qq| |
- $form->{"$form->{vc}phone"} |
+ $form->{phone} |
|
| . $locale->text('Fax') . qq| |
- $form->{"$form->{vc}fax"} |
+ $form->{fax} |
|
@@ -2153,8 +2160,7 @@ sub ship_to {
|;
# delete shipto
- map { delete $form->{$_} }
- qw(shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptocontact shiptophone shiptofax shiptoemail shiptodepartment_1 shiptodepartment_2 header);
+ map({ delete $form->{$_} } (@shipto_vars, qw(header)));
$form->{title} = $title;
foreach $key (keys %$form) {
@@ -2235,7 +2241,6 @@ sub relink_accounts {
$lxdebug->leave_sub();
}
-
sub set_duedate {
$lxdebug->enter_sub();
|