Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 85c0b8c7

Von Tamino Steinert vor etwa 1 Jahr hinzugefügt

  • ID 85c0b8c7b85b27df79baaa35ba419f8800d55072
  • Vorgänger 6c9e2179
  • Nachfolger 08a6863d

EmailJournal: Report um Obsolete, Belegtype und Verknüpft erweitert

Unterschiede anzeigen:

SL/Controller/EmailJournal.pm
224 224
  my ($self) = @_;
225 225

  
226 226
  $::auth->assert('email_journal');
227
  # default filter
228
  $::form->{filter} ||= {"obsolete:eq_ignore_empty" => 0};
227 229

  
228 230
  if ( $::instance_conf->get_email_journal == 0 ) {
229 231
    flash('info',  $::locale->text('Storing the emails in the journal is currently disabled in the client configuration.'));
230 232
  }
231 233
  $self->setup_list_action_bar;
234
  my @record_types_with_info = $self->get_record_types_with_info();
232 235
  $self->render('email_journal/list',
233 236
                title   => $::locale->text('Email journal'),
234 237
                ENTRIES => $self->models->get,
235
                MODELS  => $self->models);
238
                MODELS  => $self->models,
239
                RECORD_TYPES_WITH_INFO => \@record_types_with_info,
240
              );
236 241
}
237 242

  
238 243
sub action_show {
......
626 631
      sent_on         => t8('Sent on'),
627 632
      status          => t8('Status'),
628 633
      extended_status => t8('Extended status'),
634
      record_type     => t8('Record Type'),
635
      obsolete        => t8('Obsolete'),
629 636
      linked_to       => t8('Linked to'),
630 637
    },
631 638
  );
......
650 657
    send_failed     => $::locale->text('send failed'),
651 658
    sent            => $::locale->text('sent'),
652 659
    imported        => $::locale->text('imported'),
653
    record_imported => $::locale->text('record imported'),
654 660
  );
655 661
  push @filter_strings, $status{ $filter->{'status:eq_ignore_empty'} } if $filter->{'status:eq_ignore_empty'};
656 662

  
663

  
664
  my %record_type = map { $_->{record_type} => $_->{text} } $self->get_record_types_with_info();
665
  push @filter_strings, $record_type{ $filter->{'record_type:eq_ignore_empty'} } if $filter->{'record_type:eq_ignore_empty'};
666

  
667
  push @filter_strings, $::locale->text('Obsolete')     if $filter->{'obsolete:eq_ignore_empty'} eq '1';
668
  push @filter_strings, $::locale->text('Not obsolete') if $filter->{'obsolete:eq_ignore_empty'} eq '0';
669

  
670
  push @filter_strings, $::locale->text('Linked')       if $filter->{'linked_to:eq_ignore_empty'} eq '1';
671
  push @filter_strings, $::locale->text('Not linked')   if $filter->{'linked_to:eq_ignore_empty'} eq '0';
672

  
657 673
  return join ', ', @filter_strings;
