Bugzilla – Attachment 36405 Details for
Bug 5786
Move AllowOnShelfHolds and OpacItemHolds system preferences to the Circulation Matrix
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 5786 [QA Followup]
Bug-5786-QA-Followup.patch (text/plain), 7.68 KB, created by
Benjamin Rokseth
on 2015-03-03 14:02:57 UTC
(
hide
)
Description:
Bug 5786 [QA Followup]
Filename:
MIME Type:
Creator:
Benjamin Rokseth
Created:
2015-03-03 14:02:57 UTC
Size:
7.68 KB
patch
obsolete
>From 846d6de203558ed03be65364f28dd46fcc9c291f Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 19 Dec 2014 06:27:27 -0500 >Subject: [PATCH] Bug 5786 [QA Followup] > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> >--- > C4/Reserves.pm | 2 +- > Koha/Schema/Result/Issuingrule.pm | 21 ++++++++++++++-- > admin/smart-rules.pl | 48 ++++++++++++++++++++++++++----------- > opac/opac-detail.pl | 2 +- > 4 files changed, 55 insertions(+), 18 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 496bfa5..b82387f 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -1545,7 +1545,7 @@ sub IsAvailableForItemLevelRequest { > $notforloan_per_itemtype || > $item->{itemlost} || > $item->{notforloan} > 0 || >- $item->{wthdrawn} || >+ $item->{withdrawn} || > ($item->{damaged} && !C4::Context->preference('AllowHoldsOnDamagedItems')); > > >diff --git a/Koha/Schema/Result/Issuingrule.pm b/Koha/Schema/Result/Issuingrule.pm >index a8cf014..438c23b 100644 >--- a/Koha/Schema/Result/Issuingrule.pm >+++ b/Koha/Schema/Result/Issuingrule.pm >@@ -161,6 +161,19 @@ __PACKAGE__->table("issuingrules"); > is_nullable: 1 > size: [28,6] > >+=head2 onshelfholds >+ >+ data_type: 'tinyint' >+ default_value: 0 >+ is_nullable: 0 >+ >+=head2 opacitemholds >+ >+ data_type: 'char' >+ default_value: 'N' >+ is_nullable: 0 >+ size: 1 >+ > =cut > > __PACKAGE__->add_columns( >@@ -217,6 +230,10 @@ __PACKAGE__->add_columns( > { data_type => "varchar", default_value => "", is_nullable => 0, size => 10 }, > "overduefinescap", > { data_type => "decimal", is_nullable => 1, size => [28, 6] }, >+ "onshelfholds", >+ { data_type => "tinyint", default_value => 0, is_nullable => 0 }, >+ "opacitemholds", >+ { data_type => "char", default_value => "N", is_nullable => 0, size => 1 }, > ); > > =head1 PRIMARY KEY >@@ -236,8 +253,8 @@ __PACKAGE__->add_columns( > __PACKAGE__->set_primary_key("branchcode", "categorycode", "itemtype"); > > >-# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-09-17 21:06:58 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vmlv13CeQ99RO0VsviRABg >+# Created by DBIx::Class::Schema::Loader v0.07040 @ 2014-12-19 07:00:40 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CE8yuYC5QgPHI2GOjiT28w > > > # You can replace this text with custom content, and it will be preserved on regeneration >diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl >index eed932d..34efefb 100755 >--- a/admin/smart-rules.pl >+++ b/admin/smart-rules.pl >@@ -27,6 +27,7 @@ use C4::Koha; > use C4::Debug; > use C4::Branch; # GetBranches > use C4::Dates qw/format_date format_date_in_iso/; >+use Koha::Database; > > my $input = CGI->new; > my $dbh = C4::Context->dbh; >@@ -100,10 +101,6 @@ elsif ($op eq 'delete-branch-item') { > } > # save the values entered > elsif ($op eq 'add') { >- my $sth_search = $dbh->prepare('SELECT COUNT(*) AS total FROM issuingrules WHERE branchcode=? AND categorycode=? AND itemtype=?'); >- my $sth_insert = $dbh->prepare('INSERT INTO issuingrules (branchcode, categorycode, itemtype, maxissueqty, renewalsallowed, reservesallowed, norenewalbefore, auto_renew, reservesallowed, issuelength, lengthunit, hardduedate, hardduedatecompare, fine, finedays, maxsuspensiondays, firstremind, chargeperiod,rentaldiscount, onshelfholds, opacitemholds, overduefinescap) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)'); >- my $sth_update=$dbh->prepare("UPDATE issuingrules SET fine=?, finedays=?, maxsuspensiondays=?, firstremind=?, chargeperiod=?, maxissueqty=?, renewalsallowed=?, renewalperiod=?, norenewalbefore=?, auto_renew=?, reservesallowed=?, issuelength=?, lengthunit=?, hardduedate=?, hardduedatecompare=?, rentaldiscount=?, onshelfholds=?, opacitemholds=?, overduefinescap=? WHERE branchcode=? AND categorycode=? AND itemtype=?"); >- > my $br = $branch; # branch > my $bor = $input->param('categorycode'); # borrower category > my $itemtype = $input->param('itemtype'); # item type >@@ -133,14 +130,37 @@ elsif ($op eq 'add') { > my $overduefinescap = $input->param('overduefinescap') || undef; > $debug and warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty"; > >- $sth_search->execute($br,$bor,$itemtype); >- my $res = $sth_search->fetchrow_hashref(); >- if ($res->{total}) { >- $sth_update->execute($fine, $finedays, $maxsuspensiondays, $firstremind, $chargeperiod, $maxissueqty, $renewalsallowed, $renewalperiod, $norenewalbefore, $auto_renew, $reservesallowed, $issuelength,$lengthunit, $hardduedate,$hardduedatecompare,$rentaldiscount, $onshelfholds, $opacitemholds, $overduefinescap, $br,$bor,$itemtype); >- } else { >- $sth_insert->execute($br,$bor,$itemtype,$maxissueqty,$renewalsallowed, $renewalperiod, $norenewalbefore, $auto_renew, $reservesallowed,$issuelength,$lengthunit,$hardduedate,$hardduedatecompare,$fine,$finedays, $maxsuspensiondays, $firstremind,$chargeperiod,$rentaldiscount,$onshelfholds,$opacitemholds,$overduefinescap); >- } >-} >+ my $schema = Koha::Database->new()->schema(); >+ my $rs = $schema->resultset('Issuingrule'); >+ >+ my $params = { >+ branchcode => $br, >+ categorycode => $bor, >+ itemtype => $itemtype, >+ fine => $fine, >+ finedays => $finedays, >+ maxsuspensiondays => $maxsuspensiondays, >+ firstremind => $firstremind, >+ chargeperiod => $chargeperiod, >+ maxissueqty => $maxissueqty, >+ renewalsallowed => $renewalsallowed, >+ renewalperiod => $renewalperiod, >+ norenewalbefore => $norenewalbefore, >+ auto_renew => $auto_renew, >+ reservesallowed => $reservesallowed, >+ issuelength => $issuelength, >+ lengthunit => $lengthunit, >+ hardduedate => $hardduedate, >+ hardduedatecompare => $hardduedatecompare, >+ rentaldiscount => $rentaldiscount, >+ onshelfholds => $onshelfholds, >+ opacitemholds => $opacitemholds, >+ overduefinescap => $overduefinescap, >+ }; >+ >+ $rs->update_or_create($params); >+ >+} > elsif ($op eq "set-branch-defaults") { > my $categorycode = $input->param('categorycode'); > my $maxissueqty = $input->param('maxissueqty'); >@@ -413,7 +433,7 @@ if ($branch eq "*") { > SELECT default_borrower_circ_rules.*, categories.description AS humancategorycode > FROM default_borrower_circ_rules > JOIN categories USING (categorycode) >- >+ > "); > $sth_branch_cat->execute(); > } else { >@@ -507,7 +527,7 @@ $template->param(categoryloop => \@category_loop, > branchloop => \@branchloop, > humanbranch => ($branch ne '*' ? $branches->{$branch}->{branchname} : ''), > current_branch => $branch, >- definedbranch => scalar(@sorted_row_loop)>0 >+ definedbranch => scalar(@sorted_row_loop)>0 > ); > output_html_with_http_headers $input, $cookie, $template->output; > >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index e0824d8..c5f9a6f 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -635,7 +635,7 @@ if ( not $viewallitems and @items > $max_items_to_display ) { > && !$itemtypes->{$itm->{'itype'}}->{notforloan} > && $itm->{'itemnumber'}; > >- $allow_onshelf_holds = C4::Reserves::OnShelfHoldsAllowed($itm, $borrower) >+ $allow_onshelf_holds = C4::Reserves::OnShelfHoldsAllowed( $itm, $borrower ) > unless $allow_onshelf_holds; > > # get collection code description, too >-- >1.7.10.4
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 5786
:
4706
|
4751
|
4755
|
6898
|
7018
|
7034
|
7044
|
11116
|
11137
|
11184
|
11185
|
11190
|
11903
|
11992
|
12323
|
12440
|
12441
|
15648
|
34080
|
34534
|
34535
|
34536
|
35545
|
35546
|
35547
|
35548
|
35550
|
35567
|
35568
|
35596
|
35597
|
35598
|
35599
|
36383
|
36384
|
36405
|
36617
|
36618
|
36619
|
37253
|
37263
|
37292
|
37373