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

(-)a/catalogue/detail.pl (-4 / +5 lines)
Lines 188-196 my $currentbranch = C4::Context->userenv ? C4::Context->userenv->{branch} : unde Link Here
188
if ($currentbranch and C4::Context->preference('SeparateHoldings')) {
188
if ($currentbranch and C4::Context->preference('SeparateHoldings')) {
189
    $template->param(SeparateHoldings => 1);
189
    $template->param(SeparateHoldings => 1);
190
}
190
}
191
my $separatebranch = C4::Context->preference('SeparateHoldingsBranch') || 'homebranch';
191
foreach my $item (@items) {
192
foreach my $item (@items) {
192
193
    my $itembranchcode = $item->{$separatebranch};
193
    my $homebranchcode = $item->{homebranch};
194
    $item->{homebranch}        = GetBranchName($item->{homebranch});
194
    $item->{homebranch}        = GetBranchName($item->{homebranch});
195
195
196
    # can place holds defaults to yes
196
    # can place holds defaults to yes
Lines 273-280 foreach my $item (@items) { Link Here
273
    if (defined($item->{'materials'}) && $item->{'materials'} =~ /\S/){
273
    if (defined($item->{'materials'}) && $item->{'materials'} =~ /\S/){
274
	$materials_flag = 1;
274
	$materials_flag = 1;
275
275
276
    if ($currentbranch and $currentbranch ne "NO_LIBRARY_SET" and C4::Context->preference('SeparateHoldings')) {
276
    if ($currentbranch and $currentbranch ne "NO_LIBRARY_SET"
277
        if ($homebranchcode and $homebranchcode eq $currentbranch) {
277
    and C4::Context->preference('SeparateHoldings')) {
278
        if ($itembranchcode and $itembranchcode eq $currentbranch) {
278
            push @itemloop, $item;
279
            push @itemloop, $item;
279
        } else {
280
        } else {
280
            push @otheritemloop, $item;
281
            push @otheritemloop, $item;
(-)a/installer/data/mysql/sysprefs.sql (+2 lines)
Lines 389-392 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' Link Here
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');
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('SeparateHoldingsBranch', 'homebranch', 'Branch used to separate holdings', 'homebranch|holdingbranch', 'Choice');
392
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacSeparateHoldings', '0', 'Separate current branch holdings from other holdings (OPAC)', NULL, 'YesNo');
393
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacSeparateHoldings', '0', 'Separate current branch holdings from other holdings (OPAC)', NULL, 'YesNo');
394
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 6128-6133 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
6128
    SetVersion($DBversion);
6112
    SetVersion($DBversion);
6129
}
6113
}
6130
6114
6115
$DBversion = "XXX";
6116
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
6117
    $dbh->do("
6118
        INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES
6119
        ('SeparateHoldings', '0', 'Separate current branch holdings from other holdings', NULL, 'YesNo'),
6120
        ('SeparateHoldingsBranch', 'homebranch', 'Branch used to separate holdings', 'homebranch|holdingbranch', 'Choice'),
6121
        ('OpacSeparateHoldings', '0', 'Separate current branch holdings from other holdings (OPAC)', NULL, 'YesNo'),
6122
        ('OpacSeparateHoldingsBranch', 'homebranch', 'Branch used to separate holdings (OPAC)', 'homebranch|holdingbranch', 'Choice')
6123
    ");
6124
6125
    print "Upgrade to $DBversion done (Add systempreferences SeparateHoldings, SeparateHoldingsBranch, OpacSeparateHoldings and OpacSeparateHoldingsBranch) \n";
6126
    SetVersion ($DBversion);
6127
}
6128
6129
6131
=head1 FUNCTIONS
6130
=head1 FUNCTIONS
6132
6131
6133
=head2 TableExists($table)
6132
=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 517-522 my $currentbranch = C4::Context->userenv ? C4::Context->userenv->{branch} : unde Link Here
517
if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) {
517
if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) {
518
    $template->param(SeparateHoldings => 1);
518
    $template->param(SeparateHoldings => 1);
519
}
519
}
520
my $separatebranch = C4::Context->preference('OpacSeparateHoldingsBranch');
520
for my $itm (@items) {
521
for my $itm (@items) {
521
    $itm->{holds_count} = $item_reserves{ $itm->{itemnumber} };
522
    $itm->{holds_count} = $item_reserves{ $itm->{itemnumber} };
522
    $itm->{priority} = $priority{ $itm->{itemnumber} };
523
    $itm->{priority} = $priority{ $itm->{itemnumber} };
Lines 567-575 for my $itm (@items) { Link Here
567
        $itm->{transfertfrom} = $branches->{$transfertfrom}{branchname};
568
        $itm->{transfertfrom} = $branches->{$transfertfrom}{branchname};
568
        $itm->{transfertto}   = $branches->{$transfertto}{branchname};
569
        $itm->{transfertto}   = $branches->{$transfertto}{branchname};
569
     }
570
     }
570
    my $homebranch = $itm->{homebranch};
571
    my $itembranch = $itm->{$separatebranch};
571
    if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) {
572
    if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) {
572
        if ($homebranch and $homebranch eq $currentbranch) {
573
        if ($itembranch and $itembranch eq $currentbranch) {
573
            push @itemloop, $itm;
574
            push @itemloop, $itm;
574
        } else {
575
        } else {
575
            push @otheritemloop, $itm;
576
            push @otheritemloop, $itm;
576
- 

Return to bug 7674