Beim Anlegen einer Einheit bei allen Einheiten nachsehen, ob es eine Einheit mit...
[kivitendo-erp.git] / bin / mozilla / admin.pl
index f0b1c2d..6ac2a51 100644 (file)
@@ -239,7 +239,7 @@ sub list_users {
 
     if (/^(name=|company=|templates=|dbuser=|dbdriver=|dbname=|dbhost=)/) {
       chop($var = $&);
-      ($null, $member{$login}{$var}) = split /=/, $_, 2;
+      ($null, $member{$login}{$var}) = split(/=/, $_, 2);
     }
   }
 
@@ -440,11 +440,12 @@ sub form_header {
   }
 
   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|sty|odt)$/, @all;
+  @alldir = grep !/\.(html|tex|sty|odt|xml|txb)$/, @alldir;
   @alldir = grep !/^(webpages|\.svn)$/, @alldir;
 
   @allhtml = reverse grep !/Default/, @allhtml;
@@ -473,7 +474,7 @@ sub form_header {
   }
 
   opendir CSS, "css/.";
-  @all = grep /.*\.css$/, readdir CSS;
+  @all = sort(grep({ /\.css$/ && ($_ ne "tabcontent.css") } readdir(CSS)));
   closedir CSS;
 
   foreach $item (@all) {
@@ -483,7 +484,6 @@ sub form_header {
       $selectstylesheet .= qq|<option>$item\n|;
     }
   }
-  $selectstylesheet .= "<option>\n";
 
   $form->header;
 
@@ -539,8 +539,8 @@ sub form_header {
          <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>
@@ -728,7 +728,7 @@ sub form_header {
   </tr>
 |;
 
-  foreach $item (split /;/, $myconfig->{acs}) {
+  foreach $item (split(/;/, $myconfig->{acs})) {
     ($key, $value) = split /--/, $item, 2;
     $excl{$key}{$value} = 1;
   }
@@ -863,7 +863,7 @@ sub save {
   $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) {
@@ -969,7 +969,7 @@ sub save {
 
       # copy templates to the directory
       opendir TEMPLATEDIR, "$templates/." or $form - error("$templates : $!");
-      @templates = grep /$form->{mastertemplates}.*?\.(html|tex|sty)$/,
+      @templates = grep /$form->{mastertemplates}.*?\.(html|tex|sty|xml|txb)$/,
         readdir TEMPLATEDIR;
       closedir TEMPLATEDIR;
 
@@ -1121,9 +1121,16 @@ sub change_admin_password {
 
 <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=path value=$form->{path}>
 <input type=hidden name=rpw value=$form->{rpw}>
@@ -1141,6 +1148,24 @@ sub change_admin_password {
 }
 
 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};
 
@@ -1276,10 +1301,11 @@ sub dbselect_source {
 <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>
@@ -1398,10 +1424,29 @@ $upd
 }
 
 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>|;
 
 }