From 4458e86865d09196591646e29a319958c8680578 Mon Sep 17 00:00:00 2001 From: Fridolyn SOMERS Date: Tue, 6 Aug 2013 12:13:34 +0200 Subject: [PATCH] Bug 10689: make public note appear in subscriptions search In a serials module, when searching subscriptions, the results table as a "Notes" column. In TT code, you see that it tries to display public note "subscription.notes" and internal note "subscription.internalnotes". The internal note is displayed well but not the public note. You can see the 2 notes in serial details in summary tab. The problem commes from the SQL query. A join is perform on subscription and biblio, both containing a "notes" column. This patch solves the problem by using a alias in query for both columns (biblio.notes is acutally not used in template but could be). Test plan : - Edit a subscription - Add public and internal notes. For example : "too busy" and "on holiday" - Perform a subscription search that returns this subscription => "Notes" column contains both notes. For example : "too busy (on holiday)" - Test with only public note - Test with only internal note Works as described. Signed-off-by:Mathieu Saby Signed-off-by: Bernardo Gonzalez Kriegel Signed-off-by: Katrin Fischer All tests and QA script pass. Works as described, fixes a bug as the templates show that the intention was to display both notes in the column. Signed-off-by: Galen Charlton --- C4/Serials.pm | 9 ++++++++- .../prog/en/modules/serials/serials-search.tt | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/C4/Serials.pm b/C4/Serials.pm index a1ce0543d1..a2498c8238 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -654,7 +654,14 @@ sub SearchSubscriptions { my ( $args ) = @_; my $query = qq{ - SELECT subscription.*, subscriptionhistory.*, biblio.*, biblioitems.issn + SELECT + subscription.notes AS publicnotes, + subscription.*, + subscriptionhistory.*, + biblio.notes AS biblionotes, + biblio.title, + biblio.author, + biblioitems.issn FROM subscription LEFT JOIN subscriptionhistory USING(subscriptionid) LEFT JOIN biblio ON biblio.biblionumber = subscription.biblionumber diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt index 459a80a7a0..7b2803a243 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt @@ -148,7 +148,7 @@ [% subscription.title |html %] - [% IF ( subscription.notes ) %][% subscription.notes %][% END %] + [% IF ( subscription.publicnotes ) %][% subscription.publicnotes %][% END %] [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %] -- 2.39.5