Bug 8979 - simple addition of news to CCSR theme

Nothing fancy, just displays the news in the mobile view.

To test:

enable CCSR theme
ensure you have a news item that will be displayed on the home page
browse to your test site with a mobile phone - news item should be displayed (without the patch it will not be displayed)

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Comment: Works as described. No errors.

Note: Perhaps 'Persona' login could be hidden in movile view.
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 9341: Problem with UNIMARC authors facets

In UNIMARC installations the authors have a double comma separating the subfield a and the subfield b.

Test plan:

- After applying the patch do a search and check the double comma in authors facets.
- Apply the patch
- Do a new search
- Check if authors facets as a double comma

Sponsored-by: KEEP SOLUTIONS
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Conflicts:
	installer/data/mysql/sysprefs.sql
	installer/data/mysql/updatedatabase.pl

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bumping the version number
Bug 9727: Fix typo in variable name

Variable is passed as recordtype not record_type
correct name

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
before applying the patch
$ perl -wc Koha/SearchEngine/Solr/Index.pm
Global symbol "$record_type" requires explicit package name at Koha/SearchEngine/Solr/Index.pm line 43.
Koha/SearchEngine/Solr/Index.pm had compilation errors.

after
Koha/SearchEngine/Solr/Index.pm syntax OK

Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
I can't really test this with solr, but as various people
at the hackfest have confirmed this to be fixing the problem
I feel save to pass QA. All tests and QA script pass too.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 9841 - Improve the link from the "logged in as mysql-user"-warning

Currently, the link from the "logged in as mysql-user"-warning goes to
add a patron in a seemingly random category code. This patch changes
the link to point to Home > Patrons, where a category for the new
patron can be chosen.

A small typo in the warning message is also corrected.

To test:
- Apply the patch
- Login as the MySQL user
- Check that the warning appears on the intranet home page
- Check that the typo in the first line is fixed: "This *is* a bad idea"
- Check that the link in the warning leads to Home > Patrons

Signed-off-by: Brendan <brendan@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All happy with this.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 9415: XML catalog export is missing root node

When exporting some biblio or authorities records with tools/export.pl (via web client or command-line) :
If choosing XML format, you get a concatenation of full XML records.

This patch uses MARC::File::XML to create a well formated file.
See http://search.cpan.org/~gmcharlt/MARC-XML-0.93/lib/MARC/File/XML.pm#close%28%29

Test plan:
- Go to Tools/Export data
- Enter numbers in from and to biblio number
  (make sure that at least two records will
   be exported).
- Select xml in file format
- Click "Export bibliographic records"
- Save file somewhere
- Look at downloaded file
=> File should look like :
   <?xml version="1.0" encoding="UTF-8"?>
   <collection
   ...

   <record>
   ...
   </record>

   <record>
   ...
   </record>

   </collection>
=> "collection" is the root node and XML declaration exists only once
- Do the same for authorities export and command-line use of tools/export.pl

Second test plan:

- From the command line, run tools/export.pl, e.g.,

  tools/export.pl  --format=xml --filename=bibs.xml

- Verify that the output is valid XML, e.g.,

  xmllint --noout bibs.xml # if the file is valid, no error messages will be displayed

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 9423: Add notforloan value to issue confirmation or blocking message

When trying to checkout an item that is not for loan (due to
items.notforloan value or because itemtype is not for loan), you get a
confirmation or blocking message (depending on AllowNotForLoanOverride
syspref).

This message tells "Item is normally not for loan".

This patch adds some informations :
if itemtype is not for loan, tells "Item type is normally not for loan".
if item is not for loan due to items.notforloan value, adds notforloan
description to message.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Works as advertised: Not for loan authorized value is correctly shown.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 7018 : need all acq permissions to search

All acquisition module permissions are needed to allow order search (acqui/histsearch.pl).

With this patch any acquisition permission allows to order search.
Many other pages of this module have this behavior.

Test plan :
- Set for a user only one permission in acquisition module (not order_receive)
=> they also need catalogue permission to be able to log in
- Login with this user and try to perform an order search
=> you get access to page
- Set for a user no permission in acquisition module
- Login with this user and try to perform an order search
=> you do not get access to page

Signed-off-by: MJ Ray <mjr@phonecoop.coop>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as expected and passes tests.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 9504: URL escape in OPAC more searches

OPACSearchForTitleIn is a syspref used to add links as "more searches" in OPAC record detail page.
The links can contain vars depending on record values like title, ISBN, ...
Thoses values must be URL-escaped because they can contain special characters that will brake URL and/or HTML.

This patch add a method C4::Output::parametrized_url() that replaces vars in URL usign escape and UTF-8 encoding.

