From c3cee60334aa81dfb51e5ffe45635d59450c3409 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 16 May 2007 10:43:40 +0000 Subject: [PATCH] Umstellung des Anlegens und Bearbeitens von Benutzern auf die Verwendung von HTML-Vorlagen. --- bin/mozilla/admin.pl | 510 +++--------------- locale/de/admin | 38 +- locale/de/all | 12 +- templates/webpages/admin/edit_user_de.html | 260 +++++++++ .../webpages/admin/edit_user_master.html | 260 +++++++++ 5 files changed, 604 insertions(+), 476 deletions(-) create mode 100644 templates/webpages/admin/edit_user_de.html create mode 100644 templates/webpages/admin/edit_user_master.html 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}) - ? "