From 3d8c8e2fa8dc160248411314e135b21e92332201 Mon Sep 17 00:00:00 2001 From: Martin Helmling Date: Tue, 17 Jan 2017 16:34:40 +0100 Subject: [PATCH] Link History zu EmailJournal MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Einträge in History mit addition MAILED haben nun nicht die Rechnungsnummer sondern die ID des Emailjournals in snumber stehen, also emailjournal_${journal_id} --- SL/Form.pm | 9 ++++++++- bin/mozilla/common.pl | 4 ++-- bin/mozilla/io.pl | 1 + templates/webpages/common/show_history.html | 8 +++++++- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/SL/Form.pm b/SL/Form.pm index bfc8827eb..3969cbfef 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -1223,6 +1223,10 @@ sub send_email { $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}; @@ -3177,7 +3181,10 @@ sub get_history { 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 diff --git a/bin/mozilla/common.pl b/bin/mozilla/common.pl index e21b3c505..b03ca4c09 100644 --- a/bin/mozilla/common.pl +++ b/bin/mozilla/common.pl @@ -237,9 +237,9 @@ sub show_history { 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 = ''; }; diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index b4f85af3c..ec4e1e65c 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -1533,6 +1533,7 @@ sub print_form { $form->{emailed} .= " $form->{formname}"; $form->{emailed} =~ s/^ //; + $form->{addition} = "MAILED"; } my $emailed = $form->{emailed}; diff --git a/templates/webpages/common/show_history.html b/templates/webpages/common/show_history.html index 795e2d2da..46496b199 100644 --- a/templates/webpages/common/show_history.html +++ b/templates/webpages/common/show_history.html @@ -105,7 +105,13 @@  [% HTML.escape(row.id) %]  -  [% HTML.escape(row.snumbers) %]  +   + [% IF row.haslink %] + [% HTML.escape(row.snumbers) %] + [% ELSE %] + [% HTML.escape(row.snumbers) %] + [% END %] +   [% END %] -- 2.20.1