Bug 17014 - Remove more event attributes from patron templates
Summary: Remove more event attributes from patron templates
Status: RESOLVED 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:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-01 16:32 UTC by Owen Leonard
Modified: 2017-04-02 17:49 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 17014 - Remove more event attributes from patron templates (13.13 KB, patch)
2016-08-01 18:44 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 17014 - Remove more event attributes from patron templates (13.15 KB, patch)
2017-03-21 13:13 UTC, sandboxes@biblibre.com
Details | Diff | Splinter Review
Bug 17014 - Remove more event attributes from patron templates (13.22 KB, patch)
2017-03-21 19:56 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17014: Simplify some code (1.82 KB, patch)
2017-03-21 19:56 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-08-01 16:32:58 UTC
There are many patron-related templates which still use event attributes to define events. These should be modified so that events are defined in JavaScript.
Comment 1 Owen Leonard 2016-08-01 18:44:59 UTC
Created attachment 53860 [details] [review]
Bug 17014 - Remove more event attributes from patron templates

There are many patron-related templates which still use event attributes
to define events. This patch updates these templates so that events are
defined in JavaScript.

To test apply the patch and check out to a patron.

- From the Print menu in the toolbar, choose "Print summary." The patron
  summary page should open and the print dialog should be automatically
  triggered.

- From the Print menu in the toolbar, choose "Print slip." The patron
  slip page should open and the print dialog should be automatically
  triggered.

- From the Print menu in the toolbar, choose "Print quick slip." The
  patron quick slip page should open and the print dialog should be
  automatically triggered.

- Click the patron's "Fines" tab in the left-hand sidebar and then
  choose the "Account" tab.
  -- Click the "Print" button for an account payment (the link should
     point to printfeercpt.pl). A print receipt page should open and
     the print dialog should be automatically triggered.
  -- Follow the same procedure for a transaction which is not an account
     payment (the link should point to printinvoice.pl).

- Click the "Create manual invoice" tab.
  -- Select one of the "type" choices. Doing so should automatically
     populate the "Description" field with the corresponding code.
  -- If necessary, define one or more values for the MANUAL_INV
     authorized value and confirm that those invoice types work as well.

- From the patron's "Pay fines" tab, click the "Pay amount" button. In
  the "collect from patron" field, enter any combination of letters,
  numbers, and symbols. When you tab away from that field your text
  should be reformatted to currency format.

- From the patrons home page, change the filter in the left-hand sidebar
  and submit it. The correct results should be returned.
Comment 2 Frédéric Demians 2016-08-05 17:05:26 UTC
It works as described. Reading the code, and for the sake of discussion:

You have this:

    $("#searchform").on("submit",function(){
        return filter();
    });

Why not directly:

    $("#searchform").on("submit",filter);

Or, since filter() isn't used anywhere else, why not moving its code directly
above:

    $("#searchform").on("submit",function(){
      // filter() code

And this old code:

    var type_fees = new Array();
    type_fees['L'] = '';
    type_fees['F'] = '';
    type_fees['A'] = '';
    type_fees['N'] = '';
    type_fees['M'] = '';

could be cleaned up:

    var type_fees = {'L':'','F':'','A':'','N':'','M':''};
Comment 3 sandboxes@biblibre.com 2017-03-21 13:13:12 UTC
Patch tested with a sandbox, by EricGosselin <eric.gosselin.5@gmail.com>
Comment 4 sandboxes@biblibre.com 2017-03-21 13:13:33 UTC
Created attachment 61382 [details] [review]
Bug 17014 - Remove more event attributes from patron templates

There are many patron-related templates which still use event attributes
to define events. This patch updates these templates so that events are
defined in JavaScript.

To test apply the patch and check out to a patron.

- From the Print menu in the toolbar, choose "Print summary." The patron
  summary page should open and the print dialog should be automatically
  triggered.

- From the Print menu in the toolbar, choose "Print slip." The patron
  slip page should open and the print dialog should be automatically
  triggered.

- From the Print menu in the toolbar, choose "Print quick slip." The
  patron quick slip page should open and the print dialog should be
  automatically triggered.

- Click the patron's "Fines" tab in the left-hand sidebar and then
  choose the "Account" tab.
  -- Click the "Print" button for an account payment (the link should
     point to printfeercpt.pl). A print receipt page should open and
     the print dialog should be automatically triggered.
  -- Follow the same procedure for a transaction which is not an account
     payment (the link should point to printinvoice.pl).

- Click the "Create manual invoice" tab.
  -- Select one of the "type" choices. Doing so should automatically
     populate the "Description" field with the corresponding code.
  -- If necessary, define one or more values for the MANUAL_INV
     authorized value and confirm that those invoice types work as well.

- From the patron's "Pay fines" tab, click the "Pay amount" button. In
  the "collect from patron" field, enter any combination of letters,
  numbers, and symbols. When you tab away from that field your text
  should be reformatted to currency format.

- From the patrons home page, change the filter in the left-hand sidebar
  and submit it. The correct results should be returned.

Signed-off-by: EricGosselin <eric.gosselin.5@gmail.com>
Comment 5 Jonathan Druart 2017-03-21 19:56:11 UTC
Created attachment 61423 [details] [review]
Bug 17014 - Remove more event attributes from patron templates

There are many patron-related templates which still use event attributes
to define events. This patch updates these templates so that events are
defined in JavaScript.

To test apply the patch and check out to a patron.

- From the Print menu in the toolbar, choose "Print summary." The patron
  summary page should open and the print dialog should be automatically
  triggered.

- From the Print menu in the toolbar, choose "Print slip." The patron
  slip page should open and the print dialog should be automatically
  triggered.

- From the Print menu in the toolbar, choose "Print quick slip." The
  patron quick slip page should open and the print dialog should be
  automatically triggered.

- Click the patron's "Fines" tab in the left-hand sidebar and then
  choose the "Account" tab.
  -- Click the "Print" button for an account payment (the link should
     point to printfeercpt.pl). A print receipt page should open and
     the print dialog should be automatically triggered.
  -- Follow the same procedure for a transaction which is not an account
     payment (the link should point to printinvoice.pl).

- Click the "Create manual invoice" tab.
  -- Select one of the "type" choices. Doing so should automatically
     populate the "Description" field with the corresponding code.
  -- If necessary, define one or more values for the MANUAL_INV
     authorized value and confirm that those invoice types work as well.

- From the patron's "Pay fines" tab, click the "Pay amount" button. In
  the "collect from patron" field, enter any combination of letters,
  numbers, and symbols. When you tab away from that field your text
  should be reformatted to currency format.

- From the patrons home page, change the filter in the left-hand sidebar
  and submit it. The correct results should be returned.

Signed-off-by: EricGosselin <eric.gosselin.5@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Jonathan Druart 2017-03-21 19:56:14 UTC
Created attachment 61424 [details] [review]
Bug 17014: Simplify some code

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 7 Kyle M Hall 2017-03-31 15:14:34 UTC
Pushed to master for 17.05, thanks Owen, Jonathan!
Comment 8 Katrin Fischer 2017-04-02 17:49:48 UTC
This won't get ported back to 16.11.x as it is an enhancement.