Datenbank anlegen: ISO8859-1 als default eingestellt.
[kivitendo-erp.git] / bin / mozilla / admin.pl
index 71828e2..28bc6fa 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,12 +484,16 @@ sub form_header {
       $selectstylesheet .= qq|<option>$item\n|;
     }
   }
-  $selectstylesheet .= "<option>\n";
 
   $form->header;
 
-  if ($myconfig->{menustyle} eq "neu") { $neu = "checked"; }
-  else { $old = "checked"; }
+  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>
@@ -539,8 +544,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>
@@ -596,8 +601,13 @@ sub form_header {
        </tr>
        <tr>
            <th align=right>| . $locale->text('Setup Menu') . qq|</th>
-           <td><input name=menustyle type=radio class=radio value=neu $neu>&nbsp;New
-                 <input name=menustyle type=radio class=radio value=old $old>&nbsp;Old</td>
+           <td><input name=menustyle type=radio class=radio value=v3 $menustyle_v3>&nbsp;| .
+           $locale->text("Top (CSS)") . qq|
+           <input name=menustyle type=radio class=radio value=neu $menustyle_neu>&nbsp;| .
+           $locale->text("Top (Javascript)") . qq|
+           <input name=menustyle type=radio class=radio value=old $menustyle_old>&nbsp;| .
+           $locale->text("Old (on the side)") . qq|
+           </td>
          </tr>
        <input type=hidden name=templates value=$myconfig->{templates}>
       </table>
@@ -728,7 +738,7 @@ sub form_header {
   </tr>
 |;
 
-  foreach $item (split /;/, $myconfig->{acs}) {
+  foreach $item (split(/;/, $myconfig->{acs})) {
     ($key, $value) = split /--/, $item, 2;
     $excl{$key}{$value} = 1;
   }
@@ -969,7 +979,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;
 
@@ -1301,10 +1311,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>
@@ -1423,10 +1434,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>|;
 
 }
 
@@ -1437,7 +1467,7 @@ sub create_dataset {
   }
 
   opendir SQLDIR, "sql/." or $form - error($!);
-  foreach $item (sort grep /-chart\.sql/, readdir SQLDIR) {
+  foreach $item (sort grep /-chart\.sql\z/, readdir SQLDIR) {
     next if ($item eq 'Default-chart.sql');
     $item =~ s/-chart\.sql//;
     push @charts,
@@ -1446,21 +1476,22 @@ sub create_dataset {
   closedir SQLDIR;
 
   $selectencoding = qq|<option>
-  <option value=SQL_ASCII>ASCII
-  <option value=EUC_JP>Japanese Extended UNIX Code
-  <option value=EUC_CN>Chinese Extended UNIX Code
-  <option value=EUC_KR>Korean Extended UNIX Code
-  <option value=EUC_TW>Taiwan Extended UNIX Code
-  <option value=UNICODE>UTF-8 Unicode
-  <option value=MULE_INTERNAL>Mule internal type
-  <option value=LATIN1>ISO 8859-1
-  <option value=LATIN2>ISO 8859-2
-  <option value=LATIN3>ISO 8859-3
-  <option value=LATIN4>ISO 8859-4
-  <option value=LATIN5>ISO 8859-5
-  <option value=KOI8>KOI8-R
-  <option value=WIN>Windows CP1251
-  <option value=ALT>Windows CP866
+  <option value="SQL_ASCII">ASCII
+  <option value="EUC_JP">Japanese Extended UNIX Code
+  <option value="EUC_CN">Chinese Extended UNIX Code
+  <option value="EUC_KR">Korean Extended UNIX Code
+  <option value="EUC_TW">Taiwan Extended UNIX Code
+  <option value="UNICODE">UTF-8 Unicode
+  <option value="MULE_INTERNAL">Mule internal type
+  <option selected="selected"  value="LATIN1">ISO 8859-1 
+  <option value="LATIN2">ISO 8859-2
+  <option value="LATIN3">ISO 8859-3
+  <option value="LATIN4">ISO 8859-4
+  <option value="LATIN5">ISO 8859-5
+  <option value="LATIN9">ISO 8859-15
+  <option value="KOI8">KOI8-R
+  <option value="WIN">Windows CP1251
+  <option value="ALT">Windows CP866
   |;
 
   $form->{title} =