Main Koha release repository https://koha-community.org
Find a file
Martin Persson eca286349b Bug 14305: View arbitrary branch's news
This patch adds an input named 'branch' to opac-main.pl that
allows overriding the home library to view news from any branch.

This is part of the 'Use Koha as a CMS' development.

To reviewers: Does this create any security implications?
              The column is text; it is possbile to push SQL
              statemens into the DB via the opac-membership.pl
              page, but all the code there seems to use DBIx::Class
              and prepared statements. When attemped, accepting the
              changes were rejected because of the foreign key
              constraint placed on the main borrowers table.

It is recommended to use this patch in conjunction with 11584
which adds a WYSIWYG editor to System Preferences.

Test plan:
* Make sure your Koha installation has multiple branches:
  * Log in to the Staff interface and select 'Koha administration'
  * Select 'Libraries and groups', the first item in the list
  * Add an extra branch named 'BRANCH1':
    * Press the 'New library' button
    * Set 'Library code' to 'BRANCH1'
    * Enter an arbitrary name
    * Press 'Submit'

* Add at least two news items with different branches:
  * Log in to the Staff interface and select 'Tools'
  * Under 'Additional tools' select 'News'
  * On the 'Koha news' page, create a news item for all libraries:
    * Press the 'New entry' button
    * Set 'Library' to 'All libraries' and enter a title.
    * Press 'Submit'
  * On the 'Koha news' page, create a news item for one library:
    * Press the 'New entry' button
    * Set 'Library' to 'BRANCH1' and enter a title
    * Press 'Submit'

* Add links to OPAC to select branch:
  * Select 'System preferences' and then the 'OPAC' tab
  * Scroll down to the 'OpacNav' preference and click 'Click to Edit'
  * Create two hyperlinks with a parameter named 'branch':
    * '<a href="?branch=BRANCH1">BRANCH1</a>'
    * '<a href="?branch=">none</a>'
  * Click 'Save all OPAC preferences'

* Test OPAC:
  * By default, global news and news for home branch should show.
  * When clicking the 'BRANCH1' link, you should see global news
    plus news for the BRANCH1 branch.
  * When the parameter 'branch' is set but has no value,
    news from the home branch should be shown.

Issues: Tricky to create a link to the same page
        which removes existing paramters.

The user normally has a home branch set.
We can override it with the parameter.
If undefined, the home branch should be shown.

Sponsored-by: Halland County Library

http://bugs.koha-community.org/show_bug.cgi?id=14305

