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>

Auch abrufbar als: Unified diff