@@ -, +, @@
rules.
---
admin/smart-rules.pl | 151 ++++++-
.../prog/en/modules/admin/smart-rules.tt | 422 ++++++++++--------
2 files changed, 383 insertions(+), 190 deletions(-)
--- a/admin/smart-rules.pl
+++ a/admin/smart-rules.pl
@@ -75,6 +75,8 @@ $cache->clear_from_cache( Koha::CirculationRules::GUESSED_ITEMTYPES_KEY );
if ($op eq 'delete') {
my $itemtype = $input->param('itemtype');
my $categorycode = $input->param('categorycode');
+ my $checkout_type = $input->param('checkout_type');
+
$debug and warn "deleting $1 $2 $branch";
Koha::CirculationRules->set_rules(
@@ -82,6 +84,7 @@ if ($op eq 'delete') {
categorycode => $categorycode eq '*' ? undef : $categorycode,
branchcode => $branch eq '*' ? undef : $branch,
itemtype => $itemtype eq '*' ? undef : $itemtype,
+ checkout_type => $checkout_type eq '*' ? undef : $checkout_type,
rules => {
maxissueqty => undef,
rentaldiscount => undef,
@@ -125,7 +128,26 @@ elsif ($op eq 'delete-branch-cat') {
categorycode => undef,
rules => {
max_holds => undef,
- patron_maxissueqty => undef,
+ }
+ }
+ );
+ Koha::CirculationRules->set_rules(
+ {
+ branchcode => undef,
+ categorycode => undef,
+ checkout_type => $Koha::Checkouts::type->{checkout},
+ rules => {
+ patron_maxissueqty => undef,
+ }
+ }
+ );
+ Koha::CirculationRules->set_rules(
+ {
+ branchcode => undef,
+ categorycode => undef,
+ checkout_type => $Koha::Checkouts::type->{onsite_checkout},
+ rules => {
+ patron_maxissueqty => undef,
}
}
);
@@ -147,6 +169,25 @@ elsif ($op eq 'delete-branch-cat') {
branchcode => undef,
rules => {
max_holds => undef,
+ }
+ }
+ );
+ Koha::CirculationRules->set_rules(
+ {
+ categorycode => $categorycode,
+ branchcode => undef,
+ checkout_type => $Koha::Checkouts::type->{checkout},
+ rules => {
+ patron_maxissueqty => undef,
+ }
+ }
+ );
+ Koha::CirculationRules->set_rules(
+ {
+ categorycode => $categorycode,
+ branchcode => undef,
+ checkout_type => $Koha::Checkouts::type->{onsite_checkout},
+ rules => {
patron_maxissueqty => undef,
}
}
@@ -157,6 +198,17 @@ elsif ($op eq 'delete-branch-cat') {
{
branchcode => $branch,
categorycode => undef,
+ checkout_type => $Koha::Checkouts::type->{checkout},
+ rules => {
+ patron_maxissueqty => undef,
+ }
+ }
+ );
+ Koha::CirculationRules->set_rules(
+ {
+ branchcode => $branch,
+ categorycode => undef,
+ checkout_type => $Koha::Checkouts::type->{onsite_checkout},
rules => {
patron_maxissueqty => undef,
}
@@ -180,7 +232,26 @@ elsif ($op eq 'delete-branch-cat') {
branchcode => $branch,
rules => {
max_holds => undef,
- patron_maxissueqty => undef,
+ }
+ }
+ );
+ Koha::CirculationRules->set_rules(
+ {
+ categorycode => $categorycode,
+ branchcode => $branch,
+ checkout_type => $Koha::Checkouts::type->{checkout},
+ rules => {
+ patron_maxissueqty => undef,
+ }
+ }
+ );
+ Koha::CirculationRules->set_rules(
+ {
+ categorycode => $categorycode,
+ branchcode => $branch,
+ checkout_type => $Koha::Checkouts::type->{onsite_checkout},
+ rules => {
+ patron_maxissueqty => undef,
}
}
);
@@ -245,6 +316,7 @@ elsif ($op eq 'add') {
my $br = $branch; # branch
my $bor = $input->param('categorycode'); # borrower category
my $itemtype = $input->param('itemtype'); # item type
+ my $checkout_type = $input->param('checkout_type');
my $fine = $input->param('fine');
my $finedays = $input->param('finedays');
my $maxsuspensiondays = $input->param('maxsuspensiondays');
@@ -320,6 +392,7 @@ elsif ($op eq 'add') {
categorycode => $bor eq '*' ? undef : $bor,
itemtype => $itemtype eq '*' ? undef : $itemtype,
branchcode => $br eq '*' ? undef : $br,
+ checkout_type => $checkout_type eq '*' ? undef : $checkout_type,
rules => $rules,
}
);
@@ -328,6 +401,7 @@ elsif ($op eq 'add') {
elsif ($op eq "set-branch-defaults") {
my $categorycode = $input->param('categorycode');
my $patron_maxissueqty = strip_non_numeric($input->param('patron_maxissueqty'));
+ my $patron_maxonsiteissueqty = strip_non_numeric($input->param('patron_maxonsiteissueqty'));
my $holdallowed = $input->param('holdallowed');
my $hold_fulfillment_policy = $input->param('hold_fulfillment_policy');
my $returnbranch = $input->param('returnbranch');
@@ -351,11 +425,22 @@ elsif ($op eq "set-branch-defaults") {
{
categorycode => undef,
branchcode => undef,
+ checkout_type => $Koha::Checkouts::type->{checkout},
rules => {
patron_maxissueqty => $patron_maxissueqty,
}
}
);
+ Koha::CirculationRules->set_rules(
+ {
+ categorycode => undef,
+ branchcode => undef,
+ checkout_type => $Koha::Checkouts::type->{onsite_checkout},
+ rules => {
+ patron_maxissueqty => $patron_maxonsiteissueqty,
+ }
+ }
+ );
} else {
Koha::CirculationRules->set_rules(
{
@@ -372,11 +457,22 @@ elsif ($op eq "set-branch-defaults") {
{
categorycode => undef,
branchcode => $branch,
+ checkout_type => $Koha::Checkouts::type->{checkout},
rules => {
patron_maxissueqty => $patron_maxissueqty,
}
}
);
+ Koha::CirculationRules->set_rules(
+ {
+ categorycode => undef,
+ branchcode => $branch,
+ checkout_type => $Koha::Checkouts::type->{onsite_checkout},
+ rules => {
+ patron_maxissueqty => $patron_maxonsiteissueqty,
+ }
+ }
+ );
}
Koha::CirculationRules->set_rule(
{
@@ -390,6 +486,7 @@ elsif ($op eq "set-branch-defaults") {
elsif ($op eq "add-branch-cat") {
my $categorycode = $input->param('categorycode');
my $patron_maxissueqty = strip_non_numeric($input->param('patron_maxissueqty'));
+ my $patron_maxonsiteissueqty = strip_non_numeric($input->param('patron_maxonsiteissueqty'));
my $max_holds = $input->param('max_holds');
$max_holds =~ s/\s//g;
$max_holds = undef if $max_holds !~ /^\d+/;
@@ -400,46 +497,94 @@ elsif ($op eq "add-branch-cat") {
{
categorycode => undef,
branchcode => undef,
+ checkout_type => $Koha::Checkouts::type->{checkout},
rules => {
max_holds => $max_holds,
patron_maxissueqty => $patron_maxissueqty,
}
}
);
+ Koha::CirculationRules->set_rules(
+ {
+ categorycode => undef,
+ branchcode => undef,
+ checkout_type => $Koha::Checkouts::type->{onsite_checkout},
+ rules => {
+ max_holds => $max_holds,
+ patron_maxissueqty => $patron_maxonsiteissueqty,
+ }
+ }
+ );
} else {
Koha::CirculationRules->set_rules(
{
categorycode => $categorycode,
branchcode => undef,
+ checkout_type => $Koha::Checkouts::type->{checkout},
rules => {
max_holds => $max_holds,
patron_maxissueqty => $patron_maxissueqty,
}
}
);
+ Koha::CirculationRules->set_rules(
+ {
+ categorycode => $categorycode,
+ branchcode => undef,
+ checkout_type => $Koha::Checkouts::type->{onsite_checkout},
+ rules => {
+ max_holds => $max_holds,
+ patron_maxissueqty => $patron_maxonsiteissueqty,
+ }
+ }
+ );
}
} elsif ($categorycode eq "*") {
Koha::CirculationRules->set_rules(
{
categorycode => undef,
branchcode => $branch,
+ checkout_type => $Koha::Checkouts::type->{checkout},
rules => {
max_holds => $max_holds,
patron_maxissueqty => $patron_maxissueqty,
}
}
);
+ Koha::CirculationRules->set_rules(
+ {
+ categorycode => undef,
+ branchcode => $branch,
+ checkout_type => $Koha::Checkouts::type->{onsite_checkout},
+ rules => {
+ max_holds => $max_holds,
+ patron_maxissueqty => $patron_maxonsiteissueqty,
+ }
+ }
+ );
} else {
Koha::CirculationRules->set_rules(
{
categorycode => $categorycode,
branchcode => $branch,
+ checkout_type => $Koha::Checkouts::type->{checkout},
rules => {
max_holds => $max_holds,
patron_maxissueqty => $patron_maxissueqty,
}
}
);
+ Koha::CirculationRules->set_rules(
+ {
+ categorycode => $categorycode,
+ branchcode => $branch,
+ checkout_type => $Koha::Checkouts::type->{onsite_checkout},
+ rules => {
+ max_holds => $max_holds,
+ patron_maxissueqty => $patron_maxonsiteissueqty,
+ }
+ }
+ );
}
}
elsif ($op eq "add-branch-item") {
@@ -549,7 +694,7 @@ my $definedbranch = $all_rules->count ? 1 : 0;
my $rules = {};
while ( my $r = $all_rules->next ) {
$r = $r->unblessed;
- $rules->{ $r->{categorycode} }->{ $r->{itemtype} }->{ $r->{rule_name} } = $r->{rule_value};
+ $rules->{ $r->{categorycode} }->{ $r->{itemtype} }->{ $r->{checkout_type} }->{ $r->{rule_name} } = $r->{rule_value};
}
$template->param(show_branch_cat_rule_form => 1);
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt
@@ -5,6 +5,7 @@
[% USE Branches %]
[% USE Categories %]
[% USE ItemTypes %]
+[% USE Checkouts %]
[% USE CirculationRules %]
[% SET footerjs = 1 %]
@@ -22,6 +23,12 @@
[% END %]
[% itemtypes.push(undef) %]
+[% SET checkout_types = [] %]
+[% FOREACH ct IN Checkouts.type %]
+ [% checkout_types.push( ct.value ) %]
+[% END %]
+[% checkout_types.push(undef) %]
+
[% INCLUDE 'doc-head-open.inc' %]
Koha › Administration › Circulation and fine rules
[% INCLUDE 'doc-head-close.inc' %]
@@ -88,6 +95,7 @@
Patron category
Item type
+ Checkout type
Actions
Note
Current checkouts allowed
@@ -125,178 +133,191 @@
[% SET c = '' UNLESS c.defined %]
[% FOREACH i IN itemtypes %]
[% SET i = '' UNLESS i.defined %]
- [% SET note = all_rules.$c.$i.note %]
- [% SET maxissueqty = all_rules.$c.$i.maxissueqty %]
- [% SET issuelength = all_rules.$c.$i.issuelength %]
- [% SET lengthunit = all_rules.$c.$i.lengthunit %]
- [% SET hardduedate = all_rules.$c.$i.hardduedate %]
- [% SET hardduedatecompare = all_rules.$c.$i.hardduedatecompare %]
- [% SET fine = all_rules.$c.$i.fine %]
- [% SET chargeperiod = all_rules.$c.$i.chargeperiod %]
- [% SET chargeperiod_charge_at = all_rules.$c.$i.chargeperiod_charge_at %]
- [% SET firstremind = all_rules.$c.$i.firstremind %]
- [% SET overduefinescap = all_rules.$c.$i.overduefinescap %]
- [% SET cap_fine_to_replacement_price = all_rules.$c.$i.cap_fine_to_replacement_price %]
- [% SET finedays = all_rules.$c.$i.finedays %]
- [% SET maxsuspensiondays = all_rules.$c.$i.maxsuspensiondays %]
- [% SET suspension_chargeperiod = all_rules.$c.$i.suspension_chargeperiod %]
- [% SET renewalsallowed = all_rules.$c.$i.renewalsallowed %]
- [% SET renewalperiod = all_rules.$c.$i.renewalperiod %]
- [% SET norenewalbefore = all_rules.$c.$i.norenewalbefore %]
- [% SET auto_renew = all_rules.$c.$i.auto_renew %]
- [% SET no_auto_renewal_after = all_rules.$c.$i.no_auto_renewal_after %]
- [% SET no_auto_renewal_after_hard_limit = all_rules.$c.$i.no_auto_renewal_after_hard_limit %]
- [% SET reservesallowed = all_rules.$c.$i.reservesallowed %]
- [% SET holds_per_day = all_rules.$c.$i.holds_per_day %]
- [% SET holds_per_record = all_rules.$c.$i.holds_per_record %]
- [% SET onshelfholds = all_rules.$c.$i.onshelfholds %]
- [% SET opacitemholds = all_rules.$c.$i.opacitemholds %]
- [% SET article_requests = all_rules.$c.$i.article_requests %]
- [% SET rentaldiscount = all_rules.$c.$i.rentaldiscount %]
-
- [% SET show_rule = maxissueqty || issuelength || lengthunit || hardduedate || hardduedatebefore || hardduedateexact || fine || chargeperiod || chargeperiod_charge_at || firstremind || overduefinescap || cap_fine_to_replacement_price || finedays || maxsuspensiondays || suspension_chargeperiod || renewalsallowed || renewalsallowed || norenewalbefore || auto_renew || no_auto_renewal_after || no_auto_renewal_after_hard_limit || reservesallowed || holds_per_day || holds_per_record || onshelfholds || opacitemholds || article_requests || article_requests %]
- [% IF show_rule %]
- [% SET row_count = row_count + 1 %]
-
-
- [% IF c == undef %]
- All
- [% ELSE %]
- [% Categories.GetName(c) | html %]
- [% END %]
-
-
- [% IF i == undef %]
- All
- [% ELSE %]
- [% ItemTypes.GetDescription(i) | html %]
- [% END %]
-
-
- Edit
- Delete
-
-
- [% IF note.defined && note != '' %]
- View note
- [% ELSE %] [% END %]
-
-
- [% IF maxissueqty.defined && maxissueqty != '' %]
- [% maxissueqty | html %]
- [% ELSE %]
- Unlimited
- [% END %]
-
- [% issuelength | html %]
-
- [% IF ( lengthunit == 'days' ) %]
- Days
- [% ELSIF ( lengthunit == 'hours') %]
- Hours
- [% ELSE %]
- Undefined
- [% END %]
-
-
- [% IF ( hardduedate ) %]
- [% IF ( hardduedatecompare == '-1' ) %]
- before [% hardduedate | $KohaDates %]
-
- [% ELSIF ( hardduedatecompare == '0' ) %]
- on [% hardduedate | $KohaDates %]
-
- [% ELSIF ( hardduedatecompare == '1' ) %]
- after [% hardduedate | $KohaDates %]
-
- [% END %]
- [% ELSE %]
- None defined
- [% END %]
-
- [% fine | html %]
- [% chargeperiod | html %]
- [% IF chargeperiod_charge_at %]Start of interval[% ELSE %]End of interval[% END %]
- [% firstremind | html %]
- [% overduefinescap FILTER format("%.2f") %]
-
- [% IF cap_fine_to_replacement_price %]
-
- [% ELSE %]
-
- [% END %]
-
- [% finedays | html %]
- [% maxsuspensiondays | html %]
- [% suspension_chargeperiod | html %]
- [% renewalsallowed | html %]
- [% renewalperiod | html %]
- [% norenewalbefore | html %]
-
- [% IF auto_renew %]
- Yes
- [% ELSE %]
- No
- [% END %]
-
- [% no_auto_renewal_after | html %]
- [% no_auto_renewal_after_hard_limit | $KohaDates %]
-
- [% IF reservesallowed.defined && reservesallowed != '' %]
- [% reservesallowed | html %]
- [% ELSE %]
- Unlimited
- [% END %]
-
-
- [% IF holds_per_day.defined && holds_per_day != '' %]
- [% holds_per_day | html %]
- [% ELSE %]
- Unlimited
- [% END %]
-
-
- [% IF holds_per_record.defined && holds_per_record != '' %]
- [% holds_per_record | html %]
- [% ELSE %]
- Unlimited
- [% END %]
-
-
- [% IF onshelfholds == 1 %]
- Yes
- [% ELSIF onshelfholds == 2 %]
- If all unavailable
- [% ELSE %]
- If any unavailable
- [% END %]
-
-
- [% IF opacitemholds == 'F'%]
- Force
- [% ELSIF opacitemholds == 'Y'%]
- Allow
- [% ELSE %]
- Don't allow
- [% END %]
-
-
- [% IF article_requests == 'no' %]
- No
- [% ELSIF article_requests == 'yes' %]
- Yes
- [% ELSIF article_requests == 'bib_only' %]
- Record only
- [% ELSIF article_requests == 'item_only' %]
- Item only
- [% END %]
-
- [% rentaldiscount | html %]
-
- Edit
- Delete
-
-
+ [% FOREACH ct IN checkout_types %]
+ [% SET ct = '' UNLESS ct.defined %]
+ [% SET note = all_rules.$c.$i.$ct.note %]
+ [% SET maxissueqty = all_rules.$c.$i.$ct.maxissueqty %]
+ [% SET issuelength = all_rules.$c.$i.$ct.issuelength %]
+ [% SET lengthunit = all_rules.$c.$i.$ct.lengthunit %]
+ [% SET hardduedate = all_rules.$c.$i.$ct.hardduedate %]
+ [% SET hardduedatecompare = all_rules.$c.$i.$ct.hardduedatecompare %]
+ [% SET fine = all_rules.$c.$i.$ct.fine %]
+ [% SET chargeperiod = all_rules.$c.$i.$ct.chargeperiod %]
+ [% SET chargeperiod_charge_at = all_rules.$c.$i.$ct.chargeperiod_charge_at %]
+ [% SET firstremind = all_rules.$c.$i.$ct.firstremind %]
+ [% SET overduefinescap = all_rules.$c.$i.$ct.overduefinescap %]
+ [% SET cap_fine_to_replacement_price = all_rules.$c.$i.$ct.cap_fine_to_replacement_price %]
+ [% SET finedays = all_rules.$c.$i.$ct.finedays %]
+ [% SET maxsuspensiondays = all_rules.$c.$i.$ct.maxsuspensiondays %]
+ [% SET suspension_chargeperiod = all_rules.$c.$i.$ct.suspension_chargeperiod %]
+ [% SET renewalsallowed = all_rules.$c.$i.$ct.renewalsallowed %]
+ [% SET renewalperiod = all_rules.$c.$i.$ct.renewalperiod %]
+ [% SET norenewalbefore = all_rules.$c.$i.$ct.norenewalbefore %]
+ [% SET auto_renew = all_rules.$c.$i.$ct.auto_renew %]
+ [% SET no_auto_renewal_after = all_rules.$c.$i.$ct.no_auto_renewal_after %]
+ [% SET no_auto_renewal_after_hard_limit = all_rules.$c.$i.$ct.no_auto_renewal_after_hard_limit %]
+ [% SET reservesallowed = all_rules.$c.$i.$ct.reservesallowed %]
+ [% SET holds_per_day = all_rules.$c.$i.$ct.holds_per_day %]
+ [% SET holds_per_record = all_rules.$c.$i.$ct.holds_per_record %]
+ [% SET onshelfholds = all_rules.$c.$i.$ct.onshelfholds %]
+ [% SET opacitemholds = all_rules.$c.$i.$ct.opacitemholds %]
+ [% SET article_requests = all_rules.$c.$i.$ct.article_requests %]
+ [% SET rentaldiscount = all_rules.$c.$i.$ct.rentaldiscount %]
+ [% SET show_rule = maxissueqty || issuelength || lengthunit || hardduedate || hardduedatebefore || hardduedateexact || fine || chargeperiod || chargeperiod_charge_at || firstremind || overduefinescap || cap_fine_to_replacement_price || finedays || maxsuspensiondays || suspension_chargeperiod || renewalsallowed || renewalsallowed || norenewalbefore || auto_renew || no_auto_renewal_after || no_auto_renewal_after_hard_limit || reservesallowed || holds_per_day || holds_per_record || onshelfholds || opacitemholds || article_requests || article_requests %]
+ [% IF show_rule %]
+ [% SET row_count = row_count + 1 %]
+
+
+ [% IF c == undef %]
+ All
+ [% ELSE %]
+ [% Categories.GetName(c) | html %]
+ [% END %]
+
+
+ [% IF i == undef %]
+ All
+ [% ELSE %]
+ [% ItemTypes.GetDescription(i) | html %]
+ [% END %]
+
+
+ [% IF ct == undef %]
+ All
+ [% ELSE %]
+ [% IF ct == 'CHECKOUT' %]
+ Normal checkout
+ [% ELSIF ct == 'ONSITE' %]
+ On-site checkout
+ [% END %]
+ [% END %]
+
+
+ Edit
+ Delete
+
+
+ [% IF note.defined && note != '' %]
+ View note
+ [% ELSE %] [% END %]
+
+
+ [% IF maxissueqty.defined && maxissueqty != '' %]
+ [% maxissueqty | html %]
+ [% ELSE %]
+ Unlimited
+ [% END %]
+
+ [% issuelength | html %]
+
+ [% IF ( lengthunit == 'days' ) %]
+ Days
+ [% ELSIF ( lengthunit == 'hours') %]
+ Hours
+ [% ELSE %]
+ Undefined
+ [% END %]
+
+
+ [% IF ( hardduedate ) %]
+ [% IF ( hardduedatecompare == '-1' ) %]
+ before [% hardduedate | $KohaDates %]
+
+ [% ELSIF ( hardduedatecompare == '0' ) %]
+ on [% hardduedate | $KohaDates %]
+
+ [% ELSIF ( hardduedatecompare == '1' ) %]
+ after [% hardduedate | $KohaDates %]
+
+ [% END %]
+ [% ELSE %]
+ None defined
+ [% END %]
+
+ [% fine | html %]
+ [% chargeperiod | html %]
+ [% IF chargeperiod_charge_at %]Start of interval[% ELSE %]End of interval[% END %]
+ [% firstremind | html %]
+ [% overduefinescap FILTER format("%.2f") %]
+
+ [% IF cap_fine_to_replacement_price %]
+
+ [% ELSE %]
+
+ [% END %]
+
+ [% finedays | html %]
+ [% maxsuspensiondays | html %]
+ [% suspension_chargeperiod | html %]
+ [% renewalsallowed | html %]
+ [% renewalperiod | html %]
+ [% norenewalbefore | html %]
+
+ [% IF auto_renew %]
+ Yes
+ [% ELSE %]
+ No
+ [% END %]
+
+ [% no_auto_renewal_after | html %]
+ [% no_auto_renewal_after_hard_limit | $KohaDates %]
+
+ [% IF reservesallowed.defined && reservesallowed != '' %]
+ [% reservesallowed | html %]
+ [% ELSE %]
+ Unlimited
+ [% END %]
+
+
+ [% IF holds_per_day.defined && holds_per_day != '' %]
+ [% holds_per_day | html %]
+ [% ELSE %]
+ Unlimited
+ [% END %]
+
+
+ [% IF holds_per_record.defined && holds_per_record != '' %]
+ [% holds_per_record | html %]
+ [% ELSE %]
+ Unlimited
+ [% END %]
+
+
+ [% IF onshelfholds == 1 %]
+ Yes
+ [% ELSIF onshelfholds == 2 %]
+ If all unavailable
+ [% ELSE %]
+ If any unavailable
+ [% END %]
+
+
+ [% IF opacitemholds == 'F'%]
+ Force
+ [% ELSIF opacitemholds == 'Y'%]
+ Allow
+ [% ELSE %]
+ Don't allow
+ [% END %]
+
+
+ [% IF article_requests == 'no' %]
+ No
+ [% ELSIF article_requests == 'yes' %]
+ Yes
+ [% ELSIF article_requests == 'bib_only' %]
+ Record only
+ [% ELSIF article_requests == 'item_only' %]
+ Item only
+ [% END %]
+
+ [% rentaldiscount | html %]
+
+ Edit
+ Delete
+
+
+ [% END %]
[% END %]
[% END %]
[% END %]
@@ -317,6 +338,13 @@
[% END %]
+
+
+ All
+ Normal checkout
+ On-site checkout
+
+
Save
@@ -404,6 +432,7 @@
Patron category
Item type
+ Checkout type
Note
Current checkouts allowed
@@ -449,6 +478,7 @@
Total current checkouts allowed
+ Total current on-site checkouts allowed
Maximum total holds allowed (count)
Hold policy
Hold pickup library match
@@ -458,16 +488,20 @@
Defaults
- [% SET patron_maxissueqty = CirculationRules.Search( current_branch, undef, undef, 'patron_maxissueqty' ) %]
+ [% SET patron_maxissueqty = CirculationRules.Search( current_branch, undef, undef, Checkouts.type.checkout, 'patron_maxissueqty' ) %]
- [% SET rule_value = CirculationRules.Search( current_branch, undef , undef, 'max_holds' ) %]
+ [% SET patron_maxissueqty = CirculationRules.Search( current_branch, undef, undef, Checkouts.type.onsite_checkout, 'patron_maxissueqty' ) %]
+
+
+
+ [% SET rule_value = CirculationRules.Search( current_branch, undef , undef, undef, 'max_holds' ) %]
- [% SET holdallowed = CirculationRules.Search( current_branch, undef, undef, 'holdallowed' ) %]
+ [% SET holdallowed = CirculationRules.Search( current_branch, undef, undef, undef, 'holdallowed' ) %]
Not set
@@ -507,7 +541,7 @@
- [% SET hold_fulfillment_policy = CirculationRules.Search( current_branch, undef, undef, 'hold_fulfillment_policy' ) %]
+ [% SET hold_fulfillment_policy = CirculationRules.Search( current_branch, undef, undef, undef, 'hold_fulfillment_policy' ) %]
Not set
@@ -566,7 +600,7 @@
- [% SET returnbranch = CirculationRules.Search( current_branch, undef, undef, 'returnbranch' ) %]
+ [% SET returnbranch = CirculationRules.Search( current_branch, undef, undef, undef, 'returnbranch' ) %]
Not set
@@ -619,13 +653,15 @@
Patron category
Total current checkouts allowed
+ Total current on-site checkouts allowed
Total holds allowed
[% FOREACH c IN categorycodes %]
[% NEXT UNLESS c %]
- [% SET patron_maxissueqty = CirculationRules.Search( branchcode, c, undef, 'patron_maxissueqty' ) %]
- [% SET max_holds = CirculationRules.Search( branchcode, c, undef, 'max_holds' ) %]
+ [% SET patron_maxissueqty = CirculationRules.Search( branchcode, c, undef, Checkouts.type.checkout, 'patron_maxissueqty' ) %]
+ [% SET patron_maxonsiteissueqty = CirculationRules.Search( branchcode, c, undef, Checkouts.type.onsite_checkout, 'patron_maxissueqty' ) %]
+ [% SET max_holds = CirculationRules.Search( branchcode, c, undef, undef, 'max_holds' ) %]
[% IF ( patron_maxissueqty.defined && patron_maxissueqty != '' ) || ( max_holds.defined && max_holds != '' ) %]
@@ -643,6 +679,13 @@
Unlimited
[% END %]
+
+ [% IF patron_maxonsiteissueqty.defined && patron_maxonsiteissueqty != '' %]
+ [% patron_maxonsiteissueqty | html %]
+ [% ELSE %]
+ Unlimited
+ [% END %]
+
[% IF max_holds.defined && max_holds != '' %]
[% max_holds | html %]
@@ -666,6 +709,7 @@
+
Add
@@ -785,9 +829,9 @@
[% FOREACH i IN itemtypeloop %]
- [% SET holdallowed = CirculationRules.Search( branchcode, undef, i.itemtype, 'holdallowed' ) %]
- [% SET hold_fulfillment_policy = CirculationRules.Search( branchcode, undef, i.itemtype, 'hold_fulfillment_policy' ) %]
- [% SET returnbranch = CirculationRules.Search( branchcode, undef, i.itemtype, 'returnbranch' ) %]
+ [% SET holdallowed = CirculationRules.Search( branchcode, undef, i.itemtype, undef, 'holdallowed' ) %]
+ [% SET hold_fulfillment_policy = CirculationRules.Search( branchcode, undef, i.itemtype, undef, 'hold_fulfillment_policy' ) %]
+ [% SET returnbranch = CirculationRules.Search( branchcode, undef, i.itemtype, undef, 'returnbranch' ) %]
[% IF holdallowed || hold_fulfillment_policy || returnbranch %]
@@ -958,11 +1002,11 @@
itm = $(this).text();
itm = itm.replace(/^\s*|\s*$/g,'');
var current_column = $("#edit_row td:eq("+i+")");
- if ( i == 3 ) {
+ if ( i == 4 ) {
// specific processing for the Note column
var note = $(this).find("a[name='viewnote']").data("content");
$(current_column).find("input[type='text']").val(note);
- } else if ( i == 7 ) {
+ } else if ( i == 8 ) {
// specific processing for the Hard due date column
var select_value = $(this).find("input[type='hidden'][name='hardduedatecomparebackup']").val();
var input_value = '';
@@ -973,7 +1017,7 @@
}
$(current_column).find("input[type='text']").val(input_value);
$(current_column).find("select").val(select_value);
- } else if ( i == 13 ) {
+ } else if ( i == 14 ) {
// specific processing for cap_fine_to_replacement_price
var cap_fine_to_replacement_price = $(this).find("input[type='checkbox']");
$('#cap_fine_to_replacement_price').prop('checked', cap_fine_to_replacement_price.is(':checked') );
@@ -988,17 +1032,20 @@
$(this).attr('selected', 'selected');
}
});
- if ( i == 0 || i == 1 ) {
+ if ( i == 0 || i == 1 || i == 2 ) {
// Disable the 2 first columns, we cannot update them.
var val = $(current_column).find("select option:selected").val();
var name = "categorycode";
if ( i == 1 ) {
name="itemtype";
}
+ if ( i == 2 ) {
+ name="checkout_type";
+ }
// Remove potential previous input added
$(current_column).find("input").remove();
$(current_column).append(" ");
- } else if ( i == 4 || i == 23 || i == 24 || i == 25 ) {
+ } else if ( i == 5 || i == 24 || i == 25 || i == 26 ) {
// If the value is not an integer for
// - "Current checkouts allowed"
// - "Holds allowed (total)"
@@ -1014,6 +1061,7 @@
});
$("#default-circulation-rules tr:last td:eq(0) select").prop('disabled', true);
$("#default-circulation-rules tr:last td:eq(1) select").prop('disabled', true);
+ $("#default-circulation-rules tr:last td:eq(2) select").prop('disabled', true);
return false;
});
$(".clear_edit").on("click",function(e){
--