View | Details | Raw Unified | Return to bug 5786
Collapse All | Expand All

(-)a/C4/Circulation.pm (-1 / +2 lines)
Lines 2200-2206 sub CanBookBeRenewed { Link Here
2200
                   LEFT JOIN biblioitems USING (biblioitemnumber)
2200
                   LEFT JOIN biblioitems USING (biblioitemnumber)
2201
                   
2201
                   
2202
                   WHERE
2202
                   WHERE
2203
                    (issuingrules.categorycode = borrowers.categorycode OR issuingrules.categorycode = '*')
2203
                    (issuingrules.categorycode = borrowers.categorycode 
2204
			OR issuingrules.categorycode = '*')
2204
                   AND
2205
                   AND
2205
                    (issuingrules.itemtype = $itype OR issuingrules.itemtype = '*')
2206
                    (issuingrules.itemtype = $itype OR issuingrules.itemtype = '*')
2206
                   AND
2207
                   AND
(-)a/C4/Items.pm (+2 lines)
Lines 160-165 sub GetItem { Link Here
160
        ($data->{'serialseq'} , $data->{'publisheddate'}) = $ssth->fetchrow_array();
160
        ($data->{'serialseq'} , $data->{'publisheddate'}) = $ssth->fetchrow_array();
161
    }
161
    }
162
	#if we don't have an items.itype, use biblioitems.itemtype.
162
	#if we don't have an items.itype, use biblioitems.itemtype.
163
    # FIXME this should respect the itypes systempreference
164
    # if (C4::Context->preference('item-level_itypes')) {
