Bug 11403: (follow-up) Fix typo in renew help

This patch adds a missing letter to the Renew help file

To test:

Go to Circulation > Renew
Click Help
Confirm that the text now reads 'scan' instead of 'can'

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 353418dee043ccd332ef3f24d1f1bd330a6d2dd1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11846: Correct database update for restrictions with date 9999-12-31

The borrowers with indefinite restrictions have borrowers.debarred with '9999-12-31'.

Database update for this bug contained :
  INSERT INTO borrower_debarments ( borrowernumber, expiration, comment )
  SELECT borrowernumber, debarred, debarredcomment FROM borrowers WHERE debarred IS NOT NULL

For borrowers where borrowers.debarred is '9999-12-31', this value
is copied into borrower_debarments.expiration.

This is not correct because borrower_debarments.expiration must be
NULL for indefinite restrictions.

This patch corrects update 3.13.00.035 and also adds an update for
databases already updated.

Test plan :
- Use a database with version 3.13.00.000
- Set a borrower as restricted for ever (leave until empty)
- Use sources to master + patch
- Perform updatedatabase
- Look at borrower details, tab "Restrictions"
=> Without patch, you see Expiration 31/12/9999
=> With patch, you see Expiration Infinite

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

I tested both DB revisions by resetting Version of my database (and
adding a SetVersion after the revised older dbrev). This was possible
since the debarred field still exists in borrowers. (I have my doubts
about that, but that goes outside the scope of this report.)

Also note that routine _UpdateBorrowerDebarmentFlags puts back 9999-12-31
into borrowers for indefinite restrictions (which looks not very consistent).

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit f6131d8e6094ae9e221a9d5750d744ed1f91dd85)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11846: DBRev 3.14.05.001

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11554: Capitalization fix in patron account on fines tab

Works as described.

To test: Create patron account with outstanding fines. Open "Fines" tab.
Confirm that capitalization is correct.

Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
String patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 41a77e659b58160a95bfd93700829cfd4d753886)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 10691: use authority ID in see-also links in authority search results (staff)

This patch changes the URL and data used to show the 'see also' links
on the Staff's authority search results page.

Bonus points: makes some strings translatable.

To test:
- On your dev setup (master) create some authority records (I created
  personal name authorities).
- Pick one of them and link 400$a to another one, do the same with 500$a
- Add some other 400$a and 500$a entries with plain text (i.e. no
  linking)
- Make sure zebra is running and changes got indexed.
- In the staff interface search for the authority that is linked to the
  others.
- Check the 'see also:' link points to an authority search
- Apply the patch
- Reload/re-do the search
- Check the 'see also:' link points to the authority id for linked
  authorities,
  and to an authority search result in the case of plain text entries.
- Check that the authority search from the cataloguing interface still
  works as usual.

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Work as described. No errors

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

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit c62557a4fa239487e128754e79cd3a9427d4f964)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 10691: use authority ID in see-also links in authority search results (OPAC)

This patch changes the URL and data used to show the 'see also' links
on the OPAC's authority search results page.

Bonus points: makes some strings translatable.

To test:
- On your dev setup (master) create some authority records (I created
  personal name authorities).
- Pick one of them and link 400$a to another one, do the same with 500$a
- Add some other 400$a and 500$a without linking (i.e. plain text)
- Make sure zebra is running and changes got indexed.
- In the OPAC search for the authority that is linked to the others.
- Check the 'see also:' link points to an authority search
- Apply the patch
- Reload/re-do the search
- Check the 'see also:' link points to the authority id in the case
  of linked authorities, and to an authority search in the case of
  plain text headings.

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Work as described. No errors

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

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit ae7431608cfa2f9aa2674079d17f3b96fa12c8c7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 10691: (follow-up) restore behaviour for control field ($w)

As noted by Jared, in the presence of 4XX$w or 5XX$w the display
got broken by this refactoring. This patch restores the previous
behaviour in that front.

The OPAC themes get fixed too, and the Bootstrap one gets this
fix too.

Applied the fix that Galen proposed on comment #30 regarding
Zeno's fix in bug 11174.

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 06ef9f11098405cd688f43af39d828a4eb674582)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 10691: (follow-up) replace HTML comments with TT contents

Comments on the usage of Template Toolkit blocks don't need
to appear in the rendered HTML, so this patch converts HTML
comments to TT comments and thereby saves a tiny amount of
bandwidth.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit ab2a422af61a3c6df80091a311b64e8448417b13)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 10987: remove duplicate 'see also' and 'see from' labels from authority search results

If an authority record has more than one 4xx$a (or 5xx$a) entries the
corresponding labels 'see also' and 'used for/see from' werwe repeated.
This patch removes duplicate instances of the labels, improving
readability.

To test:
- Have authority records with more than one entry on the 4xx (or 5xx)
  fields.
- Do a search, check "see also:" (or 'used for/see from') appear more
  than once.
- Apply the patch
- Reload and check it looks nicer :-D
- Repeat for: staff auth search, OPAC using ccsr, OPAC using prog
- Signoff

