@@ -, +, @@ detail page (staff+opac) --- 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 @@ -177,15 +177,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 @@ -267,8 +272,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 ); @@ -332,6 +345,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 @@ -388,3 +388,5 @@ INSERT INTO systempreferences (variable, value, options, explanation, type) VALU 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('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'); 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'); +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 @@ -5927,6 +5927,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 @@ -261,18 +261,22 @@ function verify_images() {
-