- <tr>
- <th class=listtop colspan=2>$form->{title}</th>
- </tr>
- <tr height="5"></tr>
- <tr>
- <th align=right>| . $locale->text('Code') . qq|</th>
- <td><input name=code size=10 value=$form->{code}></td>
- <tr>
- <tr>
- <td></td>
- <th align=left><input name=sictype type=checkbox style=checkbox value="H" $checked> |
- . $locale->text('Heading') . qq|</th>
- <tr>
- <tr>
- <th align=right>| . $locale->text('Description') . qq|</th>
- <td><input name=description size=60 value="$form->{description}"></td>
- </tr>
- <td colspan=2><hr size=3 noshade></td>
- </tr>
-</table>
-|;
-
- $lxdebug->leave_sub();
-}
-
-sub save_sic {
- $lxdebug->enter_sub();
-
- $form->isblank("code", $locale->text('Code missing!'));
- $form->isblank("description", $locale->text('Description missing!'));
- AM->save_sic(\%myconfig, \%$form);
- $form->redirect($locale->text('SIC saved!'));
-
- $lxdebug->leave_sub();
-}
-
-sub delete_sic {
- $lxdebug->enter_sub();
-
- AM->delete_sic(\%myconfig, \%$form);
- $form->redirect($locale->text('SIC deleted!'));
-
- $lxdebug->leave_sub();
-}
-
-sub display_stylesheet {
- $lxdebug->enter_sub();
-
- $form->{file} = "css/$myconfig{stylesheet}";
- &display_form;
-
- $lxdebug->leave_sub();
-}
-
-sub display_form {
- $lxdebug->enter_sub();
-
- $form->{file} =~ s/^(.:)*?\/|\.\.\///g;
- $form->{file} =~ s/^\/*//g;
- $form->{file} =~ s/$userspath//;
-
- $form->error("$!: $form->{file}") unless -f $form->{file};
-
- AM->load_template(\%$form);
-
- $form->{title} = $form->{file};
-
- # if it is anything but html
- if ($form->{file} !~ /\.html$/) {
- $form->{body} = "<pre>\n$form->{body}\n</pre>";
- }
-
- $form->header;
-
- print qq|
-<body>
-
-$form->{body}
-
-<form method=post action=$form->{script}>
-
-<input name=file type=hidden value=$form->{file}>
-<input name=type type=hidden value=template>
-
-<input type=hidden name=path value=$form->{path}>
-<input type=hidden name=login value=$form->{login}>
-<input type=hidden name=password value=$form->{password}>
-
-<input name=action type=submit class=submit value="|
- . $locale->text('Edit') . qq|">|;
-
- if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
- &menubar;
- }
-
- print qq|
- </form>
-
-</body>
-</html>
-|;
-
- $lxdebug->leave_sub();
-}
-
-sub edit_template {
- $lxdebug->enter_sub();
-
- AM->load_template(\%$form);
-
- $form->{title} = $locale->text('Edit Template');
-
- # convert   to &nbsp;
- $form->{body} =~ s/ /&nbsp;/gi;
-
- $form->header;
-
- print qq|
-<body>
-
-<form method=post action=$form->{script}>
-
-<input name=file type=hidden value=$form->{file}>
-<input name=type type=hidden value=template>
-
-<input type=hidden name=path value=$form->{path}>
-<input type=hidden name=login value=$form->{login}>
-<input type=hidden name=password value=$form->{password}>
-
-<input name=callback type=hidden value="$form->{script}?action=display_form&file=$form->{file}&path=$form->{path}&login=$form->{login}&password=$form->{password}">
-
-<textarea name=body rows=25 cols=70>
-$form->{body}
-</textarea>
-
-<br>
-<input type=submit class=submit name=action value="|
- . $locale->text('Save') . qq|">|;
-
- if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
- &menubar;
- }
-
- print q|
- </form>
-
-
-</body>
-</html>
-|;
-
- $lxdebug->leave_sub();
-}
-
-sub save_template {
- $lxdebug->enter_sub();
-
- AM->save_template(\%$form);
- $form->redirect($locale->text('Template saved!'));
-
- $lxdebug->leave_sub();
-}
-
-sub config {
- $lxdebug->enter_sub();
-
- # get defaults for account numbers and last numbers
- AM->defaultaccounts(\%myconfig, \%$form);
-
- foreach $item (qw(mm-dd-yy mm/dd/yy dd-mm-yy dd/mm/yy dd.mm.yy yyyy-mm-dd)) {
- $dateformat .=
- ($item eq $myconfig{dateformat})
- ? "<option selected>$item\n"
- : "<option>$item\n";
- }
-
- foreach $item (qw(1,000.00 1000.00 1.000,00 1000,00)) {
- $numberformat .=
- ($item eq $myconfig{numberformat})
- ? "<option selected>$item\n"
- : "<option>$item\n";
- }
-
- foreach $item (qw(name company address signature)) {
- $myconfig{$item} =~ s/\"/"/g;
- }
-
- foreach $item (qw(address signature)) {
- $myconfig{$item} =~ s/\\n/\r\n/g;
- }
-
- @formats = ();
- if ($opendocument_templates && $openofficeorg_writer_bin &&
- $xvfb_bin && (-x $openofficeorg_writer_bin) && (-x $xvfb_bin)) {
- push(@formats, { "name" => $locale->text("PDF (OpenDocument/OASIS)"),
- "value" => "opendocument_pdf" });
- }
- if ($latex_templates) {
- push(@formats, { "name" => $locale->text("PDF"), "value" => "pdf" });
- }
- push(@formats, { "name" => "HTML", "value" => "html" });
- if ($latex_templates) {
- push(@formats, { "name" => $locale->text("Postscript"),
- "value" => "postscript" });
- }
- if ($opendocument_templates) {
- push(@formats, { "name" => $locale->text("OpenDocument/OASIS"),
- "value" => "opendocument" });
- }
-
- if (!$myconfig{"template_format"}) {
- $myconfig{"template_format"} = "pdf";
- }
- $template_format = "";
- foreach $item (@formats) {
- $template_format .=
- "<option value=\"$item->{value}\"" .
- ($item->{"value"} eq $myconfig{"template_format"} ?
- " selected" : "") .
- ">" . H($item->{"name"}) . "</option>";
- }
-
- %countrycodes = User->country_codes;
- $countrycodes = '';
- foreach $key (sort { $countrycodes{$a} cmp $countrycodes{$b} }
- keys %countrycodes
- ) {
- $countrycodes .=
- ($myconfig{countrycode} eq $key)
- ? "<option selected value=$key>$countrycodes{$key}\n"
- : "<option value=$key>$countrycodes{$key}\n";
- }
- $countrycodes = "<option>American English\n$countrycodes";
-
- # use an other input number format than output numberformat
- # look at Form.pm, sub parse_amount
- my $in_numberformat = '';
- $text1 = qq|value="0">| . $locale->text('equal Outputformat');
- $text2 = qq|value="1">| . $locale->text('1000,00 or 1000.00');
- @in_nf = ($text1, $text2);
- foreach $item (@in_nf) {
- $in_numberformat .=
- (substr($item, 7, 1) eq $myconfig{in_numberformat})
- ? "<option selected $item\n"
- : "<option $item\n";
- }
-
- foreach $key (keys %{ $form->{IC} }) {
- foreach $accno (sort keys %{ $form->{IC}{$key} }) {
- $myconfig{$key} .=
- ($form->{IC}{$key}{$accno}{id} == $form->{defaults}{$key})
- ? "<option selected>$accno--$form->{IC}{$key}{$accno}{description}\n"
- : "<option>$accno--$form->{IC}{$key}{$accno}{description}\n";
- }
- }
-
- opendir CSS, "css/.";
- @all = grep /.*\.css$/, readdir CSS;
- closedir CSS;
-
- foreach $item (@all) {
- if ($item eq $myconfig{stylesheet}) {
- $selectstylesheet .= qq|<option selected>$item\n|;
- } else {
- $selectstylesheet .= qq|<option>$item\n|;
- }
- }
- $selectstylesheet .= "<option>\n";
-
- $form->{title} = $locale->text('Edit Preferences for') . qq| $form->{login}|;
-
- $form->header;
-
- if ($myconfig{menustyle} eq "old") {
- $menustyle_old = "checked";
- } elsif ($myconfig{menustyle} eq "neu") {
- $menustyle_neu = "checked";
- } elsif ($myconfig{menustyle} eq "v3") {
- $menustyle_v3 = "checked";
- }
-
- print qq|
-<body>
-
-<form method=post action=$form->{script}>
-
-<input type=hidden name=old_password value=$myconfig{password}>
-<input type=hidden name=type value=preferences>
-<input type=hidden name=role value=$myconfig{role}>
-
-<table width=100%>
- <tr><th class=listtop>$form->{title}</th></tr>