163
	if( ! $data->{'itype'} ) {
165
	if( ! $data->{'itype'} ) {
164
		my $sth = $dbh->prepare("SELECT itemtype FROM biblioitems  WHERE biblionumber = ?");
166
		my $sth = $dbh->prepare("SELECT itemtype FROM biblioitems  WHERE biblionumber = ?");
165
		$sth->execute($data->{'biblionumber'});
167
		$sth->execute($data->{'biblionumber'});
(-)a/C4/Reserves.pm (-12 / +60 lines)
Lines 479-485 sub CanItemBeReserved{ Link Here
479
    if(my $rowcount = $sthcount->fetchrow_hashref()){
479
    if(my $rowcount = $sthcount->fetchrow_hashref()){
480
        $reservecount = $rowcount->{count};
480
        $reservecount = $rowcount->{count};
481
    }
481
    }
482
    
483
    # we check if it's ok or not
482
    # we check if it's ok or not
484
    if( $reservecount < $allowedreserves ){
483
    if( $reservecount < $allowedreserves ){
485
        return 1;
484
        return 1;
Lines 1321-1327 sub GetReserveInfo { Link Here
1321
1320
1322
=head2 IsAvailableForItemLevelRequest
1321
=head2 IsAvailableForItemLevelRequest
1323
1322
1324
  my $is_available = IsAvailableForItemLevelRequest($itemnumber);
1323
  my $is_available = IsAvailableForItemLevelRequest($itemnumber,$borrowernumber,$branchcode);
1325
1324
1326
Checks whether a given item record is available for an
1325
Checks whether a given item record is available for an
1327
item-level hold request.  An item is available if
1326
item-level hold request.  An item is available if
Lines 1331-1342 item-level hold request. An item is available if Link Here
1331
* it is not withdrawn AND 
1330
* it is not withdrawn AND 
1332
* does not have a not for loan value > 0
1331
* does not have a not for loan value > 0
1333
1332
1334
Whether or not the item is currently on loan is 
1333
Need to check the issuingrules onshelfholds column, 
1335
also checked - if the AllowOnShelfHolds system preference
1334
if this is set items on the shelf can be placed on hold
1336
is ON, an item can be requested even if it is currently
1337
on loan to somebody else.  If the system preference
1338
is OFF, an item that is currently checked out cannot
1339
be the target of an item-level hold request.
1340
1335
1341
Note that IsAvailableForItemLevelRequest() does not
1336
Note that IsAvailableForItemLevelRequest() does not
1342
check if the staff operator is authorized to place
1337
check if the staff operator is authorized to place
Lines 1348-1356 and canreservefromotherbranches. Link Here
1348
1343
1349
sub IsAvailableForItemLevelRequest {
1344
sub IsAvailableForItemLevelRequest {
1350
    my $itemnumber = shift;
1345
    my $itemnumber = shift;
1351
   
1346
    my $borrowernumber = shift;
1347
    my $branchcode = shift;
1352
    my $item = GetItem($itemnumber);
1348
    my $item = GetItem($itemnumber);
1353
1354
    # must check the notforloan setting of the itemtype
1349
    # must check the notforloan setting of the itemtype
1355
    # FIXME - a lot of places in the code do this
1350
    # FIXME - a lot of places in the code do this
1356
    #         or something similar - need to be
1351
    #         or something similar - need to be
Lines 1383-1396 sub IsAvailableForItemLevelRequest { Link Here
1383
                               $item->{wthdrawn} or
1378
                               $item->{wthdrawn} or
1384
                               $notforloan_per_itemtype;
1379
                               $notforloan_per_itemtype;
1385
1380
1386
1381
    # check issuingrules
1387
    if (C4::Context->preference('AllowOnShelfHolds')) {
1382
    
1383
    if (OnShelfHoldsAllowed($itemnumber,$borrowernumber,$branchcode)) {
1388
        return $available_per_item;
1384
        return $available_per_item;
1389
    } else {
1385
    } else {
1390
        return ($available_per_item and ($item->{onloan} or GetReserveStatus($itemnumber) eq "W")); 
1386
        return ($available_per_item and ($item->{onloan} or GetReserveStatus($itemnumber) eq "W")); 
1391
    }
1387
    }
1392
}
1388
}
1393
1389
1390
=head2 OnShelfHoldsAllowed
1391
1392
  OnShelfHoldsAllowed($itemnumber,$borrowernumber,$branchcode);
1393
1394
Checks issuingrules, using the borrowers categorycode, the itemtype, and branchcode to see if onshelf
1395
holds are allowed, returns true if so. 
1396
1397
=cut
1398
1399
sub OnShelfHoldsAllowed {
1400
    my ($itemnumber,$borrowernumber,$branchcode) = @_;
1401
    my $item = GetItem($itemnumber);
1402
    my $borrower = C4::Members::GetMember(borrowernumber => $borrowernumber);
1403
    my $itype;
1404
    my $dbh = C4::Context->dbh;
1405
    if (C4::Context->preference('item-level_itypes')) {
1406
	# We cant trust GetItem to honour the syspref, so safest to do it ourselves
1407
	# When GetItem is fixed, we can remove this
1408
	$itype = $item->{itype};
1409
    } 
1410
    else {
1411
	my $query = "SELECT itemtype FROM biblioitems WHERE biblioitemnumber = ? ";
1412
	my $sth = $dbh->prepare($query);	
1413
	$sth->execute($item->{biblioitemnumber});
1414
	if (my $data = $sth->fetchrow_hashref()){
1415
	    $itype = $data->{itemtype};
1416
	}
1417
    }
1418
1419
    my $query = "SELECT onshelfholds,categorycode,itemtype,branchcode FROM issuingrules WHERE
1420
          (issuingrules.categorycode = ? OR issuingrules.categorycode = '*')
1421
        AND
1422
          (issuingrules.itemtype = ? OR issuingrules.itemtype = '*')
1423
        AND
1424
          (issuingrules.branchcode = ? OR issuingrules.branchcode = '*')
1425
        ORDER BY
1426
          issuingrules.categorycode desc,
1427
          issuingrules.itemtype desc,
1428
          issuingrules.branchcode desc
1429
       LIMIT 1";
1430
    my $dbh = C4::Context->dbh;
1431
    my $sth = $dbh->prepare($query);
1432
    $sth->execute($borrower->{categorycode},$itype,$branchcode);
1433
    my $data = $sth->fetchrow_hashref;
1434
    if ($data->{onshelfholds}){
1435
	return 1;
1436
    }
1437
    else {
1438
	return 0;
1439
    }
1440
}
1441
1394
=head2 AlterPriority
1442
=head2 AlterPriority
1395
1443
1396
  AlterPriority( $where, $borrowernumber, $biblionumber, $reservedate );
1444
  AlterPriority( $where, $borrowernumber, $biblionumber, $reservedate );
(-)a/C4/VirtualShelves/Page.pm (-1 lines)
Lines 183-189 sub shelfpage ($$$$$) { Link Here
183
            # explicitly fetch this shelf
183
            # explicitly fetch this shelf
184
            my ($shelfnumber2,$shelfname,$owner,$category,$sorton) = GetShelf($shelfnumber);
184
            my ($shelfnumber2,$shelfname,$owner,$category,$sorton) = GetShelf($shelfnumber);
185
185
186
            $template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds') );
187
            if (C4::Context->preference('TagsEnabled')) {
186
            if (C4::Context->preference('TagsEnabled')) {
188
                $template->param(TagsEnabled => 1);
187
                $template->param(TagsEnabled => 1);
189
                    foreach (qw(TagsShowOnList TagsInputOnList)) {
188
                    foreach (qw(TagsShowOnList TagsInputOnList)) {
(-)a/admin/smart-rules.pl (-4 / +5 lines)
Lines 101-108 elsif ($op eq 'delete-branch-item') { Link Here
101
# save the values entered
101
# save the values entered
102
elsif ($op eq 'add') {
102
elsif ($op eq 'add') {
103
    my $sth_search = $dbh->prepare("SELECT COUNT(*) AS total FROM issuingrules WHERE branchcode=? AND categorycode=? AND itemtype=?");
103
    my $sth_search = $dbh->prepare("SELECT COUNT(*) AS total FROM issuingrules WHERE branchcode=? AND categorycode=? AND itemtype=?");
104
    my $sth_insert = $dbh->prepare("INSERT INTO issuingrules (branchcode, categorycode, itemtype, maxissueqty, renewalsallowed, reservesallowed, issuelength, hardduedate, hardduedatecompare, fine, finedays, firstremind, chargeperiod,rentaldiscount) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
104
    my $sth_insert = $dbh->prepare("INSERT INTO issuingrules (branchcode, categorycode, itemtype, maxissueqty, renewalsallowed, reservesallowed, issuelength, hardduedate, hardduedatecompare, fine, finedays, firstremind, chargeperiod, rentaldiscount, onshelfholds) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
105
    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=?");
105
    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=?");
106
    
106
    
107
    my $br = $branch; # branch
107
    my $br = $branch; # branch
108
    my $bor  = $input->param('categorycode'); # borrower category
108
    my $bor  = $input->param('categorycode'); # borrower category
Lines 114-119 elsif ($op eq 'add') { Link Here
114
    my $maxissueqty  = $input->param('maxissueqty');
114
    my $maxissueqty  = $input->param('maxissueqty');
115
    my $renewalsallowed  = $input->param('renewalsallowed');
115
    my $renewalsallowed  = $input->param('renewalsallowed');
116
    my $reservesallowed  = $input->param('reservesallowed');
116
    my $reservesallowed  = $input->param('reservesallowed');
117
    my $onshelfholds     = $input->param('onshelfholds');
117
    $maxissueqty =~ s/\s//g;
118
    $maxissueqty =~ s/\s//g;
118
    $maxissueqty = undef if $maxissueqty !~ /^\d+/;
119
    $maxissueqty = undef if $maxissueqty !~ /^\d+/;
119
    my $issuelength  = $input->param('issuelength');
120
    my $issuelength  = $input->param('issuelength');
Lines 126-134 elsif ($op eq 'add') { Link Here
126
    $sth_search->execute($br,$bor,$cat);
127
    $sth_search->execute($br,$bor,$cat);
127
    my $res = $sth_search->fetchrow_hashref();
128
    my $res = $sth_search->fetchrow_hashref();
128
    if ($res->{total}) {
129
    if ($res->{total}) {
129
        $sth_update->execute($fine, $finedays,$firstremind, $chargeperiod, $maxissueqty, $renewalsallowed,$reservesallowed, $issuelength,$hardduedate,$hardduedatecompare,$rentaldiscount, $br,$bor,$cat);
130
        $sth_update->execute($fine, $finedays,$firstremind, $chargeperiod, $maxissueqty, $renewalsallowed,$reservesallowed, $issuelength,$hardduedate,$hardduedatecompare,$rentaldiscount, $onshelfholds, $br,$bor,$cat);
130
    } else {
131
    } else {
131
        $sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed,$reservesallowed,$issuelength,$hardduedate,$hardduedatecompare,$fine,$finedays,$firstremind,$chargeperiod,$rentaldiscount);
132
        $sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed,$reservesallowed,$issuelength,$hardduedate,$hardduedatecompare,$fine,$finedays,$firstremind,$chargeperiod,$rentaldiscount,$onshelfholds);
132
    }
133
    }
133
} 
134
} 
134
elsif ($op eq "set-branch-defaults") {
135
elsif ($op eq "set-branch-defaults") {
(-)a/admin/systempreferences.pl (-1 lines)
Lines 186-192 $tabsysprefs{HomeOrHoldingBranch} = "Circulation"; Link Here
186
$tabsysprefs{HomeOrHoldingBranchReturn}      = "Circulation";
186
$tabsysprefs{HomeOrHoldingBranchReturn}      = "Circulation";
187
$tabsysprefs{RandomizeHoldsQueueWeight}      = "Circulation";
187
$tabsysprefs{RandomizeHoldsQueueWeight}      = "Circulation";
188
$tabsysprefs{StaticHoldsQueueWeight}         = "Circulation";
188
$tabsysprefs{StaticHoldsQueueWeight}         = "Circulation";
189
$tabsysprefs{AllowOnShelfHolds}              = "Circulation";
190
$tabsysprefs{AllowHoldsOnDamagedItems}       = "Circulation";
189
$tabsysprefs{AllowHoldsOnDamagedItems}       = "Circulation";
191
$tabsysprefs{UseBranchTransferLimits}        = "Circulation";
190
$tabsysprefs{UseBranchTransferLimits}        = "Circulation";
192
$tabsysprefs{AllowHoldPolicyOverride}        = "Circulation";
191
$tabsysprefs{AllowHoldPolicyOverride}        = "Circulation";
(-)a/installer/data/mysql/it-IT/necessari/system_preferences.sql (-1 lines)
Lines 17-23 Link Here
17
-- 51 Franklin Street' WHERE variable = ' Fifth Floor' WHERE variable = ' Boston' WHERE variable = ' MA 02110-1301 USA.
17
-- 51 Franklin Street' WHERE variable = ' Fifth Floor' WHERE variable = ' Boston' WHERE variable = ' MA 02110-1301 USA.
18
18
19
UPDATE systempreferences SET value = 'cataloguing' WHERE variable = 'AcqCreateItem';
19
UPDATE systempreferences SET value = 'cataloguing' WHERE variable = 'AcqCreateItem';
20
UPDATE systempreferences SET value = '1' WHERE variable = 'AllowOnShelfHolds';
21
UPDATE systempreferences SET value = '1' WHERE variable = 'AllowRenewalLimitOverride';
20
UPDATE systempreferences SET value = '1' WHERE variable = 'AllowRenewalLimitOverride';
22
UPDATE systempreferences SET value = 'annual' WHERE variable = 'autoBarcode';
21
UPDATE systempreferences SET value = 'annual' WHERE variable = 'autoBarcode';
23
UPDATE systempreferences SET value = 'email' WHERE variable = 'AutoEmailPrimaryAddress';
22
UPDATE systempreferences SET value = 'email' WHERE variable = 'AutoEmailPrimaryAddress';
(-)a/installer/data/mysql/kohastructure.sql (-1 / +2 lines)
Lines 970-975 CREATE TABLE `issues` ( -- information related to check outs or issues Link Here
970
970
971
DROP TABLE IF EXISTS `issuingrules`;
971
DROP TABLE IF EXISTS `issuingrules`;
972
CREATE TABLE `issuingrules` (
972
CREATE TABLE `issuingrules` (
973
  `branchcode` varchar(10) NOT NULL default '',
973
  `categorycode` varchar(10) NOT NULL default '',
974
  `categorycode` varchar(10) NOT NULL default '',
974
  `itemtype` varchar(10) NOT NULL default '',
975
  `itemtype` varchar(10) NOT NULL default '',
975
  `restrictedtype` tinyint(1) default NULL,
976
  `restrictedtype` tinyint(1) default NULL,
Lines 987-993 CREATE TABLE `issuingrules` ( Link Here
987
  `hardduedatecompare` tinyint NOT NULL default "0",
988
  `hardduedatecompare` tinyint NOT NULL default "0",
988
  `renewalsallowed` smallint(6) NOT NULL default "0",
989
  `renewalsallowed` smallint(6) NOT NULL default "0",
989
  `reservesallowed` smallint(6) NOT NULL default "0",
990
  `reservesallowed` smallint(6) NOT NULL default "0",
990
  `branchcode` varchar(10) NOT NULL default '',
991
  `onshelfholds` tinyint(1) NOT NULL default 0,
991
  PRIMARY KEY  (`branchcode`,`categorycode`,`itemtype`),
992
  PRIMARY KEY  (`branchcode`,`categorycode`,`itemtype`),
992
  KEY `categorycode` (`categorycode`),
993
  KEY `categorycode` (`categorycode`),
993
  KEY `itemtype` (`itemtype`)
994
  KEY `itemtype` (`itemtype`)
(-)a/installer/data/mysql/sysprefs.sql (-1 lines)
Lines 223-229 INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES Link Here
223
('XSLTDetailsDisplay','0','','Enable XSL stylesheet control over details page display on intranet','YesNo'),
223
('XSLTDetailsDisplay','0','','Enable XSL stylesheet control over details page display on intranet','YesNo'),
224
('XSLTResultsDisplay','0','','Enable XSL stylesheet control over results page display on intranet','YesNo');
224
('XSLTResultsDisplay','0','','Enable XSL stylesheet control over results page display on intranet','YesNo');
225
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');
225
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');
226
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');
227
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowHoldsOnDamagedItems', '1', '', 'Allow hold requests to be placed on damaged items', 'YesNo');
226
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowHoldsOnDamagedItems', '1', '', 'Allow hold requests to be placed on damaged items', 'YesNo');
228
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');
227
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');
229
-- FIXME: add FrameworksLoaded, noOPACUserLogin?
228
-- FIXME: add FrameworksLoaded, noOPACUserLogin?
(-)a/installer/data/mysql/updatedatabase.pl (+20 lines)
Lines 4585-4590 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
4585
    SetVersion($DBversion);
4585
    SetVersion($DBversion);
4586
}
4586
}
4587
4587
4588
$DBversion = '3.06.03.XXX';
4589
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4590
    # First create the column
4591
    $dbh->do("ALTER TABLE issuingrules ADD onshelfholds tinyint(1) default 0");
4592
    # Now update the column    
4593
    if (C4::Context->preference("AllowOnShelfHolds")){
4594
	      # Pref is on, set allow for all rules
4595
	      $dbh->do("UPDATE issuingrules SET onshelfholds=1");
4596
    } else {
4597
        # If the preference is not set, leave off
4598
	      $dbh->do("UPDATE issuingrules SET onshelfholds=0");
4599
    }
4600
    $dbh->do("ALTER TABLE issuingrules MODIFY onshelfholds tinyint(1) default 0 NOT NULL");
4601
    # Remove from the systempreferences table
4602
    $dbh->do("DELETE FROM systempreferences WHERE variable = 'AllowOnShelfHolds'");	
4603
4604
    print "Upgrade to $DBversion done (Bug 5786 move AllowOnShelfHolds to circulation matrix)\n";
4605
    SetVersion ($DBversion);
4606
}
4607
4588
=head1 FUNCTIONS
4608
=head1 FUNCTIONS
4589
4609
4590
=head2 DropAllForeignKeys($table)
4610
=head2 DropAllForeignKeys($table)
(-)a/installer/html-template-to-template-toolkit.pl (-1 / +1 lines)
Lines 32-38 my @globals = ("themelang","JacketImages","OPACAmazonCoverImages","GoogleJackets Link Here
32
"SyndeticsEnabled", "OpacRenewalAllowed", "item_level_itypes","noItemTypeImages",
32
"SyndeticsEnabled", "OpacRenewalAllowed", "item_level_itypes","noItemTypeImages",
33
"virtualshelves", "RequestOnOpac", "COinSinOPACResults", "OPACXSLTResultsDisplay",
33
"virtualshelves", "RequestOnOpac", "COinSinOPACResults", "OPACXSLTResultsDisplay",
34
"OPACItemsResultsDisplay", "LibraryThingForLibrariesID", "opacuserlogin", "TagsEnabled",
34
"OPACItemsResultsDisplay", "LibraryThingForLibrariesID", "opacuserlogin", "TagsEnabled",
35
"TagsShowOnList", "TagsInputOnList","loggedinusername","AllowOnShelfHolds","opacbookbag",
35
"TagsShowOnList", "TagsInputOnList","loggedinusername","opacbookbag",
36
"OPACAmazonEnabled", "SyndeticsCoverImages","using_https");
36
"OPACAmazonEnabled", "SyndeticsCoverImages","using_https");
37
37
38
# Arguments:
38
# Arguments:
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-6 lines)
Lines 236-247 Circulation: Link Here
236
                  no: "Don't allow"
236
                  no: "Don't allow"
237
            - hold requests to be placed on damaged items.
237
            - hold requests to be placed on damaged items.
238
        -
238
        -
239
            - pref: AllowOnShelfHolds
240
              choices:
241
                  yes: Allow
242
                  no: "Don't allow"
243
            - hold requests to be placed on items that are not checked out.
244
        -
245
            - pref: AllowHoldDateInFuture
239
            - pref: AllowHoldDateInFuture
246
              choices:
240
              choices:
247
                  yes: Allow
241
                  yes: Allow
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-6 lines)
Lines 319-330 OPAC: Link Here
319
#              choices:
319
#              choices:
320
#            - If ON, enables subject cloud on OPAC
320
#            - If ON, enables subject cloud on OPAC
321
        -
321
        -
322
            - pref: OPACItemHolds
323
              choices:
324
                  yes: Allow
325
                  no: "Don't allow"
326
            - 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.
327
        -
328
            - pref: OpacRenewalAllowed
322
            - pref: OpacRenewalAllowed
329
              choices:
323
              choices:
330
                  yes: Allow
324
                  yes: Allow
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt (-8 / +17 lines)
Lines 80-86 for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde Link Here
80
                <th>Suspension in Days (day)</th>
80
                <th>Suspension in Days (day)</th>
81
                <th>Renewals Allowed (count)</th>
81
                <th>Renewals Allowed (count)</th>
82
                <th>Holds Allowed (count)</th>
82
                <th>Holds Allowed (count)</th>
83
		        <th>Rental Discount (%)</th>
83
		<th>On Shelf Holds Allowed</th>
84
		<th>Rental Discount (%)</th>
84
				<th>&nbsp;</th>
85
				<th>&nbsp;</th>
85
            </tr>
86
            </tr>
86
				[% FOREACH rule IN rules %]
87
				[% FOREACH rule IN rules %]
Lines 108-126 for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde Link Here
108
								[% END %]
109
								[% END %]
109
							</td>
110
							</td>
110
							<td>[% rule.issuelength %]</td>
111
							<td>[% rule.issuelength %]</td>
111
                                                        <td>[% IF ( rule.hardduedate ) %]
112
                            <td>[% IF ( rule.hardduedate ) %]
112
                                                               [% IF ( rule.hardduedatebefore ) %]before [% rule.hardduedate %]</td>
113
                                    [% IF ( rule.hardduedatebefore ) %]
113
                                                               [% ELSE %][% IF ( rule.hardduedateexact ) %]on [% rule.hardduedate %]</td>
114
                                        before
114
                                                                                 [% ELSE %][% IF ( rule.hardduedateafter ) %]after [% rule.hardduedate %]</td>[% END %]
115
                                    [% ELSIF ( rule.hardduedateexact ) %]
115
                                                                                 [% END %]
116
                                        on
116
                                                               [% END %]
117
                                    [% ELSIF ( rule.hardduedateafter ) %]
117
                                                            [% ELSE %]None defined[% END %]   
118
                                        after
119
                                    [% END %]
120
                                    [% rule.hardduedate %]
121
                                [% ELSE %]
122
                                    None defined
123
                                [% END %]   
124
                            </td>
118
							<td>[% rule.fine %]</td>
125
							<td>[% rule.fine %]</td>
119
							<td>[% rule.chargeperiod %]</td>
126
							<td>[% rule.chargeperiod %]</td>
120
							<td>[% rule.firstremind %]</td>
127
							<td>[% rule.firstremind %]</td>
121
							<td>[% rule.finedays %]</td>
128
							<td>[% rule.finedays %]</td>
122
							<td>[% rule.renewalsallowed %]</td>
129
							<td>[% rule.renewalsallowed %]</td>
123
							<td>[% rule.reservesallowed %]</td>
130
							<td>[% rule.reservesallowed %]</td>
131
							<td>[% IF rule.onshelfholds %]Yes[% ELSE %]No[% END %]</td>
124
							<td>[% rule.rentaldiscount %]</td>
132
							<td>[% rule.rentaldiscount %]</td>
125
							<td>
133
							<td>
126
								<a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&amp;itemtype=[% rule.itemtype %]&amp;categorycode=[% rule.categorycode %]&amp;branch=[% rule.current_branch %]">Delete</a>
134
								<a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&amp;itemtype=[% rule.itemtype %]&amp;categorycode=[% rule.categorycode %]&amp;branch=[% rule.current_branch %]">Delete</a>
Lines 175-180 for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde Link Here
175
                    <td><input name="finedays" size="3" /> </td>
183
                    <td><input name="finedays" size="3" /> </td>
176
                    <td><input name="renewalsallowed" size="2" /></td>
184
                    <td><input name="renewalsallowed" size="2" /></td>
177
                    <td><input name="reservesallowed" size="2" /></td>
185
                    <td><input name="reservesallowed" size="2" /></td>
186
		    <td><input type="radio" name="onshelfholds" value="1">Yes <input type="radio" name="onshelfholds" value="0">No</td>
178
		    <td><input name="rentaldiscount" size="2" /></td>
187
		    <td><input name="rentaldiscount" size="2" /></td>
179
                    <td><input type="hidden" name="branch" value="[% current_branch %]"/><input type="submit" value="Add" class="submit" /></td>
188
                    <td><input type="hidden" name="branch" value="[% current_branch %]"/><input type="submit" value="Add" class="submit" /></td>
180
                </tr>
189
                </tr>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/help/reserve/request.tt (-1 / +1 lines)
Lines 72-75 Link Here
72
72
73
<p><strong>See the full documentation for Holds in the <a href="http://manual.koha-community.org/3.6/en/holds.html">manual</a> (online).</strong></p>
73
<p><strong>See the full documentation for Holds in the <a href="http://manual.koha-community.org/3.6/en/holds.html">manual</a> (online).</strong></p>
74
74
75
[% INCLUDE 'help-bottom.inc' %]
75
[% INCLUDE 'help-bottom.inc' %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tt (-6 lines)
Lines 51-63 Link Here
51
[% UNLESS ( norequests ) %]
51
[% UNLESS ( norequests ) %]
52
        [% IF ( opacuserlogin ) %]
52
        [% IF ( opacuserlogin ) %]
53
		[% IF ( RequestOnOpac ) %]
53
		[% IF ( RequestOnOpac ) %]
54
			[% IF ( AllowOnShelfHolds ) %]
55
				<li><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% biblionumber %]">Place Hold</a></li>
54
				<li><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% biblionumber %]">Place Hold</a></li>
56
			[% ELSE %]
57
				[% IF ( ItemsIssued ) %]
58
					<li><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% biblionumber %]">Place Hold</a></li>
59
				[% END %]
60
			[% END %]
61
55
62
        	[% END %]
56
        	[% END %]
63
	[% END %]
57
	[% END %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tt (-6 lines)
Lines 206-218 $(document).ready(function(){ Link Here
206
[% UNLESS ( norequests ) %]
206
[% UNLESS ( norequests ) %]
207
        [% IF ( opacuserlogin ) %]
207
        [% IF ( opacuserlogin ) %]
208
        [% IF ( RequestOnOpac ) %]
208
        [% IF ( RequestOnOpac ) %]
209
            [% IF ( AllowOnShelfHolds ) %]
210
                <li><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% biblionumber %]">Place Hold</a></li>
209
                <li><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% biblionumber %]">Place Hold</a></li>
211
            [% ELSE %]
212
                [% IF ( ItemsIssued ) %]
213
                    <li><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% biblionumber %]">Place Hold</a></li>
214
                [% END %]
215
            [% END %]
216
210
217
            [% END %]
211
            [% END %]
218
    [% END %]
212
    [% END %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt (-9 / +3 lines)
Lines 1016-1031 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
1016
<ul id="action">
1016
<ul id="action">
1017
1017
1018
[% UNLESS ( norequests ) %]
1018
[% UNLESS ( norequests ) %]
1019
        [% IF ( opacuserlogin ) %]
1019
    [% IF ( opacuserlogin ) %]
1020
		[% IF ( RequestOnOpac ) %]
1020
		[% IF ( RequestOnOpac ) %]
1021
			[% IF ( AllowOnShelfHolds ) %]
1021
            <li><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% biblionumber %]">Place Hold</a></li>
1022
	            		<li><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% biblionumber %]">Place Hold</a></li>
1022
       	[% END %]
1023
			[% ELSE %]
1024
				[% IF ( ItemsIssued ) %]
1025
		            		<li><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% biblionumber %]">Place Hold</a></li>
1026
				[% END %]
1027
			[% END %]
1028
        	[% END %]
1029
	[% END %]
1023
	[% END %]
1030
[% END %]
1024
[% END %]
1031
        <li><a class="print" href="#" onclick="window.print();">Print</a></li>
1025
        <li><a class="print" href="#" onclick="window.print();">Print</a></li>
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results-grouped.tt (-6 lines)
Lines 260-272 function highlightOn() { Link Here
260
                                [% IF ( RequestOnOpac ) %]
260
                                [% IF ( RequestOnOpac ) %]
261
					[% UNLESS ( GROUP_RESULT.norequests ) %]
261
					[% UNLESS ( GROUP_RESULT.norequests ) %]
262
						[% IF ( opacuserlogin ) %]
262
						[% IF ( opacuserlogin ) %]
263
							[% IF ( AllowOnShelfHolds ) %]
264
								<a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% GROUP_RESULT.biblionumber %]">Place Hold</a><!-- add back when available 0 holds in queue-->
263
								<a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% GROUP_RESULT.biblionumber %]">Place Hold</a><!-- add back when available 0 holds in queue-->
265
							[% ELSE %]
266
								[% IF ( GROUP_RESULT.itemsissued ) %]
267
									<a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% GROUP_RESULT.biblionumber %]">Place Hold</a><!-- add back when available 0 holds in queue-->
268
								[% END %]
269
							[% END %]
270
						[% END %]
264
						[% END %]
271
					[% END %]
265
					[% END %]
272
				[% END %]
266
				[% END %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt (-7 / +1 lines)
Lines 510-522 $(document).ready(function(){ Link Here
510
                                [% IF ( RequestOnOpac ) %]
510
                                [% IF ( RequestOnOpac ) %]
511
					[% UNLESS ( SEARCH_RESULT.norequests ) %]
511
					[% UNLESS ( SEARCH_RESULT.norequests ) %]
512
						[% IF ( opacuserlogin ) %]
512
						[% IF ( opacuserlogin ) %]
513
							[% IF ( AllowOnShelfHolds ) %]
513
							<a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Place Hold</a><!-- add back when available 0 holds in queue-->
514
								<a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Place Hold</a><!-- add back when available 0 holds in queue-->
515
							[% ELSE %]
516
								[% IF ( SEARCH_RESULT.itemsissued ) %]
517
									<a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Place Hold</a><!-- add back when available 0 holds in queue-->
518
								[% END %]
519
							[% END %]
520
						[% END %]
514
						[% END %]
521
					[% END %]
515
					[% END %]
522
				[% END %]
516
				[% END %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt (-6 lines)
Lines 308-320 $(function() { Link Here
308
      [% IF ( RequestOnOpac ) %]
308
      [% IF ( RequestOnOpac ) %]
309
          [% UNLESS ( itemsloo.norequests ) %]
309
          [% UNLESS ( itemsloo.norequests ) %]
310
            [% IF ( opacuserlogin ) %]
310
            [% IF ( opacuserlogin ) %]
311
              [% IF ( AllowOnShelfHolds ) %]
312
                <a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% itemsloo.biblionumber %]">Place Hold</a><!-- add back when available 0 holds in queue-->
311
                <a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% itemsloo.biblionumber %]">Place Hold</a><!-- add back when available 0 holds in queue-->
313
              [% ELSE %]
314
                [% IF ( itemsloo.itemsissued ) %]
315
                  <a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% itemsloo.biblionumber %]">Place Hold</a><!-- add back when available 0 holds in queue-->
316
                [% END %]
317
              [% END %]
318
            [% END %]
312
            [% END %]
319
          [% END %]
313
          [% END %]
320
        [% END %]
314
        [% END %]
(-)a/opac/opac-ISBDdetail.pl (-2 lines)
Lines 69-75 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
69
69
70
my $biblionumber = $query->param('biblionumber');
70
my $biblionumber = $query->param('biblionumber');
71
71
72
$template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds') );
73
$template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) );
72
$template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) );
74
73
75
my $marcflavour      = C4::Context->preference("marcflavour");
74
my $marcflavour      = C4::Context->preference("marcflavour");
Lines 152-158 foreach ( @$reviews ) { Link Here
152
151
153
$template->param(
152
$template->param(
154
    RequestOnOpac       => C4::Context->preference("RequestOnOpac"),
153
    RequestOnOpac       => C4::Context->preference("RequestOnOpac"),
155
    AllowOnShelfHolds   => C4::Context->preference('AllowOnShelfHolds'),
156
    norequests   => $norequests,
154
    norequests   => $norequests,
157
    ISBD         => $res,
155
    ISBD         => $res,
158
    biblionumber => $biblionumber,
156
    biblionumber => $biblionumber,
(-)a/opac/opac-MARCdetail.pl (-1 lines)
Lines 81-87 $template->param( Link Here
81
    bibliotitle => $biblio->{title},
81
    bibliotitle => $biblio->{title},
82
);
82
);
83
83
84
$template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds') );
85
$template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) );
84
$template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) );
86
85
87
# adding the $RequestOnOpac param
86
# adding the $RequestOnOpac param
(-)a/opac/opac-detail.pl (-2 lines)
Lines 347-354 if ($session->param('busc')) { Link Here
347
}
347
}
348
348
349
349
350
351
$template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds') );
352
$template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) );
350
$template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) );
353
351
354
my $record       = GetMarcBiblio($biblionumber);
352
my $record       = GetMarcBiblio($biblionumber);
(-)a/opac/opac-reserve.pl (-1 / +1 lines)
Lines 471-477 foreach my $biblioNum (@biblionumbers) { Link Here
471
            $policy_holdallowed = 0;
471
            $policy_holdallowed = 0;
472
        }
472
        }
