Bug 8836 - Resurrect Rotating Collections

Test Plan:
In "Tools" -> "Rotating Collections" -> "Add/Remove items":
When adding item barcodes to the collection, the input field
  <input type="text" id="barcode" name="barcode">
should become active
automatically so it is easy to add multiple barcodes rapidly without touching the
mouse or keyboard.
Enter-press is dealt by the barcode reader so automatic form submittal should be handled
by the barcode reader.

In "Rotating collections" -> "Transfer Collection":
When the collection is initially transferred, items are set to trasfer correctly.
When the collection is transferred while items are still being transferred, the transfer
destination library doesn't change from the original one.
The holding library changes for all items in the collection to the destination library on
retransfers as well.
This is tricky if a user accidentally places the wrong destination.
When I try to checkin these items to their new retransfer location, I get the following messages:
-"This item is part of a rotating collection and needs to be transferred to <original transfer destination>"
-"Please return Valkoinen ihmissyj / to <original transfer destination>"
-"Print slip or Cancel transfer"

When I checkin a Item to a arbitrary branch, I get the following messages:
"This item is part of a rotating collection and needs to be transferred to <retransfer destination>"
"Please return Valkoinen ihmissyj / to <original trasfer destination>"

Bug 8836 - Resurrect Rotating Collections - QA Followup

Bug 8836 - Resurrect Rotating Collections - Followup 2 - Perltidy rotating collections scripts

Bug 8836 - Resurrect Rotating Collections - Followup 3

* Fix bad TT Tag
* Fix bad sql query
* Fix capitalization ( HTML4 )
* Allow a rotating collection's location to keep AutomaticItemReturn
  from sending it back to the branch of origin
* Fix bad query

Bug 8836 - Resurrect Rotating Collections - Followup 4 - Autofocus on barcode field

Bug 8836 - Resurrect Rotating Collections - Followup 5 - Don't transfer issued and waiting items

Items in a rotating collection are automatcially transferred when a
collection is transferred. This is a problem for currently checked out
items and items on hold marked as "Waiting".

This patch resolves this issue by skipping the transfer for those items.
When the items are then returned, the librarian will be alerted to
transfer the item to the library currently holding that rotating
collection.

Bug 8836 - Resurrect Rotating Collections - Followup 5 - Link collections.colBranchcode to branches.branchcode

Signed-off-by: jmbroust <jean-manuel.broust@univ-lyon2.fr>
Signed-off-by: Cindy Murdock Ames <cmurdock@ccfls.org>

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

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Bug 8836 [QA Followup] - Fix koha-qa.pl errors reported

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

Trusting the sign off on the other page, I only tested the QA changes

Signed-off-by: Cindy Murdock Ames <cmurdock@ccfls.org>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Bug 8836 [QA Followup 2]

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Bug 8836 [Template follow-up] Resurrect Rotating Collections

This follow-up makes drastic changes to the templates in order to bring
them into compliance with established patterns and markup guidelines.
Only minor changes are made to perl scripts.

Changes:

- Add a toolbar include for displaying new, edit, transfer, and delete
  buttons.
- Improve title and breadcrumbs with collection titles and better
  specificity.
- Correct page structure which was inconsistent with the markup of
  similarly-structured pages.
- Correct styling of error and informational messages.
- Added detailed error messages for a couple of conditions which were
  not defined in the template.
- Add link to the detail page of titles which are in a collection using
  the view defined in the IntranetBiblioDefaultView preference.
- Add a link to remove an item from a collection directly without having
  to scan the barcode.
- Add client-side validation to collection creation form.
- In RotatingCollections.pm, add biblionumber to the list of columns
  returned by GetItemsInCollection.
- In rotating_collections/*.pl, remove obsolete declaration of system
  preference variables.

To test, perform all the operations associated with Rotating
Collections:

- Add a new collection
- Edit an existing collection
- Add items to a collection
- Remove items from a collection (via barcode and link)
- Test the behavior of all new toolbar buttons
- Verify that titles and breadcrumbs look correct and links work
  correctly.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Bug 8836 [QA Followup] - Allow collection description to be optional

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

Description is no longer made required by the template and an empty
description is saved correctly.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Bug 8836 [QA Followup] - Sort transfer branches alphabetically

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

Libraries sort correctly now.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Bug 8836 [QA Followup] - Don't transfer in items already in transit

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Bug 8836 [Alt QA Followup] - Add confirmation dialog for deleting collections

The previous patch for adding a confirmation dialog didn't work to make
the confirmation message translatable. This alternate patch uses a
progressive-enhancement method recycled from Guided Reports to trigger a
warning and highlight the row which was clicked.

To test, apply the patch and try to delete an existing rotating
collection. You should get a confirmation dialog, and the corresponding
row in the table should be highlighted red.

Clicking cancel should cancel the deletion. Clicking OK should complete
the deletion.

To test the translatability of the confirmation message:

Run perl translate update [a language code, e.g. 'en-GB']
Search [lang]-i-staff-t-prog-v-3006000.po for the message string

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Bug 8836 [QA Followup] - Prevent multiple collections from having the same title

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

This works, and so I'll sign off, but I'm not crazy about the workflow.
Having the error message display on an otherwise empty page is not user
friendly. The entry form should be redisplayed so that the user can
modify the data they submitted.

That really should be changed in a follow-up.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Bug 8836: (RM followup) fix updatedatabase.pl rebase problem

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 8836: Update DBIx

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 8836: (RM followup) unit tests should use the new API

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
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>