X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FBackgroundJob.pm;h=5f937d536d70c8765650adb20253a195e81879d2;hb=42ca4b6790baf76f507cc3675f4a171223cfde4c;hp=7729dafe1684a364212f97b13f7638b621fd63c6;hpb=4fa7102b36468079313df9e579f7537d49aab859;p=kivitendo-erp.git diff --git a/SL/Controller/BackgroundJob.pm b/SL/Controller/BackgroundJob.pm index 7729dafe1..5f937d536 100644 --- a/SL/Controller/BackgroundJob.pm +++ b/SL/Controller/BackgroundJob.pm @@ -4,6 +4,7 @@ use strict; use parent qw(SL::Controller::Base); +use SL::BackgroundJob::Base; use SL::Controller::Helper::GetModels; use SL::Controller::Helper::Paginated; use SL::Controller::Helper::Sorted; @@ -50,13 +51,18 @@ sub action_list { sub action_new { my ($self) = @_; - $self->background_job(SL::DB::BackgroundJob->new(cron_spec => '* * * * *')); - $self->render('background_job/form', title => $::locale->text('Create a new background job')); + $self->background_job(SL::DB::BackgroundJob->new(cron_spec => '* * * * *', package_name => 'Test')); + $self->render('background_job/form', + title => $::locale->text('Create a new background job'), + JOB_CLASSES => [ SL::BackgroundJob::Base->get_known_job_classes ]); } sub action_edit { my ($self) = @_; - $self->render('background_job/form', title => $::locale->text('Edit background job')); + + $self->render('background_job/form', + title => $::locale->text('Edit background job'), + JOB_CLASSES => [ SL::BackgroundJob::Base->get_known_job_classes ]); } sub action_create { @@ -86,6 +92,7 @@ sub action_destroy { sub action_save_and_execute { my ($self) = @_; + $self->background_job(SL::DB::BackgroundJob->new) if !$self->background_job; return unless $self->create_or_update; $self->action_execute; }