X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/984f6322b98c8d0cd3ceb9f659ed6621d180e617..c5dccb51a821e57f3888370bea51dab9f82c0639:/SL/Controller/CustomerVendor.pm diff --git a/SL/Controller/CustomerVendor.pm b/SL/Controller/CustomerVendor.pm index 4812f1b40..c8fd5fd9c 100644 --- a/SL/Controller/CustomerVendor.pm +++ b/SL/Controller/CustomerVendor.pm @@ -41,7 +41,8 @@ use Rose::Object::MakeMethods::Generic ( __PACKAGE__->run_before( sub { $::auth->assert('customer_vendor_edit'); - } + }, + except => [ qw(ajaj_autocomplete) ], ); __PACKAGE__->run_before( '_instantiate_args', @@ -585,13 +586,17 @@ sub action_ajaj_get_contact { } qw( id gender abteilung title position givenname name email phone1 phone2 fax mobile1 mobile2 - satphone satfax project street zipcode city privatphone privatemail birthday + satphone satfax project street zipcode city privatphone privatemail birthday main ) ) }; $data->{contact_cvars} = $self->_prepare_cvar_configs_for_ajaj($self->{contact}->cvars_by_config); + # avoid two or more main_cp + my $has_main_cp = grep { $_->cp_main == 1 } @{ $self->{cv}->contacts }; + $data->{contact}->{disable_cp_main} = 1 if ($has_main_cp && !$data->{contact}->{cp_main}); + $self->render(\SL::JSON::to_json($data), { type => 'json', process => 0 }); }