use SL::User;
$form = new Form;
+$form->{"root"} = "root login";
$locale = new Locale $language, "admin";
if ($form->{action}) {
+
$subroutine = $locale->findsub($form->{action});
if ($subroutine eq 'login') {
<th>| . $locale->text('Password') . qq|</th>
<td><input type=password name=rpw></td>
<td><input type=submit class=submit name=action value="|
- . $locale->text('Login')
- . qq|"></td>
+ . $locale->text('Login') . qq|"></td>
</tr>
<input type=hidden name=action value=login>
-<input type=hidden name=root value="root login">
<input type=hidden name=path value=$form->{path}>
</table>
}
$myconfig->{vclimit} = 200;
+ $myconfig->{"countrycode"} = "de";
+ $myconfig->{"numberformat"} = "1000,00";
+ $myconfig->{"dateformat"} = "dd.mm.yy";
+
&form_header;
&form_footer;
print qq|
-<input name=callback type=hidden value="$form->{script}?action=list_users&path=$form->{path}&root=$form->{root}&rpw=$form->{rpw}">
-<input type=hidden name=root value="$form->{root}">
+<input name=callback type=hidden value="$form->{script}?action=list_users&path=$form->{path}&rpw=$form->{rpw}">
<input type=hidden name=path value=$form->{path}>
<input type=hidden name=rpw value=$form->{rpw}>
if (/^(name=|company=|templates=|dbuser=|dbdriver=|dbname=|dbhost=)/) {
chop($var = $&);
- ($null, $member{$login}{$var}) = split /=/, $_, 2;
+ ($null, $member{$login}{$var}) = split(/=/, $_, 2);
}
}
foreach $key (sort keys %member) {
$href =
- "$script?action=edit&login=$key&path=$form->{path}&root=$form->{root}&rpw=$form->{rpw}";
+ "$script?action=edit&login=$key&path=$form->{path}&rpw=$form->{rpw}";
$href =~ s/ /%20/g;
$member{$key}{templates} =~ s/^$templates\///;
$member{$key}{dbname} = $member{$key}{dbuser}
if ($member{$key}{dbdriver} eq 'Oracle');
- $column_data{login} = qq|<td><a href=$href>$key</a></td>|;
+ $column_data{login} = qq|<td><a id="$key" href="$href">$key</a></td>|;
$column_data{name} = qq|<td>$member{$key}{name}</td>|;
$column_data{company} = qq|<td>$member{$key}{company}</td>|;
$column_data{dbdriver} = qq|<td>$member{$key}{dbdriver}</td>|;
$i++;
$i %= 2;
print qq|
- <tr class=listrow$i>|;
+ <tr class="listrow$i">|;
map { print "$column_data{$_}\n" } @column_index;
<input type=hidden name=path value=$form->{path}>
<input type=hidden name=rpw value=$form->{rpw}>
-<input type=hidden name=root value="$form->{root}">
<br><input type=submit class=submit name=action value="|
. $locale->text('Add User') . qq|">
<th align=right>| . $locale->text('Password') . qq|</th>
<td><input class=login type=password name=password></td>
<td><input type=submit name=action value="|
- . $locale->text('Login')
- . qq|"></td>
+ . $locale->text('Login') . qq|"></td>
</tr>
<input type=hidden name=path value=$form->{path}>
</table>
%countrycodes = User->country_codes;
$countrycodes = "";
foreach $key (sort { $countrycodes{$a} cmp $countrycodes{$b} }
- keys %countrycodes) {
+ keys %countrycodes
+ ) {
$countrycodes .=
($myconfig->{countrycode} eq $key)
? "<option selected value=$key>$countrycodes{$key}"
}
opendir TEMPLATEDIR, "$templates/." or $form->error("$templates : $!");
- @all = grep !/^\.\.?$/, readdir TEMPLATEDIR;
+ my @all = readdir(TEMPLATEDIR);
+ my @alldir = sort(grep({ -d "$templates/$_" && !/^\.\.?$/ } @all));
+ my @allhtml = sort(grep({ -f "$templates/$_" && /\.html$/ } @all));
closedir TEMPLATEDIR;
- @allhtml = sort grep /\.html/, @all;
- @alldir = grep !/\.(html|tex)$/, @all;
+ @alldir = grep !/\.(html|tex|sty|odt|xml|txb)$/, @alldir;
+ @alldir = grep !/^(webpages|\.svn)$/, @alldir;
@allhtml = reverse grep !/Default/, @allhtml;
push @allhtml, 'Default';
$item =~ s/-.*//g;
if ($item ne $lastitem) {
- $mastertemplates .= qq|<option>$item\n|;
+ my $selected = $item eq "German" ? " selected" : "";
+ $mastertemplates .= qq|<option$selected>$item\n|;
$lastitem = $item;
}
}
opendir CSS, "css/.";
- @all = grep /.*\.css$/, readdir CSS;
+ @all = sort(grep({ /\.css$/ && ($_ ne "tabcontent.css") } readdir(CSS)));
closedir CSS;
foreach $item (@all) {
$selectstylesheet .= qq|<option>$item\n|;
}
}
- $selectstylesheet .= "<option>\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>
<td><textarea name=address rows=4 cols=35>$myconfig->{address}</textarea></td>
</tr>
<tr valign=top>
- <th align=right>| . $locale->text('Steuernummer') . qq|</th>
- <td><input name=steuernummer size=14 value="$myconfig->{steuernummer}"></td>
+ <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=ustid size=14 value="$myconfig->{ustid}"></td>
+ <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>
<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>
|;
- foreach $item (split /;/, $myconfig->{acs}) {
+ foreach $item (split(/;/, $myconfig->{acs})) {
($key, $value) = split /--/, $item, 2;
$excl{$key}{$value} = 1;
}
$myconfig = new User "$memberfile", "$form->{login}";
# redo acs variable and delete all the acs codes
- @acs = split /;/, $form->{acs};
+ @acs = split(/;/, $form->{acs});
$form->{acs} = "";
foreach $item (@acs) {
# copy templates to the directory
opendir TEMPLATEDIR, "$templates/." or $form - error("$templates : $!");
- @templates = grep /$form->{mastertemplates}.*?\.(html|tex)$/,
+ @templates = grep /$form->{mastertemplates}.*?\.(html|tex|sty|xml|txb)$/,
readdir TEMPLATEDIR;
closedir TEMPLATEDIR;
if (-d "$dir") {
unlink <$dir/*.html>;
unlink <$dir/*.tex>;
+ unlink <$dir/*.sty>;
rmdir "$dir";
}
}
<form method=post action=$form->{script}>
-<b>|
- . $locale->text('Password')
- . qq|</b> <input type=password name=password size=8>
+<table>
+ <tr>
+ <td><b>| . $locale->text('Password') . qq|</b></td>
+ <td><input type=password name=password size=8></td>
+ </tr>
+ <tr>
+ <td><b>| . $locale->text('Repeat the password') . qq|</b></td>
+ <td><input type=password name=password_again size=8></b></td>
+ </tr>
+</table>
-<input type=hidden name=root value="$form->{root}">
<input type=hidden name=path value=$form->{path}>
<input type=hidden name=rpw value=$form->{rpw}>
}
sub change_password {
+ if ($form->{"password"} ne $form->{"password_again"}) {
+ $form->{title} =
+ qq|Lx-Office ERP |
+ . $locale->text('Administration') . " / "
+ . $locale->text('Change Admin Password');
+
+ $form->header;
+
+ print qq|
+<body class=admin>
+
+
+<h2>| . $locale->text('Change Admin Password') . qq|</h2>
+
+<p>| . $locale->text("The passwords do not match.") . qq|<br>
+<input type="button" onclick="history.back()" value="| . $locale->text("Back") . qq|">|;
+ return;
+ }
$root->{password} = $form->{password};
$root->save_member($memberfile);
$form->{callback} =
- "$form->{script}?action=list_users&path=$form->{path}&root=$form->{root}&rpw=$root->{password}";
+ "$form->{script}?action=list_users&path=$form->{path}&rpw=$root->{password}";
$form->redirect($locale->text('Password changed!'));
}
sub check_password {
-
$root = new User "$memberfile", $form->{root};
- if ($root->{password}) {
- if ($root->{password} ne $form->{rpw}) {
- $form->error($locale->text('Incorrect Password!'));
- }
+ if (!defined($root->{password}) || ($root->{password} ne $form->{rpw})) {
+ $form->error($locale->text('Incorrect Password!'));
}
}
</td></tr>
</table>
-<input name=callback type=hidden value="$form->{script}?action=list_users&path=$form->{path}&root=$form->{root}&rpw=$form->{rpw}">
-<input type=hidden name=root value="$form->{root}">
+<input name=callback type=hidden value="$form->{script}?action=list_users&path=$form->{path}&rpw=$form->{rpw}">
<input type=hidden name=path value=$form->{path}>
<input type=hidden name=rpw value=$form->{rpw}>
<br>
<input type=submit class=submit name=action value="|
- . $locale->text('Create Dataset') . qq|">
-<input type=submit class=submit name=action value="|
- . $locale->text('Update Dataset') . qq|">
-<input type=submit class=submit name=action value="|
+ . $locale->text('Create Dataset') . qq|">|;
+# Vorübergehend Deaktiviert
+# <input type=submit class=submit name=action value="|
+# . $locale->text('Update Dataset') . qq|">
+print qq| <input type=submit class=submit name=action value="|
. $locale->text('Delete Dataset') . qq|">
</form>
<center>
<h2>$form->{title}</h2>
|;
-
+ my $field_id = 0;
foreach $key (sort keys %needsupdate) {
if ($needsupdate{$key} ne $form->{dbversion}) {
- $upd .= qq|<input name="db$key" type=checkbox value=1 checked> $key\n|;
+ $upd .= qq|<input id="$field_id" name="db$key" type="checkbox" value="1" checked> $key\n|;
$form->{dbupdate} .= "db$key ";
+ $field_id++;
}
}
<input name=dbupdate type=hidden value="$form->{dbupdate}">
-<input name=callback type=hidden value="$form->{script}?action=list_users&path=$form->{path}&root=$form->{root}&rpw=$form->{rpw}">
+<input name=callback type=hidden value="$form->{script}?action=list_users&path=$form->{path}&rpw=$form->{rpw}">
-<input type=hidden name=root value="$form->{root}">
<input type=hidden name=path value=$form->{path}>
<input type=hidden name=rpw value=$form->{rpw}>
}
sub dbupdate {
+ $form->{"stylesheet"} = "lx-office-erp.css";
+ $form->{"title"} = $main::locale->text("Dataset upgrade");
+ $form->header();
+ my $dbname =
+ join(" ",
+ map({ s/\s//g; s/^db//; $_; }
+ grep({ $form->{$_} }
+ split(/\s+/, $form->{"dbupdate"}))));
+ print($form->parse_html_template("dbupgrade/header",
+ { "dbname" => $dbname }));
User->dbupdate(\%$form);
- $form->redirect($locale->text('Dataset updated!'));
+ print qq|
+<hr>
+
+| . $locale->text('Dataset updated!') . qq|
+
+<br>
+
+<a id="enddatasetupdate" href="admin.pl?action=login&| .
+join("&", map({ "$_=" . $form->escape($form->{$_}); } qw(path rpw))) .
+qq|">| . $locale->text("Continue") . qq|</a>|;
}
<tr>
<th align=right nowrap>|
- . $locale->text('Create Chart of Accounts')
- . qq|</th>
+ . $locale->text('Create Chart of Accounts') . qq|</th>
<td>@charts</td>
</tr>
<input type=hidden name=dbpasswd value=$form->{dbpasswd}>
<input type=hidden name=dbdefault value=$form->{dbdefault}>
-<input name=callback type=hidden value="$form->{script}?action=list_users&path=$form->{path}&root=$form->{root}&rpw=$form->{rpw}">
+<input name=callback type=hidden value="$form->{script}?action=list_users&path=$form->{path}&rpw=$form->{rpw}">
-<input type=hidden name=root value="$form->{root}">
<input type=hidden name=path value=$form->{path}>
<input type=hidden name=rpw value=$form->{rpw}>
. qq|
-<input type=hidden name=root value="$form->{root}">
<input type=hidden name=path value="$form->{path}">
<input type=hidden name=rpw value="$form->{rpw}">
<input type=hidden name=dbpasswd value=$form->{dbpasswd}>
<input type=hidden name=dbdefault value=$form->{dbdefault}>
-<input name=callback type=hidden value="$form->{script}?action=list_users&path=$form->{path}&root=$form->{root}&rpw=$form->{rpw}">
+<input name=callback type=hidden value="$form->{script}?action=list_users&path=$form->{path}&rpw=$form->{rpw}">
-<input type=hidden name=root value="$form->{root}">
<input type=hidden name=path value="$form->{path}">
<input type=hidden name=rpw value="$form->{rpw}">
. qq|
-<input type=hidden name=root value="$form->{root}">
<input type=hidden name=path value="$form->{path}">
<input type=hidden name=rpw value="$form->{rpw}">
unlink "$userspath/nologin";
$form->{callback} =
- "$form->{script}?action=list_users&path=$form->{path}&root=$form->{root}&rpw=$root->{password}";
+ "$form->{script}?action=list_users&path=$form->{path}&rpw=$root->{password}";
$form->redirect($locale->text('Lockfile removed!'));
close(FH);
$form->{callback} =
- "$form->{script}?action=list_users&path=$form->{path}&root=$form->{root}&rpw=$root->{password}";
+ "$form->{script}?action=list_users&path=$form->{path}&rpw=$root->{password}";
$form->redirect($locale->text('Lockfile created!'));