Bug 11869: Add more informations to the patron account printing page

This patch adds additional informations to the "Print summary"
and the "Print receipt" templates.

Additional information in "Print summary":
* Registration date
* Expiration date
* Library
* Category
* Fines and payments

TEST PLAN
---------
1) Go to a patron.
2) Make sure they have something checked out.
3) Manually add a fine.
4) Under the 'Print' button click 'Print summary'
   -- the resulting preview should:
   a) have the first for things listed above, and
   b) have a new fines and payments section.

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

NOTE: The due date of the check out is not part of this patch,
      and so I signed off. Similarly, anything required for
      slips is configurable elsewhere now and thus comment 1
      does not accurately reflect the intent of this patch.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
This works as described and passes all tests and the QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11869: (follow-up) only display active fines

This patch modifies the patron summary printout so that
only fines with an outstanding balance (either positive
or negative) are displayed.  Also, the entire fines section
is displayed only if there is a non-zero balance.

This is consistent with the logic for displaying the loans
and hold requests tables, and avoids cluttering the summary
with historical fines.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11258: fix another case where holds queue made transfer requests that contradict the library holds policy

This patch fixes a problem where the holds queue generator
was making requests where the pickup library is the
same as the item's library but not the patron's branch,
even if there is a "Default holds policy by item type" rule that states
this item can only fill holds for patrons of the same library as the
item.

Test Plan:
1) Create a test record with 2 items with different itemtypes
2) Set the Default holds policy by item type for the first
   item to "From any library"
3) Set the Default holds policy by item type for the second
   item to "From home library"
4) Place a record level hold for a patron from another library,
   but for pickup at the same library as the item is from
5) Rebuild the holds queue
6) View the holds queue, note the item is listed, though this
   patron cannot place a hold on this item
7) Apply this patch
8) Repeat step 5, note the hold is no longer in the queue

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
automated tests pass, functional tests pass. Bug replicated, eradicated by patch.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
I finally managed to reproduce this, patch works as described.
Passes tests and QA script, provided tests fail without patch, but
succeed with the patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 12071: improve generation of Z39.50 search links

This patch fixes two problems with the generation of
links to execute a Z39.50 search from the staff client
catalog and cataloguing search results page.

First, if using URI::Escape 3.30 or earlier, performing a simple search
with a double quote (e.g., "histoire algerie"), the Javascript is broken
in results page because of :

function GetZ3950Terms(){
  var strQuery="&frameworkcode=";
  strQuery += "&" + "title" + "=" + ""histoire%20algerie"";

Second, the encoding of non-ASCII characters in the search
term was broken.

This patch moves URI escaping from Perl to template with uri TT filter.

Test plan :
- To reproduce the issue with double quotes, the server
  must be running URI::Escape 3.30 or earlier; the current
  version of URI::Escape properly escapes double quote.
- In staff interface, perform a search with double quotes
  that will return no result, ie "aaa xxx"
=> Without patch, javascript is broken
=> With patch, javascript is not broken
- Click on Z3950 button on results page
=> Without patch, the Title input is empty
=> With patch, the Title input contains the search terms

Additional test:
Do a search with something like äöü and then click Z3950
button on results page.
Without patch, encoding is broken in Z3950 form
With patch, encoding is correct.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Fixed a few tabs. Passes tests and QA script.
I can't reproduce the Javascript problem, but I can reproduce
the Z39.50 encoding problem and can detect no regression.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11955: Remove spaces in empty indicators when linking an authority to a biblio record.

This patch removes spaces in indicators which are imported when we link an
authority to a biblio record. The spaces made the indicators harder to edit
after the linking, because we had to delete the superfluous space character
before a new value could be entered.

To test:
1. Open some authority on editor, save with empty indicators.
   They are saved as ind1=" " ind2=" " on auth_header tables, with spaces
2. Edit some record, link some tag with previous auth,
   indicators now have a space on it (or ind1 at last)
3. Apply the patch
4. repeat 2, space is gone

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work as described. No koha-qa errors.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>