From c2982aec8eb40aaeb3ed756dd1012783db04fe0c Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Fri, 13 Dec 2013 22:12:37 -0500 Subject: [PATCH] Bug 7567 - Correct Filtering and Default dropdown values In the staff client, when you went to Home -> Tools -> News the default 'Display location' is 'All'. Everything is correctly displayed. However, if you change the filter it filters the table correctly, but does not set the dropdown value to match. This patch corrects this. TEST PLAN --------- 1) Home -> Tools -> News 2) Change 'Display location' value and click 'Filter'. - Is the 'Display location' value the same now? (no) - Are the correct values displayed? 3) Click 'New entry' - Is it anything other than 'All'? (no, and is this correct?) 4) Click 'Cancel' 5) Click 'Edit' for various news items with different locations. - Does the 'Display location' get proper set? (no) 6) Apply patch 7) Change the 'Display location' value and click 'Filter'. - Does the 'Display location' value stay the same? (this should be correct now) - Are the correct values displayed? 8) Change the 'Display location' value to 'All' and click 'Filter'. - Does everything display? 9) Change the 'Display location' value and click 'Filter'. 10) Click 'New entry' - Does it match what the filter was? (should match now) 11) Click 'Cancel' 12) Click 'Edit' for various news items with different locations. - Does the 'Display location' get proper set? (this should be correct now) Signed-off-by: Jonathan Druart --- .../prog/en/modules/tools/koha-news.tt | 79 ++++++++++++++------ tools/koha-news.pl | 2 + 2 files changed, 57 insertions(+), 24 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt index 411ab1f..bd9c2bb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt @@ -62,23 +62,43 @@ Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %] [% UNLESS ( add_form ) %] [% END %] [% IF ( add_form ) %] + [% IF ( op == 'add' ) %][% default_lang = lang %] + [% ELSE %][% default_lang = new_detail.lang %] + [% END %]
OPAC and Koha news
  1. - +
  2. @@ -116,17 +136,27 @@ Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %] @@ -154,15 +184,16 @@ Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %] - [% IF ( opac_new.lang == 'koha' ) %] - Librarian interface - [% ELSE %] - [% IF ( opac_new.lang == 'slip' ) %] - Slip - [% ELSE %] - OPAC - [% END %] - [% END %] + [% SWITCH opac_new.lang %] + [% CASE "koha" %] + Librarian interface + [% CASE "slip" %] + Slip + [% CASE "" %] + All + [% CASE %] + OPAC ([% opac_new.lang %]) + [% END %] [% opac_new.number %] diff --git a/tools/koha-news.pl b/tools/koha-news.pl index 0461c0c..5578b31 100755 --- a/tools/koha-news.pl +++ b/tools/koha-news.pl @@ -7,6 +7,7 @@ # Casta�eda, Carlos Sebastian - seba3c@yahoo.com.ar - Physics Library UNLP Argentina # Modified to include news to KOHA intranet - tgarip@neu.edu.tr NEU library -Cyprus # Copyright 2000-2002 Katipo Communications +# Copyright (C) 2013 Mark Tompsett # # Koha is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -117,4 +118,5 @@ else { opac_news_count => $opac_news_count, ); } +$template->param( lang => $lang ); output_html_with_http_headers $cgi, $cookie, $template->output; -- 1.7.10.4