From c94bf2f6698ba2a5c78df40e607660ec75a866c0 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 21 Jan 2015 14:06:33 +0100 Subject: [PATCH] Bug 13536: Follow-up for adding date_due_without_time in column list Content-Type: text/plain; charset=utf-8 This patch adds the ("virtual") column date_due_without_time to the list of available columns when editing a notice (for the issues table). Test plan: Add the column to the CHECKOUT notice. Verify that the actual notice at checkout now contains the expected data. Signed-off-by: Marcel de Rooy I also tested this by adding the field to DUE and running the overdues cron job. Note that in that case it must be included in an section. (This is a restriction imposed by the code in the overdue_notices.pl script.) --- tools/letter.pl | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/tools/letter.pl b/tools/letter.pl index b806e9b..30e1279 100755 --- a/tools/letter.pl +++ b/tools/letter.pl @@ -430,7 +430,9 @@ sub get_columns_for { push @fields, { value => $table_prefix . $row->{Field}, text => $table_prefix . $row->{Field}, - } + }; + push @fields, _add_date_due2($table_prefix) if $table eq 'issues' && + $row->{Field} eq 'date_due'; } if ($table eq 'borrowers') { if ( my $attributes = C4::Members::Attributes::GetAttributes() ) { @@ -444,3 +446,11 @@ sub get_columns_for { } return @fields; } + +sub _add_date_due2 { + # This adds a second date due (without time) to the available columns + # when editing a notice. See also _parseletter_sth in Letters.pm. + my ( $pfx ) = @_; + my $str = $pfx . 'date_due_without_time'; + return { value => $str, text => $str }; +} -- 1.7.7.6