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

(-)a/catalogue/detail.pl (-2 / +16 lines)
Lines 177-191 $dat->{'hiddencount'} = scalar @all_items + @hostitems - scalar @items; Link Here
177
my $shelflocations = GetKohaAuthorisedValues('items.location', $fw);
177
my $shelflocations = GetKohaAuthorisedValues('items.location', $fw);
178
my $collections    = GetKohaAuthorisedValues('items.ccode'   , $fw);
178
my $collections    = GetKohaAuthorisedValues('items.ccode'   , $fw);
179
my $copynumbers    = GetKohaAuthorisedValues('items.copynumber', $fw);
179
my $copynumbers    = GetKohaAuthorisedValues('items.copynumber', $fw);
180
my (@itemloop, %itemfields);
180
my (@itemloop, @otheritemloop, %itemfields);
181
my $norequests = 1;
181
my $norequests = 1;
182
my $authvalcode_items_itemlost = GetAuthValCode('items.itemlost',$fw);
182
my $authvalcode_items_itemlost = GetAuthValCode('items.itemlost',$fw);
183
my $authvalcode_items_damaged  = GetAuthValCode('items.damaged', $fw);
183
my $authvalcode_items_damaged  = GetAuthValCode('items.damaged', $fw);
184
184
185
my $analytics_flag;
185
my $analytics_flag;
186
my $materials_flag; # set this if the items have anything in the materials field
186
my $materials_flag; # set this if the items have anything in the materials field
187
my $currentbranch = C4::Context->userenv ? C4::Context->userenv->{branch} : undef;
188
if ($currentbranch and C4::Context->preference('SeparateHoldings')) {
189
    $template->param(SeparateHoldings => 1);
190
}
187
foreach my $item (@items) {
191
foreach my $item (@items) {
188
192
193
    my $homebranchcode = $item->{homebranch};
189
    $item->{homebranch}        = GetBranchName($item->{homebranch});
194
    $item->{homebranch}        = GetBranchName($item->{homebranch});
190
195
191
    # can place holds defaults to yes
196
    # can place holds defaults to yes
Lines 267-274 foreach my $item (@items) { Link Here
267
	}
272
	}
268
    if (defined($item->{'materials'}) && $item->{'materials'} =~ /\S/){
273
    if (defined($item->{'materials'}) && $item->{'materials'} =~ /\S/){
269
	$materials_flag = 1;
274
	$materials_flag = 1;
275
276
    if ($currentbranch and $currentbranch ne "NO_LIBRARY_SET" and C4::Context->preference('SeparateHoldings')) {
277
        if ($homebranchcode and $homebranchcode eq $currentbranch) {
278
            push @itemloop, $item;
279
        } else {
280
            push @otheritemloop, $item;
281
        }
282
    } else {
283
        push @itemloop, $item;
270
    }
284
    }
271
    push @itemloop, $item;
272
}
285
}
273
286
274
$template->param( norequests => $norequests );
287
$template->param( norequests => $norequests );
Lines 332-337 foreach ( keys %{$dat} ) { Link Here
332
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages"));
345
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages"));
333
$template->param(
346
$template->param(
334
    itemloop        => \@itemloop,
347
    itemloop        => \@itemloop,
348
    otheritemloop   => \@otheritemloop,
335
    biblionumber        => $biblionumber,
349
    biblionumber        => $biblionumber,
336
    ($analyze? 'analyze':'detailview') =>1,
350
    ($analyze? 'analyze':'detailview') =>1,
337
    subscriptions       => \@subs,
351
    subscriptions       => \@subs,
(-)a/installer/data/mysql/sysprefs.sql (+2 lines)
Lines 388-390 INSERT INTO systempreferences (variable, value, options, explanation, type) VALU Link Here
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('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z','Alphabet than can be expanded into browse links, e.g. on Home > Patrons',NULL,'free');
389
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z','Alphabet than can be expanded into browse links, e.g. on Home > Patrons',NULL,'free');
390
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RefundLostItemFeeOnReturn', '1', 'If enabled, the lost item fee charged to a borrower will be refunded when the lost item is returned.', NULL, 'YesNo');
390
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RefundLostItemFeeOnReturn', '1', 'If enabled, the lost item fee charged to a borrower will be refunded when the lost item is returned.', NULL, 'YesNo');
391
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SeparateHoldings', '0', 'Separate current branch holdings from other holdings', NULL, 'YesNo');
392
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 5927-5932 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
5927
    SetVersion ($DBversion);
5927
    SetVersion ($DBversion);
5928
}
5928
}
5929
5929
5930
$DBversion = "XXX";
5931
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
5932
    $dbh->do("
5933
        INSERT INTO systempreferences (variable,value,explanation,options,type)
5934
        VALUES('SeparateHoldings', '0', 'Separate current branch holdings from other holdings', NULL, 'YesNo');
5935
    ");
5936
    $dbh->do("
5937
        INSERT INTO systempreferences (variable,value,explanation,options,type)
5938
        VALUES('OpacSeparateHoldings', '0', 'Separate current branch holdings from other holdings (OPAC)', NULL, 'YesNo');
5939
    ");
5940
5941
    print "Upgrade to $DBversion done (Add systempreferences SeparateHoldings and OpacSeparateHoldings) \n";
5942
    SetVersion ($DBversion);
5943
}
5944
5930
5945
5931
$DBversion = "3.09.00.053";
5946
$DBversion = "3.09.00.053";
5932
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
5947
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 261-278 function verify_images() { Link Here
261
</div>
261
</div>
262
<div id="bibliodetails" class="toptabs">
262
<div id="bibliodetails" class="toptabs">
263
263
264
<ul>   
264
<ul>
265
<li><a href="#holdings">Holdings</a></li>
265
    [% IF (SeparateHoldings) %]
266
        <li><a href="#holdings">[% LoginBranchname %] holdings</a></li>
267
        <li><a href="#otherholdings">Other holdings</a></li>
268
    [% ELSE %]
269
        <li><a href="#holdings">Holdings</a></li>
270
    [% END %]
266
<li><a href="#description">Descriptions</a></li>
271
<li><a href="#description">Descriptions</a></li>
267
[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
272
[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
268
[% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li><a href="#editions">Editions</a></li>[% END %][% END %]
273
[% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li><a href="#editions">Editions</a></li>[% END %][% END %]
269
[% IF ( LocalCoverImages ) %][% IF ( localimages || CAN_user_tools_upload_local_cover_images ) %]<li><a href="#images">Images</a></li>[% END %][% END %]
274
[% IF ( LocalCoverImages ) %][% IF ( localimages || CAN_user_tools_upload_local_cover_images ) %]<li><a href="#images">Images</a></li>[% END %][% END %]
270
 </ul>
275
 </ul>
271
276
272
<div id="holdings">
277
[% BLOCK items_table %]
273
[% IF ( count ) %]
278
    <table>
274
    [% IF ( showncount ) %]
279
        <thead>
275
        <table>
276
            <tr>
280
            <tr>
277
                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
281
                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
278
                <th>Current location</th>
282
                <th>Current location</th>
Lines 287-434 function verify_images() { Link Here
287
                [% IF ( itemdata_copynumber ) %]<th>Copy no.</th>[% END %]
291
                [% IF ( itemdata_copynumber ) %]<th>Copy no.</th>[% END %]
288
                [% IF materials %]<th>Materials specified</th>[% END %]
292
                [% IF materials %]<th>Materials specified</th>[% END %]
289
                [% IF ( itemdata_itemnotes ) %]<th>Public notes</th>[% END %]
293
                [% IF ( itemdata_itemnotes ) %]<th>Public notes</th>[% END %]
290
        [% IF ( SpineLabelShowPrintOnBibDetails ) %]<th>Spine label</th>[% END %]
294
                [% IF ( SpineLabelShowPrintOnBibDetails ) %]<th>Spine label</th>[% END %]
291
        [% IF ( hostrecords ) %]<th>Host records</th>[% END %]
295
                [% IF ( hostrecords ) %]<th>Host records</th>[% END %]
292
		[% IF ( analyze ) %]<th>Used in</th><th></th>[% END %]
296
                [% IF ( analyze ) %]<th>Used in</th><th></th>[% END %]
293
            </tr>
297
            </tr>
294
            [% FOREACH itemloo IN itemloop %]
298
        </thead>
299
        <tbody>
300
            [% FOREACH item IN items %]
295
                <tr>
301
                <tr>
296
                    [% IF ( item_level_itypes ) %]
302
                    [% IF ( item_level_itypes ) %]
297
                    <td class="itype">
303
                        <td class="itype">
298
                        [% IF !noItemTypeImages && itemloo.imageurl %]
304
                            [% IF !noItemTypeImages && item.imageurl %]
299
                            <img src="[% itemloo.imageurl %]" alt="[% itemloo.description %]" title="[% itemloo.description %]" />
305
                                <img src="[% item.imageurl %]" alt="[% item.description %]" title="[% item.description %]" />
300
                        [% END %]
306
                            [% END %]
301
                        [% itemloo.description %]
307
                            [% item.description %]
302
                    </td>
308
                        </td>
303
                    [% END %]
309
                    [% END %]
304
                    <td class="location">[% UNLESS ( singlebranchmode ) %][% itemloo.branchname %] [% END %]</td>
310
                    <td class="location">[% UNLESS ( singlebranchmode ) %][% item.branchname %] [% END %]</td>
305
                    <td class="homebranch">[% itemloo.homebranch %]<span class="shelvingloc">[% itemloo.location %]</span> </td>
311
                    <td class="homebranch">[% item.homebranch %]<span class="shelvingloc">[% item.location %]</span> </td>
306
		    [% IF ( itemdata_ccode ) %]<td>[% itemloo.ccode %]</td>[% END %]
312
                    [% IF ( itemdata_ccode ) %]<td>[% item.ccode %]</td>[% END %]
307
                    <td class="itemcallnumber">[% IF ( itemloo.itemcallnumber ) %] [% itemloo.itemcallnumber %][% END %]</td>
313
                    <td class="itemcallnumber">[% IF ( item.itemcallnumber ) %] [% item.itemcallnumber %][% END %]</td>
308
                    <td class="status">
314
                    <td class="status">
309
315
310
                [% IF ( itemloo.datedue ) %]
316
                        [% IF ( item.datedue ) %]
311
						<span class="datedue">Checked out
317
                            <span class="datedue">Checked out
312
                    [% UNLESS ( itemloo.NOTSAMEBRANCH ) %]
318
                                [% UNLESS ( item.NOTSAMEBRANCH ) %]
313
                          to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.borrowernumber %]">
319
                                    to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% item.borrowernumber %]">
314
			  [% IF ( itemloo.hidepatronname ) %]
320
                                        [% IF ( item.hidepatronname ) %]
315
			      [% itemloo.cardnumber %]
321
                                            [% item.cardnumber %]
316
			  [% ELSE %]
322
                                        [% ELSE %]
317
			      [% itemloo.firstname %] [% itemloo.surname %]
323
                                            [% item.firstname %] [% item.surname %]
318
			  [% END %]
324
                                        [% END %]
319
			  </a>
325
                                    </a>
320
                    [% END %]
326
                                [% END %]
321
						: due [% itemloo.datedue %]
327
                                : due [% item.datedue %]
322
						</span>
328
                            </span>
323
                [% ELSIF ( itemloo.transfertwhen ) %]
329
                        [% ELSIF ( item.transfertwhen ) %]
324
                           In transit from [% itemloo.transfertfrom %],
330
                            In transit from [% item.transfertfrom %],
325
                           to [% itemloo.transfertto %], since [% itemloo.transfertwhen %]
331
                            to [% item.transfertto %], since [% item.transfertwhen %]
326
							<!-- FIXME: the "since" clause is redundant w/ lastseen field -->
332
                            <!-- FIXME: the "since" clause is redundant w/ lastseen field -->
327
                [% END %]
333
                        [% END %]
328
334
329
                [% IF ( itemloo.itemlost ) %]
335
                        [% IF ( item.itemlost ) %]
330
                    [% IF ( itemloo.itemlostloop ) %]
336
                            [% IF ( item.itemlostloop ) %]
331
                    [% FOREACH itemlostloo IN itemloo.itemlostloop %]
337
                                [% FOREACH itemlostloo IN item.itemlostloop %]
332
                        [% IF ( itemlostloo.selected ) %]
338
                                    [% IF ( itemlostloo.selected ) %]
333
                                        <span class="lost">[% itemlostloo.lib %]</span>
339
                                        <span class="lost">[% itemlostloo.lib %]</span>
340
                                    [% END %]
341
                                [% END %]
342
                            [% ELSE %]
343
                                <span class="lost">Unavailable (lost or missing)</span>
344
                            [% END %]
334
                        [% END %]
345
                        [% END %]
335
                    [% END %]
336
                    [% ELSE %]
337
                                        <span class="lost">Unavailable (lost or missing)</span>
338
                    [% END %]
339
                [% END %]
340
346
341
                [% IF ( itemloo.wthdrawn ) %]
347
                        [% IF ( item.wthdrawn ) %]
342
                                        <span class="wdn">Withdrawn</span>
348
                            <span class="wdn">Withdrawn</span>
343
                [% END %]
349
                        [% END %]
344
350
345
                [% IF ( itemloo.damaged ) %]
351
                        [% IF ( item.damaged ) %]
346
                    [% IF ( itemloo.itemdamagedloop ) %]
352
                            [% IF ( item.itemdamagedloop ) %]
347
                        [% FOREACH itemdamagedloo IN itemloo.itemdamagedloop %]
353
                                [% FOREACH itemdamagedloo IN item.itemdamagedloop %]
348
                        [% IF ( itemdamagedloo.selected ) %]
354
                                    [% IF ( itemdamagedloo.selected ) %]
349
                                        <span class="dmg">[% itemdamagedloo.lib %]</span>
355
                                        <span class="dmg">[% itemdamagedloo.lib %]</span>
356
                                    [% END %]
357
                                [% END %]
358
                            [% ELSE %]
359
                                <span class="dmg">Damaged</span>
360
                            [% END %]
350
                        [% END %]
361
                        [% END %]
362
363
                        [% IF ( item.itemnotforloan ) %]
364
                            Not for loan
365
                            [% IF ( item.notforloanvalue ) %]
366
                                ([% item.notforloanvalue %])
367
                            [% END %]
351
                        [% END %]
368
                        [% END %]
352
                    [% ELSE %]
353
                                        <span class="dmg">Damaged</span>
354
                    [% END %]
355
                [% END %]
356
369
357
                [% IF ( itemloo.itemnotforloan ) %]
370
                        [% IF ( item.reservedate ) %]
358
                    Not for loan 
371
                            [% IF ( item.waitingdate ) %]
359
                    [% IF ( itemloo.notforloanvalue ) %]
372
                                Waiting
360
                        ([% itemloo.notforloanvalue %])
373
                            [% ELSE %]
361
                    [% END %]
374
                                Item-level hold
362
                [% END %]
375
                            [% END %]
376
                            [% IF ( canreservefromotherbranches ) %]
377
                                for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% item.ReservedForBorrowernumber %]">
378
                                    [% IF ( item.hidepatronname ) %]
379
                                        [% item.Reservedcardnumber %]
380
                                    [% ELSE %]
381
                                        [% item.ReservedForFirstname %] [% item.ReservedForSurname %]
382
                                    [% END %]
383
                                </a>
384
                            [% END %]
385
                            [% IF ( item.waitingdate ) %]
386
                                at[% ELSE %]for delivery at
387
                            [% END %]
388
                            [% item.ExpectedAtLibrary %]
389
                            [% IF ( item.waitingdate ) %]
390
                                since [% item.waitingdate %]
391
                            [% ELSE %]
392
                                [% IF ( item.reservedate ) %]
393
                                    (placed [% item.reservedate %])
394
                                [% END %]
395
                            [% END %]
396
                        [% END %]
397
                        [% UNLESS ( item.itemnotforloan or item.onloan or item.itemlost or item.wthdrawn or item.damaged or item.transfertwhen or item.reservedate ) %]
398
                            Available
399
                        [% END %]
363
400
364
                            
401
                        [% IF ( item.restricted ) %]
365
                [% IF ( itemloo.reservedate ) %]
402
                            <span class="restricted">([% item.restricted %])</span>
366
                    [% IF ( itemloo.waitingdate ) %]
403
                        [% END %]
367
                        Waiting
368
                    [% ELSE %]
369
                        Item-level hold
370
                    [% END %]
371
                    [% IF ( canreservefromotherbranches ) %]for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.ReservedForBorrowernumber %]">
372
		        [% IF ( itemloo.hidepatronname ) %]
373
		            [% itemloo.Reservedcardnumber %]
374
		        [% ELSE %]
375
		            [% itemloo.ReservedForFirstname %] [% itemloo.ReservedForSurname %]
376
			[% END %]
377
		    </a>[% END %]
378
                    [% IF ( itemloo.waitingdate ) %]
379
                        at[% ELSE %]for delivery at
380
                    [% END %]   [% itemloo.ExpectedAtLibrary %]
381
                    [% IF ( itemloo.waitingdate ) %]
382
                        since [% itemloo.waitingdate %]
383
                    [% ELSE %]
384
                        [% IF ( itemloo.reservedate ) %](placed [% itemloo.reservedate %])[% END %]
385
                    [% END %]
386
                [% END %]
387
                [% UNLESS ( itemloo.itemnotforloan ) %][% UNLESS ( itemloo.onloan ) %][% UNLESS ( itemloo.itemlost ) %][% UNLESS ( itemloo.wthdrawn ) %][% UNLESS ( itemloo.damaged ) %][% UNLESS ( itemloo.transfertwhen ) %][% UNLESS ( itemloo.reservedate ) %]
388
                                        Available
389
                [% END %][% END %][% END %][% END %][% END %][% END %][% END %]
390
404
391
                [% IF ( itemloo.restricted ) %]<span class="restricted">([% itemloo.restricted %])</span>[% END %]
392
                        
393
                    </td>
405
                    </td>
394
                    <td class="datelastseen">[% itemloo.datelastseen %]</td>
406
                    <td class="datelastseen">[% item.datelastseen %]</td>
395
                    <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>
407
                    <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>
396
				[% IF ( volinfo ) %]	<td class="enumchron">
408
                    [% IF ( volinfo ) %]
397
					[% IF ( itemdata_enumchron ) %]
409
                        <td class="enumchron">
398
						[% IF ( itemloo.enumchron ) %]
410
                            [% IF ( itemdata_enumchron ) %]
399
						[% itemloo.enumchron %][% IF ( itemloo.serialseq ) %] -- [% END %]
411
                                [% IF ( item.enumchron ) %]
400
						[% END %]
412
                                    [% item.enumchron %]
401
					[% itemloo.serialseq %][% IF ( itemloo.publisheddate ) %] ([% itemloo.publisheddate %])[% END %]
413
                                    [% IF ( item.serialseq ) %] -- [% END %]
402
					[% END %]
414
                                [% END %]
403
				</td>[% END %]
415
                                [% item.serialseq %]
404
				[% IF ( itemdata_uri ) %]
416
                                [% IF ( item.publisheddate ) %] ([% item.publisheddate %])[% END %]
405
					<td class="uri"><a href="[% itemloo.uri %]">[% itemloo.uri %]</a></td>
417
                            [% END %]
406
				[% END %]
418
                        </td>
407
				[% IF ( itemdata_copynumber ) %]
419
                    [% END %]
408
					<td class="copynumber">[% itemloo.copynumber %]</td>
420
                    [% IF ( itemdata_uri ) %]
409
				[% END %]
421
                        <td class="uri"><a href="[% item.uri %]">[% item.uri %]</a></td>
410
	        [% IF materials %]
422
                    [% END %]
411
		    <td class="materials"> [% itemloo.materials %] </td>
423
                    [% IF ( itemdata_copynumber ) %]
412
		[% END %]
424
                        <td class="copynumber">[% item.copynumber %]</td>
413
                [% IF ( itemdata_itemnotes ) %]<td><div class="itemnotes">[% itemloo.itemnotes %]</div></td>[% END %]
425
                    [% END %]
414
		[% IF ( SpineLabelShowPrintOnBibDetails ) %]
426
                    [% IF materials %]
415
            <td><a href="/cgi-bin/koha/labels/spinelabel-print.pl?barcode=[% itemloo.barcode %]" >Print label</a></td>
427
                        <td class="materials"> [% item.materials %] </td>
416
		[% END %]
428
                    [% END %]
417
                [% IF ( hostrecords ) %]
429
                    [% IF ( itemdata_itemnotes ) %]
418
                      <td>[% IF ( itemloo.hostbiblionumber) %]<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% itemloo.hostbiblionumber %]" >[% itemloo.hosttitle %]</a>[% END %]</td>
430
                        <td><div class="itemnotes">[% item.itemnotes %]</div></td>
419
                [% END %]
431
                    [% END %]
420
                [% IF ( analyze ) %]<td>
432
                    [% IF ( SpineLabelShowPrintOnBibDetails ) %]
421
			[% IF ( itemloo.countanalytics ) %]
433
                        <td><a href="/cgi-bin/koha/labels/spinelabel-print.pl?barcode=[% item.barcode %]" >Print label</a></td>
422
				<a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&amp;q=[% itemloo.itemnumber %]">[% itemloo.countanalytics %] analytics</a>
434
                    [% END %]
423
			[% END %]</td>
435
                    [% IF ( hostrecords ) %]
424
		[% END %]
436
                        <td>[% IF ( item.hostbiblionumber) %]<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.hostbiblionumber %]" >[% item.hosttitle %]</a>[% END %]</td>
425
                [% IF ( analyze ) %]
437
                    [% END %]
426
                        <td><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?hostbiblionumber=[% itemloo.biblionumber %]&amp;hostitemnumber=[% itemloo.itemnumber %]">Create analytics</a></td>
438
                    [% IF ( analyze ) %]
427
                [% END %]
439
                        <td>
440
                            [% IF ( item.countanalytics ) %]
441
                                <a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&amp;q=[% item.itemnumber %]">[% item.countanalytics %] analytics</a>
442
                            [% END %]
443
                        </td>
444
                    [% END %]
445
                    [% IF ( analyze ) %]
446
                        <td><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?hostbiblionumber=[% item.biblionumber %]&amp;hostitemnumber=[% item.itemnumber %]">Create analytics</a></td>
447
                    [% END %]
428
448
429
                </tr>
449
                </tr>
430
            [% END %]
450
            [% END %]
431
        </table>
451
        </tbody>
452
    </table>
453
[% END %][%# end of block items_table %]
454
455
<div id="holdings">
456
[% IF ( count ) %]
457
    [% IF ( showncount ) %]
458
        [% PROCESS items_table items=itemloop %]
432
        [% END %]
459
        [% END %]
433
                [% IF ( hiddencount ) %]
460
                [% IF ( hiddencount ) %]
434
                   <p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]&amp;showallitems=1">Show all items ([% hiddencount %] hidden)</a>
461
                   <p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]&amp;showallitems=1">Show all items ([% hiddencount %] hidden)</a>
Lines 451-456 function verify_images() { Link Here
451
    [% END %]
478
    [% END %]
452
[% END %]
479
[% END %]
453
    </div>
480
    </div>
481
482
[% IF (SeparateHoldings) %]
483
    <div id="otherholdings">
484
        [% IF (otheritemloop.size) %]
485
            [% PROCESS items_table items=otheritemloop %]
486
        [% ELSE %]
487
            No other items.
488
        [% END %]
489
    </div>
490
[% END %]
454
    
491
    
455
<div id="description">
492
<div id="description">
456
<div class="content_set">
493
<div class="content_set">
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt (-9 / +25 lines)
Lines 654-662 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
654
<div id="bibliodescriptions" class="toptabs">
654
<div id="bibliodescriptions" class="toptabs">
655
655
656
<ul>   
656
<ul>   
657
[% IF ( defaulttab == 'holdings' ) %]<li id="tab_holdings" class="ui-tabs-selected">[% ELSE %]<li id="tab_holdings">[% END %]
657
    [% IF ( defaulttab == 'holdings' ) %]<li id="tab_holdings" class="ui-tabs-selected">[% ELSE %]<li id="tab_holdings">[% END %]
658
    <a href="#holdings">Holdings ( [% count %] )</a>
658
        <a href="#holdings">[% IF SeparateHoldings %][% LoginBranchname %] holdings[% ELSE %]Holdings[% END %] ( [% itemloop.size || 0 %] )</a>
659
</li>
659
    </li>
660
    [% IF (SeparateHoldings) %]
661
        <li><a href="#otherholdings">Other holdings ( [% otheritemloop.size || 0 %] )</a></li>
662
    [% END %]
660
<li id="tab_descriptions"> <a href="#descriptions">Title notes</a></li>
663
<li id="tab_descriptions"> <a href="#descriptions">Title notes</a></li>
661
[% IF ( SYNDETICS_TOC ) %]
664
[% IF ( SYNDETICS_TOC ) %]
662
    <li id="tab_toc"> <a href="#toc">TOC</a></li>
665
    <li id="tab_toc"> <a href="#toc">TOC</a></li>
Lines 740-750 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
740
</div>
743
</div>
741
[% END %]
744
[% END %]
742
745
743
<div id="holdings">
746
[% BLOCK items_table %]
744
[% IF ( count ) %]
745
    [% IF ( lotsofitems ) %]
746
	<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>
747
    [% ELSE %]
748
    <table id="holdingst">
747
    <table id="holdingst">
749
        <thead><tr>
748
        <thead><tr>
750
            [% IF ( item_level_itypes ) %]<th id="item_itemtype">Item type</th>[% END %]
749
            [% IF ( item_level_itypes ) %]<th id="item_itemtype">Item type</th>[% END %]
Lines 764-770 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
764
            <th>Item hold queue priority</th>
763
            <th>Item hold queue priority</th>
765
        [% END %]
764
        [% END %]
766
        </tr></thead>
765
        </tr></thead>
767
	    <tbody>[% FOREACH ITEM_RESULT IN ITEM_RESULTS %]
766
	    <tbody>[% FOREACH ITEM_RESULT IN items %]
768
      <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 %]
767
      <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 %]
