Bug 11788 - Use validation plugin when creating new course

The page for adding a new course includes some custom form
validation JavaScript which can be removed in favor of HTML5 validation
attributes and Koha's built-in validation plugin. This patch does so.

To test, apply the patch and go to Course reserves -> New course. Try
submitting the form without entering a department, course number,
and/or course name. This should trigger validation warnings.

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

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 4e9b5110d90c3ac60c61f710ff5892b9720e643e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11795 - Use validation plugin when creating new Z39.50 server

The page for adding a new Z39.50 server includes some custom form
validation JavaScript which can be removed in favor of HTML5 validation
attributes and Koha's built-in validation plugin. This patch does so.

To test, apply the patch and go to Administration -> Z39.50 client
targets -> New Z39.50 server. Try submitting the form with any of the
following error conditions:

- Missing Z39.50 server name
- Missing hostname
- Missing port
- Non-numeric port
- Missing database
- Non-numeric rank
- Non-numeric timeout

These errors should trigger a validation warning.

Submission of the form with valid data should work correctly. Editing
an existing Z39.50 server should also work correctly.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Amended patch: replace tabs with spaces

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 19bf1e9a40ab5a8f3c86fb07dd6429bfc44f703b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11793 - Use validation plugin when creating new item type

The page for adding a new item type includes some custom form
validation JavaScript which can be removed in favor of HTML5 validation
attributes and Koha's built-in validation plugin. This patch does so.

To test, apply the patch and go to Administration -> Item types -> New
item type. Try submitting the form with the following error conditions:

- Missing item type
- Missing description
- A non-number in the "rental charge" field

These errors should trigger a validation warning.

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

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 1d9b86aabccf1bc916b6b27e568ad984caf081f6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11792 - Use validation plugin when creating new currency

The page for adding a new currency includes some custom form
validation JavaScript which can be removed in favor of HTML5 validation
attributes and Koha's built-in validation plugin. This patch does so.

To test, apply the patch and go to Administration -> Currencies &
Exchange rates -> New currency. Try submitting the form without entering
a currency, rate, and/or symbol. This should trigger a validation warning.

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

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 5dc093b30e8d949f39a67bf2ac40f219f6167d0a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11791 - Use validation plugin when creating new city

The page for adding a new city includes some custom form
validation JavaScript which can be removed in favor of HTML5 validation
attributes and Koha's built-in validation plugin. This patch does so.

To test, apply the patch and go to Administration -> Cities -> New city.
Try submitting the form without entering a city or zip code. This should
trigger a validation warning.

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

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Note: This patch changes the behavior. Before the patch, only 1 out of city
and zip was required. Now both are. Since the 2 inputs were marked as
required, I think they should be.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit d95ad086a35a7927bb7bc02453a1a1341387dc6a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11796: fix display of search result facets if facet happens to have exactly six entries

If a search gives results with 6 facets, one of those facets won't be
displayed. This is due to a bug in the code that only considers great
than 6 facets in one area, and less than 6 in another.

Test Plan:
1) Perform a search that should give results for 6 different libraries
2) Note you only see 5 libraries in the facets with no option to expand
3) Apply this patch
4) Repeat step 1
5) Note you now have the option to expand the facets list

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
This patch should provide a regression test but I really don't know how
to write it.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit e7286e05137276f0a916f06d60a13c22c93294b2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>