Revision 0c2be997
Von Sven Schöling vor fast 13 Jahren hinzugefügt
bin/mozilla/rp.pl | ||
---|---|---|
1738 | 1738 |
} |
1739 | 1739 |
|
1740 | 1740 |
sub print_options { |
1741 |
$main::lxdebug->enter_sub();
|
|
1741 |
$::lxdebug->enter_sub;
|
|
1742 | 1742 |
|
1743 | 1743 |
my ($dont_print) = @_; |
1744 | 1744 |
|
1745 |
my $form = $main::form; |
|
1746 |
my %myconfig = %main::myconfig; |
|
1747 |
my $locale = $main::locale; |
|
1748 |
|
|
1749 |
$form->{sendmode} = "attachment"; |
|
1750 |
|
|
1751 |
$form->{"format"} = |
|
1752 |
$form->{"format"} ? $form->{"format"} : |
|
1753 |
$myconfig{"template_format"} ? $myconfig{"template_format"} : |
|
1754 |
"pdf"; |
|
1745 |
$::form->{sendmode} = "attachment"; |
|
1746 |
$::form->{format} ||= $::myconfig{template_format} || "pdf"; |
|
1747 |
$::form->{copies} ||= $::myconfig{copies} || 2; |
|
1755 | 1748 |
|
1756 |
$form->{"copies"} =
|
|
1757 |
$form->{"copies"} ? $form->{"copies"} :
|
|
1758 |
$myconfig{"copies"} ? $myconfig{"copies"} :
|
|
1759 |
2;
|
|
1749 |
$::form->{PD}{ $::form->{type} } = "selected";
|
|
1750 |
$::form->{DF}{ $::form->{format} } = "selected";
|
|
1751 |
$::form->{OP}{ $::form->{media} } = "selected";
|
|
1752 |
$::form->{SM}{ $::form->{sendmode} } = "selected";
|
|
1760 | 1753 |
|
1761 |
$form->{PD}{ $form->{type} } = "selected"; |
|
1762 |
$form->{DF}{ $form->{format} } = "selected"; |
|
1763 |
$form->{OP}{ $form->{media} } = "selected"; |
|
1764 |
$form->{SM}{ $form->{sendmode} } = "selected"; |
|
1765 |
|
|
1766 |
my ($media); |
|
1767 |
my $type = qq| |
|
1768 |
<option value=statement $form->{PD}{statement}>| . $locale->text('Statement'); |
|
1769 |
|
|
1770 |
if ($form->{media} eq 'email') { |
|
1771 |
$media = qq| |
|
1772 |
<option value=attachment $form->{SM}{attachment}>| . $locale->text('Attachment') . qq| |
|
1773 |
<option value=inline $form->{SM}{inline}>| . $locale->text('In-line'); |
|
1774 |
} else { |
|
1775 |
$media = qq| |
|
1776 |
<option value=screen $form->{OP}{screen}>| . $locale->text('Screen'); |
|
1777 |
if ($myconfig{printer} && $::lx_office_conf{print_templates}->{latex}) { |
|
1778 |
$media .= qq| |
|
1779 |
<option value=printer $form->{OP}{printer}>| . $locale->text('Printer'); |
|
1780 |
} |
|
1781 |
} |
|
1782 |
|
|
1783 |
my $format; |
|
1784 |
if ($::lx_office_conf{print_templates}->{latex}) { |
|
1785 |
$format .= qq| |
|
1786 |
<option value=html $form->{DF}{html}>| . $locale->text('HTML') |
|
1787 |
. qq| <option value=pdf $form->{DF}{pdf}>| . $locale->text('PDF') |
|
1788 |
. qq| <option value=postscript $form->{DF}{postscript}>| . $locale->text('Postscript'); |
|
1789 |
} |
|
1790 |
|
|
1791 |
my $output = qq| |
|
1792 |
<table> |
|
1793 |
<tr> |
|
1794 |
<td><select name=type>$type</select></td> |
|
1795 |
<td><select name=format>$format</select></td> |
|
1796 |
<td><select name=media>$media</select></td> |
|
1797 |
|; |
|
1798 |
|
|
1799 |
if ($myconfig{printer} && $::lx_office_conf{print_templates}->{latex} && $form->{media} ne 'email') { |
|
1800 |
$output .= qq| |
|
1801 |
<td>| . $locale->text('Copies') . qq| |
|
1802 |
<input name=copies size=2 value=$form->{copies}></td> |
|
1803 |
|; |
|
1804 |
} |
|
1805 |
|
|
1806 |
$output .= qq| |
|
1807 |
</tr> |
|
1808 |
</table> |
|
1809 |
|; |
|
1754 |
my $output = $::form->parse_html_template('rp/print_options', { |
|
1755 |
got_printer => $::myconfig{printer}, |
|
1756 |
show_latex => $::lx_office_conf{print_templates}->{latex}, |
|
1757 |
is_email => $::form->{media} eq 'email', |
|
1758 |
}); |
|
1810 | 1759 |
|
1811 | 1760 |
print $output unless $dont_print; |
1812 | 1761 |
|
1813 |
$main::lxdebug->leave_sub();
|
|
1762 |
$::lxdebug->leave_sub;
|
|
1814 | 1763 |
|
1815 | 1764 |
return $output; |
1816 | 1765 |
} |
Auch abrufbar als: Unified diff
rp.pl::print_options auf template umgestellt.