Merge branch 'master' of ssh://lx-office/~/lx-office-erp
authorSven Schöling <s.schoeling@linet-services.de>
Tue, 28 Dec 2010 13:52:26 +0000 (14:52 +0100)
committerSven Schöling <s.schoeling@linet-services.de>
Tue, 28 Dec 2010 13:52:26 +0000 (14:52 +0100)
13 files changed:
SL/Form.pm
bin/mozilla/admin_groups.pl
bin/mozilla/ar.pl
bin/mozilla/do.pl
bin/mozilla/wh.pl
locale/de/all
locale/de/special_chars
locale/de_DE/all
locale/en/all
scripts/locales.pl
templates/webpages/admin/edit_group.html
templates/webpages/admin/edit_groups.html
templates/webpages/do/stock_in_form.html

index f02c25a..7b7746d 100644 (file)
@@ -616,120 +616,72 @@ sub create_http_response {
 
 
 sub header {
-  $main::lxdebug->enter_sub();
+  $::lxdebug->enter_sub;
 
-  # extra code ist currently only used by menuv3 and menuv4 to set their css.
+  # extra code is currently only used by menuv3 and menuv4 to set their css.
   # it is strongly deprecated, and will be changed in a future version.
   my ($self, $extra_code) = @_;
+  my $db_charset = $::dbcharset || Common::DEFAULT_CHARSET;
+  my @header;
+
+  $::lxdebug->leave_sub and return if !$ENV{HTTP_USER_AGENT} || $self->{header}++;
+
+  $self->{favicon} ||= "favicon.ico";
+  $self->{titlebar}  = "$self->{title} - $self->{titlebar}" if $self->{title};
+
+  # build includes
+  if ($self->{refresh_url} || $self->{refresh_time}) {
+    my $refresh_time = $self->{refresh_time} || 3;
+    my $refresh_url  = $self->{refresh_url}  || $ENV{REFERER};
+    push @header, "<meta http-equiv='refresh' content='$refresh_time;$refresh_url'>";
+  }
+
+  push @header, "<link rel='stylesheet' href='css/$_' type='text/css' title='Lx-Office stylesheet'>"
+    for grep { -f "css/$_" } apply { s|.*/|| } $self->{stylesheet}, $self->{stylesheets};
+
+  push @header, "<style type='text/css'>\@page { size:landscape; }</style>" if $self->{landscape};
+  push @header, "<link rel='shortcut icon' href='$self->{favicon}' type='image/x-icon'>" if -f $self->{favicon};
+  push @header, '<script type="text/javascript" src="js/jquery.js"></script>',
+                '<script type="text/javascript" src="js/common.js"></script>',
+                '<style type="text/css">@import url(js/jscalendar/calendar-win2k-1.css);</style>',
+                '<script type="text/javascript" src="js/jscalendar/calendar.js"></script>',
+                '<script type="text/javascript" src="js/jscalendar/lang/calendar-de.js"></script>',
+                '<script type="text/javascript" src="js/jscalendar/calendar-setup.js"></script>',
+                '<script type="text/javascript" src="js/part_selection.js"></script>';
+  push @header, $self->{javascript} if $self->{javascript};
+  push @header, map { $_->show_javascript } @{ $self->{AJAX} || [] };
+  push @header, "<script type='text/javascript'>function fokus(){ document.$self->{fokus}.focus(); }</script>" if $self->{fokus};
+  push @header, sprintf "<script type='text/javascript'>top.document.title='%s';</script>",
+    join ' - ', grep $_, $self->{title}, $self->{login}, $::myconfig{dbname}, $self->{version} if $self->{title};
 
-  if ($self->{header}) {
-    $main::lxdebug->leave_sub();
-    return;
-  }
-
-  my ($stylesheet, $favicon, $pagelayout);
-
-  if ($ENV{HTTP_USER_AGENT}) {
-    my $doctype;
-
-    if ($ENV{'HTTP_USER_AGENT'} =~ m/MSIE\s+\d/) {
-      # Only set the DOCTYPE for Internet Explorer. Other browsers have problems displaying the menu otherwise.
-      $doctype = qq|<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\n|;
-    }
-
-    my $stylesheets = "$self->{stylesheet} $self->{stylesheets}";
-
-    $stylesheets =~ s|^\s*||;
-    $stylesheets =~ s|\s*$||;
-    foreach my $file (split m/\s+/, $stylesheets) {
-      $file =~ s|.*/||;
-      next if (! -f "css/$file");
-
-      $stylesheet .= qq|<link rel="stylesheet" href="css/$file" TYPE="text/css" TITLE="Lx-Office stylesheet">\n|;
-    }
-
-    $self->{favicon}    = "favicon.ico" unless $self->{favicon};
-
-    if ($self->{favicon} && (-f "$self->{favicon}")) {
-      $favicon =
-        qq|<LINK REL="shortcut icon" HREF="$self->{favicon}" TYPE="image/x-icon">
-  |;
-    }
-
-    my $db_charset = $main::dbcharset ? $main::dbcharset : Common::DEFAULT_CHARSET;
-
-    if ($self->{landscape}) {
-      $pagelayout = qq|<style type="text/css">
-                        \@page { size:landscape; }
-                        </style>|;
-    }
-
-    my $fokus = qq|
+  # if there is a title, we put some JavaScript in to the page, wich writes a
+  # meaningful title-tag for our frameset.
+  my $title_hack = '';
+  if ($self->{title}) {
+    $title_hack = qq|
     <script type="text/javascript">
     <!--
-      function fokus() {
-        document.$self->{fokus}.focus();
-      }
+      // Write a meaningful title-tag for our frameset.
+      top.document.title="| . $self->{"title"} . qq| - | . $self->{"login"} . qq| - | . $::myconfig{dbname} . qq| - V| . $self->{"version"} . qq|";
     //-->
-    </script>
-    | if $self->{"fokus"};
-
-  # if there is a title, we put some JavaScript in to the page, wich writes a
-  # meaningful title-tag for our frameset.
-    my $title_hack;
-    if ($self->{"title"}){
-               $title_hack = qq|
-               <script type="text/javascript">
-               <!--
-                 // Write a meaningful title-tag for our frameset.
-                 top.document.title="| . $self->{"title"} . qq| - | . $self->{"login"} . qq| - | . $::myconfig{dbname} . qq| - V| . $self->{"version"} . qq|";
-               //-->
-               </script>
-               |;
-       }
-
-    #Set Calendar
-    my $jsscript = "";
-    if ($self->{jsscript} == 1) {
-
-      $jsscript = qq|
-        <script type="text/javascript" src="js/jquery.js"></script>
-        <script type="text/javascript" src="js/common.js"></script>
-        <style type="text/css">\@import url(js/jscalendar/calendar-win2k-1.css);</style>
-        <script type="text/javascript" src="js/jscalendar/calendar.js"></script>
-        <script type="text/javascript" src="js/jscalendar/lang/calendar-de.js"></script>
-        <script type="text/javascript" src="js/jscalendar/calendar-setup.js"></script>
-        $self->{javascript}
-       |;
-    }
-
-    $self->{titlebar} =
-      ($self->{title})
-      ? "$self->{title} - $self->{titlebar}"
-      : $self->{titlebar};
-    my $ajax = "";
-    for my $item (@ { $self->{AJAX} || [] }) {
-      $ajax .= $item->show_javascript();
-    }
+    </script>|;
+  }
 
-    print $self->create_http_response('content_type' => 'text/html',
-                                      'charset'      => $db_charset,);
-    print qq|${doctype}<html>
-<head>
-  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=${db_charset}">
+  # output
+  print $self->create_http_response(content_type => 'text/html', charset => $db_charset);
+  print "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01//EN' 'http://www.w3.org/TR/html4/strict.dtd'>\n"
+    if  $ENV{'HTTP_USER_AGENT'} =~ m/MSIE\s+\d/; # Other browsers may choke on menu scripts with DOCTYPE.
+  print <<EOT;
+<html>
+ <head>
+  <meta http-equiv="Content-Type" content="text/html; charset=$db_charset">
   <title>$self->{titlebar}</title>
-  $stylesheet
-  $pagelayout
-  $favicon
-  $jsscript
-  $ajax
-  $fokus
-  $title_hack
-
+EOT
+  print "  $_\n" for @header;
+  print <<EOT;
   <link rel="stylesheet" href="css/jquery.autocomplete.css" type="text/css" />
-
   <meta name="robots" content="noindex,nofollow" />
-
+  <script type="text/javascript" src="js/highlight_input.js"></script>
   <link rel="stylesheet" type="text/css" href="css/tabcontent.css" />
   <script type="text/javascript" src="js/tabcontent.js">
 
@@ -740,15 +692,13 @@ sub header {
    ***********************************************/
 
   </script>
-
   $extra_code
-</head>
+  $title_hack
+ </head>
 
-|;
-  }
-  $self->{header} = 1;
+EOT
 
-  $main::lxdebug->leave_sub();
+  $::lxdebug->leave_sub;
 }
 
 sub ajax_response_header {
@@ -3568,9 +3518,7 @@ Points of interest for a beginner are:
 
 =head1 SPECIAL FUNCTIONS
 
-=over 4
-
-=item _store_value()
+=head2 C<_store_value()>
 
 parses a complex var name, and stores it in the form.
 
@@ -3625,7 +3573,7 @@ supported key structures are:
 
   filter.status[]  => $form->{status}->[ val1, val2, ... ]
 
-=item update_business PARAMS
+=head2 C<update_business> PARAMS
 
 PARAMS (not named):
  \%config,     - config hashref
@@ -3637,7 +3585,7 @@ handles business (thats customer/vendor types) sequences.
 special behaviour for empty strings in customerinitnumber field:
 will in this case not increase the value, and return undef.
 
-=item redirect_header $url
+=head2 C<redirect_header> $url
 
 Generates a HTTP redirection header for the new C<$url>. Constructs an
 absolute URL including scheme, host name and port. If C<$url> is a
@@ -3651,6 +3599,45 @@ Examples:
   print $::form->redirect_header('oe.pl?action=edit&id=1234');
   print $::form->redirect_header('http://www.lx-office.org/');
 
+=head2 C<header>
+
+Generates a general purpose http/html header and includes most of the scripts
+ans stylesheets needed.
+
+Only one header will be generated. If the method was already called in this
+request it will not output anything and return undef. Also if no
+HTTP_USER_AGENT is found, no header is generated.
+
+Although header does not accept parameters itself, it will honor special
+hashkeys of its Form instance:
+
+=over 4
+
+=item refresh_time
+
+=item refresh_url
+
+If one of these is set, a http-equiv refresh is generated. Missing parameters
+default to 3 seconds and the refering url.
+
+=item stylesheet
+
+=item stylesheets
+
+If these are arrayrefs the contents will be inlined into the header.
+
+=item landscape
+
+If true, a css snippet will be generated that sets the page in landscape mode.
+
+=item favicon
+
+Used to override the default favicon.
+
+=item title
+
+A html page title will be generated from this
+
 =back
 
 =cut
index 069fa69..1444332 100644 (file)
@@ -73,6 +73,7 @@ sub save_group {
   $form->isblank('name', $locale->text('The group name is missing.'));
 
   my $groups = $main::auth->read_groups();
+  my %users  = map { ( $_->{id} => 1 ) } values %{ { $::auth->read_all_users() } };
 
   foreach my $group (values %{$groups}) {
     if (($form->{group_id} != $group->{id})
@@ -92,9 +93,8 @@ sub save_group {
 
   $group->{name}        = $form->{name};
   $group->{description} = $form->{description};
-  $group->{rights}      = {};
-
-  map { $group->{rights}->{$_} = $form->{"${_}_granted"} ? 1 : 0 } SL::Auth::all_rights();
+  $group->{rights}      = { map { ( $_ => $form->{"${_}_granted"} ? 1 : 0 ) } SL::Auth::all_rights() };
+  $group->{members}     = [ grep { $users{$_} } @{ $form->{user_ids} || [] } ];
 
   my $is_new = !$form->{group_id};
 
@@ -124,17 +124,9 @@ sub edit_group {
     $form->show_generic_error($locale->text("No group has been selected, or the group does not exist anymore."));
   }
 
-  my $group = $groups->{$form->{group_id}};
-
-  my %all_users   = $main::auth->read_all_users();
-  my %users_by_id = map { $_->{id} => $_ } values %all_users;
-
-  my @members     = uniq sort { lc $a->{login} cmp lc $b->{login} } @users_by_id{ @{ $group->{members} } };
-
-  my %grouped     = map { $_ => 1 } uniq @{ $group->{members} };
-  my @non_members = sort { lc $a->{login} cmp lc $b->{login} } grep { !$grouped{$_->{id}} } values %all_users;
-
-  my @rights = map {
+  my $group     = $groups->{$form->{group_id}};
+  my %all_users = $main::auth->read_all_users();
+  my @rights    = map {
     { "right"       => $_->[0],
       "description" => $_->[1],
       "is_section"  => '--' eq substr($_->[0], 0, 2),
@@ -143,8 +135,8 @@ sub edit_group {
   } SL::Auth::all_rights_full();
 
   $form->header();
-  print $form->parse_html_template("admin/edit_group", { "USERS_IN_GROUP"     => \@members,
-                                                         "USERS_NOT_IN_GROUP" => \@non_members,
+  print $form->parse_html_template("admin/edit_group", { ALL_USERS            => [ values %all_users ],
+                                                         USER_IDS_IN_GROUP    => $group->{members},
                                                          "RIGHTS"             => \@rights,
                                                          "name"               => $group->{name},
                                                          "description"        => $group->{description} });
@@ -179,56 +171,6 @@ sub delete_group {
   $main::lxdebug->leave_sub();
 }
 
-sub add_to_group {
-  $main::lxdebug->enter_sub();
-
-  my $form     = $main::form;
-  my $locale   = $main::locale;
-
-  $form->isblank('user_id_not_in_group', $locale->text('No user has been selected.'));
-
-  my $groups = $main::auth->read_groups();
-
-  if (!$form->{group_id} || !$groups->{$form->{group_id}}) {
-    $form->show_generic_error($locale->text('No group has been selected, or the group does not exist anymore.'));
-  }
-
-  my $group = $groups->{$form->{group_id}};
-  $group->{members} = [ uniq @{ $group->{members} }, $form->{user_id_not_in_group} ];
-
-  $main::auth->save_group($group);
-
-  $form->{message} = $locale->text('The user has been added to this group.');
-  edit_group();
-
-  $main::lxdebug->leave_sub();
-}
-
-sub remove_from_group {
-  $main::lxdebug->enter_sub();
-
-  my $form     = $main::form;
-  my $locale   = $main::locale;
-
-  $form->isblank('user_id_in_group', $locale->text('No user has been selected.'));
-
-  my $groups = $main::auth->read_groups();
-
-  if (!$form->{group_id} || !$groups->{$form->{group_id}}) {
-    $form->show_generic_error($locale->text('No group has been selected, or the group does not exist anymore.'));
-  }
-
-  my $group            = $groups->{$form->{group_id}};
-  $group->{members} = [ uniq grep { $_ ne $form->{user_id_in_group} } @{ $group->{members} } ];
-
-  $main::auth->save_group($group);
-
-  $form->{message} = $locale->text('The user has been removed from this group.');
-  edit_group();
-
-  $main::lxdebug->leave_sub();
-}
-
 sub edit_group_membership {
   $main::lxdebug->enter_sub();
 
index e2777bd..251c464 100644 (file)
@@ -982,9 +982,13 @@ sub update {
 
   $form->{invdate} = $form->{transdate};
 
-  my %saved_variables = map +( $_ => $form->{$_} ), qw(AR AR_amount_1 taxchart_1);
-
+  my %saved_variables = map +( $_ => $form->{$_} ), qw(AR AR_amount_1 taxchart_1 oldcustomer);
   &check_name("customer");
+     
+  # check_name ruft get_customer auf, oldcustomer wird überschrieben, daher wird dies vorher gemerkt
+  # get_customer holt Bemerkungen als intnotes, für Debitorenbuchungen gibt es aber nur das Feld notes
+  $form->{notes} = $form->{intnotes} if $saved_variables{oldcustomer} ne $form->{customer}; 
 
   $form->{AR} = $saved_variables{AR};
   if ($saved_variables{AR_amount_1} =~ m/.--./) {
index 2b1bdd9..120606a 100644 (file)
@@ -1044,7 +1044,8 @@ sub display_stock_in_form {
   my $part_info  = IC->get_basic_part_info('id' => $form->{parts_id});
 
   my $units      = AM->retrieve_units(\%myconfig, $form);
-  my $units_data = AM->unit_select_data($units, undef, undef, $part_info->{unit});
+  # der zweite Parameter von unit_select_data gibt den default-Namen (selected) vor
+  my $units_data = AM->unit_select_data($units, $form->{do_unit}, undef, $part_info->{unit});
 
   $form->get_lists('warehouses' => { 'key'    => 'WAREHOUSES',
                                      'bins'   => 'BINS' });
index c990e63..fc34ba6 100644 (file)
@@ -85,7 +85,8 @@ sub transfer_warehouse_selection {
   show_no_warehouses_error() if (!scalar @{ $form->{WAREHOUSES} });
 
   my $units      = AM->retrieve_units(\%myconfig, $form);
-  $form->{UNITS} = AM->unit_select_data($units, $form->{unit}, 0, $form->{partunit});
+  # der zweite Parameter von unit_select_data gibt den default-Namen (selected) vor
+  $form->{UNITS} = AM->unit_select_data($units, $form->{partunit}, 0, $form->{partunit});
 
   if (scalar @{ $form->{WAREHOUSES} }) {
     $form->{warehouse_id} ||= $form->{WAREHOUSES}->[0]->{id};
index 1194cec..9735b39 100644 (file)
@@ -2,6 +2,8 @@
 # -*- coding: utf-8; -*-
 # vim: fenc=UTF-8
 
+use utf8;
+
 # These are all the texts to build the translations files.
 # The file has the form of 'english text'  => 'foreign text',
 # you can add the translation in this file or in the 'missing' file
@@ -153,7 +155,6 @@ $self->{texts} = {
   'Add bank account'            => 'Bankkonto erfassen',
   'Add custom variable'         => 'Benutzerdefinierte Variable erfassen',
   'Add note'                    => 'Notiz erfassen',
-  'Add to group'                => 'Zu Gruppe hinzufügen',
   'Add unit'                    => 'Einheit hinzuf&uuml;gen',
   'Address'                     => 'Adresse',
   'Administration'              => 'Administration',
@@ -169,6 +170,7 @@ $self->{texts} = {
   'All of the exports you have selected were already closed.' => 'Alle von Ihnen ausgewählten Exporte sind bereits abgeschlossen.',
   'All reports'                 => 'Alle Berichte (Konten&uuml;bersicht, Summen- u. Saldenliste, GuV, BWA, Bilanz, Projektbuchungen)',
   'All the selected exports have already been closed, or all of their items have already been executed.' => 'Alle ausgewählten Exporte sind als abgeschlossen markiert, oder für alle Einträge wurden bereits Zahlungen verbucht.',
+  'All users'                   => 'Alle BenutzerInnen',
   'Allow access'                => 'Zugriff erlauben',
   'Allow the following users access to my follow-ups:' => 'Erlaube den folgenden Benutzern Zugriff auf meine Wiedervorlagen:',
   'Alternatively you can create a new part which will then be selected.' => 'Sie k&ouml;nnen auch einen neuen Artikel anlegen, der dann automatisch ausgew&auml;hlt wird.',
@@ -223,6 +225,7 @@ $self->{texts} = {
   'Authentification tables creation' => 'Anlegen der Tabellen zur Benutzerauthentifizierung',
   'Auto Send?'                  => 'Auto. Versand?',
   'Automatically created invoice for fee and interest for dunning %s' => 'Automatisch erzeugte Rechnung für Gebühren und Zinsen zu Mahnung %s',
+  'Available'                   => 'Verfügbar',
   'Available qty'               => 'Lagerbestand',
   'BALANCE SHEET'               => 'BILANZ',
   'BIC'                         => 'BIC',
@@ -447,7 +450,7 @@ $self->{texts} = {
   'Currency'                    => 'Währung',
   'Current / Next Level'        => 'Aktuelles / Nächstes Mahnlevel',
   'Current Earnings'            => 'Gewinn',
-  'Current assets account'      => '',
+  'Current assets account'      => 'Konto für Umlaufvermögen',
   'Current unit'                => 'Aktuelle Einheit',
   'Current value:'              => 'Aktueller Wert:',
   'Custom Variables'            => 'Benutzerdefinierte Variablen',
@@ -667,6 +670,7 @@ $self->{texts} = {
   'Edit group '                 => 'Gruppe bearbeiten',
   'Edit group membership'       => 'Gruppenmitgliedschaften bearbeiten',
   'Edit groups'                 => 'Gruppen bearbeiten',
+  'Edit membership'             => 'Mitgliedschaft bearbeiten',
   'Edit note'                   => 'Notiz bearbeiten',
   'Edit rights'                 => 'Rechte bearbeiten',
   'Edit templates'              => 'Vorlagen bearbeiten',
@@ -1009,8 +1013,6 @@ $self->{texts} = {
   'May '                        => 'Mai',
   'May set the BCC field when sending emails' => 'Beim Verschicken von Emails das Feld \'BCC\' setzen',
   'Medium Number'               => 'Datentr&auml;gernummer',
-  'Members not of'              => 'Benutzer nicht in Gruppe',
-  'Members of'                  => 'Benutzer in Gruppe',
   'Memo'                        => 'Memo',
   'Menu'                        => 'Men&uuml;',
   'Message'                     => 'Nachricht',
@@ -1089,7 +1091,6 @@ $self->{texts} = {
   'No transaction selected!'    => 'Keine Transaktion ausgewählt',
   'No transfers were executed in this export.' => 'In diesem SEPA-Export wurden keine Überweisungen ausgeführt.',
   'No unknown units where found.' => 'Es wurden keine unbekannten Einheiten gefunden.',
-  'No user has been selected.'  => 'Es wurde kein Benutzer ausgew&auml;hlt.',
   'No valid number entered for pricegroup "#1".' => 'Für Preisgruppe "#1" wurde keine gültige Nummer eingegeben.',
   'No vendor has been selected yet.' => 'Es wurde noch kein Lieferant ausgewählt.',
   'No warehouse has been created yet or the quantity of the bins is not configured yet.' => 'Es wurde noch kein Lager angelegt, bzw. die dazugehörigen Lagerplätze sind noch nicht konfiguriert.',
@@ -1357,7 +1358,6 @@ $self->{texts} = {
   'Remove'                      => 'Entfernen',
   'Remove Draft'                => 'Entwurf l&ouml;schen',
   'Remove draft when posting'   => 'Entwurf beim Buchen l&ouml;schen',
-  'Remove from group'           => 'Aus Gruppe entfernen',
   'Removed spoolfiles!'         => 'Druckdateien entfernt!',
   'Removing marked entries from queue ...' => 'Markierte Einträge werden von der Warteschlange entfernt ...',
   'Rename the group'            => 'Gruppe umbenennen',
@@ -1452,6 +1452,7 @@ $self->{texts} = {
   'Select the checkboxes that match users to the groups they should belong to.' => 'W&auml;hlen Sie diejenigen Checkboxen aus, die die Benutzer zu den gew&uuml;schten Gruppen zuordnen.',
   'Select type of removal'      => 'Grund der Entnahme ausw&auml;hlen',
   'Select type of transfer'     => 'Grund der Umlagerung ausw&auml;hlen',
+  'Selected'                    => 'Ausgewählt',
   'Selection'                   => 'Auswahlbox',
   'Selection fields: The option field must contain the available options for the selection. Options are separated by \'##\', for example \'Early##Normal##Late\'.' => 'Auswahlboxen: Das Optionenfeld muss die f&uuml;r die Auswahl verf&uuml;gbaren Eintr&auml;ge enthalten. Die Eintr&auml;ge werden mit \'##\' voneinander getrennt. Beispiel: \'Fr&uuml;h##Normal##Sp&auml;t\'.',
   'Sell Price'                  => 'Verkaufspreis',
@@ -1697,8 +1698,6 @@ $self->{texts} = {
   'The unit in row %d has been deleted in the meantime.' => 'Die Einheit in Zeile %d ist in der Zwischentzeit gel&ouml;scht worden.',
   'The unit in row %d has been used in the meantime and cannot be changed anymore.' => 'Die Einheit in Zeile %d wurde in der Zwischenzeit benutzt und kann nicht mehr ge&auml;ndert werden.',
   'The units have been saved.'  => 'Die Einheiten wurden gespeichert.',
-  'The user has been added to this group.' => 'Der Benutzer wurde der Gruppe hinzugef&uuml;gt.',
-  'The user has been removed from this group.' => 'Der Benutzer wurde aus der Gruppe entfernt.',
   'The user is a member in the following group(s):' => 'Der Benutzer ist Mitglied in den folgenden Gruppen:',
   'The user migration process is complete.' => 'Der Prozess der Benutzerdatenmigration ist abgeschlossen.',
   'The variable name must only consist of letters, numbers and underscores. It must begin with a letter. Example: send_christmas_present' => 'Der Variablenname darf nur aus Zeichen (keine Umlaute), Ziffern und Unterstrichen bestehen. Er muss mit einem Buchstaben beginnen. Beispiel: weihnachtsgruss_verschicken',
@@ -1837,6 +1836,7 @@ $self->{texts} = {
   'User name'                   => 'Benutzername',
   'User saved!'                 => 'Benutzer gespeichert!',
   'Username'                    => 'Benutzername',
+  'Users in this group'         => 'BenutzerInnen in dieser Gruppe',
   'Ust-IDNr'                    => 'USt-IdNr.',
   'Valid from'                  => 'Gültig ab',
   'Valid until'                 => 'gültig bis',
index 0b1f889..f96523a 100644 (file)
@@ -33,7 +33,7 @@ order=< > \n
 \n=<br>
 
 [Template/LaTeX]
-order=\\ <pagebreak> & \n \r " $ % _ # ^ { } < > £ ± \xe1 ² ³ °
+order=\\ <pagebreak> & \n \r " $ % _ # ^ { } < > £ ± \xe1 ² ³ ° § ® ©
 \\=\\textbackslash\s
 <pagebreak>=
 "=''
@@ -55,6 +55,9 @@ _=\\_
 ²=$^2$
 ³=$^3$
 °=$^\\circ$
+§=\\S
+®=\\textregistered
+©=\\textcopyright
 
 [Template/OpenDocument]
 order=& < > " ' \x80 \n \r
index d954187..9cf56b7 100644 (file)
@@ -2,6 +2,7 @@
 # -*- coding: utf-8; -*-
 # vim: fenc=UTF-8
 
+use utf8;
 
 # These are all the texts to build the translations files.
 # The file has the form of 'english text'  => 'foreign text',
@@ -448,7 +449,7 @@ $self->{texts} = {
   'Currency'                    => 'Währung',
   'Current / Next Level'        => 'Aktuelles / Nächstes Mahnlevel',
   'Current Earnings'            => 'Gewinn',
-  'Current assets account'      => '',
+  'Current assets account'      => 'Konto für Umlaufvermögen',
   'Current unit'                => 'Aktuelle Einheit',
   'Current value:'              => 'Aktueller Wert:',
   'Custom Variables'            => 'Erweitert',
@@ -564,7 +565,7 @@ $self->{texts} = {
   'Do you really want to delete AR transaction #1?' => 'Wollen Sie wirklich die Debitorenbuchung #1 löschen?',
   'Do you really want to delete GL transaction #1?' => 'Wollen Sie wirklich die Dialogbuchung #1 löschen?',
   'Do you really want to delete this group?' => 'Gruppe wirklich l&ouml;schen?',
-  'Do you really want to delete this object?' => '',
+  'Do you really want to delete this object?' => 'Wirklich löschen?',
   'Do you really want to delete this warehouse?' => 'Wollen Sie dieses Lager wirklich l&ouml;schen?',
   'Do you want Lx-Office to create a group for access to all functions?' => 'Wollen Sie, dass Lx-Office eine Gruppe mit Zugriff auf alle Funktionen anlegt?',
   'Do you want to <b>limit</b> your search?' => 'Wollen Sie Ihre Suche <b>spezialisieren</b>?',
@@ -1217,7 +1218,7 @@ $self->{texts} = {
   'Please enter the login for the new user.' => 'Bitte geben Sie das Login für den neuen Benutzer ein.',
   'Please enter the name of the database that will be used as the template for the new database:' => 'Bitte geben Sie den Namen der Datenbank an, die als Vorlage f&uuml;r die neue Datenbank benutzt wird:',
   'Please enter the name of the dataset you want to restore the backup in.' => 'Bitte geben Sie den Namen der Datenbank ein, in der Sie die Sicherung wiederherstellen wollen.',
-  'Please enter the sales tax identification number.' => '',
+  'Please enter the sales tax identification number.' => 'Bitte geben Sie die Umsatzsteueridentifikationsnummer an.',
   'Please enter the taxnumber in the administration menu user preferences' => 'Bitte bei den Einstellungen des aktuellen Benutzers im Administrationsmodul angeben.',
   'Please enter values'         => 'Bitte Werte eingeben',
   'Please insert object dimensions below.' => 'Bitte geben Sie die Abmessungen unten ein',
index e562295..461e7dc 100644 (file)
@@ -2,6 +2,8 @@
 # -*- coding: utf-8; -*-
 # vim: fenc=UTF-8
 
+use utf8;
+
 # These are all the texts to build the translations files.
 # The file has the form of 'english text'  => 'foreign text',
 # you can add the translation in this file or in the 'missing' file
index 25579c3..16f2b3e 100755 (executable)
@@ -31,6 +31,7 @@ parse_args();
 my $basedir      = "../..";
 my $locales_dir  = ".";
 my $bindir       = "$basedir/bin/mozilla";
+my @progdirs     = ( "$basedir/SL/Template/Plugin" );
 my $dbupdir      = "$basedir/sql/Pg-upgrade";
 my $dbupdir2     = "$basedir/sql/Pg-upgrade2";
 my $menufile     = "menu.ini";
@@ -42,11 +43,17 @@ my ($ALL_HEADER, $MISSING_HEADER, $LOST_HEADER);
 init();
 
 opendir DIR, "$bindir" or die "$!";
-my @progfiles = grep { /\.pl$/ && !/(_custom|^\.)/ } readdir DIR;
+my @progfiles = map { [ $_, $bindir ] } grep { /\.pl$/ && !/(_custom|^\.)/ } readdir DIR;
 seekdir DIR, 0;
 my @customfiles = grep /_custom/, readdir DIR;
 closedir DIR;
 
+foreach my $dir (@progdirs) {
+  opendir DIR, $dir or die "$!";
+  push @progfiles, map { [ $_, $dir ] } grep { /\.pm$/ } readdir DIR;
+  closedir DIR;
+}
+
 # put customized files into @customfiles
 my @menufiles;
 
@@ -91,7 +98,7 @@ chomp $charset;
 
 my %old_texts = %{ $self->{texts} || {} };
 
-map({ handle_file($_, $bindir); } @progfiles);
+map({ handle_file(@{ $_ }); } @progfiles);
 map({ handle_file($_, $dbupdir); } @dbplfiles);
 map({ handle_file($_, $dbupdir2); } @dbplfiles2);
 
@@ -283,11 +290,11 @@ sub extract_text_between_parenthesis {
 
     } else {
       if ($quote_next) {
+        $text .= '\\' unless $cur_char eq "'";
         $text .= $cur_char;
         $quote_next = 0;
 
       } elsif ($cur_char eq '\\') {
-        $text .= $cur_char;
         $quote_next = 1;
 
       } elsif ($cur_char eq $inside_string) {
@@ -600,12 +607,12 @@ sub generate_file {
   my $data_name = $params{data_name};
   my @delim     = split //, ($params{delim} || '{}');
 
-  open my $fh, '>', $file or die "$! : $file";
+  open my $fh, '>:encoding(utf8)', $file or die "$! : $file";
 
   $charset =~ s/\r?\n//g;
   my $emacs_charset = lc $charset;
 
-  print $fh "#!/usr/bin/perl\n# -*- coding: $emacs_charset; -*-\n# vim: fenc=$charset\n\n";
+  print $fh "#!/usr/bin/perl\n# -*- coding: $emacs_charset; -*-\n# vim: fenc=$charset\n\nuse utf8;\n\n";
   print $fh $header, "\n" if $header;
   print $fh "$data_name = $delim[0]\n" if $data_name;
 
index 88ced6a..5b68461 100644 (file)
@@ -1,10 +1,9 @@
-[%- USE T8 %]
-[% USE HTML %]<body>
- <form name="Form" method="post" action="admin.pl">
-
-  <input type="hidden" name="group_id" value="[% HTML.escape(group_id) %]">
-  <input type="hidden" name="back_nextsub" value="edit_groups">
+[% USE T8 %][% USE HTML %][% USE L %][% USE LxERP -%]
+<body>
+ [% L.stylesheet_tag('jquery.multiselect2side') %]
+ [% L.javascript_tag('jquery.selectboxes', 'jquery.multiselect2side') %]
 
+ <form name="Form" method="post" action="admin.pl">
   [% IF message %]
   <p class="message_ok">[% message %]</p>
   [% END %]
 
    <hr>
 
-   <p class="listheading">[% 'Rename the group' | $T8 %]</p>
-   <table>
-     <tr><td><div style="">[% 'Name' | $T8 %]</th><td><input name="name" maxlength="50" value="[% HTML.escape(name) %]"></td></tr>
-        <tr><th>[% 'Description' | $T8 %]</th><td><input name="description" value="[% HTML.escape(description) %]"></td></tr>
-   </table>
-   <br>
-     <input type="hidden" name="save_nextsub" value="save_group">
-     <input type="submit" class="submit" name="action" value="[% 'Save' | $T8 %]">
-
- <hr>
- <br>
- <div class="listtop">[% 'Group membership' | $T8 %]</div>
-     <table>
-      <tr>
-       <td><p class="listheading">[% 'Members of' | $T8 %]<br>[% HTML.escape(name) %]</p></td>
-       <td> </td>
-       <td><p class="listheading">[% 'Members not of' | $T8 %]<br>[% HTML.escape(name) %]</p></td>
-      </tr>
-
-      <tr>
-       <td valign="center">
-        <select name="user_id_in_group" size="10">
-         [% FOREACH user = USERS_IN_GROUP %]<option value="[% HTML.escape(user.id) %]">[% HTML.escape(user.login) %]</option>[% END %]
-        </select>
-       </td>
-
-       <td valign="center">
-        <input type="submit" class="submit" name="action" value="[% 'Add to group' | $T8 %]">
-        <br>
-        <br>
-        <input type="submit" class="submit" name="action" value="[% 'Remove from group' | $T8 %]">
-       </td>
-
-       <td valign="center">
-        <select name="user_id_not_in_group" size="10">
-         [% FOREACH user = USERS_NOT_IN_GROUP %]<option value="[% HTML.escape(user.id) %]">[% HTML.escape(user.login) %]</option>[% END %]
-        </select>
-       </td>
-      </tr>
-     </table>
- <hr>
- <br>
-    <div class="listtop">[% 'Edit rights' | $T8 %]</div>
-
-      [% FOREACH right = RIGHTS %]
-
-        [% IF right.is_section %]
-        <br>
-        <h4 style="border-bottom: solid; border-bottom-width: 1px; border-bottom-color: #ddd;">[% right.description %]</h4>
-        [% ELSE %]
-        <p style="/*font-size: 11px;*/ margin: 0;">
-        <input type="checkbox" name="[% HTML.escape(right.right) %]_granted" id="[% HTML.escape(right.right) %]_granted" [% IF right.granted %]checked[% END %]>
-        <label for="[% HTML.escape(right.right) %]_granted">[% IF right.description %][% right.description %][% ELSE %]<i>[% HTML.escape(right.right) %]</i>[% END %]</label>
-         </p>
-        [% END %]
-
-      [% END %]
-
-   <hr>
-    <input type="hidden" name="save_nextsub" value="save_group">
-    <input type="submit" class="submit" name="action" value="[% 'Back' | $T8 %]">
-    <input type="submit" class="submit" name="action" value="[% 'Save' | $T8 %]">
+  <h3 class="listheading">[%- LxERP.t8('Edit membership') %]</h3>
+
+  <div class="clearfix">
+   [% L.select_tag("user_ids[]", L.options_for_select(ALL_USERS, value => 'id', title => 'login', default => USER_IDS_IN_GROUP), 'multiple' => 'multiple') %]
+  </div>
+
+  <h3 class="listheading">[% 'Edit rights' | $T8 %]</h3>
+
+  <p>
+   [% FOREACH right = RIGHTS %]
+    [% IF right.is_section %]
+     <i>[% right.description %]</i><br>
+    [% ELSE %]
+     <input type="checkbox" name="[% HTML.escape(right.right) %]_granted" id="[% HTML.escape(right.right) %]_granted" [% IF right.granted %]checked[% END %]>
+     <label for="[% HTML.escape(right.right) %]_granted">[% IF right.description %][% right.description %][% ELSE %]<i>[% HTML.escape(right.right) %]</i>[% END %]</label>
+     <br>
+    [% END %]
+   [% END %]
+  </p>
+
+  <h3 class="listheading">[% LxERP.t8('Rename the group') %]</h3>
+
+  <table>
+   <tr>
+    <td>[% 'Name' | $T8 %]:</td>
+    <td><input name="name" maxlength="50" value="[% HTML.escape(name) %]"></td>
+   </tr>
+
+   <tr>
+    <td>[% 'Description' | $T8 %]:</td>
+    <td><input name="description" value="[% HTML.escape(description) %]"></td>
+   </tr>
+  </table>
+
+  <p>
+   <input type="hidden" name="group_id" value="[% HTML.escape(group_id) %]">
+   <input type="hidden" name="action" value="save_group">
+   <input type="submit" class="submit" value="[% 'Save' | $T8 %]">
+   &nbsp;
+   <a href="admin.pl?action=edit_groups">[% 'Back' | $T8 %]</a>
+  </p>
  </form>
+
+ [% L.multiselect2side('user_ids_', labelsx => LxERP.t8('All users'), labeldx => LxERP.t8('Users in this group')) %]
 </body>
 </html>
index 41cbf72..af71026 100644 (file)
@@ -6,10 +6,7 @@
   <p class="message_ok">[% message %]</p>
   [% END %]
 
-  <form method="post" action="admin.pl">
-     <input type="hidden" name="back_nextsub" value="list_users">
-    <p><input type="submit" class="submit" name="action" value="[% 'Back' | $T8 %]"></p>
-  </form>
+  <p><a href="admin.pl?action=login">[% 'Back' | $T8 %]</a></p>
 
  <div class="listheading">[% 'Add a new group' | $T8 %]</div>
  <form method="post" action="admin.pl">
@@ -25,8 +22,6 @@
 
 
  <form name="Form" method="post" action="admin.pl">
-
-
   <div class="listheading">[% 'Edit and delete a group' | $T8 %]</div>
 
   [% IF num_groups %]
@@ -48,7 +43,6 @@
    <input type="submit" class="submit" name="action" value="[% 'Edit' | $T8 %]">
    <input type="submit" class="submit" name="action" value="[% 'Delete' | $T8 %]">
    [% END %]
-   <input type="hidden" name="back_nextsub" value="list_users">
   </p>
  </form>
 
index 238747e..0d5ea68 100644 (file)
      <td>
       <select name="unit_[% loop.count %]">
        [%- FOREACH unit = UNITS %]
-       <option[% IF unit.name == row.unit %] selected[% END %]>[% HTML.escape(unit.name) %]</option>
+       <option[% IF unit.selected %] selected[% END %]>[% HTML.escape(unit.name) %]</option>
        [%- END %]
       </select>
      </td>