769
             <td class="location">
768
             <td class="location">
770
    [% UNLESS ( singleBranchMode ) %]
769
    [% UNLESS ( singleBranchMode ) %]
Lines 803-808 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
803
	    </tr>
802
	    </tr>
804
	    [% END %]</tbody>
803
	    [% END %]</tbody>
805
	</table>
804
	</table>
805
[% END %][%# end of items_table block %]
806
807
<div id="holdings">
808
[% IF ( itemloop.size ) %]
809
    [% IF ( lotsofitems ) %]
810
	<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>
811
    [% ELSE %]
812
        [% PROCESS items_table items=itemloop %]
806
    [% END %]
813
    [% END %]
807
    [% IF holds_count.defined || priority %]
814
    [% IF holds_count.defined || priority %]
808
    <div id="bib_holds">
815
    <div id="bib_holds">
Lines 887-892 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
887
<br clear="all" />
894
<br clear="all" />
888
</div>
895
</div>
889
896
897
[% IF (SeparateHoldings) %]
898
    <div id="otherholdings">
899
        [% IF (otheritemloop.size) %]
900
            [% PROCESS items_table items=otheritemloop %]
901
        [% ELSE %]
902
            No other items.
903
        [% END %]
904
    </div>
905
[% END %]
890
906
891
<div id="descriptions">
907
<div id="descriptions">
892
<div class="content_set">
908
<div class="content_set">
(-)a/opac/opac-detail.pl (-10 / +26 lines)
Lines 484-496 foreach my $subscription (@subscriptions) { Link Here
484
484
485
$dat->{'count'} = scalar(@items);
485
$dat->{'count'} = scalar(@items);
486
486
487
# If there is a lot of items, and the user has not decided
488
# to view them all yet, we first warn him
489
# TODO: The limit of 50 could be a syspref
490
my $viewallitems = $query->param('viewallitems');
491
if ($dat->{'count'} >= 50 && !$viewallitems) {
492
    $template->param('lotsofitems' => 1);
493
}
494
487
495
my $biblio_authorised_value_images = C4::Items::get_authorised_value_images( C4::Biblio::get_biblio_authorised_values( $biblionumber, $record ) );
488
my $biblio_authorised_value_images = C4::Items::get_authorised_value_images( C4::Biblio::get_biblio_authorised_values( $biblionumber, $record ) );
496
489
Lines 519-524 $template->param( show_priority => $has_hold ) ; Link Here
519
my $norequests = 1;
512
my $norequests = 1;
520
my $branches = GetBranches();
513
my $branches = GetBranches();
521
my %itemfields;
514
my %itemfields;
515
my (@itemloop, @otheritemloop);
516
my $currentbranch = C4::Context->userenv ? C4::Context->userenv->{branch} : undef;
517
if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) {
518
    $template->param(SeparateHoldings => 1);
519
}
522
for my $itm (@items) {
520
for my $itm (@items) {
523
    $itm->{holds_count} = $item_reserves{ $itm->{itemnumber} };
521
    $itm->{holds_count} = $item_reserves{ $itm->{itemnumber} };
524
    $itm->{priority} = $priority{ $itm->{itemnumber} };
522
    $itm->{priority} = $priority{ $itm->{itemnumber} };
Lines 569-574 for my $itm (@items) { Link Here
569
        $itm->{transfertfrom} = $branches->{$transfertfrom}{branchname};
567
        $itm->{transfertfrom} = $branches->{$transfertfrom}{branchname};
570
        $itm->{transfertto}   = $branches->{$transfertto}{branchname};
568
        $itm->{transfertto}   = $branches->{$transfertto}{branchname};
571
     }
569
     }
570
    my $homebranch = $itm->{homebranch};
571
    if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) {
572
        if ($homebranch and $homebranch eq $currentbranch) {
573
            push @itemloop, $itm;
574
        } else {
575
            push @otheritemloop, $itm;
576
        }
577
    } else {
578
        push @itemloop, $itm;
579
    }
580
}
581
582
# If there is a lot of items, and the user has not decided
583
# to view them all yet, we first warn him
584
# TODO: The limit of 50 could be a syspref
585
my $viewallitems = $query->param('viewallitems');
586
if (scalar(@itemloop) >= 50 && !$viewallitems) {
587
    $template->param('lotsofitems' => 1);
572
}
588
}
573
589
574
## get notes and subjects from MARC record
590
## get notes and subjects from MARC record
Lines 697-703 if(C4::Context->preference("ISBD")) { Link Here
697
}
713
}
698
714
699
$template->param(
715
$template->param(
700
    ITEM_RESULTS        => \@items,
716
    itemloop            => \@itemloop,
717
    otheritemloop       => \@otheritemloop,
701
    subscriptionsnumber => $subscriptionsnumber,
718
    subscriptionsnumber => $subscriptionsnumber,
702
    biblionumber        => $biblionumber,
719
    biblionumber        => $biblionumber,
703
    subscriptions       => \@subs,
720
    subscriptions       => \@subs,
Lines 960-966 my $defaulttab = Link Here
960
        ? 'subscriptions' :
977
        ? 'subscriptions' :
961
    $opac_serial_default eq 'serialcollection' && @serialcollections > 0
978
    $opac_serial_default eq 'serialcollection' && @serialcollections > 0
962
        ? 'serialcollection' :
979
        ? 'serialcollection' :
963
    $opac_serial_default eq 'holdings' && $dat->{'count'} > 0
980
    $opac_serial_default eq 'holdings' && scalar (@itemloop) > 0
964
        ? 'holdings' :
981
        ? 'holdings' :
965
    $subscriptionsnumber
982
    $subscriptionsnumber
966
        ? 'subscriptions' :
983
        ? 'subscriptions' :
967
- 

Return to bug 7674