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

(-)a/C4/Circulation.pm (-6 / +6 lines)
Lines 2376-2385 sub AddReturn { Link Here
2376
            else {
2376
            else {
2377
                $messages->{'TransferTrigger'} = $transfer->reason;
2377
                $messages->{'TransferTrigger'} = $transfer->reason;
2378
                if ( $transfer->frombranch eq $branch ) {
2378
                if ( $transfer->frombranch eq $branch ) {
2379
                    $transfer->transit;
2379
                    $messages->{'TransferTo'}    = $transfer->tobranch;
2380
                    $messages->{'WasTransfered'}   = $transfer->tobranch;
2380
                    $messages->{'WasTransfered'} = $transfer->id;
2381
                }
2381
                } else {
2382
                else {
2383
                    $messages->{'WrongTransfer'}     = $transfer->tobranch;
2382
                    $messages->{'WrongTransfer'}     = $transfer->tobranch;
2384
                    $messages->{'WrongTransferItem'} = $item->itemnumber;
2383
                    $messages->{'WrongTransferItem'} = $item->itemnumber;
2385
                }
2384
                }
Lines 2529-2536 sub AddReturn { Link Here
2529
            (C4::Context->preference("UseBranchTransferLimits") and
2528
            (C4::Context->preference("UseBranchTransferLimits") and
2530
             ! IsBranchTransferAllowed($branch, $returnbranch, $item->$BranchTransferLimitsType )
2529
             ! IsBranchTransferAllowed($branch, $returnbranch, $item->$BranchTransferLimitsType )
2531
           )) {
2530
           )) {
2532
            ModItemTransfer($item->itemnumber, $branch, $returnbranch, $transfer_trigger, { skip_record_index => 1 });
2531
            my $transfer = ModItemTransfer($item->itemnumber, $branch, $returnbranch, $transfer_trigger, { skip_record_index => 1 });
2533
            $messages->{'WasTransfered'} = $returnbranch;
2532
            $messages->{'TransferTo'} = $returnbranch;
2533
            $messages->{'WasTransfered'} = $transfer->id;
2534
            $messages->{'TransferTrigger'} = $transfer_trigger;
2534
            $messages->{'TransferTrigger'} = $transfer_trigger;
2535
        } else {
2535
        } else {
2536
            $messages->{'NeedsTransfer'} = $returnbranch;
2536
            $messages->{'NeedsTransfer'} = $returnbranch;
(-)a/C4/Items.pm (-1 / +1 lines)
Lines 386-392 sub ModItemTransfer { Link Here
386
        $transfer->transit({ skip_record_index => $params->{skip_record_index} });
386
        $transfer->transit({ skip_record_index => $params->{skip_record_index} });
387
    }
387
    }
388
388
389
    return;
389
    return $transfer;
390
}
390
}
391
391
392
=head2 ModDateLastSeen
392
=head2 ModDateLastSeen
(-)a/Koha/Item.pm (-1 lines)
Lines 776-782 we still expect the item to end up at a final location eventually. Link Here
776
776
777
sub get_transfer {
777
sub get_transfer {
778
    my ($self) = @_;
778
    my ($self) = @_;
779
780
    my $transfer = $self->_result->current_branchtransfers->next;
779
    my $transfer = $self->_result->current_branchtransfers->next;
781
    return  Koha::Item::Transfer->_new_from_dbic($transfer) if $transfer;
780
    return  Koha::Item::Transfer->_new_from_dbic($transfer) if $transfer;
782
}
781
}
(-)a/Koha/Schema/Result/Item.pm (-12 / +22 lines)
Lines 1013-1031 __PACKAGE__->many_to_many( Link Here
1013
  "ordernumber",
1013
  "ordernumber",
1014
);
1014
);
1015
1015
1016
#__PACKAGE__->has_many(
1017
#  "current_branchtransfers",
1018
#  "Koha::Schema::Result::Branchtransfer",
1019
#    sub {
1020
#        my $args = shift;
1021
#
1022
#        return {
1023
#            "$args->{foreign_alias}.itemnumber"    => { -ident => "$args->{self_alias}.itemnumber" },
1024
#            "$args->{foreign_alias}.datearrived"   => undef,
1025
#            "$args->{foreign_alias}.datecancelled" => undef,
1026
#        };
1027
#    },
1028
#    { order_by => [ { -desc => 'datesent' }, { -asc => 'daterequested' } ] }
1029
#);
1030
1016
__PACKAGE__->has_many(
1031
__PACKAGE__->has_many(
1017
  "current_branchtransfers",
1032
    "current_branchtransfers",
1018
  "Koha::Schema::Result::Branchtransfer",
1033
    "Koha::Schema::Result::Branchtransfer",
1019
    sub {
1034
    { "foreign.itemnumber" => "self.itemnumber" },
1020
        my $args = shift;
1035
    {
1021
1036
        where    => { 'datearrived' => undef, 'datecancelled' => undef },
1022
        return {
1037
        order_by => [ { -desc => 'datesent' }, { -asc => 'daterequested' } ]
1023
            "$args->{foreign_alias}.itemnumber"    => { -ident => "$args->{self_alias}.itemnumber" },
1038
    }
1024
            "$args->{foreign_alias}.datearrived"   => undef,
1025
            "$args->{foreign_alias}.datecancelled" => undef,
1026
        };
1027
    },
1028
    { order_by => [ { -desc => 'datesent' }, { -asc => 'daterequested' } ] }
1029
);
1039
);
1030
1040
1031
# Relationship with bundled items
1041
# Relationship with bundled items
(-)a/catalogue/detail.pl (-1 / +1 lines)
Lines 196-202 $params->{ itemlost } = 0 if $patron->category->hidelostitems && !$showallitems; Link Here
196
my $items_params = {
196
my $items_params = {
197
    ( $invalid_marc_record ? () : ( host_items => 1 ) ),
197
    ( $invalid_marc_record ? () : ( host_items => 1 ) ),
198
};
198
};
199
my $items = $biblio->items($items_params)->search_ordered( $params, { prefetch => ['issue','current_branchtransfers'] } );
199
my $items = $biblio->items($items_params)->search_ordered( $params, { prefetch => ['issue'] } );
200
200
201
# flag indicating existence of at least one item linked via a host record
201
# flag indicating existence of at least one item linked via a host record
202
my $hostrecords = $biblio->host_items->count;
202
my $hostrecords = $biblio->host_items->count;
(-)a/circ/returns.pl (+4 lines)
Lines 521-526 if ( $messages->{'WasTransfered'} ) { Link Here
521
    $template->param(
521
    $template->param(
522
        found          => 1,
522
        found          => 1,
523
        transfer       => $messages->{'WasTransfered'},
523
        transfer       => $messages->{'WasTransfered'},
524
        transferto     => $messages->{'TransferTo'},
524
        trigger        => $messages->{'TransferTrigger'},
525
        trigger        => $messages->{'TransferTrigger'},
525
        itemnumber     => $itemnumber,
526
        itemnumber     => $itemnumber,
526
    );
527
    );
Lines 696-701 foreach my $code ( keys %$messages ) { Link Here
696
    elsif ( $code eq 'WasTransfered' ) {
697
    elsif ( $code eq 'WasTransfered' ) {
697
        ;    # FIXME... anything to do here?
698
        ;    # FIXME... anything to do here?
698
    }
699
    }
700
    elsif ( $code eq 'TransferTo' ) {
701
        ;    # Handled above, along with WasTransfered
702
    }
699
    elsif ( $code eq 'withdrawn' ) {
703
    elsif ( $code eq 'withdrawn' ) {
700
        $err{withdrawn} = 1;
704
        $err{withdrawn} = 1;
701
    }
705
    }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-3 / +3 lines)
Lines 121-127 Link Here
121
                                </div> <!-- /.hold-auto-filled -->
121
                                </div> <!-- /.hold-auto-filled -->
122
                            [% END # /IF hold_auto_filled %]
122
                            [% END # /IF hold_auto_filled %]
123
123
124
                            [% IF ( trigger ) %]
124
                            [% IF ( trigger && !transfertodo ) %]
125
                                 <div id="transfer-trigger" class="dialog message">
125
                                 <div id="transfer-trigger" class="dialog message">
126
                                     <h3>Reason for transfer</h3>
126
                                     <h3>Reason for transfer</h3>
127
                                     <p>
127
                                     <p>
Lines 737-743 Link Here
737
737
738
                                                <div class="modal-header">
738
                                                <div class="modal-header">
739
                                                    <h3>
739
                                                    <h3>
740
                                                        Please return this item to [% IF transfer %][% Branches.GetName( transfer ) | html %][% ELSE %][% Branches.GetName( returnbranch ) | html %][% END %]
740
                                                        Please return this item to [% IF transferto %][% Branches.GetName( transferto ) | html %][% ELSE %][% Branches.GetName( returnbranch ) | html %][% END %]
741
                                                    </h3>
741
                                                    </h3>
742
                                                </div>
742
                                                </div>
743
                                                <div class="modal-body">
743
                                                <div class="modal-body">
Lines 763-768 Link Here
763
                                                        <button type="button" name="dotransfer" class="btn btn-default print openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber | uri %]&amp;&amp;branchcode=[% returnbranch | uri %]&amp;op=slip"><i class="fa fa-print"></i> Yes, print slip</button>
763
                                                        <button type="button" name="dotransfer" class="btn btn-default print openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber | uri %]&amp;&amp;branchcode=[% returnbranch | uri %]&amp;op=slip"><i class="fa fa-print"></i> Yes, print slip</button>
764
                                                        <button type="button" data-dismiss="modal" class="btn btn-default deny" name="notransfer" value="No" accesskey="n"><i class="fa fa-times"></i> No (N)</button>
764
                                                        <button type="button" data-dismiss="modal" class="btn btn-default deny" name="notransfer" value="No" accesskey="n"><i class="fa fa-times"></i> No (N)</button>
765
                                                    [% ELSE %]
765
                                                    [% ELSE %]
766
                                                        <input type="hidden" name="transit" value="[% transfer | uri %]"/>
766
                                                        <button type="button" data-dismiss="modal" class="btn btn-default approve" accesskey="y"><i class="fa fa-check"></i> OK (Y)</button>
767
                                                        <button type="button" data-dismiss="modal" class="btn btn-default approve" accesskey="y"><i class="fa fa-check"></i> OK (Y)</button>
767
                                                        <button type="button" data-dismiss="modal" class="btn btn-default print openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber | uri %]&amp;branchcode=[% transfer | uri %]&amp;op=slip" accesskey="p"><i class="fa fa-print"></i> Print slip (P)</button>
768
                                                        <button type="button" data-dismiss="modal" class="btn btn-default print openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber | uri %]&amp;branchcode=[% transfer | uri %]&amp;op=slip" accesskey="p"><i class="fa fa-print"></i> Print slip (P)</button>
768
                                                    [% END %]
769
                                                    [% END %]
769
- 

Return to bug 35100