Sponsored-by: Universidad Nacional de Cordoba

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

Work as decribed. No koha-qa errors
Nice view on staff and both opac

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 910dff28254b8a93ed03884b0e768fd7c013f449)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 10987: (follow-up) fix display of authorities containing only one see from or see also lnik

This patch fixes an incorrect test on the number of see from and
see also links in the authority record, as otherwise if a record
had only one 4XX or 5XX, the linked headings weren't displayed at
all.  This patch also makes the test consistent across the staff
theme and the two OPAC themes.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit e686dd25438b66de751551c8f8fecff115b661d4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11363: make units in label printer profile form translatable

Changed the unit names form an import to a switch case so that it is in
the .tt so that it can be translated

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 9e74700b5b4cee8f92a85f18cc2304569c30a910)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11533: (regression test) QP breaks authority search

This patch duplicates the SearchAuthority tests, with QP enabled.
Searching shouldn't be affected by QP. Instructions for manually
reproducing this can be read in the first comment for the bug entry.

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 99e2686a4985fd487dfb5e898f24ceba80ba48ab)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11533: fix authority searching with no sorting when QueryParser is enabled

This patch fixes an issue where chosing 'None' as the sort order
for an authority search would result in zero hits if QueryParser is
eanbled.

This patch also adds some additional test cases.

To test:

[1] Enable QueryParser.
[2] Perform an authority search in the staff interface that
    uses 'Heading A-Z' as the sort order and returns hits.
[3] Run the same search, but with the sort order set to 'None'.
    No hits are returned.
[4] Apply the patch.
[5] Do step 3 again.  This time, hits should be returned.
[6] Verify that prove -v t/db_dependent/Search.t passes.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 27c312b721d5533560234675712391a60f354c51)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11534: fix bug that made it impossible to remove instructors from a course

In some cases clicking the "remove" link to remove a course instructor
when editing a course reserves course doesn't work. I suspect this is
caused by leading zeroes in the card number. This patch refactors the
relevant function to fix the problem and to remove inline JavaScript
from generated markup.

Other changes:

- Make the "Remove" text translatable
- Re-order the first name and last name when added by JavaScript to
match the template's "surname, firstname" order.

To test:

1. If necessary, create or modify a patron to have a card number
   with leading zeroes.
2. Go to Course reserves and add or edit a course.
3. If you are editing a course and there are existing instructors, click
   the "remove" link. Nothing will happen.
4. Perform a patron search and choose one of the results. The name
   should be added to the list of instructors in the format "surname,
   firstname."
5. Click the "remove" link next to the patron name which was just added.
   Nothing will happen.
6. Apply the patch and repeat step 4. The "remove" link should work.
7. Add an instructor and save the course reserve. Repeat steps 2 and 3.
   The "remove" link should now work.

To test the translation fix, after applying the patch run "translate
update [language code]" and confirm that the "Remove" string is listed
in the updated po file for course_reserves/course.tt.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit d567733f2325817cca694c437c01a9e1c669f368)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11549: Add regression test

test plan:
prove t/db_dependent/Acquisition/TransferOrder.t should fail before the
patch and success after applying it.

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Testing notes on last patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit e974b554a5cc08413e66c43072e857f3d2b5458e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11549: make it possible to receive and cancel the receipt of a transferred order

To reproduce the issue:
- transfer an order from a basket to another. Note the previous
ordernumber (X) and the new one (Y).
- receive the order
- cancel the receipt
- verify the order has been deleted:
select count(*) from aqorders where ordernumber=Y;
select * from aqorders_transfers where ordernumber_from = X;
The value for ordernumber_to is null.

To test this patch:
- apply this patch
- transfer an order from a basket to another
- receive the order
- cancel the receipt
- verify the order still exist in the basket where the transfer has been
  done.

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 6d63881e0447bae83d21b6f082ee1549277c6071)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11549: (follow-up) interpolated variables into SQL statements should not be allowed

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 6e861c5563ddd807088e31a11776fb49014de27e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11549: [follow-up] Make NewOrder calculate new parent_ordernumber

If parent_ordernumber is not set in NewOrder parameter, it is
automatically set to ordernumber.

This patch only avoid code duplication.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
This solution is better!

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script. Also all tests in
t/db_dependent/Acquisitions/.

Confirmed bug and that the patch fixes it.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 9cb6174653185e8ea37871245c8d25092d8e4a81)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11138 - Add auto_unsuspend_reserves to crontab.example

To test:

Set up and run the cronjobs from crontab.example with a hold set to
unsuspend today. The hold should be unsuspended.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit e6da56acb174c56a746dde44e5d247afc7ff0ed6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11138: add auto_unsuspend_holds to daily crontab (Debian package)

To test:

Install the packages with this patch, observe the /etc/cron.daily/koha-common
file - auto_unsuspend_holds should now be in the default list.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit ebe92b97ea3082da4de7901971f681b09d3eb265)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>