Merge branch 'master' of ssh://lx-office/~/lx-office-erp
authorSven Schöling <s.schoeling@linet-services.de>
Wed, 29 Dec 2010 11:55:35 +0000 (12:55 +0100)
committerSven Schöling <s.schoeling@linet-services.de>
Wed, 29 Dec 2010 11:55:35 +0000 (12:55 +0100)
SL/Auth.pm
SL/OE.pm
bin/mozilla/io.pl
bin/mozilla/is.pl
doc/dokumentenvorlagen-und-variablen.html
modules/fallback/parent.pm [new file with mode: 0644]

index eb5a780..6bb7bfa 100644 (file)
@@ -126,7 +126,9 @@ sub authenticate_root {
 
   $main::lxdebug->leave_sub();
 
-  return $password eq $admin_password ? OK : ERR_PASSWORD;
+  return OK if $password eq $admin_password;
+  sleep 5;
+  return ERR_PASSWORD;
 }
 
 sub authenticate {
@@ -136,7 +138,10 @@ sub authenticate {
 
   $main::lxdebug->leave_sub();
 
-  return $self->{authenticator}->authenticate(@_);
+  my $result = $self->{authenticator}->authenticate(@_);
+  return OK if $result eq OK;
+  sleep 5;
+  return $result;
 }
 
 sub dbconnect {
index b9aba5c..63fcf1f 100644 (file)
--- a/SL/OE.pm
+++ b/SL/OE.pm
@@ -1285,39 +1285,6 @@ sub project_description {
   return $value;
 }
 
-##########################
-# Get data for the submitted order id
-# from database
-#
-sub get_order_data_by_ordnumber {
-  $main::lxdebug->enter_sub();
-
-  my $self      = shift;
-  my %params    = @_;
-
-  Common::check_params(\%params, qw(ordnumber));
-
-  my $form     = $main::form;
-  my %myconfig = %main::myconfig;
-  my $dbh      = $form->get_standard_dbh();
-
-  my @values = ($params{ordnumber});
-
-  # We query the database for the fields we need using the submitted "ordnumber"
-  my $query = <<SQL;
-    SELECT o.payment_id, o.salesman_id, o.transdate AS orddate, o.taxzone_id, o.quonumber
-    FROM oe o
-    WHERE o.ordnumber = ?;
-SQL
-
-  # Do the actual query and return the results for later processing by our "frontend"
-  my $result = selectfirst_hashref_query($form, $dbh, $query, @values);
-
-  $main::lxdebug->leave_sub();
-
-  return $result;
-}
-
 1;
 
 __END__
index b50fe4e..6377fa6 100644 (file)
@@ -1040,9 +1040,9 @@ sub edit_e_mail {
 
   $form->{email} = $form->{shiptoemail} if $form->{shiptoemail} && $form->{formname} =~ /(pick|packing|bin)_list/;
 
-  if ($form->{"cp_id"} && !$form->{"email"}) {
+  if ($form->{"cp_id"}) {
     CT->get_contact(\%myconfig, $form);
-    $form->{"email"} = $form->{"cp_email"};
+    $form->{"email"} = $form->{"cp_email"} if $form->{"cp_email"};
   }
 
   my $title = $locale->text('E-mail') . " " . $form->get_formname_translation();
index b5e0927..7ac9f4d 100644 (file)
@@ -155,14 +155,6 @@ sub invoice_links {
     $ref->{name} = $form->quote($ref->{name});
   }
 
-  # Load data for a specific order and update form fields
-  my $order_data = OE->get_order_data_by_ordnumber(%$form) if $form->{ordnumber};
-
-  # Copy the fields we need to %form
-  for my $key (qw(payment_id salesman_id orddate taxzone_id quonumber)) {
-    $form->{$key} = $order_data->{$key};
-  }
-
   $form->restore_vars(qw(id));
 
   IS->retrieve_invoice(\%myconfig, \%$form);
index be7dd20..77feeb3 100644 (file)
@@ -477,6 +477,10 @@ td {
     <td><code>taxnumber</code></td>
     <td>Steuernummer</td>
    </tr>
+    <td><code>ustid</code></td>
+    <td>Usatzsteuer-Identifikationsnummer</td>
+   </tr>
+   <tr>
    <tr>
     <td><code>vendoremail</code></td>
     <td>Email des Lieferanten; nur f&uuml;r Lieferanten</td>
diff --git a/modules/fallback/parent.pm b/modules/fallback/parent.pm
new file mode 100644 (file)
index 0000000..435ff25
--- /dev/null
@@ -0,0 +1,136 @@
+package parent;
+use strict;
+use vars qw($VERSION);
+$VERSION = '0.221';
+
+sub import {
+    my $class = shift;
+
+    my $inheritor = caller(0);
+
+    if ( @_ and $_[0] eq '-norequire' ) {
+        shift @_;
+    } else {
+        for ( my @filename = @_ ) {
+            if ( $_ eq $inheritor ) {
+                warn "Class '$inheritor' tried to inherit from itself\n";
+            };
+
+            s{::|'}{/}g;
+            require "$_.pm"; # dies if the file is not found
+        }
+    }
+
+    {
+        no strict 'refs';
+        # This is more efficient than push for the new MRO
+        # at least until the new MRO is fixed
+        @{"$inheritor\::ISA"} = (@{"$inheritor\::ISA"} , @_);
+    };
+};
+
+"All your base are belong to us"
+
+__END__
+
+=head1 NAME
+
+parent - Establish an ISA relationship with base classes at compile time
+
+=head1 SYNOPSIS
+
+    package Baz;
+    use parent qw(Foo Bar);
+
+=head1 DESCRIPTION
+
+Allows you to both load one or more modules, while setting up inheritance from
+those modules at the same time.  Mostly similar in effect to
+
+    package Baz;
+    BEGIN {
+        require Foo;
+        require Bar;
+        push @ISA, qw(Foo Bar);
+    }
+
+By default, every base class needs to live in a file of its own.
+If you want to have a subclass and its parent class in the same file, you
+can tell C<parent> not to load any modules by using the C<-norequire> switch:
+
+  package Foo;
+  sub exclaim { "I CAN HAS PERL" }
+
+  package DoesNotLoadFooBar;
+  use parent -norequire, 'Foo', 'Bar';
+  # will not go looking for Foo.pm or Bar.pm
+
+This is equivalent to the following code:
+
+  package Foo;
+  sub exclaim { "I CAN HAS PERL" }
+
+  package DoesNotLoadFooBar;
+  push @DoesNotLoadFooBar::ISA, 'Foo';
+
+This is also helpful for the case where a package lives within
+a differently named file:
+
+  package MyHash;
+  use Tie::Hash;
+  use parent -norequire, 'Tie::StdHash';
+
+This is equivalent to the following code:
+
+  package MyHash;
+  require Tie::Hash;
+  push @ISA, 'Tie::StdHash';
+
+If you want to load a subclass from a file that C<require> would
+not consider an eligible filename (that is, it does not end in
+either C<.pm> or C<.pmc>), use the following code:
+
+  package MySecondPlugin;
+  require './plugins/custom.plugin'; # contains Plugin::Custom
+  use parent -norequire, 'Plugin::Custom';
+
+=head1 DIAGNOSTICS
+
+=over 4
+
+=item Class 'Foo' tried to inherit from itself
+
+Attempting to inherit from yourself generates a warning.
+
+    use Foo;
+    use parent 'Foo';
+
+=back
+
+=head1 HISTORY
+
+This module was forked from L<base> to remove the cruft
+that had accumulated in it.
+
+=head1 CAVEATS
+
+=head1 SEE ALSO
+
+L<base>
+
+=head1 AUTHORS AND CONTRIBUTORS
+
+Rafaël Garcia-Suarez, Bart Lateur, Max Maischein, Anno Siegel, Michael Schwern
+
+=head1 MAINTAINER
+
+Max Maischein C< corion@cpan.org >
+
+Copyright (c) 2007 Max Maischein C<< <corion@cpan.org> >>
+Based on the idea of C<base.pm>, which was introduced with Perl 5.004_04.
+
+=head1 LICENSE
+
+This module is released under the same terms as Perl itself.
+
+=cut