Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 2394dc67

Von Moritz Bunkus vor fast 7 Jahren hinzugefügt

  • ID 2394dc67bf4994673afcec18ea3c2e1aaed787f5
  • Vorgänger f751112d
  • Nachfolger 15e61683

Hintergrundjobs: »als neu verwenden« implementiert

Dann benötigt man nicht »als neu speichern« sowie »als neu speichern
und ausführen«. Siehe #256.

Unterschiede anzeigen:

SL/Controller/BackgroundJob.pm
36 36
sub action_new {
37 37
  my ($self) = @_;
38 38

  
39
  $self->background_job(SL::DB::BackgroundJob->new(cron_spec => '* * * * *',  package_name => 'Test'));
39
  $self->background_job(SL::DB::BackgroundJob->new(cron_spec => '* * * * *',  package_name => 'Test')) unless $self->background_job;
40 40
  $self->setup_form_action_bar;
41 41
  $self->render('background_job/form',
42 42
                title       => $::locale->text('Create a new background job'),
......
52 52
                JOB_CLASSES => [ SL::BackgroundJob::Base->get_known_job_classes ]);
53 53
}
54 54

  
55
sub action_edit_as_new {
56
  my ($self) = @_;
57

  
58
  $self->background_job($self->background_job->clone_and_reset);
59
  $self->action_new;
60
}
61

  
55 62
sub action_show {
56 63
  my ($self) = @_;
57 64

  
......
222 229
          t8('Save and execute'),
223 230
          submit => [ '#form', { action => 'BackgroundJob/save_and_execute' } ],
224 231
        ],
232
        action => [
233
          t8('Use as new'),
234
          submit   => [ '#form', { action => 'BackgroundJob/edit_as_new' } ],
235
          disabled => $is_new ? t8('The object has not been saved yet.') : undef,
236
        ],
225 237
      ], # end of combobox "Save"
226 238

  
227 239
      action => [

Auch abrufbar als: Unified diff