X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FRecordLinks.pm;h=b71467752a9c2bb8baa5c8d170d9f4d6325d9072;hb=78078fbf7a94e349032c83ae324c87c94487e11a;hp=9ff64e49eee0b421ec012ecc0fa970a69074b493;hpb=bc40bcabc425b99f3b79a5544684a6fe8674adfe;p=kivitendo-erp.git diff --git a/SL/Controller/RecordLinks.pm b/SL/Controller/RecordLinks.pm index 9ff64e49e..b71467752 100644 --- a/SL/Controller/RecordLinks.pm +++ b/SL/Controller/RecordLinks.pm @@ -23,6 +23,7 @@ use Rose::Object::MakeMethods::Generic scalar => [ qw(object object_model object_id link_type link_direction link_type_desc) ], ); +__PACKAGE__->run_before('check_auth'); __PACKAGE__->run_before('check_object_params', only => [ qw(ajax_list ajax_delete ajax_add_select_type ajax_add_filter ajax_add_list ajax_add_do) ]); __PACKAGE__->run_before('check_link_params', only => [ qw( ajax_add_list ajax_add_do) ]); @@ -133,7 +134,8 @@ sub action_ajax_add_list { my @with_objects = ($vc); push @with_objects, $project if $manager->can($project_id); - my $objects = $manager->get_all_sorted(where => \@where, with_objects => \@with_objects); + # show the newest records first (should be better for 80% of the cases TODO sortable click + my $objects = $manager->get_all_sorted(where => \@where, with_objects => \@with_objects, sort_by => 'itime', sort_dir => 'ASC'); my $output = $self->render( 'record_links/add_list', { output => 0 }, @@ -217,4 +219,8 @@ sub check_link_params { return 1; } +sub check_auth { + $::auth->assert('record_links'); +} + 1;