if ($currentbranch and C4::Context->preference('SeparateHoldings')) {
$template->param(SeparateHoldings => 1);
}
+my $separatebranch = C4::Context->preference('SeparateHoldingsBranch') || 'homebranch';
foreach my $item (@items) {
-
- my $homebranchcode = $item->{homebranch};
+ my $itembranchcode = $item->{$separatebranch};
$item->{homebranch} = GetBranchName($item->{homebranch});
# can place holds defaults to yes
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) {
+ if ($currentbranch and $currentbranch ne "NO_LIBRARY_SET"
+ and C4::Context->preference('SeparateHoldings')) {
+ if ($itembranchcode and $itembranchcode eq $currentbranch) {
push @itemloop, $item;
} else {
push @otheritemloop, $item;
('PatronSelfRegistrationBorrowerMandatoryField', 'surname|firstname', NULL , 'Choose the mandatory fields for a patron''s account, when registering via the OPAC.', 'free'),
('PatronSelfRegistrationBorrowerUnwantedField', '', NULL , 'Name the fields you don''t want to display when registering a new patron via the OPAC.', 'free');
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('SeparateHoldingsBranch', 'homebranch', 'Branch used to separate holdings', 'homebranch|holdingbranch', 'Choice');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacSeparateHoldings', '0', 'Separate current branch holdings from other holdings (OPAC)', NULL, 'YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacSeparateHoldingsBranch', 'homebranch', 'Branch used to separate holdings (OPAC)', 'homebranch|holdingbranch', 'Choice');
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)) {
$dbh->do(
SetVersion($DBversion);
}
+<<<<<<< HEAD
$DBversion = "3.11.00.005";
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
$dbh->do(qq{CREATE TABLE borrower_attribute_types_branches(bat_code VARCHAR(10), b_branchcode VARCHAR(10),FOREIGN KEY (bat_code) REFERENCES borrower_attribute_types(code) ON DELETE CASCADE,FOREIGN KEY (b_branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE ) ENGINE=INNODB DEFAULT CHARSET=utf8;});
SetVersion ($DBversion);
}
+$DBversion = "3.11.00.XXX";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("
+ INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES
+ ('SeparateHoldings', '0', 'Separate current branch holdings from other holdings', NULL, 'YesNo'),
+ ('SeparateHoldingsBranch', 'homebranch', 'Branch used to separate holdings', 'homebranch|holdingbranch', 'Choice'),
+ ('OpacSeparateHoldings', '0', 'Separate current branch holdings from other holdings (OPAC)', NULL, 'YesNo'),
+ ('OpacSeparateHoldingsBranch', 'homebranch', 'Branch used to separate holdings (OPAC)', 'homebranch|holdingbranch', 'Choice')
+ ");
+
+ print "Upgrade to $DBversion done (Add systempreferences SeparateHoldings, SeparateHoldingsBranch, OpacSeparateHoldings and OpacSeparateHoldingsBranch) \n";
+ SetVersion ($DBversion);
+}
+
+
=head1 FUNCTIONS
=head2 TableExists($table)
-
- 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.
+ yes: Separate
+ no: Don't separate
+ - 'items display into two tabs. First tab contains items whose'
+ - pref: SeparateHoldingsBranch
+ choices:
+ homebranch: 'home branch'
+ holdingbranch: 'holding branch'
+ - 'is the branch of user logged in. The other tab contains other items.'
- '<br />Note: Available options are: BIBTEX (<code>bibtex</code>), Dublin Core (<code>dc</code>),'
- 'MARCXML (<code>marcxml</code>), MARC-8 encoded MARC (<code>marc8</code>), Unicode/UTF-8 encoded MARC (<code>utf8</code>),'
- 'Unicode/UTF-8 encoded MARC without local use -9xx, x9x, xx9- fields and subfields (<code>marcstd</code>), MODS (<code>mods</code>), RIS (<code>ris</code>)'
+ -
+ - pref: OpacSeparateHoldings
+ choices:
+ yes: Separate
+ no: Don't separate
+ - 'items display into two tabs. First tab contains items whose'
+ - pref: OpacSeparateHoldingsBranch
+ choices:
+ homebranch: 'home branch'
+ holdingbranch: 'holding branch'
+ - 'is the branch of user logged in. The other tab contains other items.'
Features:
-
- pref: opacuserlogin
if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) {
$template->param(SeparateHoldings => 1);
}
+my $separatebranch = C4::Context->preference('OpacSeparateHoldingsBranch');
for my $itm (@items) {
$itm->{holds_count} = $item_reserves{ $itm->{itemnumber} };
$itm->{priority} = $priority{ $itm->{itemnumber} };
$itm->{transfertfrom} = $branches->{$transfertfrom}{branchname};
$itm->{transfertto} = $branches->{$transfertto}{branchname};
}
- my $homebranch = $itm->{homebranch};
+ my $itembranch = $itm->{$separatebranch};
if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) {
- if ($homebranch and $homebranch eq $currentbranch) {
+ if ($itembranch and $itembranch eq $currentbranch) {
push @itemloop, $itm;
} else {
push @otheritemloop, $itm;