Bug 11746 - Add edit item links to record details page

In order to edit a specific item right now, one must select the edit
pulldown, then choose edit items, the click the edit link for the
particular item the librarian wishes to edit. It would be much more
convenient to have an edit link for each specific item in the items
table on the record details page.

Test Plan:
1) Apply this patch
2) View the record details for a record with items
3) Click the edit link for a particular item
4) Note that you are taken immediately to the item editor
   for this particular item

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Havilah Lyon <havilah@aflibrary.org>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11746 [QA Followup] display edit item link only if user has permission to edit items

Signed-off-by: Havilah Lyon <havilah@aflibrary.org>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10751: standardize validation of title in staff purchase suggestions form

The form for adding a new purchase suggestion in the staff client
indicates that the title field is required but does nothing to enforce
this rule. This can be handled client-side with HTML5 validation
attributes and Koha's built-in validation plugin. This patch implements
this.

To test, apply the patch and go to Acquisitions ->
Suggestions -> New purchase suggestion. Try submitting the form without
entering a title. Doing so should trigger a validation warning.

Submission of the form with valid data should work correctly. Editing an
existing suggestion should also work correctly.

The patch displays a message 'Required' near the title field.
After submitting a empty title it changes to 'This field is required'
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
The title field is required since commit
d565fb02e9fca2ac9c506e4e7d44fd8b0d66f06a
This one makes it more consistent with formatting. It makes sense.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11707: fix editing additional attributes for patron whose category code includes a space

When editing additional attributes of a patron of a category with a
code with space (ie "CAT 3"), the Javascript is broken and Additional
attributes are not displayed.

This patch corrects by adding simple quotes around category code in JS
code.

Test plan :
- Create an patron additional attribute
- Create a new patron category with a space in code. ie "CAT 3"
- Create a new patron of this category : /cgi-bin/koha/members/memberentry.pl?op=add&categorycode=CAT 3
=> Without patch the JS is broken (Syntax error, unrecognized expression:
   [data-category_code=CAT 3]) and additional attributes are not
   displayed.
=> With patch the JS is not broken and additional attributes are
   displayed and can be edited.

Signed-off-by: Marc Véron <veron@veron.ch>

In current Koha version it is not possible to create category codes
with blanks.

To test, I changed an existing category code directly in the database.
Then I followed the Test plan.
Without patch, attribute types were not displayed.
With patch, they were displayed as expected.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
I recommend not using codes with spaces and fix existing ones.
Koha doesn't allow you to add category codes with spaces, so the only way
to do it is via SQL.
This patch fixes a problem and passes all tests.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11768: Show patron cardnumber in OPAC personal details

In previous versions of Koha, the patron cardnumber was displayed in the
personal details section of the OPAC for logged in users. A patron needs
to be able to access his or her cardnumber in some cases to access
online resources a library makes available that requires his or her
cardnumber. This is especially important for patron self registration
where a patron may not have a physical library card. This field should
be re-added to the patron personal details page.

Test Plan:
1) Apply this patch
2) Log into the OPAC
3) Browse to "your personal details"
4) Verify the patron cardnumber is visible

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Restores cardnumber on personal details tab in OPAC for
prog and bootstrap theme. Passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11819 - Don't show catalog edit menu if user has no edit permissions

Currently if the logged in user lacks any cataloging permissions the
bibliographic detail page (catalogue/detail.pl) still shows the Edit
button, but with an empty dropdown menu. This patch corrects the toolbar
include so that the button will not appear at all.

To test, view the biblio detail page as a user with various combinations
of the following permissions:

- edit_items
- edit_catalogue
- items_batchmod
- items_batchdel

The edit button should appear with the correct set of links when the
user has any combination of the above permissions. If user has none the
button should not appear.

Followed test plan, patch behaves as expected
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as expected, passes all tests and QA script.
Template only change.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11809: don't display 'Clear date' on OPAC patron details form if date of birth is required

On the OPAC's patron details form, if the date of birth field is
required we shouldn't offer the user a "clear date." This patch removes
the "clear date" link if the field is required.

To test, configure the BorrowerMandatoryField system preference to
require dateofbirth. Enable the OPACPatronDetails system preference and
log in to the OPAC. View the "personal details" form and confirm that
there is no "clear date" link next to the required date of birth field.

Remove dateofbirth from the BorrowerMandatoryField system preference and
re-test. The "clear date" link should appear.

Test in both prog and Bootstrap themes.

I tested with prog and bootstrap themes, adding/removing field 'dateofbirth'
in sys pref PatronSelfRegistrationBorrowerMandatoryField.
Patch behaves as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as expected, passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>