]> wagnertech.de Git - mfinanz.git/blobdiff - SL/Controller/Part.pm
Artikelstammdaten: kein Redirect auf »neuen Artikel anlegen«
[mfinanz.git] / SL / Controller / Part.pm
index da27a865e00a203e32e254edd71fedf82c71012a..66f873136d838e6b90103e852f22a7d2beb50e97 100644 (file)
@@ -42,7 +42,6 @@ __PACKAGE__->run_before('check_part_id', only   => [ qw(edit delete) ]);
 sub action_add_part {
   my ($self, %params) = @_;
 
 sub action_add_part {
   my ($self, %params) = @_;
 
-  $::form->{callback} = $self->url_for(action => 'add_part') unless $::form->{callback};
   $self->part( SL::DB::Part->new_part );
   $self->add;
 };
   $self->part( SL::DB::Part->new_part );
   $self->add;
 };
@@ -50,7 +49,6 @@ sub action_add_part {
 sub action_add_service {
   my ($self, %params) = @_;
 
 sub action_add_service {
   my ($self, %params) = @_;
 
-  $::form->{callback} = $self->url_for(action => 'add_service') unless $::form->{callback};
   $self->part( SL::DB::Part->new_service );
   $self->add;
 };
   $self->part( SL::DB::Part->new_service );
   $self->add;
 };
@@ -58,7 +56,6 @@ sub action_add_service {
 sub action_add_assembly {
   my ($self, %params) = @_;
 
 sub action_add_assembly {
   my ($self, %params) = @_;
 
-  $::form->{callback} = $self->url_for(action => 'add_assembly') unless $::form->{callback};
   $self->part( SL::DB::Part->new_assembly );
   $self->add;
 };
   $self->part( SL::DB::Part->new_assembly );
   $self->add;
 };
@@ -66,7 +63,6 @@ sub action_add_assembly {
 sub action_add_assortment {
   my ($self, %params) = @_;
 
 sub action_add_assortment {
   my ($self, %params) = @_;
 
-  $::form->{callback} = $self->url_for(action => 'add_assortment') unless $::form->{callback};
   $self->part( SL::DB::Part->new_assortment );
   $self->add;
 };
   $self->part( SL::DB::Part->new_assortment );
   $self->add;
 };
@@ -194,11 +190,7 @@ sub action_delete {
   if ( $::form->{callback} ) {
     $self->redirect_to($::form->unescape($::form->{callback}));
   } else {
   if ( $::form->{callback} ) {
     $self->redirect_to($::form->unescape($::form->{callback}));
   } else {
-    my @redirect_params = (
-        controller => 'controller.pl',
-        action     => 'LoginScreen/user_login'
-    );
-    $self->redirect_to(@redirect_params);
+    $self->redirect_to(controller => 'ic.pl', action => 'search', searchitems => 'article');
   }
 }
 
   }
 }
 
@@ -1299,6 +1291,17 @@ parameter part_type as an action. Example:
 
   controller.pl?action=Part/add&part_type=service
 
 
   controller.pl?action=Part/add&part_type=service
 
+=item C<action_add_from_record>
+
+When adding new items to records they can be created on the fly if the entered
+partnumber or description doesn't exist yet. After being asked what part type
+the new item should have the user is redirected to the correct edit page.
+
+Depending on whether the item was added from a sales or a purchase record, only
+the relevant part classifications should be selectable for new item, so this
+parameter is passed on via a hidden parts_classification_type in the new_item
+template.
+
 =item C<action_save>
 
 Saves the current part and then reloads the edit page for the part.
 =item C<action_save>
 
 Saves the current part and then reloads the edit page for the part.