Changed 2015-12-14: Whitespace fix

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-04-29 12:44:08 +00:00
acqui Bug 16154: Fix some other occurrences 2016-04-26 23:16:44 +00:00
admin Bug 15532: Add ability to allow only items whose home/holding branch matches the hold's pickup branch to fill a given hold 2016-04-29 09:49:07 +00:00
api/v1 Bug 13799: Add types for patron's fields in Swagger spec 2015-11-04 13:47:33 -03:00
authorities Bug 16154: CGI->multi_param - Force scalar context 2016-04-26 23:16:43 +00:00
basket Bug 14306: Show URL from MARC21 field 555$u under Title Notes/Descriptions 2016-03-07 17:58:32 +00:00
C4 Bug 11371 - Add a new report : Orders by fund with more options 2016-04-29 12:20:25 +00:00
catalogue Bug 16158: Move GetAuthorisedValues outside the loop 2016-04-27 16:30:01 +00:00
cataloguing Bug 16154: CGI->multi_param - Force scalar context 2016-04-26 23:16:43 +00:00
circ Bug 11565 - decreaseLoanHighHolds needs Override 2016-04-29 12:11:44 +00:00
course_reserves Bug 16154: CGI->multi_param - Force scalar context 2016-04-26 23:16:43 +00:00
debian [SIGNED-OFF] Bug 16190: Enable the indexer daemon by default 2016-04-19 17:50:17 +00:00
docs Bug 7143: Adding releases and fixing some missing tabs 2016-01-06 16:03:30 -07:00
errors Bug 15288: Error pages: Code duplication removal and better translatability 2016-01-27 05:57:34 +00:00
etc Bug 16222: (QA followup) Add /api dir for the API 2016-04-20 21:18:36 +00:00
install_misc Bug 16011: $VERSION - Remove the $VERSION init 2016-03-24 17:20:28 +00:00
installer Bug 14577 - DBRev 3.23.00.056 2016-04-29 11:58:29 +00:00
Koha Bug 14577 - Allow restriction of checkouts based on fines of guarantor's guarantees 2016-04-29 11:54:23 +00:00
koha-tmpl Bug 14305: View arbitrary branch's news, RSS fix 2016-04-29 12:44:07 +00:00
labels Bug 16154: CGI->multi_param - Assign a list 2016-04-26 23:16:43 +00:00
members Bug 14497 - Add warning to patron details page if patron's fines exceed noissuescharge 2016-04-29 12:15:01 +00:00
misc Bug 9004: Use Koha::Calendar instead of C4::Calendar 2016-04-29 12:01:24 +00:00
offline_circ Bug 15764: Fix timestamp sent by KOCT 2016-02-23 20:53:18 +00:00
opac Bug 14305: View arbitrary branch's news 2016-04-29 12:44:08 +00:00
OpenILS Bug 9239 QA follow-up: remove stray debug code 2013-03-16 21:32:34 -04:00
patron_lists Bug 16154: CGI->multi_param - Force scalar context 2016-04-26 23:16:43 +00:00
patroncards Bug 15414: Silencing warns triggered by creating a new layout in patron card creator 2016-04-29 11:35:39 +00:00
plugins Bug 14951: Remove C4::Dates from plugins/*.pl files 2015-10-06 10:29:42 -03:00
reports Bug 11371 - Add a new report : Orders by fund with more options 2016-04-29 12:20:25 +00:00
reserve Bug 15533 [QA Followup] - Itemtype limit missing from tables 2016-04-29 10:26:04 +00:00
reviews Bug 14779: Cannot paginate reviews 2015-09-07 11:38:26 -03:00
rotating_collections Bug 15066: Make transfer rotating collection works under Plack 2015-11-05 09:50:09 -03:00
selenium
serials Bug 16154: Fix some other occurrences 2016-04-26 23:16:44 +00:00
services Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:38 -03:00
skel
sms Bug 15258: Fix Perl scripts declaring unused variables 2015-12-30 17:24:45 -07:00
suggestion Bug 16154: CGI->multi_param - Declare a list 2016-04-26 23:16:42 +00:00
svc Bug 15533 [QA Followup] - Itemtype limit missing from tables 2016-04-29 10:26:04 +00:00
t Bug 14144: Clean ups and refactors 2016-04-29 12:40:16 +00:00
tags Bug 16154: CGI->multi_param - Assign a list 2016-04-26 23:16:43 +00:00
test Bug 9819 - 'stopwords'-related code removed 2015-12-30 15:49:35 +00:00
tmp/modified_authorities
tools Bug 14686: [QA Follow-up] Move allows_add_by to Upload.pm 2016-04-27 16:14:18 +00:00
virtualshelves Bug 16154: Fix some other occurrences 2016-04-26 23:16:44 +00:00
xt Bug 16174: (QA followup) Fix remaining tests 2016-04-01 19:11:33 +00:00
.editorconfig
.htaccess
.mailmap (RM followup) .mailmap updates 2015-05-22 17:02:21 -03:00
about.pl Bug 12721 - Syspref StatisticsFields: Warning on About page and text change in System preferences 2016-04-29 02:48:30 +00:00
changelanguage.pl Bug 9978: (followup) Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:43 -03:00
edithelp.pl Bug 14813: Fix encoding issues on editing help pages 2015-09-16 10:42:15 -03:00
fix-perl-path.PL Bug 9978: (followup) Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:43 -03:00
help.pl Bug 14812: Display the help in the correct language 2015-10-02 15:06:08 -03:00
INSTALL
install-CPAN.pl Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:38 -03:00
INSTALL.debian
INSTALL.fedora7 Bug 13642 - Remove MARC::Crosswalk::DublinCore from Koha 2016-01-27 06:23:08 +00:00
INSTALL.opensuse
INSTALL.ubuntu
Koha.pm Bug 14577 - DBRev 3.23.00.056 2016-04-29 11:58:29 +00:00
koha_perl_deps.pl
kohaversion.pl Bug 13758: Move the Koha version from kohaversion.pl 2015-05-07 11:39:04 -03:00
LICENSE
mainpage.pl Bug 15548: Move new patron related code to Patron* 2016-03-03 14:38:26 -07:00
Makefile.PL Bug 16222: (QA followup) Add /api dir for the API 2016-04-20 21:18:36 +00:00
MANIFEST.SKIP
README
README.md Bug 15465 [QA Followup] - Update wording, switch logo, add links 2016-02-24 04:02:26 +00:00
README.robots
rewrite-config.PL Bug 16222: (QA followup) Add /api dir for the API 2016-04-20 21:18:36 +00:00

Koha is a free software integrated library system (ILS).

Koha is distributed under the GNU GPL version 3 or later.

Note: This is a synced mirror of the official Koha repo.

Note: Koha does not accept pull requests from git hosting sites.

Note: This project has its own bug tracker, to report a bug or submit a patch visit http://bugs.koha-comminity.org.

For guidelines on submitting patches for Koha please visit https://wiki.koha-community.org/wiki/SubmitingAPatch

The developers handbook can be found at https://wiki.koha-community.org/wiki/Developer_handbook

http://koha-community.org/

Koha Logo