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

(-)a/C4/Circulation.pm (-9 / +15 lines)
Lines 1543-1561 sub AddReturn { Link Here
1543
    my $item = GetItem($itemnumber) or die "GetItem($itemnumber) failed";
1543
    my $item = GetItem($itemnumber) or die "GetItem($itemnumber) failed";
1544
        # full item data, but no borrowernumber or checkout info (no issue)
1544
        # full item data, but no borrowernumber or checkout info (no issue)
1545
        # we know GetItem should work because GetItemnumberFromBarcode worked
1545
        # we know GetItem should work because GetItemnumberFromBarcode worked
1546
    my $hbr      = C4::Context->preference("HomeOrHoldingBranchReturn") || "homebranch";
1546
    my $hbr;
1547
    $hbr = $item->{$hbr} || '';
1547
    my $branchreturn = C4::Context->preference("ReturnBranch") || "homebranch";
1548
    if ($branchreturn eq 'returningbranch') {
1549
        $hbr = $branch;
1550
    }
1551
    else {
1552
        $hbr = $item->{$hbr} || '';
1548
        # item must be from items table -- issues table has branchcode and issuingbranch, not homebranch nor holdingbranch
1553
        # item must be from items table -- issues table has branchcode and issuingbranch, not homebranch nor holdingbranch
1549
1554
1550
    my $borrowernumber = $borrower->{'borrowernumber'} || undef;    # we don't know if we had a borrower or not
1555
        # check if the book is in a permanent collection....
1551
1556
        # FIXME -- This 'PE' attribute is largely undocumented.  afaict, there's no user interface that reflects this functionality.
1552
    # check if the book is in a permanent collection....
1557
        if ( $hbr ) {
1553
    # FIXME -- This 'PE' attribute is largely undocumented.  afaict, there's no user interface that reflects this functionality.
1558
            my $branches = GetBranches();    # a potentially expensive call for a non-feature.
1554
    if ( $hbr ) {
1559
            $branches->{$hbr}->{PE} and $messages->{'IsPermanent'} = $hbr;
1555
        my $branches = GetBranches();    # a potentially expensive call for a non-feature.
1560
        }
1556
        $branches->{$hbr}->{PE} and $messages->{'IsPermanent'} = $hbr;
1557
    }
1561
    }
1558
1562
1563
    my $borrowernumber = $borrower->{'borrowernumber'} || undef;    # we don't know if we had a borrower or not
1564
1559
    # if indy branches and returning to different branch, refuse the return
1565
    # if indy branches and returning to different branch, refuse the return
1560
    if ($hbr ne $branch && C4::Context->preference("IndependantBranches")){
1566
    if ($hbr ne $branch && C4::Context->preference("IndependantBranches")){
1561
        $messages->{'Wrongbranch'} = {
1567
        $messages->{'Wrongbranch'} = {
(-)a/admin/systempreferences.pl (-1 / +1 lines)
Lines 183-189 $tabsysprefs{finesCalendar} = "Circulation"; Link Here
183
$tabsysprefs{previousIssuesDefaultSortOrder} = "Circulation";
183
$tabsysprefs{previousIssuesDefaultSortOrder} = "Circulation";
184
$tabsysprefs{todaysIssuesDefaultSortOrder}   = "Circulation";
184
$tabsysprefs{todaysIssuesDefaultSortOrder}   = "Circulation";
185
$tabsysprefs{HomeOrHoldingBranch}            = "Circulation";
185
$tabsysprefs{HomeOrHoldingBranch}            = "Circulation";
186
$tabsysprefs{HomeOrHoldingBranchReturn}      = "Circulation";
186
$tabsysprefs{ReturnBranch}                   = "Circulation";
187
$tabsysprefs{RandomizeHoldsQueueWeight}      = "Circulation";
187
$tabsysprefs{RandomizeHoldsQueueWeight}      = "Circulation";
188
$tabsysprefs{StaticHoldsQueueWeight}         = "Circulation";
188
$tabsysprefs{StaticHoldsQueueWeight}         = "Circulation";
189
$tabsysprefs{AllowOnShelfHolds}              = "Circulation";
189
$tabsysprefs{AllowOnShelfHolds}              = "Circulation";
(-)a/circ/returns.pl (-2 / +8 lines)
Lines 222-228 if ($barcode) { Link Here
222
#
222
#
223
    ( $returned, $messages, $issueinformation, $borrower ) =
223
    ( $returned, $messages, $issueinformation, $borrower ) =
224
      AddReturn( $barcode, $userenv_branch, $exemptfine, $dropboxmode);     # do the return
224
      AddReturn( $barcode, $userenv_branch, $exemptfine, $dropboxmode);     # do the return
225
    my $homeorholdingbranchreturn = C4::Context->preference('HomeOrHoldingBranchReturn') or 'homebranch';
225
    my $homebranchname;
226
    my $branchreturn = C4::Context->preference('ReturnBranch') || 'homebranch';
227
    if ($branchreturn eq 'returningbranch') {
228
        $branchreturn = "Floating collection, home branch ";
229
        $branchreturn = 'homebranch';
230
    }
231
    $homebranchname .= GetBranchName( $biblio->{$branchreturn} );
226
232
227
    # get biblio description
233
    # get biblio description
228
    my $biblio = GetBiblioFromItemNumber($itemnumber);
234
    my $biblio = GetBiblioFromItemNumber($itemnumber);
Lines 232-238 if ($barcode) { Link Here
232
    $template->param(
238
    $template->param(
233
        title            => $biblio->{'title'},
239
        title            => $biblio->{'title'},
234
        homebranch       => $biblio->{'homebranch'},
240
        homebranch       => $biblio->{'homebranch'},
235
        homebranchname   => GetBranchName( $biblio->{$homeorholdingbranchreturn} ),
241
        homebranchname   => $homebranchname,
236
        author           => $biblio->{'author'},
242
        author           => $biblio->{'author'},
237
        itembarcode      => $biblio->{'barcode'},
243
        itembarcode      => $biblio->{'barcode'},
238
        itemtype         => $biblio->{'itemtype'},
244
        itemtype         => $biblio->{'itemtype'},
(-)a/installer/data/mysql/sysprefs.sql (-1 / +1 lines)
Lines 183-189 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
183
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacRenewalAllowed',0,'If ON, users can renew their issues directly from their OPAC account',NULL,'YesNo');
183
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacRenewalAllowed',0,'If ON, users can renew their issues directly from their OPAC account',NULL,'YesNo');
184
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('PatronsPerPage','20','Number of Patrons Per Page displayed by default','20','Integer');
184
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('PatronsPerPage','20','Number of Patrons Per Page displayed by default','20','Integer');
185
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('HomeOrHoldingBranch','holdingbranch','Used by Circulation to determine which branch of an item to check with independent branches on, and by search to determine which branch to choose for availability ','holdingbranch|homebranch','Choice');
185
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('HomeOrHoldingBranch','holdingbranch','Used by Circulation to determine which branch of an item to check with independent branches on, and by search to determine which branch to choose for availability ','holdingbranch|homebranch','Choice');
186
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('HomeOrHoldingBranchReturn','homebranch','Used by Circulation to determine which branch of an item to check checking-in items','holdingbranch|homebranch','Choice');
186
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ReturnBranch','homebranch','Used by Circulation to determine which branch of an item to check checking-in items','holdingbranch|homebranch','Choice');
187
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacHighlightedWords','1','If Set, then queried words are higlighted in OPAC','','YesNo');
187
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacHighlightedWords','1','If Set, then queried words are higlighted in OPAC','','YesNo');
188
188
189
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH','0','if ON, OAI-PMH server is enabled',NULL,'YesNo');
189
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH','0','if ON, OAI-PMH server is enabled',NULL,'YesNo');
(-)a/installer/data/mysql/updatedatabase.pl (+7 lines)
Lines 4550-4555 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
4550
    SetVersion ($DBversion);
4550
    SetVersion ($DBversion);
4551
}
4551
}
4552
4552
4553
$DBversion = "3.06.00.XXX";
4554
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4555
    $dbh->do("UPDATE `systempreferences` SET variable = 'ReturnBranch' WHERE variable = 'HomeOrHoldingBranchReturn';");
4556
    print "Upgrade to $DBversion done (Renamed HomeOrHoldingBranchReturn system preference to ReturnBranch)\n";
4557
    SetVersion ($DBversion);
4558
}
4559
4553
=head1 FUNCTIONS
4560
=head1 FUNCTIONS
4554
4561
4555
=head2 DropAllForeignKeys($table)
4562
=head2 DropAllForeignKeys($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-5 / +5 lines)
Lines 216-227 Circulation: Link Here
216
                  confirmation: Ask for confirmation
216
                  confirmation: Ask for confirmation
217
            - when checking out to a borrower that has overdues outstanding	    
217
            - when checking out to a borrower that has overdues outstanding	    
218
        -
218
        -
219
            - On checkin route the returned item to
219
            - On checkin
220
            - pref: HomeOrHoldingBranchReturn
220
            - pref: ReturnBranch
221
              type: choice
221
              type: choice
222
              choices:
222
              choices:
223
                  homebranch: the library the item is from.
223
                  homebranch: route the returned item to the library the item is from (home).
224
                  holdingbranch: the library the item was checked out from.
224
                  holdingbranch: route the returned item to the library the item was checked out from.
225
                  returningbranch: leave the item in the library the item is checked in (floating collection).
225
    Holds Policy:
226
    Holds Policy:
226
        -
227
        -
227
            - pref: AllowHoldPolicyOverride
228
            - pref: AllowHoldPolicyOverride
228
- 

Return to bug 7144