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

(-)a/catalogue/detail.pl (-2 / +16 lines)
Lines 175-189 $dat->{'hiddencount'} = scalar @all_items + @hostitems - scalar @items; Link Here
175
my $shelflocations = GetKohaAuthorisedValues('items.location', $fw);
175
my $shelflocations = GetKohaAuthorisedValues('items.location', $fw);
176
my $collections    = GetKohaAuthorisedValues('items.ccode'   , $fw);
176
my $collections    = GetKohaAuthorisedValues('items.ccode'   , $fw);
177
my $copynumbers    = GetKohaAuthorisedValues('items.copynumber', $fw);
177
my $copynumbers    = GetKohaAuthorisedValues('items.copynumber', $fw);
178
my (@itemloop, %itemfields);
178
my (@itemloop, @otheritemloop, %itemfields);
179
my $norequests = 1;
179
my $norequests = 1;
180
my $authvalcode_items_itemlost = GetAuthValCode('items.itemlost',$fw);
180
my $authvalcode_items_itemlost = GetAuthValCode('items.itemlost',$fw);
181
my $authvalcode_items_damaged  = GetAuthValCode('items.damaged', $fw);
181
my $authvalcode_items_damaged  = GetAuthValCode('items.damaged', $fw);
182
182
183
my $analytics_flag;
183
my $analytics_flag;
184
my $materials_flag; # set this if the items have anything in the materials field
184
my $materials_flag; # set this if the items have anything in the materials field
185
my $currentbranch = C4::Context->userenv ? C4::Context->userenv->{branch} : undef;
186
if ($currentbranch and C4::Context->preference('SeparateHoldings')) {
187
    $template->param(SeparateHoldings => 1);
188
}
185
foreach my $item (@items) {
189
foreach my $item (@items) {
186
190
191
    my $homebranchcode = $item->{homebranch};
187
    $item->{homebranch}        = GetBranchName($item->{homebranch});
192
    $item->{homebranch}        = GetBranchName($item->{homebranch});
188
193
189
    # can place holds defaults to yes
194
    # can place holds defaults to yes
Lines 265-272 foreach my $item (@items) { Link Here
265
	}
270
	}
266
    if (defined($item->{'materials'}) && $item->{'materials'} =~ /\S/){
271
    if (defined($item->{'materials'}) && $item->{'materials'} =~ /\S/){
267
	$materials_flag = 1;
272
	$materials_flag = 1;
273
274
    if ($currentbranch and $currentbranch ne "NO_LIBRARY_SET" and C4::Context->preference('SeparateHoldings')) {
275
        if ($homebranchcode and $homebranchcode eq $currentbranch) {
276
            push @itemloop, $item;
277
        } else {
278
            push @otheritemloop, $item;
279
        }
280
    } else {
281
        push @itemloop, $item;
268
    }
282
    }
269
    push @itemloop, $item;
270
}
283
}
271
284
272
$template->param( norequests => $norequests );
285
$template->param( norequests => $norequests );
Lines 330-335 foreach ( keys %{$dat} ) { Link Here
330
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages"));
343
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages"));
331
$template->param(
344
$template->param(
332
    itemloop        => \@itemloop,
345
    itemloop        => \@itemloop,
346
    otheritemloop   => \@otheritemloop,
333
    biblionumber        => $biblionumber,
347
    biblionumber        => $biblionumber,
334
    ($analyze? 'analyze':'detailview') =>1,
348
    ($analyze? 'analyze':'detailview') =>1,
335
    subscriptions       => \@subs,
349
    subscriptions       => \@subs,
(-)a/installer/data/mysql/sysprefs.sql (+2 lines)
Lines 386-388 INSERT INTO systempreferences (variable,value,explanation,type) VALUES('OPACdidy Link Here
386
INSERT INTO systempreferences (variable,value,explanation,type) VALUES('INTRAdidyoumean',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free');
386
INSERT INTO systempreferences (variable,value,explanation,type) VALUES('INTRAdidyoumean',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free');
387
INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('BlockReturnOfWithdrawnItems', '1', '0', 'If enabled, items that are marked as withdrawn cannot be returned.', 'YesNo');
387
INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('BlockReturnOfWithdrawnItems', '1', '0', 'If enabled, items that are marked as withdrawn cannot be returned.', 'YesNo');
388
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HoldsToPullStartDate','2','Set the default start date for the Holds to pull list to this many days ago',NULL,'Integer');
388
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HoldsToPullStartDate','2','Set the default start date for the Holds to pull list to this many days ago',NULL,'Integer');
389
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SeparateHoldings', '0', 'Separate current branch holdings from other holdings', NULL, 'YesNo');
390
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacSeparateHoldings', '0', 'Separate current branch holdings from other holdings (OPAC)', NULL, 'YesNo');
(-)a/installer/data/mysql/updatedatabase.pl (+15 lines)
Lines 5926-5931 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
5926
    SetVersion ($DBversion);
5926
    SetVersion ($DBversion);
5927
}
5927
}
5928
5928
5929
$DBversion = "XXX";
5930
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
5931
    $dbh->do("
5932
        INSERT INTO systempreferences (variable,value,explanation,options,type)
5933
        VALUES('SeparateHoldings', '0', 'Separate current branch holdings from other holdings', NULL, 'YesNo');
5934
    ");
5935
    $dbh->do("
5936
        INSERT INTO systempreferences (variable,value,explanation,options,type)
5937
        VALUES('OpacSeparateHoldings', '0', 'Separate current branch holdings from other holdings (OPAC)', NULL, 'YesNo');
5938
    ");
5939
5940
    print "Upgrade to $DBversion done (Add systempreferences SeparateHoldings and OpacSeparateHoldings) \n";
5941
    SetVersion ($DBversion);
5942
}
5943
5929
5944
5930
$DBversion = "3.09.00.053";
5945
$DBversion = "3.09.00.053";
5931
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
5946
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (-1 / +12 lines)
Lines 156-159 Cataloging: Link Here
156
            - pref: OpacSuppressionByIPRange
156
            - pref: OpacSuppressionByIPRange
157
              class: short
157
              class: short
158
            - (Leave blank if not used. Define a range like <code>192.168.</code>.)
158
            - (Leave blank if not used. Define a range like <code>192.168.</code>.)
159
159
        -
160
            - pref: SeparateHoldings
161
              choices:
162
                  yes: "Separate"
163
                  no: "Don't separate"
164
            - current branch holdings from other holdings at staff interface.
165
        -
166
            - pref: OpacSeparateHoldings
167
              choices:
168
                  yes: "Separate"
169
                  no: "Don't separate"
170
            - current branch holdings from other holdings at OPAC.
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-127 / +164 lines)
Lines 255-272 function verify_images() { Link Here
255
</div>
255
</div>
256
<div id="bibliodetails" class="toptabs">
256
<div id="bibliodetails" class="toptabs">
257
257
258
<ul>   
258
<ul>
259
<li><a href="#holdings">Holdings</a></li>
259
    [% IF (SeparateHoldings) %]
260
        <li><a href="#holdings">[% LoginBranchname %] holdings</a></li>
261
        <li><a href="#otherholdings">Other holdings</a></li>
262
    [% ELSE %]
263
        <li><a href="#holdings">Holdings</a></li>
264
    [% END %]
260
<li><a href="#description">Descriptions</a></li>
265
<li><a href="#description">Descriptions</a></li>
261
[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
266
[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
262
[% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li><a href="#editions">Editions</a></li>[% END %][% END %]
267
[% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li><a href="#editions">Editions</a></li>[% END %][% END %]
263
[% IF ( LocalCoverImages ) %][% IF ( localimages || CAN_user_tools_upload_local_cover_images ) %]<li><a href="#images">Images</a></li>[% END %][% END %]
268
[% IF ( LocalCoverImages ) %][% IF ( localimages || CAN_user_tools_upload_local_cover_images ) %]<li><a href="#images">Images</a></li>[% END %][% END %]
264
 </ul>
269
 </ul>
265
270
266
<div id="holdings">
271
[% BLOCK items_table %]
267
[% IF ( count ) %]
272
    <table>
268
    [% IF ( showncount ) %]
273
        <thead>
269
        <table>
270
            <tr>
274
            <tr>
271
                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
275
                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
272
                <th>Current location</th>
276
                <th>Current location</th>
Lines 281-428 function verify_images() { Link Here
281
                [% IF ( itemdata_copynumber ) %]<th>Copy no.</th>[% END %]
285
                [% IF ( itemdata_copynumber ) %]<th>Copy no.</th>[% END %]
282
                [% IF materials %]<th>Materials specified</th>[% END %]
286
                [% IF materials %]<th>Materials specified</th>[% END %]
283
                [% IF ( itemdata_itemnotes ) %]<th>Public notes</th>[% END %]
287
                [% IF ( itemdata_itemnotes ) %]<th>Public notes</th>[% END %]
284
        [% IF ( SpineLabelShowPrintOnBibDetails ) %]<th>Spine label</th>[% END %]
288
                [% IF ( SpineLabelShowPrintOnBibDetails ) %]<th>Spine label</th>[% END %]
285
        [% IF ( hostrecords ) %]<th>Host records</th>[% END %]
289
                [% IF ( hostrecords ) %]<th>Host records</th>[% END %]
286
		[% IF ( analyze ) %]<th>Used in</th><th></th>[% END %]
290
                [% IF ( analyze ) %]<th>Used in</th><th></th>[% END %]
287
            </tr>
291
            </tr>
288
            [% FOREACH itemloo IN itemloop %]
292
        </thead>
293
        <tbody>
294
            [% FOREACH item IN items %]
289
                <tr>
295
                <tr>
290
                    [% IF ( item_level_itypes ) %]
296
                    [% IF ( item_level_itypes ) %]
291
                    <td class="itype">
297
                        <td class="itype">
292
                        [% IF !noItemTypeImages && itemloo.imageurl %]
298
                            [% IF !noItemTypeImages && item.imageurl %]
293
                            <img src="[% itemloo.imageurl %]" alt="[% itemloo.description %]" title="[% itemloo.description %]" />
299
                                <img src="[% item.imageurl %]" alt="[% item.description %]" title="[% item.description %]" />
294
                        [% END %]
300
                            [% END %]
295
                        [% itemloo.description %]
301
                            [% item.description %]
296
                    </td>
302
                        </td>
297
                    [% END %]
303
                    [% END %]
298
                    <td class="location">[% UNLESS ( singlebranchmode ) %][% itemloo.branchname %] [% END %]</td>
304
                    <td class="location">[% UNLESS ( singlebranchmode ) %][% item.branchname %] [% END %]</td>
299
                    <td class="homebranch">[% itemloo.homebranch %]<span class="shelvingloc">[% itemloo.location %]</span> </td>
305
                    <td class="homebranch">[% item.homebranch %]<span class="shelvingloc">[% item.location %]</span> </td>
300
		    [% IF ( itemdata_ccode ) %]<td>[% itemloo.ccode %]</td>[% END %]
306
                    [% IF ( itemdata_ccode ) %]<td>[% item.ccode %]</td>[% END %]
301
                    <td class="itemcallnumber">[% IF ( itemloo.itemcallnumber ) %] [% itemloo.itemcallnumber %][% END %]</td>
307
                    <td class="itemcallnumber">[% IF ( item.itemcallnumber ) %] [% item.itemcallnumber %][% END %]</td>
302
                    <td class="status">
308
                    <td class="status">
303
309
304
                [% IF ( itemloo.datedue ) %]
310
                        [% IF ( item.datedue ) %]
305
						<span class="datedue">Checked out
311
                            <span class="datedue">Checked out
306
                    [% UNLESS ( itemloo.NOTSAMEBRANCH ) %]
312
                                [% UNLESS ( item.NOTSAMEBRANCH ) %]
307
                          to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.borrowernumber %]">
313
                                    to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% item.borrowernumber %]">
308
			  [% IF ( itemloo.hidepatronname ) %]
314
                                        [% IF ( item.hidepatronname ) %]
309
			      [% itemloo.cardnumber %]
315
                                            [% item.cardnumber %]
310
			  [% ELSE %]
316
                                        [% ELSE %]
311
			      [% itemloo.firstname %] [% itemloo.surname %]
317
                                            [% item.firstname %] [% item.surname %]
312
			  [% END %]
318
                                        [% END %]
313
			  </a>
319
                                    </a>
314
                    [% END %]
320
                                [% END %]
315
						: due [% itemloo.datedue %]
321
                                : due [% item.datedue %]
316
						</span>
322
                            </span>
317
                [% ELSIF ( itemloo.transfertwhen ) %]
323
                        [% ELSIF ( item.transfertwhen ) %]
318
                           In transit from [% itemloo.transfertfrom %],
324
                            In transit from [% item.transfertfrom %],
319
                           to [% itemloo.transfertto %], since [% itemloo.transfertwhen %]
325
                            to [% item.transfertto %], since [% item.transfertwhen %]
320
							<!-- FIXME: the "since" clause is redundant w/ lastseen field -->
326
                            <!-- FIXME: the "since" clause is redundant w/ lastseen field -->
321
                [% END %]
327
                        [% END %]
322
328
323
                [% IF ( itemloo.itemlost ) %]
329
                        [% IF ( item.itemlost ) %]
324
                    [% IF ( itemloo.itemlostloop ) %]
330
                            [% IF ( item.itemlostloop ) %]
325
                    [% FOREACH itemlostloo IN itemloo.itemlostloop %]
331
                                [% FOREACH itemlostloo IN item.itemlostloop %]
326
                        [% IF ( itemlostloo.selected ) %]
332
                                    [% IF ( itemlostloo.selected ) %]
327
                                        <span class="lost">[% itemlostloo.lib %]</span>
333
                                        <span class="lost">[% itemlostloo.lib %]</span>
334
                                    [% END %]
335
                                [% END %]
336
                            [% ELSE %]
337
                                <span class="lost">Unavailable (lost or missing)</span>
338
                            [% END %]
328
                        [% END %]
339
                        [% END %]
329
                    [% END %]
330
                    [% ELSE %]
331
                                        <span class="lost">Unavailable (lost or missing)</span>
332
                    [% END %]
333
                [% END %]
334
340
335
                [% IF ( itemloo.wthdrawn ) %]
341
                        [% IF ( item.wthdrawn ) %]
336
                                        <span class="wdn">Withdrawn</span>
342
                            <span class="wdn">Withdrawn</span>
337
                [% END %]
343
                        [% END %]
338
344
339
                [% IF ( itemloo.damaged ) %]
345
                        [% IF ( item.damaged ) %]
340
                    [% IF ( itemloo.itemdamagedloop ) %]
346
                            [% IF ( item.itemdamagedloop ) %]
341
                        [% FOREACH itemdamagedloo IN itemloo.itemdamagedloop %]
347
                                [% FOREACH itemdamagedloo IN item.itemdamagedloop %]
342
                        [% IF ( itemdamagedloo.selected ) %]
348
                                    [% IF ( itemdamagedloo.selected ) %]
343
                                        <span class="dmg">[% itemdamagedloo.lib %]</span>
349
                                        <span class="dmg">[% itemdamagedloo.lib %]</span>
350
                                    [% END %]
351
                                [% END %]
352
                            [% ELSE %]
353
                                <span class="dmg">Damaged</span>
354
                            [% END %]
344
                        [% END %]
355
                        [% END %]
356
357
                        [% IF ( item.itemnotforloan ) %]
358
                            Not for loan
359
                            [% IF ( item.notforloanvalue ) %]
360
                                ([% item.notforloanvalue %])
361
                            [% END %]
345
                        [% END %]
362
                        [% END %]
346
                    [% ELSE %]
347
                                        <span class="dmg">Damaged</span>
348
                    [% END %]
349
                [% END %]
350
363
351
                [% IF ( itemloo.itemnotforloan ) %]
364
                        [% IF ( item.reservedate ) %]
352
                    Not for loan 
365
                            [% IF ( item.waitingdate ) %]
353
                    [% IF ( itemloo.notforloanvalue ) %]
366
                                Waiting
354
                        ([% itemloo.notforloanvalue %])
367
                            [% ELSE %]
355
                    [% END %]
368
                                Item-level hold
356
                [% END %]
369
                            [% END %]
370
                            [% IF ( canreservefromotherbranches ) %]
371
                                for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% item.ReservedForBorrowernumber %]">
372
                                    [% IF ( item.hidepatronname ) %]
373
                                        [% item.Reservedcardnumber %]
374
                                    [% ELSE %]
375
                                        [% item.ReservedForFirstname %] [% item.ReservedForSurname %]
376
                                    [% END %]
377
                                </a>
378
                            [% END %]
379
                            [% IF ( item.waitingdate ) %]
380
                                at[% ELSE %]for delivery at
381
                            [% END %]
382
                            [% item.ExpectedAtLibrary %]
383
                            [% IF ( item.waitingdate ) %]
384
                                since [% item.waitingdate %]
385
                            [% ELSE %]
386
                                [% IF ( item.reservedate ) %]
387
                                    (placed [% item.reservedate %])
388
                                [% END %]
389
                            [% END %]
390
                        [% END %]
391
                        [% UNLESS ( item.itemnotforloan or item.onloan or item.itemlost or item.wthdrawn or item.damaged or item.transfertwhen or item.reservedate ) %]
392
                            Available
393
                        [% END %]
357
394
358
                            
395
                        [% IF ( item.restricted ) %]
359
                [% IF ( itemloo.reservedate ) %]
396
                            <span class="restricted">([% item.restricted %])</span>
360
                    [% IF ( itemloo.waitingdate ) %]
397
                        [% END %]
361
                        Waiting
362
                    [% ELSE %]
363
                        Item-level hold
364
                    [% END %]
365
                    [% IF ( canreservefromotherbranches ) %]for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.ReservedForBorrowernumber %]">
366
		        [% IF ( itemloo.hidepatronname ) %]
367
		            [% itemloo.Reservedcardnumber %]
368
		        [% ELSE %]
369
		            [% itemloo.ReservedForFirstname %] [% itemloo.ReservedForSurname %]
370
			[% END %]
371
		    </a>[% END %]
372
                    [% IF ( itemloo.waitingdate ) %]
373
                        at[% ELSE %]for delivery at
374
                    [% END %]   [% itemloo.ExpectedAtLibrary %]
375
                    [% IF ( itemloo.waitingdate ) %]
376
                        since [% itemloo.waitingdate %]
377
                    [% ELSE %]
378
                        [% IF ( itemloo.reservedate ) %](placed [% itemloo.reservedate %])[% END %]
379
                    [% END %]
380
                [% END %]
381
                [% UNLESS ( itemloo.itemnotforloan ) %][% UNLESS ( itemloo.onloan ) %][% UNLESS ( itemloo.itemlost ) %][% UNLESS ( itemloo.wthdrawn ) %][% UNLESS ( itemloo.damaged ) %][% UNLESS ( itemloo.transfertwhen ) %][% UNLESS ( itemloo.reservedate ) %]
382
                                        Available
383
                [% END %][% END %][% END %][% END %][% END %][% END %][% END %]
384
398
385
                [% IF ( itemloo.restricted ) %]<span class="restricted">([% itemloo.restricted %])</span>[% END %]
386
                        
387
                    </td>
399
                    </td>
388
                    <td class="datelastseen">[% itemloo.datelastseen %]</td>
400
                    <td class="datelastseen">[% item.datelastseen %]</td>
389
                    <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?type=[% itemloo.type %]&amp;itemnumber=[% itemloo.itemnumber %]&amp;biblionumber=[% itemloo.biblionumber %]&amp;bi=[% itemloo.biblioitemnumber %]#item[% itemloo.itemnumber %]">[% itemloo.barcode %]</a></td>
401
                    <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?type=[% item.type %]&amp;itemnumber=[% item.itemnumber %]&amp;biblionumber=[% item.biblionumber %]&amp;bi=[% item.biblioitemnumber %]#item[% item.itemnumber %]">[% item.barcode %]</a></td>
390
				[% IF ( volinfo ) %]	<td class="enumchron">
402
                    [% IF ( volinfo ) %]
391
					[% IF ( itemdata_enumchron ) %]
403
                        <td class="enumchron">
392
						[% IF ( itemloo.enumchron ) %]
404
                            [% IF ( itemdata_enumchron ) %]
393
						[% itemloo.enumchron %][% IF ( itemloo.serialseq ) %] -- [% END %]
405
                                [% IF ( item.enumchron ) %]
394
						[% END %]
406
                                    [% item.enumchron %]
395
					[% itemloo.serialseq %][% IF ( itemloo.publisheddate ) %] ([% itemloo.publisheddate %])[% END %]
407
                                    [% IF ( item.serialseq ) %] -- [% END %]
396
					[% END %]
408
                                [% END %]
397
				</td>[% END %]
409
                                [% item.serialseq %]
398
				[% IF ( itemdata_uri ) %]
410
                                [% IF ( item.publisheddate ) %] ([% item.publisheddate %])[% END %]
399
					<td class="uri"><a href="[% itemloo.uri %]">[% itemloo.uri %]</a></td>
411
                            [% END %]
400
				[% END %]
412
                        </td>
401
				[% IF ( itemdata_copynumber ) %]
413
                    [% END %]
402
					<td class="copynumber">[% itemloo.copynumber %]</td>
414
                    [% IF ( itemdata_uri ) %]
403
				[% END %]
415
                        <td class="uri"><a href="[% item.uri %]">[% item.uri %]</a></td>
404
	        [% IF materials %]
416
                    [% END %]
405
		    <td class="materials"> [% itemloo.materials %] </td>
417
                    [% IF ( itemdata_copynumber ) %]
406
		[% END %]
418
                        <td class="copynumber">[% item.copynumber %]</td>
407
                [% IF ( itemdata_itemnotes ) %]<td><div class="itemnotes">[% itemloo.itemnotes %]</div></td>[% END %]
419
                    [% END %]
408
		[% IF ( SpineLabelShowPrintOnBibDetails ) %]
420
                    [% IF materials %]
409
            <td><a href="/cgi-bin/koha/labels/spinelabel-print.pl?barcode=[% itemloo.barcode %]" >Print label</a></td>
421
                        <td class="materials"> [% item.materials %] </td>
410
		[% END %]
422
                    [% END %]
411
                [% IF ( hostrecords ) %]
423
                    [% IF ( itemdata_itemnotes ) %]
412
                      <td>[% IF ( itemloo.hostbiblionumber) %]<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% itemloo.hostbiblionumber %]" >[% itemloo.hosttitle %]</a>[% END %]</td>
424
                        <td><div class="itemnotes">[% item.itemnotes %]</div></td>
413
                [% END %]
425
                    [% END %]
414
                [% IF ( analyze ) %]<td>
426
                    [% IF ( SpineLabelShowPrintOnBibDetails ) %]
415
			[% IF ( itemloo.countanalytics ) %]
427
                        <td><a href="/cgi-bin/koha/labels/spinelabel-print.pl?barcode=[% item.barcode %]" >Print label</a></td>
416
				<a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&amp;q=[% itemloo.itemnumber %]">[% itemloo.countanalytics %] analytics</a>
428
                    [% END %]
417
			[% END %]</td>
429
                    [% IF ( hostrecords ) %]
418
		[% END %]
430
                        <td>[% IF ( item.hostbiblionumber) %]<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.hostbiblionumber %]" >[% item.hosttitle %]</a>[% END %]</td>
419
                [% IF ( analyze ) %]
431
                    [% END %]
420
                        <td><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?hostbiblionumber=[% itemloo.biblionumber %]&amp;hostitemnumber=[% itemloo.itemnumber %]">Create analytics</a></td>
432
                    [% IF ( analyze ) %]
421
                [% END %]
433
                        <td>
434
                            [% IF ( item.countanalytics ) %]
435
                                <a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&amp;q=[% item.itemnumber %]">[% item.countanalytics %] analytics</a>
436
                            [% END %]
437
                        </td>
438
                    [% END %]
439
                    [% IF ( analyze ) %]
440
                        <td><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?hostbiblionumber=[% item.biblionumber %]&amp;hostitemnumber=[% item.itemnumber %]">Create analytics</a></td>
441
                    [% END %]
422
442
423
                </tr>
443
                </tr>
424
            [% END %]
444
            [% END %]
425
        </table>
445
        </tbody>
446
    </table>
447
[% END %][%# end of block items_table %]
448
449
<div id="holdings">
450
[% IF ( count ) %]
451
    [% IF ( showncount ) %]
452
        [% PROCESS items_table items=itemloop %]
426
        [% END %]
453
        [% END %]
427
                [% IF ( hiddencount ) %]
454
                [% IF ( hiddencount ) %]
428
                   <p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]&amp;showallitems=1">Show all items ([% hiddencount %] hidden)</a>
455
                   <p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]&amp;showallitems=1">Show all items ([% hiddencount %] hidden)</a>
Lines 445-450 function verify_images() { Link Here
445
    [% END %]
472
    [% END %]
446
[% END %]
473
[% END %]
447
    </div>
474
    </div>
475
476
[% IF (SeparateHoldings) %]
477
    <div id="otherholdings">
478
        [% IF (otheritemloop.size) %]
479
            [% PROCESS items_table items=otheritemloop %]
480
        [% ELSE %]
481
            No other items.
482
        [% END %]
483
    </div>
484
[% END %]
448
    
485
    
449
<div id="description">
486
<div id="description">
450
<div class="content_set">
487
<div class="content_set">
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt (-9 / +25 lines)
Lines 643-651 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
643
<div id="bibliodescriptions" class="toptabs">
643
<div id="bibliodescriptions" class="toptabs">
644
644
645
<ul>   
645
<ul>   
646
[% IF ( defaulttab == 'holdings' ) %]<li id="tab_holdings" class="ui-tabs-selected">[% ELSE %]<li id="tab_holdings">[% END %]
646
    [% IF ( defaulttab == 'holdings' ) %]<li id="tab_holdings" class="ui-tabs-selected">[% ELSE %]<li id="tab_holdings">[% END %]
647
    <a href="#holdings">Holdings ( [% count %] )</a>
647
        <a href="#holdings">[% IF SeparateHoldings %][% LoginBranchname %] holdings[% ELSE %]Holdings[% END %] ( [% itemloop.size || 0 %] )</a>
648
</li>
648
    </li>
649
    [% IF (SeparateHoldings) %]
650
        <li><a href="#otherholdings">Other holdings ( [% otheritemloop.size || 0 %] )</a></li>
651
    [% END %]
649
<li id="tab_descriptions"> <a href="#descriptions">Title notes</a></li>
652
<li id="tab_descriptions"> <a href="#descriptions">Title notes</a></li>
650
[% IF ( SYNDETICS_TOC ) %]
653
[% IF ( SYNDETICS_TOC ) %]
651
    <li id="tab_toc"> <a href="#toc">TOC</a></li>
654
    <li id="tab_toc"> <a href="#toc">TOC</a></li>
Lines 729-739 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
729
</div>
732
</div>
730
[% END %]
733
[% END %]
731
734
732
<div id="holdings">
735
[% BLOCK items_table %]
733
[% IF ( count ) %]
734
    [% IF ( lotsofitems ) %]
735
	<p>This record has many physical items. <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]&amp;viewallitems=1#holdings">Click here to view them all.</a></p>
736
    [% ELSE %]
737
    <table id="holdingst">
736
    <table id="holdingst">
738
        <thead><tr>
737
        <thead><tr>
739
            [% IF ( item_level_itypes ) %]<th id="item_itemtype">Item type</th>[% END %]
738
            [% IF ( item_level_itypes ) %]<th id="item_itemtype">Item type</th>[% END %]
Lines 753-759 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
753
            <th>Item hold queue priority</th>
752
            <th>Item hold queue priority</th>
754
        [% END %]
753
        [% END %]
755
        </tr></thead>
754
        </tr></thead>
756
	    <tbody>[% FOREACH ITEM_RESULT IN ITEM_RESULTS %]
755
	    <tbody>[% FOREACH ITEM_RESULT IN items %]
757
      <tr>[% IF ( item_level_itypes ) %]<td class="itype">[% UNLESS ( noItemTypeImages ) %][% IF ( ITEM_RESULT.imageurl ) %]<img src="[% ITEM_RESULT.imageurl %]" title="[% ITEM_RESULT.description %]" alt="[% ITEM_RESULT.description %]" />[% END %][% END %] [% ITEM_RESULT.description %]</td>[% END %]
756
      <tr>[% IF ( item_level_itypes ) %]<td class="itype">[% UNLESS ( noItemTypeImages ) %][% IF ( ITEM_RESULT.imageurl ) %]<img src="[% ITEM_RESULT.imageurl %]" title="[% ITEM_RESULT.description %]" alt="[% ITEM_RESULT.description %]" />[% END %][% END %] [% ITEM_RESULT.description %]</td>[% END %]
758
             <td class="location">
757
             <td class="location">
759
    [% UNLESS ( singleBranchMode ) %]
758
    [% UNLESS ( singleBranchMode ) %]
Lines 792-797 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
792
	    </tr>
791
	    </tr>
793
	    [% END %]</tbody>
792
	    [% END %]</tbody>
794
	</table>
793
	</table>
794
[% END %][%# end of items_table block %]
795
796
<div id="holdings">
797
[% IF ( itemloop.size ) %]
798
    [% IF ( lotsofitems ) %]
799
	<p>This record has many physical items. <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]&amp;viewallitems=1#holdings">Click here to view them all.</a></p>
800
    [% ELSE %]
801
        [% PROCESS items_table items=itemloop %]
795
    [% END %]
802
    [% END %]
796
    [% IF holds_count.defined || priority %]
803
    [% IF holds_count.defined || priority %]
797
    <div id="bib_holds">
804
    <div id="bib_holds">
Lines 876-881 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
876
<br clear="all" />
883
<br clear="all" />
877
</div>
884
</div>
878
885
886
[% IF (SeparateHoldings) %]
887
    <div id="otherholdings">
888
        [% IF (otheritemloop.size) %]
889
            [% PROCESS items_table items=otheritemloop %]
890
        [% ELSE %]
891
            No other items.
892
        [% END %]
893
    </div>
894
[% END %]
879
895
880
<div id="descriptions">
896
<div id="descriptions">
881
<div class="content_set">
897
<div class="content_set">
(-)a/opac/opac-detail.pl (-10 / +26 lines)
Lines 482-494 foreach my $subscription (@subscriptions) { Link Here
482
482
483
$dat->{'count'} = scalar(@items);
483
$dat->{'count'} = scalar(@items);
484
484
485
# If there is a lot of items, and the user has not decided
486
# to view them all yet, we first warn him
487
# TODO: The limit of 50 could be a syspref
488
my $viewallitems = $query->param('viewallitems');
489
if ($dat->{'count'} >= 50 && !$viewallitems) {
490
    $template->param('lotsofitems' => 1);
491
}
492
485
493
my $biblio_authorised_value_images = C4::Items::get_authorised_value_images( C4::Biblio::get_biblio_authorised_values( $biblionumber, $record ) );
486
my $biblio_authorised_value_images = C4::Items::get_authorised_value_images( C4::Biblio::get_biblio_authorised_values( $biblionumber, $record ) );
494
487
Lines 517-522 $template->param( show_priority => $has_hold ) ; Link Here
517
my $norequests = 1;
510
my $norequests = 1;
518
my $branches = GetBranches();
511
my $branches = GetBranches();
519
my %itemfields;
512
my %itemfields;
513
my (@itemloop, @otheritemloop);
514
my $currentbranch = C4::Context->userenv ? C4::Context->userenv->{branch} : undef;
515
if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) {
516
    $template->param(SeparateHoldings => 1);
517
}
520
for my $itm (@items) {
518
for my $itm (@items) {
521
    $itm->{holds_count} = $item_reserves{ $itm->{itemnumber} };
519
    $itm->{holds_count} = $item_reserves{ $itm->{itemnumber} };
522
    $itm->{priority} = $priority{ $itm->{itemnumber} };
520
    $itm->{priority} = $priority{ $itm->{itemnumber} };
Lines 567-572 for my $itm (@items) { Link Here
567
        $itm->{transfertfrom} = $branches->{$transfertfrom}{branchname};
565
        $itm->{transfertfrom} = $branches->{$transfertfrom}{branchname};
568
        $itm->{transfertto}   = $branches->{$transfertto}{branchname};
566
        $itm->{transfertto}   = $branches->{$transfertto}{branchname};
569
     }
567
     }
568
    my $homebranch = $itm->{homebranch};
569
    if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) {
570
        if ($homebranch and $homebranch eq $currentbranch) {
571
            push @itemloop, $itm;
572
        } else {
573
            push @otheritemloop, $itm;
574
        }
575
    } else {
576
        push @itemloop, $itm;
577
    }
578
}
579
580
# If there is a lot of items, and the user has not decided
581
# to view them all yet, we first warn him
582
# TODO: The limit of 50 could be a syspref
583
my $viewallitems = $query->param('viewallitems');
584
if (scalar(@itemloop) >= 50 && !$viewallitems) {
585
    $template->param('lotsofitems' => 1);
570
}
586
}
571
587
572
## get notes and subjects from MARC record
588
## get notes and subjects from MARC record
Lines 695-701 if(C4::Context->preference("ISBD")) { Link Here
695
}
711
}
696
712
697
$template->param(
713
$template->param(
698
    ITEM_RESULTS        => \@items,
714
    itemloop            => \@itemloop,
715
    otheritemloop       => \@otheritemloop,
699
    subscriptionsnumber => $subscriptionsnumber,
716
    subscriptionsnumber => $subscriptionsnumber,
700
    biblionumber        => $biblionumber,
717
    biblionumber        => $biblionumber,
701
    subscriptions       => \@subs,
718
    subscriptions       => \@subs,
Lines 958-964 my $defaulttab = Link Here
958
        ? 'subscriptions' :
975
        ? 'subscriptions' :
959
    $opac_serial_default eq 'serialcollection' && @serialcollections > 0
976
    $opac_serial_default eq 'serialcollection' && @serialcollections > 0
960
        ? 'serialcollection' :
977
        ? 'serialcollection' :
961
    $opac_serial_default eq 'holdings' && $dat->{'count'} > 0
978
    $opac_serial_default eq 'holdings' && scalar (@itemloop) > 0
962
        ? 'holdings' :
979
        ? 'holdings' :
963
    $subscriptionsnumber
980
    $subscriptionsnumber
964
        ? 'subscriptions' :
981
        ? 'subscriptions' :
965
- 

Return to bug 7674