1 package SL::Presenter::EmailJournal;
 
   5 use SL::Presenter::EscapedText qw(escape is_escaped);
 
   7 use Exporter qw(import);
 
   8 our @EXPORT_OK = qw(email_journal);
 
  13   my ($email_journal_entry, %params) = @_;
 
  15   $params{display} ||= 'inline';
 
  17   croak "Unknown display type '$params{display}'" unless $params{display} =~ m/^(?:inline|table-cell)$/;
 
  20     $params{no_link} ? '' : '<a href="controller.pl?action=EmailJournal/show&id=' . escape($email_journal_entry->id) . '">',
 
  21     escape($email_journal_entry->subject),
 
  22     $params{no_link} ? '' : '</a>',
 
  38 SL::Presenter::EmailJournal - Presenter module for mail entries in email_journal
 
  42   use SL::Presenter::EmailJournal;
 
  44   my $journal_entry = SL::DB::Manager::EmailJournal->get_first();
 
  45   my $html   = SL::Presenter::EmailJournal::email_journal($journal_entry, display => 'inline');
 
  48   # <a href="controller.pl?action=EmailJournal/show&id=1">IDEV Daten fuer webdav/idev/2017-KW-26.csv erzeugt</a>
 
  54 =item C<email_journal $object, %params>
 
  56 Returns a rendered version (actually an instance of
 
  57 L<SL::Presenter::EscapedText>) of the email journal object C<$object>
 
  61 C<%params> can include:
 
  67 Either C<inline> (the default) or C<table-cell>. At the moment both
 
  68 representations are identical and produce the invoice number linked
 
  69 to the corresponding 'edit' action.
 
  73 If falsish (the default) then the mail subject will be linked to the
 
  74 'view details of email' dialog from the email journal report.
 
  86 copied from Moritz Bunkus E<lt>m.bunkus@linet-services.deE<gt>
 
  87 by Jan Büren E<lt>jan@kivitendo-premium.deE<gt>