@@ -, +, @@
---
catalogue/detail.pl | 18 +-
installer/data/mysql/sysprefs.sql | 2 +
installer/data/mysql/updatedatabase.pl | 15 +
.../en/modules/admin/preferences/cataloguing.pref | 13 +-
.../prog/en/modules/catalogue/detail.tt | 291 +++++++++++---------
koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 34 ++-
opac/opac-detail.pl | 35 ++-
7 files changed, 260 insertions(+), 148 deletions(-)
--- a/catalogue/detail.pl
+++ a/catalogue/detail.pl
@@ -175,15 +175,20 @@ $dat->{'hiddencount'} = scalar @all_items + @hostitems - scalar @items;
my $shelflocations = GetKohaAuthorisedValues('items.location', $fw);
my $collections = GetKohaAuthorisedValues('items.ccode' , $fw);
my $copynumbers = GetKohaAuthorisedValues('items.copynumber', $fw);
-my (@itemloop, %itemfields);
+my (@itemloop, @otheritemloop, %itemfields);
my $norequests = 1;
my $authvalcode_items_itemlost = GetAuthValCode('items.itemlost',$fw);
my $authvalcode_items_damaged = GetAuthValCode('items.damaged', $fw);
my $analytics_flag;
my $materials_flag; # set this if the items have anything in the materials field
+my $currentbranch = C4::Context->userenv ? C4::Context->userenv->{branch} : undef;
+if ($currentbranch and C4::Context->preference('SeparateHoldings')) {
+ $template->param(SeparateHoldings => 1);
+}
foreach my $item (@items) {
+ my $homebranchcode = $item->{homebranch};
$item->{homebranch} = GetBranchName($item->{homebranch});
# can place holds defaults to yes
@@ -265,8 +270,16 @@ foreach my $item (@items) {
}
if (defined($item->{'materials'}) && $item->{'materials'} =~ /\S/){
$materials_flag = 1;
+
+ if ($currentbranch and $currentbranch ne "NO_LIBRARY_SET" and C4::Context->preference('SeparateHoldings')) {
+ if ($homebranchcode and $homebranchcode eq $currentbranch) {
+ push @itemloop, $item;
+ } else {
+ push @otheritemloop, $item;
+ }
+ } else {
+ push @itemloop, $item;
}
- push @itemloop, $item;
}
$template->param( norequests => $norequests );
@@ -330,6 +343,7 @@ foreach ( keys %{$dat} ) {
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages"));
$template->param(
itemloop => \@itemloop,
+ otheritemloop => \@otheritemloop,
biblionumber => $biblionumber,
($analyze? 'analyze':'detailview') =>1,
subscriptions => \@subs,
--- a/installer/data/mysql/sysprefs.sql
+++ a/installer/data/mysql/sysprefs.sql
@@ -386,3 +386,5 @@ INSERT INTO systempreferences (variable,value,explanation,type) VALUES('OPACdidy
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');
INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('BlockReturnOfWithdrawnItems', '1', '0', 'If enabled, items that are marked as withdrawn cannot be returned.', 'YesNo');
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');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SeparateHoldings', '0', 'Separate current branch holdings from other holdings', NULL, 'YesNo');
+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
+++ a/installer/data/mysql/updatedatabase.pl
@@ -5926,6 +5926,21 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
SetVersion ($DBversion);
}
+$DBversion = "XXX";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("
+ INSERT INTO systempreferences (variable,value,explanation,options,type)
+ VALUES('SeparateHoldings', '0', 'Separate current branch holdings from other holdings', NULL, 'YesNo');
+ ");
+ $dbh->do("
+ INSERT INTO systempreferences (variable,value,explanation,options,type)
+ VALUES('OpacSeparateHoldings', '0', 'Separate current branch holdings from other holdings (OPAC)', NULL, 'YesNo');
+ ");
+
+ print "Upgrade to $DBversion done (Add systempreferences SeparateHoldings and OpacSeparateHoldings) \n";
+ SetVersion ($DBversion);
+}
+
$DBversion = "3.09.00.053";
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref
@@ -156,4 +156,15 @@ Cataloging:
- pref: OpacSuppressionByIPRange
class: short
- (Leave blank if not used. Define a range like 192.168.
.)
-
+ -
+ - pref: SeparateHoldings
+ choices:
+ yes: "Separate"
+ no: "Don't separate"
+ - current branch holdings from other holdings at staff interface.
+ -
+ - pref: OpacSeparateHoldings
+ choices:
+ yes: "Separate"
+ no: "Don't separate"
+ - current branch holdings from other holdings at OPAC.
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
@@ -255,18 +255,22 @@ function verify_images() {
Item type | [% END %]Current location | @@ -281,148 +285,171 @@ function verify_images() { [% IF ( itemdata_copynumber ) %]Copy no. | [% END %] [% IF materials %]Materials specified | [% END %] [% IF ( itemdata_itemnotes ) %]Public notes | [% END %] - [% IF ( SpineLabelShowPrintOnBibDetails ) %]Spine label | [% END %] - [% IF ( hostrecords ) %]Host records | [% END %] - [% IF ( analyze ) %]Used in | [% END %] + [% IF ( SpineLabelShowPrintOnBibDetails ) %] | Spine label | [% END %] + [% IF ( hostrecords ) %]Host records | [% END %] + [% IF ( analyze ) %]Used in | [% END %] | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
- [% IF !noItemTypeImages && itemloo.imageurl %] - - [% END %] - [% itemloo.description %] - | ++ [% IF !noItemTypeImages && item.imageurl %] + + [% END %] + [% item.description %] + | [% END %] -[% UNLESS ( singlebranchmode ) %][% itemloo.branchname %] [% END %] | -[% itemloo.homebranch %][% itemloo.location %] | - [% IF ( itemdata_ccode ) %][% itemloo.ccode %] | [% END %] -[% IF ( itemloo.itemcallnumber ) %] [% itemloo.itemcallnumber %][% END %] | +[% UNLESS ( singlebranchmode ) %][% item.branchname %] [% END %] | +[% item.homebranch %][% item.location %] | + [% IF ( itemdata_ccode ) %][% item.ccode %] | [% END %] +[% IF ( item.itemcallnumber ) %] [% item.itemcallnumber %][% END %] | - [% IF ( itemloo.datedue ) %] - Checked out - [% UNLESS ( itemloo.NOTSAMEBRANCH ) %] - to - [% IF ( itemloo.hidepatronname ) %] - [% itemloo.cardnumber %] - [% ELSE %] - [% itemloo.firstname %] [% itemloo.surname %] - [% END %] - - [% END %] - : due [% itemloo.datedue %] - - [% ELSIF ( itemloo.transfertwhen ) %] - In transit from [% itemloo.transfertfrom %], - to [% itemloo.transfertto %], since [% itemloo.transfertwhen %] - - [% END %] + [% IF ( item.datedue ) %] + Checked out + [% UNLESS ( item.NOTSAMEBRANCH ) %] + to + [% IF ( item.hidepatronname ) %] + [% item.cardnumber %] + [% ELSE %] + [% item.firstname %] [% item.surname %] + [% END %] + + [% END %] + : due [% item.datedue %] + + [% ELSIF ( item.transfertwhen ) %] + In transit from [% item.transfertfrom %], + to [% item.transfertto %], since [% item.transfertwhen %] + + [% END %] - [% IF ( itemloo.itemlost ) %] - [% IF ( itemloo.itemlostloop ) %] - [% FOREACH itemlostloo IN itemloo.itemlostloop %] - [% IF ( itemlostloo.selected ) %] + [% IF ( item.itemlost ) %] + [% IF ( item.itemlostloop ) %] + [% FOREACH itemlostloo IN item.itemlostloop %] + [% IF ( itemlostloo.selected ) %] [% itemlostloo.lib %] + [% END %] + [% END %] + [% ELSE %] + Unavailable (lost or missing) + [% END %] [% END %] - [% END %] - [% ELSE %] - Unavailable (lost or missing) - [% END %] - [% END %] - [% IF ( itemloo.wthdrawn ) %] - Withdrawn - [% END %] + [% IF ( item.wthdrawn ) %] + Withdrawn + [% END %] - [% IF ( itemloo.damaged ) %] - [% IF ( itemloo.itemdamagedloop ) %] - [% FOREACH itemdamagedloo IN itemloo.itemdamagedloop %] - [% IF ( itemdamagedloo.selected ) %] + [% IF ( item.damaged ) %] + [% IF ( item.itemdamagedloop ) %] + [% FOREACH itemdamagedloo IN item.itemdamagedloop %] + [% IF ( itemdamagedloo.selected ) %] [% itemdamagedloo.lib %] + [% END %] + [% END %] + [% ELSE %] + Damaged + [% END %] [% END %] + + [% IF ( item.itemnotforloan ) %] + Not for loan + [% IF ( item.notforloanvalue ) %] + ([% item.notforloanvalue %]) + [% END %] [% END %] - [% ELSE %] - Damaged - [% END %] - [% END %] - [% IF ( itemloo.itemnotforloan ) %] - Not for loan - [% IF ( itemloo.notforloanvalue ) %] - ([% itemloo.notforloanvalue %]) - [% END %] - [% END %] + [% IF ( item.reservedate ) %] + [% IF ( item.waitingdate ) %] + Waiting + [% ELSE %] + Item-level hold + [% END %] + [% IF ( canreservefromotherbranches ) %] + for + [% IF ( item.hidepatronname ) %] + [% item.Reservedcardnumber %] + [% ELSE %] + [% item.ReservedForFirstname %] [% item.ReservedForSurname %] + [% END %] + + [% END %] + [% IF ( item.waitingdate ) %] + at[% ELSE %]for delivery at + [% END %] + [% item.ExpectedAtLibrary %] + [% IF ( item.waitingdate ) %] + since [% item.waitingdate %] + [% ELSE %] + [% IF ( item.reservedate ) %] + (placed [% item.reservedate %]) + [% END %] + [% END %] + [% END %] + [% UNLESS ( item.itemnotforloan or item.onloan or item.itemlost or item.wthdrawn or item.damaged or item.transfertwhen or item.reservedate ) %] + Available + [% END %] - - [% IF ( itemloo.reservedate ) %] - [% IF ( itemloo.waitingdate ) %] - Waiting - [% ELSE %] - Item-level hold - [% END %] - [% IF ( canreservefromotherbranches ) %]for - [% IF ( itemloo.hidepatronname ) %] - [% itemloo.Reservedcardnumber %] - [% ELSE %] - [% itemloo.ReservedForFirstname %] [% itemloo.ReservedForSurname %] - [% END %] - [% END %] - [% IF ( itemloo.waitingdate ) %] - at[% ELSE %]for delivery at - [% END %] [% itemloo.ExpectedAtLibrary %] - [% IF ( itemloo.waitingdate ) %] - since [% itemloo.waitingdate %] - [% ELSE %] - [% IF ( itemloo.reservedate ) %](placed [% itemloo.reservedate %])[% END %] - [% END %] - [% END %] - [% UNLESS ( itemloo.itemnotforloan ) %][% UNLESS ( itemloo.onloan ) %][% UNLESS ( itemloo.itemlost ) %][% UNLESS ( itemloo.wthdrawn ) %][% UNLESS ( itemloo.damaged ) %][% UNLESS ( itemloo.transfertwhen ) %][% UNLESS ( itemloo.reservedate ) %] - Available - [% END %][% END %][% END %][% END %][% END %][% END %][% END %] + [% IF ( item.restricted ) %] + ([% item.restricted %]) + [% END %] - [% IF ( itemloo.restricted ) %]([% itemloo.restricted %])[% END %] - | -[% itemloo.datelastseen %] | -[% itemloo.barcode %] | - [% IF ( volinfo ) %]- [% IF ( itemdata_enumchron ) %] - [% IF ( itemloo.enumchron ) %] - [% itemloo.enumchron %][% IF ( itemloo.serialseq ) %] -- [% END %] - [% END %] - [% itemloo.serialseq %][% IF ( itemloo.publisheddate ) %] ([% itemloo.publisheddate %])[% END %] - [% END %] - | [% END %] - [% IF ( itemdata_uri ) %] -[% itemloo.uri %] | - [% END %] - [% IF ( itemdata_copynumber ) %] -[% itemloo.copynumber %] | - [% END %] - [% IF materials %] -[% itemloo.materials %] | - [% END %] - [% IF ( itemdata_itemnotes ) %][% itemloo.itemnotes %] | [% END %]
- [% IF ( SpineLabelShowPrintOnBibDetails ) %]
- Print label | - [% END %] - [% IF ( hostrecords ) %] -[% IF ( itemloo.hostbiblionumber) %][% itemloo.hosttitle %][% END %] | - [% END %] - [% IF ( analyze ) %]- [% IF ( itemloo.countanalytics ) %] - [% itemloo.countanalytics %] analytics - [% END %] | - [% END %] - [% IF ( analyze ) %] -Create analytics | - [% END %] +[% item.datelastseen %] | +[% item.barcode %] | + [% IF ( volinfo ) %] ++ [% IF ( itemdata_enumchron ) %] + [% IF ( item.enumchron ) %] + [% item.enumchron %] + [% IF ( item.serialseq ) %] -- [% END %] + [% END %] + [% item.serialseq %] + [% IF ( item.publisheddate ) %] ([% item.publisheddate %])[% END %] + [% END %] + | + [% END %] + [% IF ( itemdata_uri ) %] +[% item.uri %] | + [% END %] + [% IF ( itemdata_copynumber ) %] +[% item.copynumber %] | + [% END %] + [% IF materials %] +[% item.materials %] | + [% END %] + [% IF ( itemdata_itemnotes ) %] +[% item.itemnotes %] |
+ [% END %]
+ [% IF ( SpineLabelShowPrintOnBibDetails ) %]
+ Print label | + [% END %] + [% IF ( hostrecords ) %] +[% IF ( item.hostbiblionumber) %][% item.hosttitle %][% END %] | + [% END %] + [% IF ( analyze ) %] ++ [% IF ( item.countanalytics ) %] + [% item.countanalytics %] analytics + [% END %] + | + [% END %] + [% IF ( analyze ) %] +Create analytics | + [% END %]
Show all items ([% hiddencount %] hidden) @@ -445,6 +472,16 @@ function verify_images() { [% END %] [% END %]
This record has many physical items. Click here to view them all.
- [% ELSE %] +[% BLOCK items_table %]Item type | [% END %] @@ -753,7 +752,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {Item hold queue priority | [% END %]
---|---|
[% UNLESS ( noItemTypeImages ) %][% IF ( ITEM_RESULT.imageurl ) %][% END %][% END %] [% ITEM_RESULT.description %] | [% END %][% UNLESS ( singleBranchMode ) %] @@ -792,6 +791,14 @@ YAHOO.util.Event.onContentReady("furtherm", function () { |
This record has many physical items. Click here to view them all.
+ [% ELSE %] + [% PROCESS items_table items=itemloop %] [% END %] [% IF holds_count.defined || priority %]