$self->{emailerr} = $mail->send();
# $self->error($self->cleanup . "$err") if $self->{emailerr};
$self->{email_journal_id} = $mail->{journalentry};
+ $self->{snumbers} = "emailjournal" . "_" . $self->{email_journal_id};
+ $self->{what_done} = $::form->{type};
+ $self->{addition} = "MAILED";
+ $self->save_history;
#write back for message info and mail journal
$self->{cc} = $mail->{cc};
while(my $hash_ref = $sth->fetchrow_hashref()) {
$hash_ref->{addition} = $main::locale->text($hash_ref->{addition});
$hash_ref->{what_done} = $main::locale->text($hash_ref->{what_done});
- $hash_ref->{snumbers} =~ s/^.+_(.*)$/$1/g;
+ my ( $what, $number ) = split /_/, $hash_ref->{snumbers};
+ $hash_ref->{snumbers} = $number;
+ $hash_ref->{haslink} = 'controller.pl?action=EmailJournal/show&id='.$number if $what eq 'emailjournal';
+ $hash_ref->{snumbers} = $main::locale->text("E-Mail").' '.$number if $what eq 'emailjournal';
$tempArray[$i++] = $hash_ref;
}
$main::lxdebug->leave_sub() and return \@tempArray
my $callback = build_std_url(qw(action longdescription trans_id_type input_name));
my $restriction;
if ( $form->{trans_id_type} eq 'glid' ) {
- $restriction = "AND ( snumbers LIKE 'invnumber%' OR what_done LIKE '%Buchungsnummer%' OR snumbers LIKE 'gltransaction%' ) ";
+ $restriction = "AND ( snumbers LIKE 'invnumber%' OR what_done LIKE '%Buchungsnummer%' OR snumbers LIKE 'gltransaction%' OR snumbers LIKE 'emailjournal%' ) ";
} elsif ( $form->{trans_id_type} eq 'id' ) {
- $restriction = " AND ( snumbers NOT LIKE 'invnumber_%' AND snumbers NOT LIKE 'gltransaction%' AND (what_done NOT LIKE '%Buchungsnummer%' OR what_done IS null))";
+ $restriction = " AND ( snumbers NOT LIKE 'invnumber_%' AND snumbers NOT LIKE 'gltransaction%' AND snumbers NOT LIKE 'emailjournal%' AND (what_done NOT LIKE '%Buchungsnummer%' OR what_done IS null))";
} else {
$restriction = '';
};
$form->{emailed} .= " $form->{formname}";
$form->{emailed} =~ s/^ //;
+ $form->{addition} = "MAILED";
}
my $emailed = $form->{emailed};
[% HTML.escape(row.id) %]
</td>
<td>
- [% HTML.escape(row.snumbers) %]
+
+ [% IF row.haslink %]
+ <a href="[% row.haslink %]" target="_blank">[% HTML.escape(row.snumbers) %]</a>
+ [% ELSE %]
+ [% HTML.escape(row.snumbers) %]
+ [% END %]
+
</td>
</tr>
[% END %]