From 4d387ccfb2f648f4dd24071feed61754c68fb525 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 8 Jan 2015 12:53:49 +0100 Subject: [PATCH] Bug 13536: Remove time from CHECKOUT notice Content-Type: text/plain; charset=utf-8 In the issues table date_due is a datetime field. If you do not have hourly loans, the 23:59:00 on the CHECKOUT notice may be somewhat confusing. (When does the library close?) In the patch submitted I virtually add a date_due_without_time column to the issues table by adding such a field in the SELECT statement in Letters.pm, routine _parseletter_sth. If you want to remove the time from the notice, now you can just edit the notice and replace <> by <>. Test plan: [1] Edit CHECKOUT notice as described above. [2] Check out a book to a patron (notice enabled in his messaging prefs). [3] Check the notice: Do you only see the date, not the time? --- C4/Letters.pm | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index a11c862..7b400d7 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -731,7 +731,7 @@ sub _parseletter_sth { ($table eq 'biblio' ) ? "SELECT * FROM $table WHERE biblionumber = ?" : ($table eq 'biblioitems' ) ? "SELECT * FROM $table WHERE biblionumber = ?" : ($table eq 'items' ) ? "SELECT * FROM $table WHERE itemnumber = ?" : - ($table eq 'issues' ) ? "SELECT * FROM $table WHERE itemnumber = ?" : + ($table eq 'issues' ) ? "SELECT *, CAST(date_due AS DATE) AS date_due_without_time FROM $table WHERE itemnumber = ?" : ($table eq 'old_issues' ) ? "SELECT * FROM $table WHERE itemnumber = ? ORDER BY timestamp DESC LIMIT 1" : ($table eq 'reserves' ) ? "SELECT * FROM $table WHERE borrowernumber = ? and biblionumber = ?" : ($table eq 'borrowers' ) ? "SELECT * FROM $table WHERE borrowernumber = ?" : -- 1.7.7.6