Bugzilla – Attachment 168451 Details for
Bug 19037
Circulation and fine rules test tool
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19037: Update to use PQA api endpoint and modern styling
Bug-19037-Update-to-use-PQA-api-endpoint-and-moder.patch (text/plain), 23.18 KB, created by
Martin Renvoize (ashimema)
on 2024-07-03 13:22:04 UTC
(
hide
)
Description:
Bug 19037: Update to use PQA api endpoint and modern styling
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-07-03 13:22:04 UTC
Size:
23.18 KB
patch
obsolete
>From 433a791b547feace365430a54a011addeb4499e3 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 3 Jul 2024 14:19:31 +0100 >Subject: [PATCH] Bug 19037: Update to use PQA api endpoint and modern styling > >This patch updates the test tool to use the recently introduced API >endpoint. > >TODO: This works nicely with 'Categorycode', 'Itemtype' and 'Library' >selection right now, but does not yet work for the other select options >in the tester. >--- > .../prog/en/modules/admin/smart-rules.tt | 298 +++++++++--------- > 1 file changed, 149 insertions(+), 149 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >index abadba18b4d..4e9279f9180 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >@@ -73,6 +73,154 @@ > <p>The circulation and fine rules are applied based on the CircControl system preference which is set to <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=CircControl">[% Koha.Preference('CircControl') | html %]</a> and the HomeOrHoldingBranch system preference which is set to <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=HomeOrHoldingBranch">[% Koha.Preference('HomeOrHoldingBranch') | html %]</a>.</p> > </div> > >+ <div id="issuing-rules-tester" class="page-section"> >+ <a id="toggle-tester" class="btn btn-default btn-sm">Circulation and fine rules test tool</a> >+ <div id="issuing-rules-tester-container"> >+ <h3>Circulation and fine rules test tool</h3> >+ <p>This test tool lets you search a row of circulation and fine rules for a specific patron, item and library.</p> >+ <p>Dropdown value for <strong>Library</strong> is determined via system preference <strong>CircControl</strong>. If the preference is set to item's library, then system preference <strong>HomeOrHoldingBranch</strong> defines the branch to use. You can test with any library by selecting the last option <i>Library</i>.</p> >+ <table> >+ <thead> >+ <tr> >+ <th>Patron</th> >+ <th>Item</th> >+ <th>Library</th> >+ <th>Actions</th> >+ </tr> >+ </thead> >+ <tbody> >+ <tr> >+ <td> >+ <select id="tester_patron" name="tester_patron"> >+ <option value="cardnumber">Card number</option> >+ <option value="borrowernumber">Borrowernumber</option> >+ <option value="categorycode">Categorycode</option> >+ </select> >+ <span><input type="text" name="tester_input_cardnumber" placeholder="Card number" /></span> >+ <span><input type="text" name="tester_input_borrowernumber" placeholder="Borrowernumber" /></span> >+ <span> >+ <select name="tester_input_patron_category_id" id="tester_categorycode"> >+ <option value="">All</option> >+ [% FOREACH patron_category IN patron_categories%] >+ <option value="[% patron_category.categorycode %]">[% patron_category.description %]</option> >+ [% END %] >+ </select> >+ </span> >+ </td> >+ <td> >+ <select id="tester_item" name="tester_item"> >+ <option value="barcode">Barcode</option> >+ <option value="itemnumber">Itemnumber</option> >+ <option value="itemtype">Item type</option> >+ </select> >+ <span><input type="text" name="tester_input_barcode" placeholder="Barcode" /></span> >+ <span><input type="text" name="tester_input_itemnumber" placeholder="Itemnumber" /></span> >+ <span> >+ <select name="tester_input_item_type_id" id="tester_itemtype"> >+ <option value="">All</option> >+ [% FOREACH itemtypeloo IN itemtypeloop %] >+ <option value="[% itemtypeloo.itemtype %]">[% itemtypeloo.translated_description %]</option> >+ [% END %] >+ </select> >+ </span> >+ </td> >+ <td> >+ <select id="tester_branch" name="tester_branch"> >+ [% IF Koha.Preference('CircControl') == 'PatronLibrary' %] >+ <option value="patronlibrary">Patron's home library</option> >+ [% ELSIF Koha.Preference('CircControl') == 'ItemHomeLibrary' %] >+ [% IF Koha.Preference('HomeOrHoldingBranch') == 'homebranch' %] >+ <option value="itemhomelibrary">Item's home library</option> >+ [% ELSE %] >+ <option value="itemholdinglibrary">Item's holding library</option> >+ [% END %] >+ [% ELSE %] >+ <option value="pickuplibrary">Current library ([% LoginBranchname %])</option> >+ [% END %] >+ <option value="library">Library</option> >+ </select> >+ <span></span> >+ <span> >+ <select name="tester_input_library_id" id="tester_branchcode"> >+ <option value="">All</option> >+ [% PROCESS options_for_libraries libraries => Branches.all( unfiltered => 1 ) %] >+ </select> >+ </span> >+ </td> >+ <td><button type="submit" id="tester_submit" class="btn btn-default btn-xs"><i class="fa fa-search"></i> Find</button></td> >+ </tr> >+ </tbody> >+ </table> >+ <table> >+ <thead> >+ <tr> >+ <th>Library</th> >+ <th>Patron category</th> >+ <th>Item type</th> >+ <th>Current checkouts allowed</th> >+ <th>Current on-site checkouts allowed</th> >+ <th>Loan period</th> >+ <th>Unit</th> >+ <th>Hard due date</th> >+ <th>Fine amount</th> >+ <th>Fine charging interval</th> >+ <th>When to charge</th> >+ <th>Fine grace period</th> >+ <th>Overdue fines cap (amount)</th> >+ <th>Cap fine at replacement price</th> >+ <th>Suspension in days (day)</th> >+ <th>Max. suspension duration (day)</th> >+ <th>Renewals allowed (count)</th> >+ <th>Renewal period</th> >+ <th>No renewal before</th> >+ <th>Automatic renewal</th> >+ <th>No automatic renewal after</th> >+ <th>No automatic renewal after (hard limit)</th> >+ <th>Holds allowed (count)</th> >+ <th>Holds per record (count)</th> >+ <th>On shelf holds allowed</th> >+ <th>Item level holds</th> >+ <th>Article requests</th> >+ <th>Rental discount (%)</th> >+ </tr> >+ </thead> >+ <tbody> >+ <tr id="tester_res_results"> >+ <td id="tester_res_branchcode"></td> >+ <td id="tester_res_categorycode"></td> >+ <td id="tester_res_itemtype"></td> >+ <td id="tester_res_maxissueqty"></td> >+ <td id="tester_res_maxonsiteissueqty"></td> >+ <td id="tester_res_issuelength"></td> >+ <td id="tester_res_lengthunit"></td> >+ <td id="tester_res_hardduedate"></td> >+ <td id="tester_res_fine"></td> >+ <td id="tester_res_chargeperiod"></td> >+ <td id="tester_res_chargeperiod_charge_at"></td> >+ <td id="tester_res_firstremind"></td> >+ <td id="tester_res_overduefinescap"></td> >+ <td id="tester_res_cap_fine_to_replacement_price"></td> >+ <td id="tester_res_finedays"></td> >+ <td id="tester_res_maxsuspensiondays"></td> >+ <td id="tester_res_renewalsallowed"></td> >+ <td id="tester_res_renewalperiod"></td> >+ <td id="tester_res_norenewalbefore"></td> >+ <td id="tester_res_auto_renew"></td> >+ <td id="tester_res_no_auto_renewal_after"></td> >+ <td id="tester_res_no_auto_renewal_after_hard_limit"></td> >+ <td id="tester_res_reservesallowed"></td> >+ <td id="tester_res_holds_per_record"></td> >+ <td id="tester_res_onshelfholds"></td> >+ <td id="tester_res_opacitemholds"></td> >+ <td id="tester_res_article_requests"></td> >+ <td id="tester_res_rentaldiscount"></td> >+ </tr> >+ </tbody> >+ </table> >+ <div id="tester_error" class="alert alert-danger"></div> >+ </div> >+ </div> >+ > <div class="page-section"> > [% UNLESS restricted_to_own_library %] > <form method="get" action="/cgi-bin/koha/admin/smart-rules.pl" id="selectlibrary"> >@@ -612,153 +760,6 @@ > </form> > </div><!-- ./page-section --> > >- <div id="issuing-rules-tester" class="container" style="width:auto;"> >- <a id="toggle-tester" class="btn btn-default btn-sm">Circulation and fine rules test tool</a> >- <div id="issuing-rules-tester-container"> >- <h3>Circulation and fine rules test tool</h3> >- <p>This test tool lets you search a row of circulation and fine rules for a specific patron, item and library.</p> >- <p>Dropdown value for <strong>Library</strong> is determined via system preference <strong>CircControl</strong>. If the preference is set to item's library, then system preference <strong>HomeOrHoldingBranch</strong> defines the branch to use. You can test with any library by selecting the last option <i>Library</i>.</p> >- <table> >- <thead> >- <tr> >- <th>Patron</th> >- <th>Item</th> >- <th>Library</th> >- <th>Actions</th> >- </tr> >- </thead> >- <tbody> >- <tr> >- <td> >- <select id="tester_patron" name="tester_patron"> >- <option value="cardnumber">Card number</option> >- <option value="borrowernumber">Borrowernumber</option> >- <option value="categorycode">Categorycode</option> >- </select> >- <span><input type="text" name="tester_input_cardnumber" placeholder="Card number" /></span> >- <span><input type="text" name="tester_input_borrowernumber" placeholder="Borrowernumber" /></span> >- <span> >- <select name="tester_input_categorycode" id="tester_categorycode"> >- <option value="">All</option> >- [% FOREACH patron_category IN patron_categories%] >- <option value="[% patron_category.categorycode %]">[% patron_category.description %]</option> >- [% END %] >- </select> >- </span> >- </td> >- <td> >- <select id="tester_item" name="tester_item"> >- <option value="barcode">Barcode</option> >- <option value="itemnumber">Itemnumber</option> >- <option value="itemtype">Item type</option> >- </select> >- <span><input type="text" name="tester_input_barcode" placeholder="Barcode" /></span> >- <span><input type="text" name="tester_input_itemnumber" placeholder="Itemnumber" /></span> >- <span> >- <select name="tester_input_itemtype" id="tester_itemtype"> >- <option value="">All</option> >- [% FOREACH itemtypeloo IN itemtypeloop %] >- <option value="[% itemtypeloo.itemtype %]">[% itemtypeloo.translated_description %]</option> >- [% END %] >- </select> >- </span> >- </td> >- <td> >- <select id="tester_branch" name="tester_branch"> >- [% IF Koha.Preference('CircControl') == 'PatronLibrary' %] >- <option value="patronlibrary">Patron's home library</option> >- [% ELSIF Koha.Preference('CircControl') == 'ItemHomeLibrary' %] >- [% IF Koha.Preference('HomeOrHoldingBranch') == 'homebranch' %] >- <option value="itemhomelibrary">Item's home library</option> >- [% ELSE %] >- <option value="itemholdinglibrary">Item's holding library</option> >- [% END %] >- [% ELSE %] >- <option value="pickuplibrary">Current library ([% LoginBranchname %])</option> >- [% END %] >- <option value="library">Library</option> >- </select> >- <span></span> >- <span> >- <select name="tester_input_branchcode" id="tester_branchcode"> >- <option value="">All</option> >- [% PROCESS options_for_libraries libraries => Branches.all( unfiltered => 1 ) %] >- </select> >- </span> >- </td> >- <td><button type="submit" id="tester_submit" class="btn btn-default btn-xs"><i class="fa fa-search"></i> Find</button></td> >- </tr> >- </tbody> >- </table> >- <table> >- <thead> >- <tr> >- <th>Library</th> >- <th>Patron category</th> >- <th>Item type</th> >- <th>Current checkouts allowed</th> >- <th>Current on-site checkouts allowed</th> >- <th>Loan period</th> >- <th>Unit</th> >- <th>Hard due date</th> >- <th>Fine amount</th> >- <th>Fine charging interval</th> >- <th>When to charge</th> >- <th>Fine grace period</th> >- <th>Overdue fines cap (amount)</th> >- <th>Cap fine at replacement price</th> >- <th>Suspension in days (day)</th> >- <th>Max. suspension duration (day)</th> >- <th>Renewals allowed (count)</th> >- <th>Renewal period</th> >- <th>No renewal before</th> >- <th>Automatic renewal</th> >- <th>No automatic renewal after</th> >- <th>No automatic renewal after (hard limit)</th> >- <th>Holds allowed (count)</th> >- <th>Holds per record (count)</th> >- <th>On shelf holds allowed</th> >- <th>Item level holds</th> >- <th>Article requests</th> >- <th>Rental discount (%)</th> >- </tr> >- </thead> >- <tbody> >- <tr id="tester_res_results"> >- <td id="tester_res_branchcode"></td> >- <td id="tester_res_categorycode"></td> >- <td id="tester_res_itemtype"></td> >- <td id="tester_res_maxissueqty"></td> >- <td id="tester_res_maxonsiteissueqty"></td> >- <td id="tester_res_issuelength"></td> >- <td id="tester_res_lengthunit"></td> >- <td id="tester_res_hardduedate"></td> >- <td id="tester_res_fine"></td> >- <td id="tester_res_chargeperiod"></td> >- <td id="tester_res_chargeperiod_charge_at"></td> >- <td id="tester_res_firstremind"></td> >- <td id="tester_res_overduefinescap"></td> >- <td id="tester_res_cap_fine_to_replacement_price"></td> >- <td id="tester_res_finedays"></td> >- <td id="tester_res_maxsuspensiondays"></td> >- <td id="tester_res_renewalsallowed"></td> >- <td id="tester_res_renewalperiod"></td> >- <td id="tester_res_norenewalbefore"></td> >- <td id="tester_res_auto_renew"></td> >- <td id="tester_res_no_auto_renewal_after"></td> >- <td id="tester_res_no_auto_renewal_after_hard_limit"></td> >- <td id="tester_res_reservesallowed"></td> >- <td id="tester_res_holds_per_record"></td> >- <td id="tester_res_onshelfholds"></td> >- <td id="tester_res_opacitemholds"></td> >- <td id="tester_res_article_requests"></td> >- <td id="tester_res_rentaldiscount"></td> >- </tr> >- </tbody> >- </table> >- <div id="tester_error" class="alert alert-danger"></div> >- </div> >- </div> > > <div id="defaults-for-this-library" class="page-section"> > <h2>Default checkout, hold and return policy[% IF humanbranch %] for [% Branches.GetName( humanbranch ) | html %][% END %]</h2> >@@ -1628,7 +1629,6 @@ > } > > function tester_submit() { >- var url = "/api/v1/issuingrules/effective"; > var query_params = {}; > $.each($("input[name^=tester_input_], select[name^=tester_input_]"), function () { > if ($(this).parent().css("display") === "none") { >@@ -1640,7 +1640,7 @@ > } > }); > $.ajax({ >- url: "/api/v1/issuingrules/effective?"+$.param(query_params), >+ url: "/api/v1/circulation_rules?"+$.param(query_params), > method: "GET", > statusCode: { > 200: function(response) { >-- >2.45.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 19037
:
65497
|
65523
|
65524
|
65525
|
65526
|
168450
|
168451
|
169037
|
169038
|
169039
|
169040