Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 0c2be997

Von Sven Schöling vor fast 13 Jahren hinzugefügt

  • ID 0c2be9979d3c323a8f88ca372c0e1314774d7293
  • Vorgänger 0aa1a7f3
  • Nachfolger b84a5f19

rp.pl::print_options auf template umgestellt.

Unterschiede anzeigen:

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
}
templates/webpages/rp/print_options.html
1
[%- USE HTML %]
2
[%- USE LxERP %]
3
[%- USE L %]
4
[%- USE T8 %]
5
<table>
6
  <tr>
7
    <td>
8
     <select name=type>
9
      <option value=statement [% PD.statement %]>[% 'Statement' | $T8 %]</option>
10
     </select>
11
    </td>
12
    <td>
13
     <select name=format>
14
      <option value=html [% DF.html %]>[% 'HTML' | $T8 %]</option>
15
      <option value=pdf [% DF.pdf %]>[% 'PDF' | $T8 %]</option>
16
      <option value=postscript [% DF.postscript %]>[% 'Postscript' | $T8 %]</option>
17
     </select>
18
    </td>
19
    <td>
20
     <select name=media>
21
[%- IF is_email %]
22
      <option value=attachment [% SM.attachment %]>[% 'Attachment' | $T8 %]</option>
23
      <option value=inline [% SM.inline %]>[% 'In-line' | $T8 %]</option>
24
[%- ELSE %]
25
      <option value=screen [% OP.screen %]>[% 'Screen' | $T8 %]</option>
26
  [%- IF got_printer && show_latex %]
27
      <option value=printer [% OP.printer %]>[% 'Printer' | $T8 %]</option>
28
  [%- END %]
29
[%- END %]
30
     </select>
31
    </td>
32
[%- IF got_printer && show_latex && !is_email %]
33
      <td>[% 'Copies' | $T8 %]<input name=copies size=2 value=[% copies %]></td>
34
[%- END %]
35
  </tr>
36
</table>

Auch abrufbar als: Unified diff