Bug 9894 - (3.12) de-serialize the 'hidden' value for subfields in frameworks

This patch aims to provide a non-intrusive way (with respect to Koha's code, so
it could have got into 3.12) for the users to easily choose the visibility settings
for each subfield.

This patch is also known to have arrived late for 3.12. I've been struggling with
other stuff at work, but I just wanted to put this somewhere just in case it can
be reused or something else.

The patch adds two JavaScript functions that deal with (de)serialization of the 'hidden'
value for subfields. One each way. Listeners are added to the checkboxes so the (actually, heh)
'hidden' value gets correctly updated on each checkbox change.

There's a costly function to update all checkboxes on every tab to match the 'hidden' value on page load.

To test:
- open the docs to have at hand the list of codes/visibility options combinations and
try changing several subfields from a single tagfield. Save, and reopen the "Edit subfields" page.
- I had a MySQL shell opened to repeatedly run this query (i tested against field 886
  on the default framework):
>  SELECT tagfield,tagsubfield,hidden FROM marc_subfield_structure WHERE frameworkcode='' AND tagfield=886;
- Compare what was saved on the DB with the docs for that visibility selection.

Regards
To+

PS: I promise I'll work on the proper patch for 3.14, which would involve DB structure changes and
(more than I expected) rewriten code.

Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Liz Rea <liz@catalyst.net.nz>
I promise to hug you the next time we meet. This works, and is a reasonable work around for a very longstanding awkward interface.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 9894 - Followup: Add support for "flagged" values

Even though we don't know what they mean or do.

To test:
- open the docs to have at hand the list of codes/visibility options combinations and
try changing several subfields from a single tagfield. Save, and reopen the "Edit subfields" page.
- Click the "Flagged" checkbox - it should disable the other checkboxes as this setting is (apparently) exclusive to the others.
- Step through several tabs and set your visibilities as you like.
- I had a MySQL shell opened to repeatedly run this query (i tested against field 886
  on the default framework):
>  SELECT tagfield,tagsubfield,hidden FROM marc_subfield_structure WHERE frameworkcode='' AND tagfield=886;
- Compare what was saved on the DB with the docs for that visibility selection.

Bug 9894 - Help file updates

To test:

Click the Help link in the upper right hand corner of the MARC subfield editor
Verify that the epic list of values is gone
Verify that the help page overall looks alright
Verify that the help makes sense and is understandable.

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>
Bug 9894 - (3.12) Small followup

Liz's patch adds the 'flagged' value back, but there's a problem with its logic that prevents it to work on startup (works fine for changing values)

Regards
To+

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

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 9894: Add labels for checkboxes

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

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_9894' into 3.14-master
Bug 9737 - Local Covers sometimes appear then disappear on OPAC Search Results/Lists

The current problem:

When the verify_images() function runs from amazonimages.js, it loops
through every img element and selects the elements that come from Amazon
sources.

However, if the height/width is 1 (i.e. Amazon passes off a blank image)
or if the img element's complete property is null or non-existent, then
it searches for the parent node and re-writes the HTML with the "No
Cover Image Available" (NO_AMAZON_IMAGE) text, even though that parent
node might contain other img elements that have images available (from
Google, local images, etc)!

Proposed fix:

Wrap the Amazon image in a span tag (as we do with the Google and local
covers), so that it re-writes the HTML within that parent span, rather
than the parent anchor which contains all the other images.

To test:

1) Turn on the OPACAmazonCoverImages, GoogleJackets, and
   OPACLocalCoverImages system preferences
2) Replace the ISBN in one of your records with 9780615352435
3) Now load a local cover image for that record
4) Search for that record (but make sure you're vague enough to have
   multiple search results)
5) For a split second, you may notice the local cover image appears before being replaced by a "No Cover Image Available".

Now apply this patch

6) Refresh your search results page
7) You should now see your local cover image, PLUS the "No Cover Image
   Available" for the Amazon image, and whatever other graphics/"no
   cover image available" "graphics" for the Google Jackets.

To be comprehensive, try the same set of steps using the OPAC Lists
rather than the OPAC Search Results

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_9737' into 3.14-master
Bug 9997 - Suspected typo in patron self registration code

String fix. The field name is also incorrect, causing the alternate
contact country to not be stored.

To test: Submit an update to an existing patron record an include a
change to the alternate contact's country field. Before the patch this
line would not appear in the staff client for approval. After the patch
it should.

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

Reminder: Even small patches require test plans. I have added one which
I think covers the changes in the patch.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_9997' into 3.14-master
Bug 10042 - Minor typo ("Communnity") in packages docs

VERY trivial string patch. Couldn't help sending it.

To+

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
Thanks for fixing my typo! I did not test by building packages
etc, but by grepping for "Communnity". The patch removes
all occurences of the typo.

Passed-QA-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_10042' into 3.14-master
Bug 10008 - Serials search results 'Opened' tab should be 'Open'

The searials search results "Opened" tab should be labeled "Open." This
patch makes this correction and changes the wording in another place
which used "opened." Markup has also been added to maintain consistency
in display of messages.

To test, perform a search for a subscription. If your search returns
results you should see an "Open" and a "Closed" tab. To test other
affected changes perform searches which return no results, only open
subscriptions, or only closed subscriptions. "No results" messages
should display correctly and consistently.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_10008' into 3.14-master
Bug 10002 - Don't include line breaks in strings that are translated

Several JS alert messages contain "\n" which is problematic for
translation. This patch removes those instances (a line break is not
strictly necessary anyway). Also corrected: two instances of "holds(s)"

To test, place a hold on a title with items. From the biblio detail page
choose Edit -> Delete all items and Edit -> Delete record. In each case
you should see error messages with no line breaks and no misspellings.

Delete all items attached to the record with holds from the item edit
page. Go back to the detail page and choose Edit -> Delete record. You
should see an error message about existing hold(s) with no line breaks
or misspellings.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Harmless change, fixes misspellings and makes translations easier

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_10002' into 3.14-master
Bug 10000 - Little typo in intranet-tmpl/prog/en/modules/help/tools/letter.tt: sliip

This patch removes the extra i in "sliip."

To test, go to Tools -> Notices & Slips and view the help file. The last
bulleted item on the page should contain no typo.

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

Comment: Can't resist to sign Bug 10000!!
Work as described. No errors.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Can't resist to QA - All tests and QA script pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_10000' into 3.14-master
Bug 6554 Fix error caused by modifying $_ in a map

Error 'Modification of a read-only value attempted' triggered
on login because of manipulation of $_ in the map

Moved the mod to a loop as recommended in the doc for map

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_6554' into 3.14-master
Bug 7368: Typo in kohastructure.sql documentation line

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>