Bugzilla – Attachment 170032 Details for
Bug 34440
Add warm-up and cool-down periods to bookings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34440: Add lead and trail time to circulation rules
Bug-34440-Add-lead-and-trail-time-to-circulation-r.patch (text/plain), 18.86 KB, created by
Martin Renvoize (ashimema)
on 2024-08-03 06:20:13 UTC
(
hide
)
Description:
Bug 34440: Add lead and trail time to circulation rules
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-08-03 06:20:13 UTC
Size:
18.86 KB
patch
obsolete
>From 0c8211d48267457c307c6a6fd7bf3da796882acd Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 26 Feb 2024 13:50:11 +0000 >Subject: [PATCH] Bug 34440: Add lead and trail time to circulation rules > >--- > Koha/CirculationRules.pm | 6 + > admin/smart-rules.pl | 110 +++++++++++------- > installer/onboarding.pl | 2 + > .../prog/en/modules/admin/smart-rules.tt | 32 ++++- > 4 files changed, 106 insertions(+), 44 deletions(-) > >diff --git a/Koha/CirculationRules.pm b/Koha/CirculationRules.pm >index 1d074768754..d558c1e7810 100644 >--- a/Koha/CirculationRules.pm >+++ b/Koha/CirculationRules.pm >@@ -216,6 +216,12 @@ our $RULE_KINDS = { > holds_pickup_period => { > scope => [ 'branchcode', 'categorycode', 'itemtype' ], > }, >+ bookings_lead_period => { >+ scope => [ 'branchcode', 'itemtype' ], >+ }, >+ bookings_trail_period => { >+ scope => [ 'branchcode', 'itemtype' ], >+ }, > # Not included (deprecated?): > # * accountsent > # * reservecharge >diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl >index efe1b91dfb5..b6a1e4e2587 100755 >--- a/admin/smart-rules.pl >+++ b/admin/smart-rules.pl >@@ -138,11 +138,13 @@ elsif ($op eq 'cud-delete-branch-cat') { > ); > Koha::CirculationRules->set_rules( > { >- branchcode => undef, >- itemtype => undef, >- rules => { >+ branchcode => undef, >+ itemtype => undef, >+ rules => { > holdallowed => undef, > hold_fulfillment_policy => undef, >+ bookings_lead_period => undef, >+ bookings_trail_period => undef, > returnbranch => undef, > } > } >@@ -174,11 +176,13 @@ elsif ($op eq 'cud-delete-branch-cat') { > ); > Koha::CirculationRules->set_rules( > { >- branchcode => $branch, >- itemtype => undef, >- rules => { >+ branchcode => $branch, >+ itemtype => undef, >+ rules => { > holdallowed => undef, > hold_fulfillment_policy => undef, >+ bookings_lead_period => undef, >+ bookings_trail_period => undef, > returnbranch => undef, > } > } >@@ -203,11 +207,13 @@ elsif ($op eq 'cud-delete-branch-item') { > if ($itemtype eq "*") { > Koha::CirculationRules->set_rules( > { >- branchcode => undef, >- itemtype => undef, >- rules => { >+ branchcode => undef, >+ itemtype => undef, >+ rules => { > holdallowed => undef, > hold_fulfillment_policy => undef, >+ bookings_lead_period => undef, >+ bookings_trail_period => undef, > returnbranch => undef, > } > } >@@ -215,11 +221,13 @@ elsif ($op eq 'cud-delete-branch-item') { > } else { > Koha::CirculationRules->set_rules( > { >- branchcode => undef, >- itemtype => $itemtype, >- rules => { >+ branchcode => undef, >+ itemtype => $itemtype, >+ rules => { > holdallowed => undef, > hold_fulfillment_policy => undef, >+ bookings_lead_period => undef, >+ bookings_trail_period => undef, > returnbranch => undef, > } > } >@@ -228,11 +236,13 @@ elsif ($op eq 'cud-delete-branch-item') { > } elsif ($itemtype eq "*") { > Koha::CirculationRules->set_rules( > { >- branchcode => $branch, >- itemtype => undef, >- rules => { >+ branchcode => $branch, >+ itemtype => undef, >+ rules => { > holdallowed => undef, > hold_fulfillment_policy => undef, >+ bookings_lead_period => undef, >+ bookings_trail_period => undef, > returnbranch => undef, > } > } >@@ -240,11 +250,13 @@ elsif ($op eq 'cud-delete-branch-item') { > } else { > Koha::CirculationRules->set_rules( > { >- branchcode => $branch, >- itemtype => $itemtype, >- rules => { >+ branchcode => $branch, >+ itemtype => $itemtype, >+ rules => { > holdallowed => undef, > hold_fulfillment_policy => undef, >+ bookings_lead_period => undef, >+ bookings_trail_period => undef, > returnbranch => undef, > } > } >@@ -357,23 +369,27 @@ elsif ( $op eq 'cud-add' ) { > > } > elsif ($op eq "cud-set-branch-defaults") { >- my $categorycode = $input->param('categorycode'); >- my $patron_maxissueqty = strip_non_numeric( scalar $input->param('patron_maxissueqty') ); >+ my $categorycode = $input->param('categorycode'); >+ my $patron_maxissueqty = strip_non_numeric( scalar $input->param('patron_maxissueqty') ); > my $patron_maxonsiteissueqty = $input->param('patron_maxonsiteissueqty'); > $patron_maxonsiteissueqty = strip_non_numeric($patron_maxonsiteissueqty); >- my $holdallowed = $input->param('holdallowed'); >+ my $holdallowed = $input->param('holdallowed'); > my $hold_fulfillment_policy = $input->param('hold_fulfillment_policy'); >- my $returnbranch = $input->param('returnbranch'); >- my $max_holds = strip_non_numeric( scalar $input->param('max_holds') ); >+ my $bookings_lead_period = $input->param('bookings_lead_period'); >+ my $bookings_trail_period = $input->param('bookings_trail_period'); >+ my $returnbranch = $input->param('returnbranch'); >+ my $max_holds = strip_non_numeric( scalar $input->param('max_holds') ); > > if ($branch eq "*") { > Koha::CirculationRules->set_rules( > { >- itemtype => undef, >- branchcode => undef, >- rules => { >+ itemtype => undef, >+ branchcode => undef, >+ rules => { > holdallowed => $holdallowed, > hold_fulfillment_policy => $hold_fulfillment_policy, >+ bookings_lead_period => $bookings_lead_period, >+ bookings_trail_period => $bookings_trail_period, > returnbranch => $returnbranch, > } > } >@@ -391,11 +407,13 @@ elsif ($op eq "cud-set-branch-defaults") { > } else { > Koha::CirculationRules->set_rules( > { >- itemtype => undef, >- branchcode => $branch, >- rules => { >+ itemtype => undef, >+ branchcode => $branch, >+ rules => { > holdallowed => $holdallowed, > hold_fulfillment_policy => $hold_fulfillment_policy, >+ bookings_lead_period => $bookings_lead_period, >+ bookings_trail_period => $bookings_trail_period, > returnbranch => $returnbranch, > } > } >@@ -584,17 +602,21 @@ elsif ($op eq "cud-add-branch-item") { > my $itemtype = $input->param('itemtype'); > my $holdallowed = $input->param('holdallowed'); > my $hold_fulfillment_policy = $input->param('hold_fulfillment_policy'); >+ my $bookings_lead_period = $input->param('bookings_lead_period'); >+ my $bookings_trail_period = $input->param('bookings_trail_period'); > my $returnbranch = $input->param('returnbranch'); > > if ($branch eq "*") { > if ($itemtype eq "*") { > Koha::CirculationRules->set_rules( > { >- itemtype => undef, >- branchcode => undef, >- rules => { >+ itemtype => undef, >+ branchcode => undef, >+ rules => { > holdallowed => $holdallowed, > hold_fulfillment_policy => $hold_fulfillment_policy, >+ bookings_lead_period => $bookings_lead_period, >+ bookings_trail_period => $bookings_trail_period, > returnbranch => $returnbranch, > } > } >@@ -602,11 +624,13 @@ elsif ($op eq "cud-add-branch-item") { > } else { > Koha::CirculationRules->set_rules( > { >- itemtype => $itemtype, >- branchcode => undef, >- rules => { >+ itemtype => $itemtype, >+ branchcode => undef, >+ rules => { > holdallowed => $holdallowed, > hold_fulfillment_policy => $hold_fulfillment_policy, >+ bookings_lead_period => $bookings_lead_period, >+ bookings_trail_period => $bookings_trail_period, > returnbranch => $returnbranch, > } > } >@@ -615,11 +639,13 @@ elsif ($op eq "cud-add-branch-item") { > } elsif ($itemtype eq "*") { > Koha::CirculationRules->set_rules( > { >- itemtype => undef, >- branchcode => $branch, >- rules => { >+ itemtype => undef, >+ branchcode => $branch, >+ rules => { > holdallowed => $holdallowed, > hold_fulfillment_policy => $hold_fulfillment_policy, >+ bookings_lead_period => $bookings_lead_period, >+ bookings_trail_period => $bookings_trail_period, > returnbranch => $returnbranch, > } > } >@@ -627,11 +653,13 @@ elsif ($op eq "cud-add-branch-item") { > } else { > Koha::CirculationRules->set_rules( > { >- itemtype => $itemtype, >- branchcode => $branch, >- rules => { >+ itemtype => $itemtype, >+ branchcode => $branch, >+ rules => { > holdallowed => $holdallowed, > hold_fulfillment_policy => $hold_fulfillment_policy, >+ bookings_lead_period => $bookings_lead_period, >+ bookings_trail_period => $bookings_trail_period, > returnbranch => $returnbranch, > } > } >diff --git a/installer/onboarding.pl b/installer/onboarding.pl >index d5b8bee0411..38fe3badf5a 100755 >--- a/installer/onboarding.pl >+++ b/installer/onboarding.pl >@@ -288,6 +288,8 @@ if ( $step == 5 ) { > recall_overdue_fine => undef, > recall_shelf_time => undef, > holds_pickup_period => undef, >+ bookings_lead_period => undef, >+ bookings_trail_period => undef, > } > }; > >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 c4943b34072..78ab889b53a 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 >@@ -627,6 +627,8 @@ > <th>Maximum total holds allowed (count)</th> > <th>Hold policy</th> > <th>Hold pickup library match</th> >+ <th>Booking preparation period</th> >+ <th>Booking precaution period</th> > <th>Return policy</th> > <th class="noExport">Actions</th> > </tr> >@@ -635,6 +637,8 @@ > [% SET rule_value = CirculationRules.Search( current_branch, undef , undef, 'max_holds', { want_rule => 1 } ) %] > [% SET holdallowed = CirculationRules.Search( current_branch, undef, undef, 'holdallowed', { want_rule => 1 } ) %] > [% SET hold_fulfillment_policy = CirculationRules.Search( current_branch, undef, undef, 'hold_fulfillment_policy', { want_rule => 1 }) %] >+ [% SET bookings_lead_period = CirculationRules.Search( current_branch, undef, undef, 'bookings_lead_period', { want_rule => 1 }) %] >+ [% SET bookings_trail_period = CirculationRules.Search( current_branch, undef, undef, 'bookings_trail_period', { want_rule => 1 }) %] > [% SET returnbranch = CirculationRules.Search( current_branch, undef, undef, 'returnbranch', { want_rule => 1 }) %] > [% SET default_checkout_hold_and_return_policy = ( patron_maxissueqty || patron_maxonsiteissueqty || rule_value || holdallowed || hold_fulfillment_policy || returnbranch ) %] > <tr> >@@ -753,6 +757,12 @@ > [% END %] > </select> > </td> >+ <td> >+ <input type="text" name="bookings_lead_period" class="bookinglead" size="3" value="[% bookings_lead_period | html %]"> >+ </td> >+ <td> >+ <input type="text" name="bookings_trail_period" class="bookingtrail" size="3" value="[% bookings_trail_period | html %]"> >+ </td> > <td> > <select name="returnbranch"> > >@@ -1269,12 +1279,12 @@ > </div> > > <div id="holds-policy-by-item-type" class="page-section"> >- <h2>[% IF humanbranch %]Holds policy by item type for [% Branches.GetName( humanbranch ) | html %][% ELSE %]Default holds policy by item type[% END %]</h2> >+ <h2>[% IF humanbranch %]Holds and bookings policies by item type for [% Branches.GetName( humanbranch ) | html %][% ELSE %]Default holds and bookings policies by item type[% END %]</h2> > <p> > For this library, you can edit rules for given itemtypes, regardless of the patron's category. > </p> > <p> >- Currently, this means hold policies. The various policies have the following effects: >+ Currently, this means holds and bookings policies. The various policies have the following effects: > </p> > <ul> > <li><strong>From any library:</strong> Patrons from any library may put this item on hold. <cite>(default if none is defined)</cite></li> >@@ -1301,6 +1311,8 @@ > <th>Item type</th> > <th>Hold policy</th> > <th>Hold pickup library match</th> >+ <th>Booking preparation period</th> >+ <th>Booking precaution period</th> > <th>Return policy</th> > <th> </th> > </tr> >@@ -1309,9 +1321,11 @@ > [% SET c = undef %] > [% SET holdallowed = all_rules.$c.$it.holdallowed %] > [% SET hold_fulfillment_policy = all_rules.$c.$it.hold_fulfillment_policy %] >+ [% SET bookings_lead_period = all_rules.$c.$it.bookings_lead_period %] >+ [% SET bookings_trail_period = all_rules.$c.$it.bookings_trail_period %] > [% SET returnbranch = all_rules.$c.$it.returnbranch %] > >- [% IF holdallowed || hold_fulfillment_policy || returnbranch %] >+ [% IF holdallowed || hold_fulfillment_policy || returnbranch || bookings_lead_period || bookings_trail_period %] > <tr> > <td> > [% i.translated_description | html %] >@@ -1340,6 +1354,12 @@ > <span>item's holding library</span> > [% END %] > </td> >+ <td> >+ <span>[% bookings_lead_period | html %]</span> >+ </td> >+ <td> >+ <span>[% bookings_trail_period | html %]</span> >+ </td> > <td> > [% IF returnbranch == 'homebranch' %] > <span>Item returns home</span> >@@ -1396,6 +1416,12 @@ > </option> > </select> > </td> >+ <td> >+ <input type="text" name="bookings_lead_period" class="bookinglead" size="3" value="[% bookings_lead_period | html %]"> >+ </td> >+ <td> >+ <input type="text" name="bookings_trail_period" class="bookingtrail" size="3" value="[% bookings_trail_period | html %]"> >+ </td> > <td> > <select name="returnbranch"> > <option value="homebranch">Item returns home</option> >-- >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 34440
:
167948
|
167949
|
167950
|
167951
|
167952
|
167953
|
167954
|
167955
|
168941
|
168942
|
168943
|
168944
|
168945
|
168946
|
168947
|
168948
|
168949
|
168998
|
168999
|
169000
|
169001
|
169002
|
169003
|
169004
|
169005
|
169006
|
169007
|
169571
|
169572
|
169573
|
169574
|
169575
|
169576
|
169577
|
169578
|
169579
|
169580
|
169581
|
169587
|
169588
|
170032
|
170033
|
170034
|
170035
|
170036
|
170037
|
170038
|
170039
|
170040
|
170041
|
170042
|
170046
|
170047
|
170048
|
170049
|
170050
|
170051
|
170052
|
170053
|
170054
|
170055
|
170056
|
170589
|
170590
|
170591
|
170592
|
170593
|
170594
|
170595
|
170596
|
170597
|
170598
|
170599
|
170600
|
170603
|
170610
|
170951