Bug 16967 - Remove the use of "onclick" from serial frequency and numbering management
Summary: Remove the use of "onclick" from serial frequency and numbering management
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-22 18:43 UTC by Owen Leonard
Modified: 2017-06-14 22:16 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 16967 - Remove the use of "onclick" from serial frequency and numbering management (5.28 KB, patch)
2016-07-22 18:58 UTC, Owen Leonard
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 16967: Remove the use of "onclick" from serial frequency and numbering management (5.33 KB, patch)
2016-09-05 19:57 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
Bug 16967: Remove the use of "onclick" from serial frequency and numbering management (5.39 KB, patch)
2016-09-12 16:28 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2016-07-22 18:43:26 UTC
There are several instances of "onclick" in the templates for managing serial numbering patterns and serial frequencies. These should be removed in favor of events defined in the JavaScript.
Comment 1 Owen Leonard 2016-07-22 18:58:27 UTC Comment hidden (obsolete)
Comment 2 Aliki Pavlidou 2016-08-15 22:10:06 UTC
Dear Owen,

I've tested 

-> Manage frequencies:

- Everything works just fine. When I've selected to "Delete" a frequency, there was this message:
This frequency is still used by 2 subscription(s). Do you still want to delete it?
The list of titles it was also there, after clicking the "Show subscriptions" link.

- The form submission validation is still working correctly, as I've entered a non-numeric data (the word: two) in the "issues per unit" field and after submitting the form, I got back as a result this message:
Some fields are not valid. Issues per unit is required (must be a number greater than 0).

-> Manage numbering patterns:

- Like before, I tried to "Delete" "Back up pattern1", and the following message appeared:
This pattern is still used by 2 subscription(s). Do you still want to delete it?
The list of titles it was also there, after clicking the "Show subscriptions" link.

- Regarding creating a new numbering pattern, I was trying to create one yearly subscription that has 11 issues per year. Do you have any idea how could I set this pattern? For example 2015 was the 18th year of this journal publication, and July and August was merged into one issue.

Kind regards
Aliki
Comment 3 Héctor Eduardo Castro Avalos 2016-09-05 19:57:37 UTC Comment hidden (obsolete)
Comment 4 Héctor Eduardo Castro Avalos 2016-09-05 20:47:38 UTC
(In reply to Aliki Pavlidou from comment #2)

Hi Aliki


I will answer your question


> - Regarding creating a new numbering pattern, I was trying to create one
> yearly subscription that has 11 issues per year. Do you have any idea how
> could I set this pattern? For example 2015 was the 18th year of this journal
> publication, and July and August was merged into one issue.
> 

Name: 11 volums per year
Description: 11 volums per year

		X	Y
Label 		Year	No
Add		 1	1
Every		 11	1
Setback		1	1
When..		9999	11

Test prediction pattern
Frequency: 1/month
First issue publication date: 01/01/2015
Subscription length: issues 11


Beggins		2015	1
with
Inner
couter		1	1

You will get:
Number 	Publication date
Year 2015, No. 1 	01/01/2015
Year 2015, No. 2 	01/02/2015
Year 2015, No. 3 	01/03/2015
Year 2015, No. 4 	01/04/2015
Year 2015, No. 5 	01/05/2015
Year 2015, No. 6 	01/06/2015
Year 2015, No. 7 	01/07/2015
Year 2015, No. 8 	01/08/2015
Year 2015, No. 9 	01/09/2015
Year 2015, No. 10 	01/10/2015
Year 2016, No. 11 	01/11/2015

If this does not always happen, i.e., just one year and the another year came with 12 issues
You just delete the number not published when you add a new subscription in the "Prediction pattern"
learn more about this here: <http://manual.koha-community.org/16.05/en/newsubscription.html>

Maybe this isn't the best place to ask, please use the mailing list at <https://koha-community.org/support/koha-mailing-lists/> or the IRC <https://koha-community.org/get-involved/irc/>

I hope this helps

Regards
Comment 5 Jonathan Druart 2016-09-12 16:28:12 UTC
Created attachment 55511 [details] [review]
Bug 16967: Remove the use of "onclick" from serial frequency and numbering management

This patch removes instance of "onclick" from the templates for serial
frequency and numbering management. Events are now defined in the
JavaScript.

To test, apply the patch and go to Serials -> Manage frequencies.

 - In the list of frequencies, click the "Delete" button for a frequency
   which is in use by at least one subscription. In the confirmation
   dialog, clicking the "Show subscriptions" link should display a list
   of titles.
 - Edit or create a frequency.
 - To test that the form submission validation is still working
   correctly, enter non-numeric data in the "issues per unit" field and
   submit the form. This should trigger an error.

In Serials -> Manage numbering patterns:

 - In the list of numbering patterns, click the "Delete" button for a
   pattern which is in use by at least one subscription. In the
   confirmation dialog, clicking the "Show subscriptions" link should
   display a list of titles.
 - Edit or create a numbering pattern.
 - Confirm that the "Test pattern" button works correctly.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Kyle M Hall 2016-09-12 16:34:31 UTC
Pushed to master for 16.11, thanks Owen!