$::lxdebug->enter_sub;
$::auth->assert('config');
- AM->language(\%myconfig, \%$form);
+ AM->language(\%::myconfig, $::form);
$::form->{callback} = "am.pl?action=list_language";
$::form->{title} = $::locale->text('Languages');
}
sub language_header {
- $main::lxdebug->enter_sub();
-
- my $form = $main::form;
- my $locale = $main::locale;
-
- $main::auth->assert('config');
-
- $form->{title} = $locale->text("$form->{title} Language");
+ $::lxdebug->enter_sub;
+ $::auth->assert('config');
# $locale->text('Add Language')
# $locale->text('Edit Language')
+ $::form->{title} = $::locale->text("$::form->{title} Language");
- $form->{description} =~ s/\"/"/g;
- $form->{template_code} =~ s/\"/"/g;
- $form->{article_code} =~ s/\"/"/g;
-
-
- $form->header;
-
- my $numberformat =
- qq|<option value="">| . $locale->text("use program settings") .
- qq|</option>|;
- foreach my $item (('1,000.00', '1000.00', '1.000,00', '1000,00')) {
- $numberformat .=
- ($item eq $form->{output_numberformat})
- ? "<option selected>$item"
- : "<option>$item"
- . "</option>";
- }
-
- my $dateformat =
- qq|<option value="">| . $locale->text("use program settings") .
- qq|</option>|;
- foreach my $item (qw(mm-dd-yy mm/dd/yy dd-mm-yy dd/mm/yy dd.mm.yy yyyy-mm-dd)) {
- $dateformat .=
- ($item eq $form->{output_dateformat})
- ? "<option selected>$item"
- : "<option>$item"
- . "</option>";
- }
-
- print qq|
-<body>
-
-<form method=post action=am.pl>
-
-<input type=hidden name=id value=$form->{id}>
-<input type=hidden name=type value=language>
+ $::form->header;
-<table width=100%>
- <tr>
- <th class=listtop colspan=2>$form->{title}</th>
- </tr>
- <tr height="5"></tr>
- <tr>
- <th align=right>| . $locale->text('Language') . qq|</th>
- <td><input name=description size=30 value="| . $form->quote($form->{description}) . qq|"></td>
- <tr>
- <tr>
- <th align=right>| . $locale->text('Template Code') . qq|</th>
- <td><input name=template_code size=5 value="| . $form->quote($form->{template_code}) . qq|"></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Article Code') . qq|</th>
- <td><input name=article_code size=10 value="| . $form->quote($form->{article_code}) . qq|"></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Number Format') . qq|</th>
- <td><select name="output_numberformat">$numberformat</select></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Date Format') . qq|</th>
- <td><select name="output_dateformat">$dateformat</select></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Long Dates') . qq|</th>
- <td><input type="radio" name="output_longdates" value="1"| .
- ($form->{output_longdates} ? " checked" : "") .
- qq|>| . $locale->text("Yes") .
- qq|<input type="radio" name="output_longdates" value="0"| .
- ($form->{output_longdates} ? "" : " checked") .
- qq|>| . $locale->text("No") .
- qq|</td>
- </tr>
- <td colspan=2><hr size=3 noshade></td>
- </tr>
-</table>
-|;
+ print $::form->parse_html_template('am/language_header', {
+ numberformats => [ '1,000.00', '1000.00', '1.000,00', '1000,00' ],
+ dateformats => [ qw(mm-dd-yy mm/dd/yy dd-mm-yy dd/mm/yy dd.mm.yy yyyy-mm-dd) ],
+ });
- $main::lxdebug->leave_sub();
+ $::lxdebug->leave_sub;
}
sub save_language {
--- /dev/null
+[%- USE L %]
+[%- USE HTML %]
+[%- USE LxERP %]
+[%- USE T8 %]
+<body>
+
+<form method=post action=am.pl>
+
+<input type=hidden name=id value='[% id %]'>
+<input type=hidden name=type value=language>
+
+<table width=100%>
+ <tr>
+ <th class=listtop colspan=2>[% title | html %]</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <th align=right>[% 'Language' | $T8 %]</th>
+ <td><input name=description size=30 value="[% description | html %]"></td>
+ <tr>
+ <tr>
+ <th align=right>[% 'Template Code' | $T8 %]</th>
+ <td><input name=template_code size=5 value="[% template_code | html %]"></td>
+ </tr>
+ <tr>
+ <th align=right>[% 'Article Code' | $T8 %]</th>
+ <td><input name=article_code size=10 value="[% article_code | html %]"></td>
+ </tr>
+ <tr>
+ <th align=right>[% 'Number Format' | $T8 %]</th>
+ <td><select name="output_numberformat">[% L.options_for_select(numberformats, default=output_numberformat, with_empty=1, empty_title=LxERP.t8('use program settings')) %]</select></td>
+ </tr>
+ <tr>
+ <th align=right>[% 'Date Format' | $T8 %]</th>
+ <td><select name="output_dateformat">[% L.options_for_select(dateformats, default=output_dateformat, with_empty=1, empty_title=LxERP.t8('use program settings')) %]</select></td>
+ </tr>
+ <tr>
+ <th align=right>[% 'Long Dates' | $T8 %]</th>
+ <td>[% L.radio_button_tag('output_longdates', checked=output_longdates, label=LxERP.t8('Yes')) %]
+ [% L.radio_button_tag('output_longdates', checked=!output_longdates, label=LxERP.t8('No')) %]</td>
+ </tr>
+ <td colspan=2><hr size=3 noshade></td>
+ </tr>
+</table>