X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FBackgroundJob.pm;h=3e89ecc02ec395130e618108666215d4993932fb;hb=e73ff77bd82ac037e7189d0d30397dc08d8c9584;hp=f0a1722f2e530f0fd400805a658f3f850a75ec6e;hpb=783342e0eebf05742b2c4649aee747a4cb48eb5a;p=kivitendo-erp.git diff --git a/SL/Controller/BackgroundJob.pm b/SL/Controller/BackgroundJob.pm index f0a1722f2..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) = @_; @@ -158,7 +168,6 @@ sub init_back_to { sub init_models { SL::Controller::Helper::GetModels->new( controller => $_[0], - model => 'BackgroundJob', filtered => 0, sorted => { package_name => t8('Package name'), @@ -168,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 ], + ], ); }