- $usetemplates .= qq|<option>$item\n|;
- }
- }
-
- $lastitem = $allhtml[0];
- $lastitem =~ s/-.*//g;
- $mastertemplates = qq|<option>$lastitem\n|;
- foreach $item (@allhtml) {
- $item =~ s/-.*//g;
-
- if ($item ne $lastitem) {
- my $selected = $item eq "German" ? " selected" : "";
- $mastertemplates .= qq|<option$selected>$item\n|;
- $lastitem = $item;
- }
- }
-
-# opendir CSS, "css/.";
-# @all = grep /.*\.css$/, readdir CSS;
-# closedir CSS;
-
-# css dir has styles that are not intended as general layouts.
-# reverting to hardcoded list
- @all = qw(lx-office-erp.css Win2000.css);
-
- foreach $item (@all) {
- if ($item eq $myconfig->{stylesheet}) {
- $selectstylesheet .= qq|<option selected>$item\n|;
- } else {
- $selectstylesheet .= qq|<option>$item\n|;
- }
- }
-
- $form->header;
-
- if ($myconfig->{menustyle} eq "v3") {
- $menustyle_v3 = "checked";
- } elsif ($myconfig->{menustyle} eq "neu") {
- $menustyle_neu = "checked";
- } else {
- $menustyle_old = "checked";
- }
-
- print qq|
-<body class=admin>
-
-<form method=post action=$form->{script}>
-
-<table width=100%>
- <tr class=listheading><th colspan=2>$form->{title}</th></tr>
- <tr size=5></tr>
- <tr valign=top>
- <td>
- <table>
- <tr>
- <th align=right>| . $locale->text('Login') . qq|</th>
- <td><input name="login" value="$myconfig->{login}"></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Password') . qq|</th>
- <td><input type="password" name="password" size="8" value="$myconfig->{password}"></td>
- <input type="hidden" name="old_password" value="$myconfig->{password}">
- </tr>
- <tr>
- <th align=right>| . $locale->text('Name') . qq|</th>
- <td><input name="name" size="15" value="$myconfig->{name}"></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('E-mail') . qq|</th>
- <td><input name=email size=30 value="$myconfig->{email}"></td>
- </tr>
- <tr valign=top>
- <th align=right>| . $locale->text('Signature') . qq|</th>
- <td><textarea name=signature rows=3 cols=35>$myconfig->{signature}</textarea></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Phone') . qq|</th>
- <td><input name=tel size=14 value="$myconfig->{tel}"></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Fax') . qq|</th>
- <td><input name=fax size=14 value="$myconfig->{fax}"></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Company') . qq|</th>
- <td><input name=company size=35 value="$myconfig->{company}"></td>
- </tr>
- <tr valign=top>
- <th align=right>| . $locale->text('Address') . qq|</th>
- <td><textarea name=address rows=4 cols=35>$myconfig->{address}</textarea></td>
- </tr>
- <tr valign=top>
- <th align=right>| . $locale->text('Tax number') . qq|</th>
- <td><input name=taxnumber size=14 value="$myconfig->{taxnumber}"></td>
- </tr>
- <tr valign=top>
- <th align=right>| . $locale->text('Ust-IDNr') . qq|</th>
- <td><input name=co_ustid size=14 value="$myconfig->{co_ustid}"></td>
- </tr>
- <tr valign=top>
- <th align=right>| . $locale->text('DUNS-Nr') . qq|</th>
- <td><input name=duns size=14 value="$myconfig->{duns}"></td>
- </tr>
- </table>
- </td>
- <td>
- <table>
- <tr>
- <th align=right>| . $locale->text('Date Format') . qq|</th>
- <td><select name=dateformat>$dateformat</select></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Number Format') . qq|</th>
- <td><select name=numberformat>$numberformat</select></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Dropdown Limit') . qq|</th>
- <td><input name=vclimit value="$myconfig->{vclimit}"></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Language') . qq|</th>
- <td><select name=countrycode>$countrycodes</select></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Stylesheet') . qq|</th>
- <td><select name=userstylesheet>$selectstylesheet</select></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Printer') . qq|</th>
- <td><input name=printer size=20 value="$myconfig->{printer}"></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Use Templates') . qq|</th>
- <td><select name=usetemplates>$usetemplates</select></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('New Templates') . qq|</th>
- <td><input name=newtemplates></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Setup Templates') . qq|</th>
- <td><select name=mastertemplates>$mastertemplates</select></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Setup Menu') . qq|</th>
- <td><input name=menustyle type=radio class=radio value=v3 $menustyle_v3> | .
- $locale->text("Top (CSS)") . qq|
- <input name=menustyle type=radio class=radio value=neu $menustyle_neu> | .
- $locale->text("Top (Javascript)") . qq|
- <input name=menustyle type=radio class=radio value=old $menustyle_old> | .
- $locale->text("Old (on the side)") . qq|
- </td>
- </tr>
- <input type=hidden name=templates value=$myconfig->{templates}>
- </table>
- </td>
- </tr>
- <tr class=listheading>
- <th colspan=2>| . $locale->text('Database') . qq|</th>
- </tr>|;
-
- # list section for database drivers
- foreach $item (User->dbdrivers) {
-
- print qq|
- <tr>
- <td colspan=2>
- <table>
- <tr>|;
-
- $checked = "";
- if ($myconfig->{dbdriver} eq $item) {
- map { $form->{"${item}_$_"} = $myconfig->{$_} }
- qw(dbhost dbport dbuser dbpasswd dbname sid);
- $checked = "checked";
- }
-
- print qq|
- <th align=right>| . $locale->text('Driver') . qq|</th>
- <td><input name="dbdriver" type="radio" class="radio" value="$item" $checked> $item</td>
- <th align=right>| . $locale->text('Host') . qq|</th>
- <td><input name="${item}_dbhost" size=30 value="$form->{"${item}_dbhost"}"></td>
- </tr>
- <tr>|;
-
- if ($item eq 'Pg') {
-
- print qq|
- <th align=right>| . $locale->text('Dataset') . qq|</th>
- <td><input name="Pg_dbname" size="15" value="$form->{Pg_dbname}"></td>
- <th align=right>| . $locale->text('Port') . qq|</th>
- <td><input name="Pg_dbport" size="4" value="$form->{Pg_dbport}"></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('User') . qq|</th>
- <td><input name="${item}_dbuser" size=15 value="$form->{"${item}_dbuser"}"></td>
- <th align=right>| . $locale->text('Password') . qq|</th>
- <td><input name="${item}_dbpasswd" type=password size=10 value="$form->{"${item}_dbpasswd"}"></td>
- </tr>|;
-
- }
-
- if ($item eq 'Oracle') {
- print qq|
- <th align=right>SID</th>
- <td><input name=Oracle_sid value=$form->{Oracle_sid}></td>
- <th align=right>| . $locale->text('Port') . qq|</th>
- <td><input name=Oracle_dbport size=4 value=$form->{Oracle_dbport}></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Dataset') . qq|</th>
- <td><input name="${item}_dbuser" size=15 value=$form->{"${item}_dbuser"}></td>
- <th align=right>| . $locale->text('Password') . qq|</th>
- <td><input name="${item}_dbpasswd" type=password size=10 value="$form->{"${item}_dbpasswd"}"></td>
-
- </tr>|;
- }
-
- print qq|
- <input type="hidden" name="old_dbpasswd" value="$myconfig->{dbpasswd}">
- </table>
- </td>
- </tr>
- <tr>
- <td colspan=2><hr size=2 noshade></td>
- </tr>
-|;
-
- }
-
- # access control
- open(FH, $menufile) or $form->error("$menufile : $!");
-
- # scan for first menu level
- @a = <FH>;
- close(FH);
-
- foreach $item (@a) {
- next unless $item =~ /\[/;
- next if $item =~ /\#/;
-
- $item =~ s/(\[|\])//g;
- chop $item;
-
- if ($item =~ /--/) {
- ($level, $menuitem) = split /--/, $item, 2;
- } else {
- $level = $item;
- $menuitem = $item;
- push @acsorder, $item;
- }
-
- push @{ $acs{$level} }, $menuitem;
-
- }
-
- %role = ('admin' => $locale->text('Administrator'),
- 'user' => $locale->text('User'),
- 'manager' => $locale->text('Manager'),
- 'supervisor' => $locale->text('Supervisor'));
-
- $selectrole = "";
- foreach $item (qw(user supervisor manager admin)) {
- $selectrole .=
- ($myconfig->{role} eq $item)
- ? "<option selected value=$item>$role{$item}\n"
- : "<option value=$item>$role{$item}\n";
- }
-
- print qq|
- <tr class=listheading>
- <th colspan=2>| . $locale->text('Access Control') . qq|</th>
- </tr>
- <tr>
- <td><select name=role>$selectrole</select></td>
- </tr>
-|;
-
- foreach $item (split(/;/, $myconfig->{acs})) {
- ($key, $value) = split /--/, $item, 2;
- $excl{$key}{$value} = 1;
- }
-
- foreach $key (@acsorder) {
-
- $checked = "checked";
- if ($form->{login}) {
- $checked = ($excl{$key}{$key}) ? "" : "checked";
- }
-
- # can't have variable names with spaces
- # the 1 is for apache 2
- $item = $form->escape("${key}--$key", 1);
-
- $acsheading = $key;
- $acsheading =~ s/ / /g;
-
- $acsheading = qq|
- <th align=left><input name="$item" class=checkbox type=checkbox value=1 $checked> $acsheading</th>\n|;
- $menuitems .= "$item;";
- $acsdata = "
- <td>";
-
- foreach $item (@{ $acs{$key} }) {
- next if ($key eq $item);
-
- $checked = "checked";
- if ($form->{login}) {
- $checked = ($excl{$key}{$item}) ? "" : "checked";
- }
-
- $acsitem = $form->escape("${key}--$item", 1);
-
- $acsdata .= qq|
- <br><input name="$acsitem" class=checkbox type=checkbox value=1 $checked> $item|;
- $menuitems .= "$acsitem;";
- }
-
- $acsdata .= "
- </td>";
-
- print qq|
- <tr valign=top>$acsheading $acsdata
- </tr>
-|;
- }
-
- print qq|<input type=hidden name=acs value="$menuitems">
-|;
- if ($webdav) {
- @webdavdirs =
- qw(angebote bestellungen rechnungen anfragen lieferantenbestellungen einkaufsrechnungen);
- foreach $directory (@webdavdirs) {
- if ($myconfig->{$directory}) {
- $webdav{"${directory}c"} = "checked";
- } else {
- $webdav{"${directory}c"} = "";