Bug 11785 - Use validation plugin when uploading local cover images

When uploading local cover images the form should not be submitted if
no file has been selected. The existing form validation script doesn't
work. This patch adds HTML5 validation attributes and use of Koha's
built-in form validation plugin.

To test, apply the patch and go to Tools -> Upload local cover image.
Try to submit the form without selecting a file to upload. You should be
prevented from doing so. Choose a file and confirm that the upload
completes 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>
Bug 11787 - Use validation plugin when adding new vendor

The vendor entry form uses some custom JavaScript which can be removed
in favor of HTML5 validation attributes and Koha's built-in validation
plugin. This patch does so.

Also corrected: Minor validation issue.

To test, apply the patch and go to Acquisitions -> New vendor. Try
submitting the form without entering a vendor name. This should trigger
a validation warning.

Submission of the form with valid data should work correctly. Editing an
existing vendor 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>
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>
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>
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>
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>
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>