Bug 12829: properly skip invalid ISBN when rendering for normal record display

Currently, 020$z (and 010$z fr UNIMARC) occurences are not shown, but the XSLT logic
used introduces punctuation characters for those $z occurences.

This patch adds a check for the existence of subfield a, and only loops
on $a subfields.

To test:
- Create/have a record with 020$z (or 010$z on UNIMARC) but no 020$a (no 010$a on UNIMARC).
- Open the detail page for the record (on both OPAC and staff).
=> FAIL: the ISBN label and ';' and '.' characters incorrectly shown.
- Repeat mixing with 020$a occurences to notice the bug.
- Apply the patch, reload
=> SUCCES: ISBN label shows only on the presence of a $a, and $z are skipped.
           no matter how many ISBN fields you add.
- Sign off :-D

Regards
To+

http://bugs.koha-community.org/show_bug.cgi?id=12901
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12829: Follow-up - fix small display issue in UNIMARC

UNIMARC XSLT uses <li> instead of <span>.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 9312: strict perl for picture-upload.pl

Testing - this is a code-cleanup patch, so the purpose
of testing is to ensure that patron image upload functionality
still works.  To test:

- Turn on the patronimages system preference
- Go to Tools | Upload patron images and import a suitable image
  for a test patron.
- Bring up the test patron and verify that the image is attached.
- From the patron details page, upload a replacement image.
- Create a patron image ZIP file containing at least two images (
  per the documentation of the patron image feature) and load it
  via the patron image import tool.
- Verfiy that the test patrons now have images.
- Verify that tools/picture-upload.pl didn't report any errors
  in the Apache error log.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 9312: Perltidying picture-upload.pl

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 9312: fix a couple more uninitialized variable warnings

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 9312: Followup for one tab character

To satisfy qa tools, removing one tab somewhere..

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

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Sometimes our QA tools are pretty annoying, in cases like this, when its a
tab in a comment, .. I don't think we really need to hold up a patch
set for it

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 9312: Resolve error triggered by mutli-type return value.

$results is 1 upon success or a hash on failure.
Rather than check %$results || %error, I changed it to
$results!=1 || %error. Strangely, this works without
messy warnings. I believe this resolves the problem Katrin
mentions in comment #43.

TEST PLAN
---------
0) Make sure the system preference patronimages is set to Allow.
1) Apply all the patches
2) Login to staff client
3) Tools -> Upload patron images (it's in the bottom left)
4) Choose an image file, browse for a photo, enter a patron #.
5) Click Upload
6) Click the card number link
   -- the uploaded photo should be visible on the left side of
      the screen.
7) Run koha qa test tools.

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

Image uploaded without problems
No koha-qa errors

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12760 - add restrictions purge to cleanup_database.pl

This patch adds to the database cleanup script an option to purge expired patron restrictions (debarments in code).

Test plan :
- Select a borrower
- Create a restriction with expiration date in the futur
- Create a restriction expired since 7 days
- Create a restriction expired since 14 days
- run "misc/cronjobs/cleanup_database.pl -v --restrictions 14"
=> no restriction is removed for this borrower
- run "misc/cronjobs/cleanup_database.pl -v --restrictions 13"
=> restriction expired since 14 days is removed
- run "misc/cronjobs/cleanup_database.pl -v --restrictions 6"
=> restriction expired since 7 days is removed
- run without argument "misc/cronjobs/cleanup_database.pl"
=> You see help text for restrictions option
- run without days "misc/cronjobs/cleanup_database.pl -v --restrictions"
=> You get a purge on 30 days

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12760 - add restrictions purge to cleanup_database.pl (followup 1)

Remove unused $query var
Correct redefined $count var

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12760 - add restrictions purge to cleanup_database.pl (followup 2)

Formatting :
perltidy
use q{} for SQL queries
add use Modern::Perl

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12448: Ask for confirmation when checking out an item with rental fees

Sponsored-by: Ville de Victoriaville, QC

Confirmation box contents:

"Please confirm checkout"
"-Rental charge for this item: n"
[Yes, check out (Y)] [No, Don't Check Out (N)]

Test case A: Confirm checkout
1) Go to checkout user "X"'s checkout page.
2) Enter barcode for an item with rental fees.
3) Click the "Check out" button.
4) Confirmation box appears.
5) Click on the "Yes" button.
6) Item is added to checkout list.
7) Fees are added to the patron's account.

Test case B: Decline checkout
1) Go to checkout user "X"'s checkout page.
2) Enter barcode for an item with rental fees.
3) Click the "Check out" button.
4) Confirmation box appears.
5) Click the "No" button.
6) Checkout page goes back to its initial state.
7) Patron has no item checked out and no fees to pay.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
With the system preference RentalFeesCheckoutConfirmation
set to "don't ask" there is no change in behaviour.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12448: Follow-up: Only ask confirmation when rental charge > 0

To test:
- Check out an item with no rental charge
- Verify no confirmation message appears
- Check out an item with rental charge
- Verify rental charge shows

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12448: DBRev 3.17.00.048

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