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

(-)a/catalogue/detail.pl (-4 / +5 lines)
Lines 186-194 my $currentbranch = C4::Context->userenv ? C4::Context->userenv->{branch} : unde Link Here
186
if ($currentbranch and C4::Context->preference('SeparateHoldings')) {
186
if ($currentbranch and C4::Context->preference('SeparateHoldings')) {
187
    $template->param(SeparateHoldings => 1);
187
    $template->param(SeparateHoldings => 1);
188
}
188
}
189
my $separatebranch = C4::Context->preference('SeparateHoldingsBranch') || 'homebranch';
189
foreach my $item (@items) {
190
foreach my $item (@items) {
190
191
    my $itembranchcode = $item->{$separatebranch};
191
    my $homebranchcode = $item->{homebranch};
192
    $item->{homebranch}        = GetBranchName($item->{homebranch});
192
    $item->{homebranch}        = GetBranchName($item->{homebranch});
193
193
194
    # can place holds defaults to yes
194
    # can place holds defaults to yes
Lines 271-278 foreach my $item (@items) { Link Here
271
    if (defined($item->{'materials'}) && $item->{'materials'} =~ /\S/){
271
    if (defined($item->{'materials'}) && $item->{'materials'} =~ /\S/){
272
	$materials_flag = 1;
272
	$materials_flag = 1;
273
273
274
    if ($currentbranch and $currentbranch ne "NO_LIBRARY_SET" and C4::Context->preference('SeparateHoldings')) {
274
    if ($currentbranch and $currentbranch ne "NO_LIBRARY_SET"
275
        if ($homebranchcode and $homebranchcode eq $currentbranch) {
275
    and C4::Context->preference('SeparateHoldings')) {
276
        if ($itembranchcode and $itembranchcode eq $currentbranch) {
276
            push @itemloop, $item;
277
            push @itemloop, $item;
277
        } else {
278
        } else {
278
            push @otheritemloop, $item;
279
            push @otheritemloop, $item;
(-)a/installer/data/mysql/sysprefs.sql (+2 lines)
Lines 387-390 INSERT INTO systempreferences (variable,value,explanation,type) VALUES('INTRAdid Link Here
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');
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('SeparateHoldingsBranch', 'homebranch', 'Branch used to separate holdings', 'homebranch|holdingbranch', 'Choice');
390
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacSeparateHoldings', '0', 'Separate current branch holdings from other holdings (OPAC)', NULL, 'YesNo');
391
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacSeparateHoldings', '0', 'Separate current branch holdings from other holdings (OPAC)', NULL, 'YesNo');
392
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacSeparateHoldingsBranch', 'homebranch', 'Branch used to separate holdings (OPAC)', 'homebranch|holdingbranch', 'Choice');
(-)a/installer/data/mysql/updatedatabase.pl (-16 / +15 lines)
Lines 5926-5947 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
5944
5945
$DBversion = "3.09.00.053";
5929
$DBversion = "3.09.00.053";
5946
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
5930
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
5947
    $dbh->do(
5931
    $dbh->do(
Lines 6035-6040 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
6035
   SetVersion ($DBversion);
6019
   SetVersion ($DBversion);
6036
}
6020
}
6037
6021
6022
$DBversion = "XXX";
6023
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
6024
    $dbh->do("
6025
        INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES
6026
        ('SeparateHoldings', '0', 'Separate current branch holdings from other holdings', NULL, 'YesNo'),
6027
        ('SeparateHoldingsBranch', 'homebranch', 'Branch used to separate holdings', 'homebranch|holdingbranch', 'Choice'),
6028
        ('OpacSeparateHoldings', '0', 'Separate current branch holdings from other holdings (OPAC)', NULL, 'YesNo'),
6029
        ('OpacSeparateHoldingsBranch', 'homebranch', 'Branch used to separate holdings (OPAC)', 'homebranch|holdingbranch', 'Choice')
6030
    ");
6031
6032
    print "Upgrade to $DBversion done (Add systempreferences SeparateHoldings, SeparateHoldingsBranch, OpacSeparateHoldings and OpacSeparateHoldingsBranch) \n";
6033
    SetVersion ($DBversion);
6034
}
6035
6036
6038
=head1 FUNCTIONS
6037
=head1 FUNCTIONS
6039
6038
6040
=head2 TableExists($table)
6039
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (-9 / +8 lines)
Lines 159-170 Cataloging: Link Here
159
        -
159
        -
160
            - pref: SeparateHoldings
160
            - pref: SeparateHoldings
161
              choices:
161
              choices:
162
                  yes: "Separate"
162
                  yes: Separate
163
                  no: "Don't separate"
163
                  no: Don't separate
164
            - current branch holdings from other holdings at staff interface.
164
            - 'items display into two tabs. First tab contains items whose'
165
        -
165
            - pref: SeparateHoldingsBranch
166
            - pref: OpacSeparateHoldings
166
              choices:
167
              choices:
167
                homebranch: 'home branch'
168
                  yes: "Separate"
168
                holdingbranch: 'holding branch'
169
                  no: "Don't separate"
169
            - 'is the branch of user logged in. The other tab contains other items.'
170
            - current branch holdings from other holdings at OPAC.
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+11 lines)
Lines 258-263 OPAC: Link Here
258
            - '<br />Note: Available options are: BIBTEX (<code>bibtex</code>), Dublin Core (<code>dc</code>),'
258
            - '<br />Note: Available options are: BIBTEX (<code>bibtex</code>), Dublin Core (<code>dc</code>),'
259
            - 'MARCXML (<code>marcxml</code>), MARC-8 encoded MARC (<code>marc8</code>), Unicode/UTF-8 encoded MARC (<code>utf8</code>),'
259
            - 'MARCXML (<code>marcxml</code>), MARC-8 encoded MARC (<code>marc8</code>), Unicode/UTF-8 encoded MARC (<code>utf8</code>),'
260
            - '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>)'
260
            - '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>)'
261
        -
262
            - pref: OpacSeparateHoldings
263
              choices:
264
                  yes: Separate
265
                  no: Don't separate
266
            - 'items display into two tabs. First tab contains items whose'
267
            - pref: OpacSeparateHoldingsBranch
268
              choices:
269
                homebranch: 'home branch'
270
                holdingbranch: 'holding branch'
271
            - 'is the branch of user logged in. The other tab contains other items.'
261
    Features:
272
    Features:
262
        -
273
        -
263
            - pref: opacuserlogin
274
            - pref: opacuserlogin
(-)a/opac/opac-detail.pl (-3 / +3 lines)
Lines 515-520 my $currentbranch = C4::Context->userenv ? C4::Context->userenv->{branch} : unde Link Here
515
if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) {
515
if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) {
516
    $template->param(SeparateHoldings => 1);
516
    $template->param(SeparateHoldings => 1);
517
}
517
}
518
my $separatebranch = C4::Context->preference('OpacSeparateHoldingsBranch');
518
for my $itm (@items) {
519
for my $itm (@items) {
519
    $itm->{holds_count} = $item_reserves{ $itm->{itemnumber} };
520
    $itm->{holds_count} = $item_reserves{ $itm->{itemnumber} };
520
    $itm->{priority} = $priority{ $itm->{itemnumber} };
521
    $itm->{priority} = $priority{ $itm->{itemnumber} };
Lines 565-573 for my $itm (@items) { Link Here
565
        $itm->{transfertfrom} = $branches->{$transfertfrom}{branchname};
566
        $itm->{transfertfrom} = $branches->{$transfertfrom}{branchname};
566
        $itm->{transfertto}   = $branches->{$transfertto}{branchname};
567
        $itm->{transfertto}   = $branches->{$transfertto}{branchname};
567
     }
568
     }
568
    my $homebranch = $itm->{homebranch};
569
    my $itembranch = $itm->{$separatebranch};
569
    if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) {
570
    if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) {
570
        if ($homebranch and $homebranch eq $currentbranch) {
571
        if ($itembranch and $itembranch eq $currentbranch) {
571
            push @itemloop, $itm;
572
            push @itemloop, $itm;
572
        } else {
573
        } else {
573
            push @otheritemloop, $itm;
574
            push @otheritemloop, $itm;
574
- 

Return to bug 7674