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

(-)a/C4/Circulation.pm (-6 / +25 lines)
Lines 42-47 use C4::Koha qw( Link Here
42
    GetKohaAuthorisedValueLib
42
    GetKohaAuthorisedValueLib
43
);
43
);
44
use C4::Overdues qw(CalcFine UpdateFine);
44
use C4::Overdues qw(CalcFine UpdateFine);
45
use C4::RotatingCollections qw(GetCollectionItemBranches);
45
use Algorithm::CheckDigits;
46
use Algorithm::CheckDigits;
46
47
47
use Data::Dumper;
48
use Data::Dumper;
Lines 1919-1933 sub AddReturn { Link Here
1919
    logaction("CIRCULATION", "RETURN", $borrowernumber, $item->{'itemnumber'})
1920
    logaction("CIRCULATION", "RETURN", $borrowernumber, $item->{'itemnumber'})
1920
        if C4::Context->preference("ReturnLog");
1921
        if C4::Context->preference("ReturnLog");
1921
    
1922
    
1922
    # FIXME: make this comment intelligible.
1923
    # IF
1923
    #adding message if holdingbranch is non equal a userenv branch to return the document to homebranch
1924
    # a) The item is so far returnable or hasn't been issued
1924
    #we check, if we don't have reserv or transfert for this document, if not, return it to homebranch .
1925
    # b) There is no hold for this item for pickup at this branch
1925
1926
    # c) The item's branch is not this branch
1926
    if (($doreturn or $messages->{'NotIssued'}) and !$resfound and ($branch ne $hbr) and not $messages->{'WrongTransfer'}){
1927
    # c) The should not have been transferred to another branch instead of this one
1928
    # d) The item is not part of a rotating collection that is currently at this branch
1929
    # THEN this return should be considered a transfer
1930
    #
1931
    # This transfer should be considered valid UNLESS
1932
    # a) AutomaticItemReturn is enabled
1933
    # OR
1934
    # b) There is branch transfer limit that should prevent this item from being transfered to this branch
1935
    #
1936
    # If the transfer is not valid, a new transfer back to the item's branch will be created
1937
    if (
1938
                ( $doreturn or $messages->{'NotIssued'} )
1939
            and !$resfound
1940
            and $branch ne $hbr
1941
            and !$messages->{'WrongTransfer'}
1942
            and [GetCollectionItemBranches( $item->{'itemnumber'} )]->[1] ne $branch
1943
    ){
1927
        if ( C4::Context->preference("AutomaticItemReturn"    ) or
1944
        if ( C4::Context->preference("AutomaticItemReturn"    ) or
1928
            (C4::Context->preference("UseBranchTransferLimits") and
1945
            (C4::Context->preference("UseBranchTransferLimits") and
1929
             ! IsBranchTransferAllowed($branch, $hbr, $item->{C4::Context->preference("BranchTransferLimitsType")} )
1946
             ! IsBranchTransferAllowed($branch, $hbr, $item->{C4::Context->preference("BranchTransferLimitsType")} )
1930
           )) {
1947
           )
1948
            ) {
1931
            $debug and warn sprintf "about to call ModItemTransfer(%s, %s, %s)", $item->{'itemnumber'},$branch, $hbr;
1949
            $debug and warn sprintf "about to call ModItemTransfer(%s, %s, %s)", $item->{'itemnumber'},$branch, $hbr;
1932
            $debug and warn "item: " . Dumper($item);
1950
            $debug and warn "item: " . Dumper($item);
1933
            ModItemTransfer($item->{'itemnumber'}, $branch, $hbr);
1951
            ModItemTransfer($item->{'itemnumber'}, $branch, $hbr);
Lines 1936-1941 sub AddReturn { Link Here
1936
            $messages->{'NeedsTransfer'} = 1;   # TODO: instead of 1, specify branchcode that the transfer SHOULD go to, $item->{homebranch}
1954
            $messages->{'NeedsTransfer'} = 1;   # TODO: instead of 1, specify branchcode that the transfer SHOULD go to, $item->{homebranch}
1937
        }
1955
        }
1938
    }
1956
    }
1957
1939
    return ( $doreturn, $messages, $issue, $borrower );
1958
    return ( $doreturn, $messages, $issue, $borrower );
1940
}
1959
}
1941
1960
(-)a/C4/RotatingCollections.pm (-4 / +7 lines)
Lines 332-341 sub AddItemToCollection { Link Here
332
    my $dbh = C4::Context->dbh;
332
    my $dbh = C4::Context->dbh;
333
333
334
    my $sth;
334
    my $sth;
335
    $sth = $dbh->prepare(
335
    $sth = $dbh->prepare("
336
        "INSERT INTO collections_tracking ( ctId, colId, itemnumber ) 
336
        INSERT INTO collections_tracking (
337
                        VALUES ( NULL, ?, ? )"
337
            ctId,
338
    );
338
            colId,
339
            itemnumber
340
        ) VALUES ( NULL, ?, ? )
341
    ");
339
    $sth->execute( $colId, $itemnumber ) or return ( 0, 3, $sth->errstr() );
342
    $sth->execute( $colId, $itemnumber ) or return ( 0, 3, $sth->errstr() );
340
343
341
    return 1;
344
    return 1;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-1 / +1 lines)
Lines 67-73 $(document).ready(function () { Link Here
67
[% END %]
67
[% END %]
68
68
69
[% IF ( collectionItemNeedsTransferred ) %]
69
[% IF ( collectionItemNeedsTransferred ) %]
70
	<div id="rotating-collection" class="dialog message">This item is part of a Rotating Collection and needs to be Transferred to [% collectionBranch %]</div>
70
 <div id="rotating-collection" class="dialog message">This item is part of a rotating collection and needs to be transferred to [% collectionBranch %]</div>
71
[% END %]
71
[% END %]
72
72
73
<!-- Patron has fines -->
73
<!-- Patron has fines -->
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/editCollections.tt (-4 / +7 lines)
Lines 44-56 Link Here
44
      <div>
44
      <div>
45
        [% IF ( collectionsLoop ) %]
45
        [% IF ( collectionsLoop ) %]
46
          <table>
46
          <table>
47
           <thead>
47
            <tr>
48
            <tr>
48
              <th>Title</th>
49
              <th>Title</th>
49
              <th>Description</th>
50
              <th>Description</th>
50
              <th>Holding library</th>
51
              <th>Holding library</th>
51
              <td></td>
52
              <th>&nbsp;</th>
52
              <td></td>
53
              <th>&nbsp;</th>
53
            </tr>
54
            </tr>
55
           <thead>
56
           <tbody>
54
            [% FOREACH collectionsLoo IN collectionsLoop %]
57
            [% FOREACH collectionsLoo IN collectionsLoop %]
55
              <tr>
58
              <tr>
56
                <td>[% collectionsLoo.colTitle %]</td>
59
                <td>[% collectionsLoo.colTitle %]</td>
Lines 60-65 Link Here
60
                <td><a href="editCollections.pl?action=delete&amp;colId=[% collectionsLoo.colId %]">Delete</a></td>
63
                <td><a href="editCollections.pl?action=delete&amp;colId=[% collectionsLoo.colId %]">Delete</a></td>
61
              </tr>
64
              </tr>
62
            [% END %]
65
            [% END %]
66
           </tbody>
63
          </table>
67
          </table>
64
        [% ELSE %]
68
        [% ELSE %]
65
          There are no collections currently defined.
69
          There are no collections currently defined.
Lines 99-105 Link Here
99
                <label for="description">Description: </label>
103
                <label for="description">Description: </label>
100
              </td>
104
              </td>
101
              <td>
105
              <td>
102
                [% IF (editColDescription ) %]<input type="text" size="50" name="description" value="[ editColDescription %]" />
106
                [% IF (editColDescription ) %]<input type="text" size="50" name="description" value="[% editColDescription %]" />
103
                [% ELSE %]<input type="text" size="50" name="description" />[% END %]
107
                [% ELSE %]<input type="text" size="50" name="description" />[% END %]
104
              </td>
108
              </td>
105
            </tr>
109
            </tr>
106
- 

Return to bug 8836