X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FBackgroundJob.pm;h=3e89ecc02ec395130e618108666215d4993932fb;hb=59e3b9a9b52a94beb8b17f38743bc60c4372c401;hp=0ff74590ad5b798d8aff64d524c4413d623d1674;hpb=2f374c963333aa8ee6ebbab7942b57386585c58b;p=kivitendo-erp.git diff --git a/SL/Controller/BackgroundJob.pm b/SL/Controller/BackgroundJob.pm index 0ff74590a..3e89ecc02 100644 --- a/SL/Controller/BackgroundJob.pm +++ b/SL/Controller/BackgroundJob.pm @@ -19,7 +19,7 @@ use Rose::Object::MakeMethods::Generic __PACKAGE__->run_before('check_auth'); __PACKAGE__->run_before('check_task_server'); -__PACKAGE__->run_before('load_background_job', only => [ qw(edit update destroy execute) ]); +__PACKAGE__->run_before('load_background_job', only => [ qw(edit update destroy execute show) ]); # # actions @@ -51,6 +51,16 @@ sub action_edit { JOB_CLASSES => [ SL::BackgroundJob::Base->get_known_job_classes ]); } +sub action_show { + my ($self) = @_; + + if ($::request->type eq 'json') { + $self->render(\ SL::JSON::to_json($self->background_job->as_tree), { type => 'json' }); + } else { + $self->action_edit; + } +} + sub action_create { my ($self) = @_; @@ -167,6 +177,9 @@ sub init_models { last_run_at => t8('Last run at'), next_run_at => t8('Next run at'), }, + query => [ + package_name => [ SL::BackgroundJob::Base->get_known_job_classes ], + ], ); }