Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 9d015fd3

Von Sven Schöling vor etwa 11 Jahren hinzugefügt

  • ID 9d015fd3a98cdfd59863a7d2908d3887099107a7
  • Vorgänger fa7a37a2
  • Nachfolger 75e726e7

BackgroundJobHistory getmodels

Unterschiede anzeigen:

SL/Controller/BackgroundJobHistory.pm
4 4

  
5 5
use parent qw(SL::Controller::Base);
6 6

  
7
use SL::Controller::Helper::Filtered;
8 7
use SL::Controller::Helper::GetModels;
9
use SL::Controller::Helper::Paginated;
10
use SL::Controller::Helper::Sorted;
11 8
use SL::DB::BackgroundJobHistory;
12 9
use SL::Helper::Flash;
13 10
use SL::Locale::String;
......
15 12

  
16 13
use Rose::Object::MakeMethods::Generic
17 14
(
18
  scalar                  => [ qw(history db_args flat_filter filter_summary) ],
19
  'scalar --get_set_init' => [ qw(task_server) ],
15
  scalar                  => [ qw(history filter_summary) ],
16
  'scalar --get_set_init' => [ qw(task_server models) ],
20 17
);
21 18

  
22 19
__PACKAGE__->run_before('check_auth');
23 20
__PACKAGE__->run_before('add_stylesheet');
24 21
__PACKAGE__->run_before('check_task_server');
25 22

  
26
__PACKAGE__->make_filtered(
27
  MODEL             => 'BackgroundJobHistory',
28
  LAUNDER_TO        => 'filter'
29
);
30
__PACKAGE__->make_paginated(ONLY => [ qw(list) ]);
31

  
32
__PACKAGE__->make_sorted(
33
  ONLY         => [ qw(list) ],
34

  
35
  package_name => t8('Package name'),
36
  run_at       => t8('Run at'),
37
  status       => t8('Execution status'),
38
  result       => t8('Result'),
39
  error        => t8('Error'),
40
);
41

  
42 23
#
43 24
# actions
44 25
#
......
50 31

  
51 32
  $self->render('background_job_history/list',
52 33
                title   => $::locale->text('Background job history'),
53
                ENTRIES => $self->get_models);
34
                ENTRIES => $self->models->get,
35
                MODELS  => $self->models);
54 36
}
55 37

  
56 38
sub action_show {
......
114 96
  $self->filter_summary(join(', ', @filter_strings));
115 97
}
116 98

  
99
sub init_models {
100
  my ($self) = @_;
101

  
102
  SL::Controller::Helper::GetModels->new(
103
    controller => $self,
104
    model  => 'BackgroundJobHistory',
105
    sorted => {
106
      package_name => t8('Package name'),
107
      run_at       => t8('Run at'),
108
      status       => t8('Execution status'),
109
      result       => t8('Result'),
110
      error        => t8('Error'),
111
    },
112
  );
113
}
114

  
117 115
1;

Auch abrufbar als: Unified diff