From d900cde882508116207317963d49418a5763e5a8 Mon Sep 17 00:00:00 2001 From: Srdjan Jankovic Date: Wed, 27 Jul 2011 17:56:20 +1200 Subject: [PATCH 1/1] bug_5786: moved AllowOnShelfHolds to circ matrix (issuingrules) --- C4/Circulation.pm | 3 +- C4/Items.pm | 2 + C4/Reserves.pm | 73 ++++++++++++++++--- C4/VirtualShelves/Page.pm | 1 - admin/smart-rules.pl | 9 ++- admin/systempreferences.pl | 1 - installer/data/mysql/de-DE/mandatory/sysprefs.sql | 1 - installer/data/mysql/en/mandatory/sysprefs.sql | 1 - .../1-Obligatoire/unimarc_standard_systemprefs.sql | 1 - installer/data/mysql/it-IT/necessari/sysprefs.sql | 1 - .../data/mysql/nb-NO/1-Obligatorisk/sysprefs.sql | 1 - installer/data/mysql/pl-PL/mandatory/sysprefs.sql | 1 - ...m_preferences_full_optimal_for_install_only.sql | 1 - ...m_preferences_full_optimal_for_install_only.sql | 1 - installer/data/mysql/updatedatabase.pl | 16 ++++ installer/html-template-to-template-toolkit.pl | 2 +- .../en/modules/admin/preferences/circulation.pref | 6 -- .../prog/en/modules/admin/preferences/opac.pref | 6 -- .../prog/en/modules/admin/smart-rules.tt | 25 +++++-- .../prog/en/modules/help/reserve/request.tt | 4 +- .../opac-tmpl/prog/en/modules/opac-ISBDdetail.tt | 6 -- .../opac-tmpl/prog/en/modules/opac-MARCdetail.tt | 6 -- koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 12 +--- .../prog/en/modules/opac-results-grouped.tt | 6 -- .../opac-tmpl/prog/en/modules/opac-results.tt | 8 +-- .../opac-tmpl/prog/en/modules/opac-shelves.tt | 6 -- opac/opac-ISBDdetail.pl | 2 - opac/opac-MARCdetail.pl | 1 - opac/opac-detail.pl | 1 - opac/opac-reserve.pl | 2 +- opac/opac-search.pl | 2 +- 31 files changed, 112 insertions(+), 96 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 179fe70..637f551 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -2167,7 +2167,8 @@ sub CanBookBeRenewed { LEFT JOIN biblioitems USING (biblioitemnumber) WHERE - (issuingrules.categorycode = borrowers.categorycode OR issuingrules.categorycode = '*') + (issuingrules.categorycode = borrowers.categorycode + OR issuingrules.categorycode = '*') AND (issuingrules.itemtype = $itype OR issuingrules.itemtype = '*') AND diff --git a/C4/Items.pm b/C4/Items.pm index 9342564..9ba46d3 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -156,6 +156,8 @@ sub GetItem { ($data->{'serialseq'} , $data->{'publisheddate'}) = $ssth->fetchrow_array(); } #if we don't have an items.itype, use biblioitems.itemtype. + # FIXME this should respect the itypes systempreference + # if (C4::Context->preference('item-level_itypes')) { if( ! $data->{'itype'} ) { my $sth = $dbh->prepare("SELECT itemtype FROM biblioitems WHERE biblionumber = ?"); $sth->execute($data->{'biblionumber'}); diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 8373840..9a8e608 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -3,6 +3,7 @@ package C4::Reserves; # Copyright 2000-2002 Katipo Communications # 2006 SAN Ouest Provence # 2007-2010 BibLibre Paul POULAIN +# 2011 Catalyst IT # # This file is part of Koha. # @@ -471,7 +472,6 @@ sub CanItemBeReserved{ if(my $rowcount = $sthcount->fetchrow_hashref()){ $reservecount = $rowcount->{count}; } - # we check if it's ok or not if( $reservecount < $allowedreserves ){ return 1; @@ -1299,7 +1299,7 @@ sub GetReserveInfo { =head2 IsAvailableForItemLevelRequest - my $is_available = IsAvailableForItemLevelRequest($itemnumber); + my $is_available = IsAvailableForItemLevelRequest($itemnumber,$borrowernumber,$branchcode); Checks whether a given item record is available for an item-level hold request. An item is available if @@ -1309,12 +1309,8 @@ item-level hold request. An item is available if * it is not withdrawn AND * does not have a not for loan value > 0 -Whether or not the item is currently on loan is -also checked - if the AllowOnShelfHolds system preference -is ON, an item can be requested even if it is currently -on loan to somebody else. If the system preference -is OFF, an item that is currently checked out cannot -be the target of an item-level hold request. +Need to check the issuingrules onshelfholds column, +if this is set items on the shelf can be placed on hold Note that IsAvailableForItemLevelRequest() does not check if the staff operator is authorized to place @@ -1326,9 +1322,9 @@ and canreservefromotherbranches. sub IsAvailableForItemLevelRequest { my $itemnumber = shift; - + my $borrowernumber = shift; + my $branchcode = shift; my $item = GetItem($itemnumber); - # must check the notforloan setting of the itemtype # FIXME - a lot of places in the code do this # or something similar - need to be @@ -1361,14 +1357,67 @@ sub IsAvailableForItemLevelRequest { $item->{wthdrawn} or $notforloan_per_itemtype; - - if (C4::Context->preference('AllowOnShelfHolds')) { + # check issuingrules + + if (OnShelfHoldsAllowed($itemnumber,$borrowernumber,$branchcode)) { return $available_per_item; } else { return ($available_per_item and ($item->{onloan} or GetReserveStatus($itemnumber) eq "W")); } } +=head2 OnShelfHoldsAllowed + + OnShelfHoldsAllowed($itemnumber,$borrowernumber,$branchcode); + +Checks issuingrules, using the borrowers categorycode, the itemtype, and branchcode to see if onshelf +holds are allowed, returns true if so. + +=cut + +sub OnShelfHoldsAllowed { + my ($itemnumber,$borrowernumber,$branchcode) = @_; + my $item = GetItem($itemnumber); + my $borrower = C4::Members::GetMember(borrowernumber => $borrowernumber); + my $itype; + my $dbh = C4::Context->dbh; + if (C4::Context->preference('item-level_itypes')) { + # We cant trust GetItem to honour the syspref, so safest to do it ourselves + # When GetItem is fixed, we can remove this + $itype = $item->{itype}; + } + else { + my $query = "SELECT itemtype FROM biblioitems WHERE biblioitemnumber = ? "; + my $sth = $dbh->prepare($query); + $sth->execute($item->{biblioitemnumber}); + if (my $data = $sth->fetchrow_hashref()){ + $itype = $data->{itemtype}; + } + } + + my $query = "SELECT onshelfholds,categorycode,itemtype,branchcode FROM issuingrules WHERE + (issuingrules.categorycode = ? OR issuingrules.categorycode = '*') + AND + (issuingrules.itemtype = ? OR issuingrules.itemtype = '*') + AND + (issuingrules.branchcode = ? OR issuingrules.branchcode = '*') + ORDER BY + issuingrules.categorycode desc, + issuingrules.itemtype desc, + issuingrules.branchcode desc + LIMIT 1"; + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare($query); + $sth->execute($borrower->{categorycode},$itype,$branchcode); + my $data = $sth->fetchrow_hashref; + if ($data->{onshelfholds}){ + return 1; + } + else { + return 0; + } +} + =head2 AlterPriority AlterPriority( $where, $borrowernumber, $biblionumber, $reservedate ); diff --git a/C4/VirtualShelves/Page.pm b/C4/VirtualShelves/Page.pm index 9e5ec3a..022eb98 100644 --- a/C4/VirtualShelves/Page.pm +++ b/C4/VirtualShelves/Page.pm @@ -183,7 +183,6 @@ sub shelfpage ($$$$$) { # explicitly fetch this shelf my ($shelfnumber2,$shelfname,$owner,$category,$sorton) = GetShelf($shelfnumber); - $template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds') ); if (C4::Context->preference('TagsEnabled')) { $template->param(TagsEnabled => 1); foreach (qw(TagsShowOnList TagsInputOnList)) { diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl index f290934..5bfdc7d 100755 --- a/admin/smart-rules.pl +++ b/admin/smart-rules.pl @@ -101,8 +101,8 @@ 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, issuelength, hardduedate, hardduedatecompare, fine, finedays, firstremind, chargeperiod,rentaldiscount) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); - my $sth_update=$dbh->prepare("UPDATE issuingrules SET fine=?, finedays=?, firstremind=?, chargeperiod=?, maxissueqty=?, renewalsallowed=?, reservesallowed=?, issuelength=?, hardduedate=?, hardduedatecompare=?, rentaldiscount=? WHERE branchcode=? AND categorycode=? AND itemtype=?"); + my $sth_insert = $dbh->prepare("INSERT INTO issuingrules (branchcode, categorycode, itemtype, maxissueqty, renewalsallowed, reservesallowed, issuelength, hardduedate, hardduedatecompare, fine, finedays, firstremind, chargeperiod, rentaldiscount, onshelfholds) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); + my $sth_update=$dbh->prepare("UPDATE issuingrules SET fine=?, finedays=?, firstremind=?, chargeperiod=?, maxissueqty=?, renewalsallowed=?, reservesallowed=?, issuelength=?, hardduedate=?, hardduedatecompare=?, rentaldiscount=?, onshelfholds=? WHERE branchcode=? AND categorycode=? AND itemtype=?"); my $br = $branch; # branch my $bor = $input->param('categorycode'); # borrower category @@ -114,6 +114,7 @@ elsif ($op eq 'add') { my $maxissueqty = $input->param('maxissueqty'); my $renewalsallowed = $input->param('renewalsallowed'); my $reservesallowed = $input->param('reservesallowed'); + my $onshelfholds = $input->param('onshelfholds'); $maxissueqty =~ s/\s//g; $maxissueqty = undef if $maxissueqty !~ /^\d+/; my $issuelength = $input->param('issuelength'); @@ -126,9 +127,9 @@ elsif ($op eq 'add') { $sth_search->execute($br,$bor,$cat); my $res = $sth_search->fetchrow_hashref(); if ($res->{total}) { - $sth_update->execute($fine, $finedays,$firstremind, $chargeperiod, $maxissueqty, $renewalsallowed,$reservesallowed, $issuelength,$hardduedate,$hardduedatecompare,$rentaldiscount, $br,$bor,$cat); + $sth_update->execute($fine, $finedays,$firstremind, $chargeperiod, $maxissueqty, $renewalsallowed,$reservesallowed, $issuelength,$hardduedate,$hardduedatecompare,$rentaldiscount, $onshelfholds, $br,$bor,$cat); } else { - $sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed,$reservesallowed,$issuelength,$hardduedate,$hardduedatecompare,$fine,$finedays,$firstremind,$chargeperiod,$rentaldiscount); + $sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed,$reservesallowed,$issuelength,$hardduedate,$hardduedatecompare,$fine,$finedays,$firstremind,$chargeperiod,$rentaldiscount,$onshelfholds); } } elsif ($op eq "set-branch-defaults") { diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index 87ecac4..d285a5b 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -185,7 +185,6 @@ $tabsysprefs{HomeOrHoldingBranch} = "Circulation"; $tabsysprefs{HomeOrHoldingBranchReturn} = "Circulation"; $tabsysprefs{RandomizeHoldsQueueWeight} = "Circulation"; $tabsysprefs{StaticHoldsQueueWeight} = "Circulation"; -$tabsysprefs{AllowOnShelfHolds} = "Circulation"; $tabsysprefs{AllowHoldsOnDamagedItems} = "Circulation"; $tabsysprefs{UseBranchTransferLimits} = "Circulation"; $tabsysprefs{AllowHoldPolicyOverride} = "Circulation"; diff --git a/installer/data/mysql/de-DE/mandatory/sysprefs.sql b/installer/data/mysql/de-DE/mandatory/sysprefs.sql index 6eb67a3..67f7613 100755 --- a/installer/data/mysql/de-DE/mandatory/sysprefs.sql +++ b/installer/data/mysql/de-DE/mandatory/sysprefs.sql @@ -217,7 +217,6 @@ INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('XSLTDetailsDisplay','0','','Enable XSL stylesheet control over details page display on intranet','YesNo'), ('XSLTResultsDisplay','0','','Enable XSL stylesheet control over results page display on intranet','YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AdvancedSearchTypes','itemtypes','itemtypes|ccode','Select which set of fields comprise the Type limit in the advanced search','Choice'); -INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowOnShelfHolds', '0', '', 'Allow hold requests to be placed on items that are not on loan', 'YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowHoldsOnDamagedItems', '1', '', 'Allow hold requests to be placed on damaged items', 'YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('OpacSuppression', '0', '', 'Turn ON the OPAC Suppression feature, requires further setup, ask your system administrator for details', 'YesNo'); -- FIXME: add FrameworksLoaded, noOPACUserLogin? diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index 0abf9d8..69ef3ac 100755 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -219,7 +219,6 @@ INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('XSLTDetailsDisplay','0','','Enable XSL stylesheet control over details page display on intranet','YesNo'), ('XSLTResultsDisplay','0','','Enable XSL stylesheet control over results page display on intranet','YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AdvancedSearchTypes','itemtypes','itemtypes|ccode','Select which set of fields comprise the Type limit in the advanced search','Choice'); -INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowOnShelfHolds', '0', '', 'Allow hold requests to be placed on items that are not on loan', 'YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowHoldsOnDamagedItems', '1', '', 'Allow hold requests to be placed on damaged items', 'YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('OpacSuppression', '0', '', 'Turn ON the OPAC Suppression feature, requires further setup, ask your system administrator for details', 'YesNo'); -- FIXME: add FrameworksLoaded, noOPACUserLogin? diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql index 59a258f..cc249bc 100755 --- a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql @@ -214,7 +214,6 @@ INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('XSLTDetailsDisplay','0','','Activer la feuille XSL pour l''affichage des notices détaillées dans la partie pro','YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('XSLTResultsDisplay','0','','Activer la feuille XSL pour l''affichage des listes de résultat dans la partie pro','YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AdvancedSearchTypes','itemtypes','itemtypes|ccode','Définit quel champ est utilisé pour la limitation par type de document dans la recherche avancée','Choice'); -INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowOnShelfHolds', '0', '', 'Autorise les réservations de documents en rayon.', 'YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowHoldsOnDamagedItems', '1', '', 'Autorise les réservations de documents déclarés endommagés', 'YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('OpacSuppression', '0', '', 'Active la fonction de suppression à l''OPAC. Elle demande plus de paramétrage, demandez à votre administrateur', 'YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('SMSSendDriver','','','Détermine le pilote utilisé par SMS::Send pour envoyer des SMS.','free'); diff --git a/installer/data/mysql/it-IT/necessari/sysprefs.sql b/installer/data/mysql/it-IT/necessari/sysprefs.sql index dcdf0ee..3cf7fed 100755 --- a/installer/data/mysql/it-IT/necessari/sysprefs.sql +++ b/installer/data/mysql/it-IT/necessari/sysprefs.sql @@ -9,7 +9,6 @@ insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('advancedMARCeditor','0','','Se su ON, nel MARC editor non verranno visualizzati i campi/sottocampi delle descrizioni.','YesNo'); insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('AdvancedSearchTypes','itemtypes','itemtypes|ccode','Selezionare quale set di campi comprenderà la ricerca avanzata per tipo.','Choice'); insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('AllowHoldsOnDamagedItems','1','','Permette l\'inserimento di richieste di prenotazione su copie danneggiate','YesNo'); -insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('AllowOnShelfHolds','1','','Permette di inserire prenotazioni su documenti non in prestito.','YesNo'); insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('AllowRenewalLimitOverride','1','','Se On, permette che i limiti ai rinnovi possano essere superati dal bibliotecario nel modulo della circolazione','YesNo'); insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('AmazonAssocTag','','','See: http://aws.amazon.com','free'); insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('AmazonCoverImages','0','','Se ON, visualizza nell’interfaccia del bibliotecario l’immagine della copertina presa dal Web Service di Amazon','YesNo'); diff --git a/installer/data/mysql/nb-NO/1-Obligatorisk/sysprefs.sql b/installer/data/mysql/nb-NO/1-Obligatorisk/sysprefs.sql index ca71769..f15aad4 100644 --- a/installer/data/mysql/nb-NO/1-Obligatorisk/sysprefs.sql +++ b/installer/data/mysql/nb-NO/1-Obligatorisk/sysprefs.sql @@ -235,7 +235,6 @@ INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('XSLTDetailsDisplay','0','','Enable XSL stylesheet control over details page display on intranet','YesNo'), ('XSLTResultsDisplay','0','','Enable XSL stylesheet control over results page display on intranet','YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AdvancedSearchTypes','itemtypes','itemtypes|ccode','Select which set of fields comprise the Type limit in the advanced search','Choice'); -INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowOnShelfHolds', '0', '', 'Allow hold requests to be placed on items that are not on loan', 'YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowHoldsOnDamagedItems', '1', '', 'Allow hold requests to be placed on damaged items', 'YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('OpacSuppression', '0', '', 'Turn ON the OPAC Suppression feature, requires further setup, ask your system administrator for details', 'YesNo'); -- FIXME: add FrameworksLoaded, noOPACUserLogin? diff --git a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql index 58ba035..0aaa9de 100755 --- a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql +++ b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql @@ -214,7 +214,6 @@ INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('XSLTDetailsDisplay','0','','Enable XSL stylesheet control over details page display on OPAC WARNING: MARC21 Only','YesNo'), ('XSLTResultsDisplay','0','','Enable XSL stylesheet control over results page display on OPAC WARNING: MARC21 Only','YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AdvancedSearchTypes','itemtypes','itemtypes|ccode','Select which set of fields comprise the Type limit in the advanced search','Choice'); -INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowOnShelfHolds', '0', '', 'Allow hold requests to be placed on items that are not on loan', 'YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowHoldsOnDamagedItems', '1', '', 'Allow hold requests to be placed on damaged items', 'YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('OpacSuppression', '0', '', 'Turn ON the OPAC Suppression feature, requires further setup, ask your system administrator for details', 'YesNo'); -- FIXME: add FrameworksLoaded, noOPACUserLogin? diff --git a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql b/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql index 54c533c..c6cb253 100755 --- a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql +++ b/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql @@ -241,7 +241,6 @@ INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('XSLTDetailsDisplay','0','','Enable XSL stylesheet control over details page display on OPAC exemple : ../koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl','Textarea'), ('XSLTResultsDisplay','0','','Enable XSL stylesheet control over results page display on OPAC exemple : ../koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl','Textarea'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AdvancedSearchTypes','itemtypes','itemtypes|ccode','Select which set of fields comprise the Type limit in the advanced search','Choice'); -INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowOnShelfHolds', '0', '', 'Allow hold requests to be placed on items that are not on loan', 'YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowHoldsOnDamagedItems', '1', '', 'Allow hold requests to be placed on damaged items', 'YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('OpacSuppression', '0', '', 'Turn ON the OPAC Suppression feature, requires further setup, ask your system administrator for details', 'YesNo'); -- FIXME: add FrameworksLoaded, noOPACUserLogin? diff --git a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql b/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql index 9f095ab..6023b3d 100755 --- a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql +++ b/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql @@ -266,7 +266,6 @@ INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('XSLTDetailsDisplay','0','','Enable XSL stylesheet control over details page display on OPAC exemple : ../koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl','Textarea'), ('XSLTResultsDisplay','0','','Enable XSL stylesheet control over results page display on OPAC exemple : ../koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl','Textarea'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AdvancedSearchTypes','itemtypes','itemtypes|ccode','Select which set of fields comprise the Type limit in the advanced search','Choice'); -INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowOnShelfHolds', '0', '', 'Allow hold requests to be placed on items that are not on loan', 'YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowHoldsOnDamagedItems', '1', '', 'Allow hold requests to be placed on damaged items', 'YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('OpacSuppression', '0', '', 'Turn ON the OPAC Suppression feature, requires further setup, ask your system administrator for details', 'YesNo'); -- FIXME: add FrameworksLoaded, noOPACUserLogin? diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 9cbc8db..61b7892 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4370,6 +4370,22 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion($DBversion); } +$DBversion = '3.05.00.XXX'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + print "Upgrade to $DBversion done (Bug 5786 move AllowOnShelfHolds to circulation matrix)\n"; + # First create the column + $dbh->do("ALTER TABLE issuingrules ADD onshelfholds BOOLEAN"); + # Now update the column + if (C4::Context->preference("AllowOnShelfHolds")){ + # Pref is on, set allow for all rules + $dbh->do("UPDATE issuingrules SET onshelfholds=1"); + } + # If the preference is not set, leave off + # Remove from the systempreferences table + $dbh->do("DELETE FROM systempreferences WHERE variable = 'AllowOnShelfHolds'"); + SetVersion ($DBversion); +} + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) diff --git a/installer/html-template-to-template-toolkit.pl b/installer/html-template-to-template-toolkit.pl index e99b195..5f0e0ac 100755 --- a/installer/html-template-to-template-toolkit.pl +++ b/installer/html-template-to-template-toolkit.pl @@ -32,7 +32,7 @@ my @globals = ("themelang","JacketImages","OPACAmazonCoverImages","GoogleJackets "SyndeticsEnabled", "OpacRenewalAllowed", "item_level_itypes","noItemTypeImages", "virtualshelves", "RequestOnOpac", "COinSinOPACResults", "OPACXSLTResultsDisplay", "OPACItemsResultsDisplay", "LibraryThingForLibrariesID", "opacuserlogin", "TagsEnabled", -"TagsShowOnList", "TagsInputOnList","loggedinusername","AllowOnShelfHolds","opacbookbag", +"TagsShowOnList", "TagsInputOnList","loggedinusername","opacbookbag", "OPACAmazonEnabled", "SyndeticsCoverImages","using_https"); # Arguments: diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index dc821a8..5f17c23 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -229,12 +229,6 @@ Circulation: no: "Don't allow" - hold requests to be placed on damaged items. - - - pref: AllowOnShelfHolds - choices: - yes: Allow - no: "Don't allow" - - hold requests to be placed on items that are not checked out. - - - pref: AllowHoldDateInFuture choices: yes: Allow diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index f4be568..fa0ab77 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -295,12 +295,6 @@ OPAC: # choices: # - If ON, enables subject cloud on OPAC - - - pref: OPACItemHolds - choices: - yes: Allow - no: "Don't allow" - - patrons to place holds on specific items in the OPAC. If this is disabled, users can only put a hold on the next available item. - - - pref: OpacRenewalAllowed choices: yes: Allow 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 0edcece..2ee7f3f 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 @@ -80,7 +80,8 @@ for="tobranch">Clone these rules to: Clone these rules to: Delete @@ -175,6 +183,7 @@ for="tobranch">Clone these rules to: + Yes No diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/reserve/request.tt index a6cc1ff..855992e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/reserve/request.tt @@ -17,7 +17,7 @@ TIP: Note that in this case an error message appears notifying the circulation l
  • it is not marked not for loan AND,
  • it is not withdrawn AND,
  • it is not damaged (unless the AllowHoldsOnDamagedItems system preference is ON), AND
  • -
  • it is not on loan (unless the AllowOnShelfHolds system preference is ON)
  • +
  • it is not on loan (unless the On Shelf Holds Allowed issue rule is ON)
  • @@ -34,4 +34,4 @@ TIP: If independent branches is on and the canreservefromotherbranches system p
  • Hold priority can be altered by viewing the holds for the title
  • To view holds on a title, click the 'Holds' tab on the left
  • By changing the priority number a patron can be moved up or down on the list of holds
  • - [% INCLUDE 'help-bottom.inc' %] \ No newline at end of file + [% INCLUDE 'help-bottom.inc' %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tt index f9984a7..d04e7b1 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tt @@ -51,13 +51,7 @@ [% UNLESS ( norequests ) %] [% IF ( opacuserlogin ) %] [% IF ( RequestOnOpac ) %] - [% IF ( AllowOnShelfHolds ) %]
  • Place Hold
  • - [% ELSE %] - [% IF ( ItemsIssued ) %] -
  • Place Hold
  • - [% END %] - [% END %] [% END %] [% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tt index 284154e..200c0ed 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tt @@ -206,13 +206,7 @@ $(document).ready(function(){ [% UNLESS ( norequests ) %] [% IF ( opacuserlogin ) %] [% IF ( RequestOnOpac ) %] - [% IF ( AllowOnShelfHolds ) %]
  • Place Hold
  • - [% ELSE %] - [% IF ( ItemsIssued ) %] -
  • Place Hold
  • - [% END %] - [% END %] [% END %] [% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt index 3430cbb..9f4e4c9 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt @@ -802,16 +802,10 @@ YAHOO.util.Event.onContentReady("furtherm", function () {