From: Moritz Bunkus Date: Wed, 16 May 2007 10:43:40 +0000 (+0000) Subject: Umstellung des Anlegens und Bearbeitens von Benutzern auf die Verwendung von HTML... X-Git-Tag: release-2.4.3^2~303 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=c3cee60334aa81dfb51e5ffe45635d59450c3409;p=kivitendo-erp.git Umstellung des Anlegens und Bearbeitens von Benutzern auf die Verwendung von HTML-Vorlagen. --- diff --git a/bin/mozilla/admin.pl b/bin/mozilla/admin.pl index a9769a06b..ef985f40c 100644 --- a/bin/mozilla/admin.pl +++ b/bin/mozilla/admin.pl @@ -160,18 +160,15 @@ sub add_user { $form->{Oracle_dbport} = '1521'; $form->{Oracle_dbhost} = `hostname`; - if (-f "css/lx-office-erp.css") { - $myconfig->{stylesheet} = "lx-office-erp.css"; - } - - $myconfig->{vclimit} = 200; - $myconfig->{countrycode} = "de"; - $myconfig->{numberformat} = "1000,00"; - $myconfig->{dateformat} = "dd.mm.yy"; - - form_header(); - form_footer(); - + my $myconfig = { + "vclimit" => 200, + "countrycode" => "de", + "numberformat" => "1000,00", + "dateformat" => "dd.mm.yy", + "stylesheet" => "lx-office-erp.css", + }; + + edit_user_form($myconfig); } sub edit { @@ -182,91 +179,46 @@ sub edit { . $locale->text('Edit User'); $form->{edit} = 1; - form_header(); - form_footer(); - -} - -sub form_footer { - - if ($form->{edit}) { - $delete = - qq| -|; - } - - print qq| - - -{rpw}> + $form->isblank("login", $locale->text("The login is missing.")); - -$delete + # get user + my $myconfig = new User "$memberfile", "$form->{login}"; - + $myconfig->{signature} =~ s/\\n/\r\n/g; + $myconfig->{address} =~ s/\\n/\r\n/g; - - -|; + # strip basedir from templates directory + $myconfig->{templates} =~ s|.*/||; + edit_user_form($myconfig); } -sub form_header { - - # if there is a login, get user - if ($form->{login}) { - - # get user - $myconfig = new User "$memberfile", "$form->{login}"; - - $myconfig->{signature} =~ s/\\n/\r\n/g; - $myconfig->{address} =~ s/\\n/\r\n/g; - - # strip basedir from templates directory - $myconfig->{templates} =~ s/^$templates\///; - - # $myconfig->{dbpasswd} = unpack 'u', $myconfig->{dbpasswd}; - } +sub edit_user_form { + my ($myconfig) = @_; - 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}) - ? "