473
473
474
        if (IsAvailableForItemLevelRequest($itemNum) and $policy_holdallowed and CanItemBeReserved($borrowernumber,$itemNum) and ($itemLoopIter->{already_reserved} ne 1)) {
474
        if (IsAvailableForItemLevelRequest($itemNum,$borr->{'borrowernumber'},$itemInfo->{'homebranch'}) and $policy_holdallowed and CanItemBeReserved($borrowernumber,$itemNum) and !$itemLoopIter->{already_reserved}) {
475
            $itemLoopIter->{available} = 1;
475
            $itemLoopIter->{available} = 1;
476
            $numCopiesAvailable++;
476
            $numCopiesAvailable++;
477
        }
477
        }
(-)a/opac/opac-search.pl (-2 / +1 lines)
Lines 100-106 if (C4::Context->preference("marcflavour") eq "UNIMARC" ) { Link Here
100
elsif (C4::Context->preference("marcflavour") eq "MARC21" ) {
100
elsif (C4::Context->preference("marcflavour") eq "MARC21" ) {
101
    $template->param('usmarc' => 1);
101
    $template->param('usmarc' => 1);
102
}
102
}
103
$template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds') );
103
104
$template->param( 'OPACNoResultsFound' => C4::Context->preference('OPACNoResultsFound') );
104
$template->param( 'OPACNoResultsFound' => C4::Context->preference('OPACNoResultsFound') );
105
105
106
if (C4::Context->preference('BakerTaylorEnabled')) {
106
if (C4::Context->preference('BakerTaylorEnabled')) {
107
- 

Return to bug 5786