658 674
}
659 675

  
SL/DB/Manager/EmailJournal.pm
6 6

  
7 7
use SL::DB::Helper::Paginated;
8 8
use SL::DB::Helper::Sorted;
9
use SL::DB::Helper::Filtered;
9 10

  
10 11
sub object_class { 'SL::DB::EmailJournal' }
11 12

  
12 13
__PACKAGE__->make_manager_methods;
13 14

  
15
__PACKAGE__->add_filter_specs(
16
  linked_to => sub {
17
    my ($key, $value, $prefix) = @_;
18

  
19
    # if $value is truish, we want at least one link otherwise we want none
20
    my $comp = !!$value ? '>' : '=';
21

  
22
    # table emial_journal is aliased as t1
23
    return
24
      \qq{(
25
        SELECT CASE WHEN count(*) $comp 0 THEN TRUE ELSE FALSE END
26
        FROM record_links
27
        WHERE (
28
            (record_links.from_table = 'email_journal'::varchar(50))
29
            AND record_links.from_id = t1.id
30
          ) OR (
31
            (record_links.to_table = 'email_journal'::varchar(50))
32
            AND record_links.to_id = t1.id
33
          )
34
        )} => \'TRUE';
35
  },
36
);
37

  
14 38
sub _sort_spec {
15 39
  return (
16 40
    default => [ 'sent_on', 0 ],
......
18 42
      SIMPLE => 'ALL',
19 43
      sender => 'sender.name',
20 44
      linked_to => qq{(
21
        SELECT count(*) from record_links where
45
        SELECT count(*)
46
        FROM record_links
47
        WHERE
22 48
          ( record_links.from_table = 'email_journal'::varchar(50)
23 49
            AND record_links.from_id = email_journal.id
24 50
          ) OR (
locale/de/all
2226 2226
  'Link to'                     => 'Verknüpfen mit',
2227 2227
  'Link to invoice'             => 'Beleglink',
2228 2228
  'Link to the following project:' => 'Mit dem folgenden Projekt verknüpfen:',
2229
  'Linked'                      => 'Verknüpft',
2229 2230
  'Linked Records'              => 'Verknüpfte Belege',
2230 2231
  'Linked email and attachment to ' => 'E-Mail und Anhang verknüpft mit ',
2231 2232
  'Linked invoices'             => 'Verknüpfte Rechnungen',
......
2573 2574
  'Not done yet'                => 'Noch nicht fertig',
2574 2575
  'Not enough in stock for the serial number #1' => 'Nicht genug auf Lager von der Seriennummer #1',
2575 2576
  'Not implemented yet!'        => 'Noch nicht implementiert!',
2577
  'Not linked'                  => 'Nicht verknüpft',
2576 2578
  'Not obsolete'                => 'Gültig',
2577 2579
  'Not yet implemented'         => 'Noch nicht implementiert',
2578 2580
  'Note'                        => 'Hinweis',
locale/en/all
2225 2225
  'Link to'                     => '',
2226 2226
  'Link to invoice'             => '',
2227 2227
  'Link to the following project:' => '',
2228
  'Linked'                      => '',
2228 2229
  'Linked Records'              => '',
2229 2230
  'Linked email and attachment to ' => '',
2230 2231
  'Linked invoices'             => '',
......
2572 2573
  'Not done yet'                => '',
2573 2574
  'Not enough in stock for the serial number #1' => '',
2574 2575
  'Not implemented yet!'        => '',
2576
  'Not linked'                  => '',
2575 2577
  'Not obsolete'                => '',
2576 2578
  'Not yet implemented'         => '',
2577 2579
  'Note'                        => '',
templates/design40_webpages/email_journal/_filter.html
30 30
               ], default=filter.status_eq_ignore_empty) %]
31 31
      </td>
32 32
    </tr>
33
    <tr>
34
      <th>[% LxERP.t8("Record Type") %]</th>
35
      <td>
36
        [% L.select_tag("filter.record_type:eq_ignore_empty",
37
             RECORD_TYPES_WITH_INFO,
38
             title_key = 'text', value_key = 'record_type',
39
             with_empty=1, default=filter.record_type_eq_ignore_empty) %]
40
      </td>
41
    </tr>
42
    <tr>
43
      <th>[% LxERP.t8("Obsolete") %]</th>
44
      <td>[% L.yes_no_tag("filter.obsolete:eq_ignore_empty",
45
            filter.obsolete, with_empty=1,
46
            default=filter.obsolete_eq_ignore_empty
47
            ) %]
48
      </td>
49
    </tr>
50
    <tr>
51
      <th>[% LxERP.t8("Linked") %]</th>
52
      <td>[% L.yes_no_tag("filter.linked_to:eq_ignore_empty",
53
            filter.linked_to, with_empty=1,
54
            default=filter.linked_to_eq_ignore_empty
55
            ) %]
56
      </td>
57
    </tr>
33 58
    </tbody>
34 59
  </table>
35 60
  [% L.hidden_tag("sort_by", FORM.sort_by) %]
templates/design40_webpages/email_journal/list.html
25 25
      <th>[% L.sortable_table_header("sent_on") %]</th>
26 26
      <th>[% L.sortable_table_header("status") %]</th>
27 27
      <th>[% L.sortable_table_header("extended_status") %]</th>
28
      <th>[% L.sortable_table_header("record_type") %]</th>
29
      <th>[% L.sortable_table_header("obsolete") %]</th>
28 30
      <th>[% L.sortable_table_header("linked_to") %]</th>
29 31
    </tr>
30 32
  </thead>
......
40 42
      <td>[% HTML.escape(entry.sent_on.to_lxoffice('precision' => 'second')) %]</td>
41 43
      <td> [% P.email_journal.entry_status(entry) %] </td>
42 44
      <td>[% HTML.escape(entry.extended_status) %]</td>
45
      <td>[% HTML.escape(entry.record_type) %]</td>
46
      <td>[% HTML.escape(entry.obsolete_as_bool_yn) %]</td>
43 47
      <td>
44 48
        [% P.record.simple_grouped_record_list(entry.linked_records) %]
45 49
      </td>

Auch abrufbar als: Unified diff