Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision e16e1f36

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

  • ID e16e1f36dec1679b1defb5efc5acd7290cc9de85
  • Vorgänger 23551aa6
  • Nachfolger a52aa2f2

am/list_language in template ausgelagert

Unterschiede anzeigen:

bin/mozilla/am.pl
846 846
}
847 847

  
848 848
sub list_language {
849
  $main::lxdebug->enter_sub();
850

  
851
  my $form     = $main::form;
852
  my %myconfig = %main::myconfig;
853
  my $locale   = $main::locale;
854

  
855
  $main::auth->assert('config');
849
  $::lxdebug->enter_sub;
850
  $::auth->assert('config');
856 851

  
857 852
  AM->language(\%myconfig, \%$form);
858 853

  
859
  $form->{callback} = "am.pl?action=list_language";
854
  $::form->{callback} = "am.pl?action=list_language";
855
  $::form->{title}   = $::locale->text('Languages');
860 856

  
861
  my $callback = $form->escape($form->{callback});
857
  $::form->header;
862 858

  
863
  $form->{title} = $locale->text('Languages');
859
  print $::form->parse_html_template('am/language_list');
864 860

  
865
  my @column_index = qw(description template_code article_code output_numberformat output_dateformat output_longdates);
866
  my %column_header;
867
  $column_header{description} =
868
      qq|<th class=listheading width=60%>|
869
    . $locale->text('Description')
870
    . qq|</th>|;
871
  $column_header{template_code} =
872
      qq|<th class=listheading width=10%>|
873
    . $locale->text('Template Code')
874
    . qq|</th>|;
875
  $column_header{article_code} =
876
      qq|<th class=listheading>|
877
    . $locale->text('Article Code')
878
    . qq|</th>|;
879
  $column_header{output_numberformat} =
880
      qq|<th class=listheading>|
881
    . $locale->text('Number Format')
882
    . qq|</th>|;
883
  $column_header{output_dateformat} =
884
      qq|<th class=listheading>|
885
    . $locale->text('Date Format')
886
    . qq|</th>|;
887
  $column_header{output_longdates} =
888
      qq|<th class=listheading>|
889
    . $locale->text('Long Dates')
890
    . qq|</th>|;
891

  
892
  $form->header;
893

  
894
  print qq|
895
<body>
896

  
897
<table width=100%>
898
  <tr>
899
    <th class=listtop>$form->{title}</th>
900
  </tr>
901
  <tr height="5"></tr>
902
  <tr>
903
    <td>
904
      <table width=100%>
905
        <tr class=listheading>
906
|;
907

  
908
  map { print "$column_header{$_}\n" } @column_index;
909

  
910
  print qq|
911
        </tr>
912
|;
913

  
914
  my ($i, %column_data);
915
  foreach my $ref (@{ $form->{ALL} }) {
916

  
917
    $i++;
918
    $i %= 2;
919

  
920
    print qq|
921
        <tr valign=top class=listrow$i>
922
|;
923

  
924

  
925
    $column_data{description} =
926
      qq|<td><a href="am.pl?action=edit_language&id=$ref->{id}&callback=$callback">$ref->{description}</td>|;
927
    $column_data{template_code}           = qq|<td align=right>$ref->{template_code}</td>|;
928
    $column_data{article_code} =
929
      qq|<td align=right>$ref->{article_code}</td>|;
930
    $column_data{output_numberformat} =
931
      "<td nowrap>" .
932
      ($ref->{output_numberformat} ? $ref->{output_numberformat} :
933
       $locale->text("use program settings")) .
934
      "</td>";
935
    $column_data{output_dateformat} =
936
      "<td nowrap>" .
937
      ($ref->{output_dateformat} ? $ref->{output_dateformat} :
938
       $locale->text("use program settings")) .
939
      "</td>";
940
    $column_data{output_longdates} =
941
      "<td nowrap>" .
942
      ($ref->{output_longdates} ? $locale->text("Yes") : $locale->text("No")) .
943
      "</td>";
944

  
945
    map { print "$column_data{$_}\n" } @column_index;
946

  
947
    print qq|
948
        </tr>
949
|;
950
  }
951

  
952
  print qq|
953
      </table>
954
    </td>
955
  </tr>
956
  <tr>
957
  <td><hr size=3 noshade></td>
958
  </tr>
959
</table>
960

  
961
<br>
962
<form method=post action=am.pl>
963

  
964
<input name=callback type=hidden value="$form->{callback}">
965

  
966
<input type=hidden name=type value=language>
967

  
968
<input class=submit type=submit name=action value="|
969
    . $locale->text('Add') . qq|">
970

  
971
  </form>
972

  
973
  </body>
974
  </html>
975
|;
976

  
977
  $main::lxdebug->leave_sub();
861
  $::lxdebug->leave_sub;
978 862
}
979 863

  
980 864
sub language_header {
......
1378 1262
  }
1379 1263

  
1380 1264
  my $linkaccounts;
1381
  if ( $::instance_conf->get_inventory_system eq 'perpetual' ) { # was !$::lx_office_conf{system}->{eur}) {
1265
  if ( $::instance_conf->get_inventory_system eq 'perpetual' ) { # was !$::lx_office_conf{system}->{eur}) { }
1382 1266
    $linkaccounts = qq|
1383 1267
               <tr>
1384 1268
                <th align=right>| . $locale->text('Inventory') . qq|</th>
templates/webpages/am/language_list.html
1
[%- USE HTML %]
2
[%- USE L %]
3
[%- USE LxERP %]
4
[%- USE T8 %]
5
<body>
6

  
7
<h1>[% title | html %]</h1>
8

  
9
<table width=100%>
10
  <tr>
11
  </tr>
12
  <tr height="5"></tr>
13
  <tr>
14
    <td>
15
      <table width=100%>
16
        <tr class=listheading>
17
          <th class=listheading>[% 'Description' | $T8 %]</th>
18
          <th class=listheading>[% 'Template Code' | $T8 %]</th>
19
          <th class=listheading>[% 'Article Code' | $T8 %]</th>
20
          <th class=listheading>[% 'Number Format' | $T8 %]</th>
21
          <th class=listheading>[% 'Date Format' | $T8 %]</th>
22
          <th class=listheading>[% 'Long Dates' | $T8 %]</th>
23
        </tr>
24
[%- FOREACH row = ALL %]
25
        <tr valign=top class=listrow[% loop.count % 2 %]>
26
         <td><a href="am.pl?action=edit_language&id=[% row.id | html %]&callback=[% callback | html %]">[% row.description %]</a></td>
27
         <td align=right>[% row.template_code | html %]</td>
28
         <td align=right>[% row.article_code | html %]</td>
29
         <td nowrap>[% row.output_numberformat ? row.output_numberformat : LxERP.t8('use program settings') | html %]</td>
30
         <td nowrap>[% row.output_dateformat   ? row.output_dateformat   : LxERP.t8('use program settings') | html %]</td>
31
         <td nowrap>[% row.output_longdates    ? LxERP.t8('Yes')         : LxERP.t8('No') %]</td>
32
[%- END %]
33
       </tr>
34
      </table>
35
    </td>
36
  </tr>
37
  <tr>
38
  <td><hr size=3 noshade></td>
39
  </tr>
40
</table>
41

  
42
<br>
43
<form method=post action=am.pl>
44

  
45
<input name=callback type=hidden value="[% callback | html %]">
46
<input type=hidden name=type value=language>
47
<input class=submit type=submit name=action value="[% 'Add' | $T8 %]">
48

  
49
  </form>
50

  
51
  </body>
52
  </html>

Auch abrufbar als: Unified diff