Test plan :
- Define in OPACSearchForTitleIn a link with all possible vars : TITLE, AUTHOR, ISBN, ISSN, CONTROLNUMBER, BIBLIONUMBER
- Edit a record to add special characters in title : ", &, ? ...
- Go to OPAC detail pages of this record
=> Check that URL is well encoded
=> Click on link to check the term is well encoded (diacritical characters, ...)

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Nice test plan, thanks!

Verified bug and fix - both look good.
Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 7875: Change the pending suggestion link in home page so that it directs to pending suggestions

Pending suggestion link from staff client home directs to accepted
suggestions instead of pending suggestions. This patch changes the link
so that it directs to pending suggestions.

To test :
1 - create 2 suggestions, accept 1 of them
2 - click on the link on home page

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 9748: don't link items in SCO checkout list back to main OPAC

It appears that the conversion from HTML::Template to TT
changed noitemlinks to ISSUE.noitemlinks, hence it is being ignored.

This is a problem for SCO kiosks where all the navigation controls
are hidden. Clicking the link means leaving the SCO module and
not being able to get back.

Test plan:
1) Run SCO module, check for item links
2) Apply patch
3) Run SCO module, note that the items no longer have links

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 9802 - add test case to ensure man pages have correct XML

To test:
* run xt/verify-debian-docbook.t and make sure it's all OK
* modify an xml file in debian/docs, try again, make sure it fails

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
- Running "prove -v xt/verify-debian-docbook.t" loops through all the
  XML files in debian/docs and reports them as being ok.
- Removing a "<" from one of the files makes the test report it as
  an error
- I did not verify that the test actually trips up a package build
  if there is invalid XML.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 8378 - <fine> in overdues changed to <<items.fine>>

This patch reintroduces fines in overdue_notices.pl with minimal
changes to exsiting code.

It DOES changes template syntax, it used to be <fine>USD</fine> but
currency was not recalculated and used only to select format, so
now we are using active system currency because values are in it
anyway.

Example notify template:

<item>"<<biblio.title>>" by <<biblio.author>>, <<items.itemcallnumber>>,
Barcode: <<items.barcode>> Fine: <<items.fine>> </item>

If your active currency doesn't have valid ISO code this code will
fallback to sprintf with two decimal digits, and you can insert
currency symbol in template itself (currency field is not editable
through web interface, so this fallback might be useful for existing
installations).

Test scenario:
1. configure fine amount under "Circulation and fines rules"
   for patron category and item type
2. checkout item with correct type to partron in correct
   category with due date set to yesterday
3. verify that overdue notice uses new <<items.fine>> tag
4. run ./misc/cronjobs/fines.pl to calculate fines
5. run ./misc/cronjobs/overdue_notices.pl -n
   and verify that fine amount is included

Notes: Tested using the default ODUE notice, changing:
<fines>USD</fines>
for
<<items.fine>>

Everything worked as expected with finesmode=production set.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 8378 - show all items columns and new items.fine

This allows users to select any columns from items and adds new
items.fine field introduced by previous patch to user interface.

Note: This works as expected. items.fine appears as an option and gets inserted in the notice template as expected.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 8378 - followup - sample_notices.sql updated to <<items.fine>>

Trivial string substitution.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 8378 - followup - update notices to use <<items.fine>>

Didn't break on well-formed notices, and fixed those with problems

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Conflicts:
	installer/data/mysql/updatedatabase.pl

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bumping db version
bug 9496: improve error checking in rebuild_zebra.pl

When using rebuild_zebra to index all records, skip over
bibliographic or authority records that don't come out
as valid XML.  Also, strip extraneous XML declarations when
using --nosanitize.

Test plans
----------
Note that both plans assume that DOM indexing is turned on.

Test plan #1
============

[1] Run rebuild_zebra.pl with the -x -nosanitize options.  Without
    the patch, zebraidx should terminate early and complain
    about invalid XML.
[2] With the patch, the rebuild_zebra.pl should work without
    error.

Test plan #2
============
[1] Intentionally make a MARCXML record invalid, e.g, by running
    the following SQL:

    UPDATE bilbioitems SET marcxml = CONCATENATE(marcxml, 'junk')
    WHERE biblionumber = 123;

[2] Run rebuild_zebra.pl -b -x -r
[3] Without the patch, only part of the database will be indexed.
[4] With the patch, rebuild_zebra.pl will not export the bad
    record and will give an error message saying so, but will
    successfully index the rest of the records.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Larry Baerveldt <larry@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 8942 : Adding a test to make sure we don't use single quotes for js

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Tested by adding single quotes to a translation-escaped string.
Test correctly failed it.
Bug 8942: Translation process breaks javascript

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

I tested most scripts affected by this patch and visually verified
all changes. Functionality is unaffected.
Signed-off-by: Mason James <mtj@kohaaloha.com>