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

(-)a/C4/Reserves.pm (-3 / +3 lines)
Lines 1075-1081 sub ModReserveStatus { Link Here
1075
1075
1076
=head2 ModReserveAffect
1076
=head2 ModReserveAffect
1077
1077
1078
  &ModReserveAffect($itemnumber,$borrowernumber,$diffBranchSend,$reserve_id);
1078
  &ModReserveAffect($itemnumber,$borrowernumber,$diffBranchSend,$reserve_id, $desk);
1079
1079
1080
This function affect an item and a status for a given reserve, either fetched directly
1080
This function affect an item and a status for a given reserve, either fetched directly
1081
by record_id, or by borrowernumber and itemnumber or biblionumber. If only biblionumber
1081
by record_id, or by borrowernumber and itemnumber or biblionumber. If only biblionumber
Lines 1089-1095 take care of the waiting status Link Here
1089
=cut
1089
=cut
1090
1090
1091
sub ModReserveAffect {
1091
sub ModReserveAffect {
1092
    my ( $itemnumber, $borrowernumber, $transferToDo, $reserve_id ) = @_;
1092
    my ( $itemnumber, $borrowernumber, $transferToDo, $reserve_id, $desk_id ) = @_;
1093
    my $dbh = C4::Context->dbh;
1093
    my $dbh = C4::Context->dbh;
1094
1094
1095
    # we want to attach $itemnumber to $borrowernumber, find the biblionumber
1095
    # we want to attach $itemnumber to $borrowernumber, find the biblionumber
Lines 1114-1120 sub ModReserveAffect { Link Here
1114
    my $already_on_shelf = $hold->found && $hold->found eq 'W';
1114
    my $already_on_shelf = $hold->found && $hold->found eq 'W';
1115
1115
1116
    $hold->itemnumber($itemnumber);
1116
    $hold->itemnumber($itemnumber);
1117
    $hold->set_waiting($transferToDo);
1117
    $hold->set_waiting($transferToDo, $desk_id);
1118
1118
1119
    _koha_notify_reserve( $hold->reserve_id )
1119
    _koha_notify_reserve( $hold->reserve_id )
1120
      if ( !$transferToDo && !$already_on_shelf );
1120
      if ( !$transferToDo && !$already_on_shelf );
(-)a/Koha/Hold.pm (-1 / +18 lines)
Lines 156-162 sub delete { Link Here
156
=cut
156
=cut
157
157
158
sub set_waiting {
158
sub set_waiting {
159
    my ( $self, $transferToDo ) = @_;
159
    my ( $self, $transferToDo, $desk_id ) = @_;
160
160
161
    $self->priority(0);
161
    $self->priority(0);
162
162
Lines 169-176 sub set_waiting { Link Here
169
    my $values = {
169
    my $values = {
170
        found => 'W',
170
        found => 'W',
171
        waitingdate => $today->ymd,
171
        waitingdate => $today->ymd,
172
        desk_id => $desk_id,
172
    };
173
    };
173
174
175
    if (defined $desk_id) { $values->{'desk_id'} = $desk_id };
176
174
    my $requested_expiration;
177
    my $requested_expiration;
175
    if ($self->expirationdate) {
178
    if ($self->expirationdate) {
176
        $requested_expiration = dt_from_string($self->expirationdate);
179
        $requested_expiration = dt_from_string($self->expirationdate);
Lines 310-315 sub branch { Link Here
310
    return $self->{_branch};
313
    return $self->{_branch};
311
}
314
}
312
315
316
=head3 desk
317
318
Returns the related Koha::Library object for this Hold
319
320
=cut
321
322
sub desk {
323
    my ($self) = @_;
324
325
    $self->{_desk} ||= Koha::Desks->find( $self->desk_id() );
326
327
    return $self->{_desk};
328
}
329
313
=head3 borrower
330
=head3 borrower
314
331
315
Returns the related Koha::Patron object for this Hold
332
Returns the related Koha::Patron object for this Hold
(-)a/Koha/Template/Plugin/Desks.pm (-2 / +2 lines)
Lines 47-54 return desk name or empty string Link Here
47
47
48
sub GetName {
48
sub GetName {
49
    my ( $self, $desk_id ) = @_;
49
    my ( $self, $desk_id ) = @_;
50
    my $d = Koha::Desks->search( { desk_id => $desk_id} )->unblessed;
50
    my $d = Koha::Desks->find( $desk_id );
51
    return @$d ? $d->{'desk_name'} : q{};
51
    return (defined $d) ? $d->unblessed->{'desk_name'} : q{};
52
}
52
}
53
53
54
=head3 GetLoggedInDeskId
54
=head3 GetLoggedInDeskId
(-)a/circ/returns.pl (-2 / +3 lines)
Lines 75-80 if ($session->param('branch') eq 'NO_LIBRARY_SET'){ Link Here
75
    print $query->redirect("/cgi-bin/koha/circ/selectbranchprinter.pl");
75
    print $query->redirect("/cgi-bin/koha/circ/selectbranchprinter.pl");
76
    exit;
76
    exit;
77
}
77
}
78
my $desk_id = C4::Context->userenv->{"desk_id"} || '';
78
79
79
# Print a reserve slip on this page
80
# Print a reserve slip on this page
80
if ( $query->param('print_slip') ) {
81
if ( $query->param('print_slip') ) {
Lines 166-172 if ( $query->param('reserve_id') ) { Link Here
166
        my $diffBranchSend = ($userenv_branch ne $diffBranchReturned) ? $diffBranchReturned : undef;
167
        my $diffBranchSend = ($userenv_branch ne $diffBranchReturned) ? $diffBranchReturned : undef;
167
        # diffBranchSend tells ModReserveAffect whether document is expected in this library or not,
168
        # diffBranchSend tells ModReserveAffect whether document is expected in this library or not,
168
        # i.e., whether to apply waiting status
169
        # i.e., whether to apply waiting status
169
        ModReserveAffect( $itemnumber, $borrowernumber, $diffBranchSend, $reserve_id );
170
        ModReserveAffect( $itemnumber, $borrowernumber, $diffBranchSend, $reserve_id, $desk_id );
170
    }
171
    }
171
#   check if we have other reserves for this document, if we have a return send the message of transfer
172
#   check if we have other reserves for this document, if we have a return send the message of transfer
172
    my ( $messages, $nextreservinfo ) = GetOtherReserves($itemnumber);
173
    my ( $messages, $nextreservinfo ) = GetOtherReserves($itemnumber);
Lines 423-429 if ( $messages->{'ResFound'}) { Link Here
423
        my $biblio = $item->biblio;
424
        my $biblio = $item->biblio;
424
425
425
        my $diffBranchSend = !$branchCheck ? $reserve->{branchcode} : undef;
426
        my $diffBranchSend = !$branchCheck ? $reserve->{branchcode} : undef;
426
        ModReserveAffect( $reserve->{itemnumber}, $reserve->{borrowernumber}, $diffBranchSend, $reserve->{reserve_id} );
427
        ModReserveAffect( $reserve->{itemnumber}, $reserve->{borrowernumber}, $diffBranchSend, $reserve->{reserve_id}, $desk_id );
427
        my ( $messages, $nextreservinfo ) = GetOtherReserves($reserve->{itemnumber});
428
        my ( $messages, $nextreservinfo ) = GetOtherReserves($reserve->{itemnumber});
428
429
429
        my $patron = Koha::Patrons->find( $nextreservinfo );
430
        my $patron = Koha::Patrons->find( $nextreservinfo );
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc (-1 / +2 lines)
Lines 1-4 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE Desks %]
2
<table>
3
<table>
3
    <tr>
4
    <tr>
4
        [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
5
        [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
Lines 119-125 Link Here
119
                [% IF ( hold.found ) %]
120
                [% IF ( hold.found ) %]
120
                    [% IF ( hold.atdestination ) %]
121
                    [% IF ( hold.atdestination ) %]
121
                        [% IF ( hold.found ) %]
122
                        [% IF ( hold.found ) %]
122
                            Item waiting at <b> [% hold.wbrname | html %]</b> <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" /> since [% hold.waiting_date | $KohaDates %]
123
                            Item waiting at <b> [% hold.wbrname | html %]</b>[% IF hold.desk_name %], [% hold.desk_name | html %],[% END %] <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" /> since [% hold.waiting_date | $KohaDates %]
123
                        [% ELSE %]
124
                        [% ELSE %]
124
                            Waiting to be pulled <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" />
125
                            Waiting to be pulled <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" />
125
                        [% END %]
126
                        [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/waiting_holds.inc (-1 / +2 lines)
Lines 1-4 Link Here
1
[% USE ItemTypes %]
1
[% USE ItemTypes %]
2
[% USE Desks %]
2
[% USE AuthorisedValues %]
3
[% USE AuthorisedValues %]
3
<table id="[% table_name | html %]">
4
<table id="[% table_name | html %]">
4
    <thead>
5
    <thead>
Lines 38-44 Link Here
38
                    [% END %]
39
                    [% END %]
39
                </td>
40
                </td>
40
                <td>[% Branches.GetName( reserveloo.item.homebranch ) | html %]</td>
41
                <td>[% Branches.GetName( reserveloo.item.homebranch ) | html %]</td>
41
                <td>[% Branches.GetName( reserveloo.item.holdingbranch ) | html %]</td>
42
                <td>[% Branches.GetName( reserveloo.item.holdingbranch ) | html %][% IF (reserveloo.desk_id  ) %], [% Desks.GetName (reserveloo.desk_id) | html %][% END %]</td>
42
                <td>[% AuthorisedValues.GetByCode('LOC', reserveloo.item.location) | html %]</td>
43
                <td>[% AuthorisedValues.GetByCode('LOC', reserveloo.item.location) | html %]</td>
43
                <td>[% reserveloo.item.itemcallnumber | html %]</td>
44
                <td>[% reserveloo.item.itemcallnumber | html %]</td>
44
                <td>[% reserveloo.item.copynumber | html %]</td>
45
                <td>[% reserveloo.item.copynumber | html %]</td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-1 / +2 lines)
Lines 4-9 Link Here
4
[% USE KohaDates %]
4
[% USE KohaDates %]
5
[% USE AuthorisedValues %]
5
[% USE AuthorisedValues %]
6
[% USE Branches %]
6
[% USE Branches %]
7
[% USE Desks %]
7
[% USE Biblio %]
8
[% USE Biblio %]
8
[% USE ColumnsSettings %]
9
[% USE ColumnsSettings %]
9
[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
10
[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
Lines 380-386 Note that permanent location is a code, and location may be an authval. Link Here
380
                        [% SET hold = item.first_hold %]
381
                        [% SET hold = item.first_hold %]
381
                        [% IF hold %]
382
                        [% IF hold %]
382
                            [% IF hold.waitingdate %]
383
                            [% IF hold.waitingdate %]
383
                                Waiting at [% Branches.GetName( hold.branchcode ) | html %] since [% hold.waitingdate | $KohaDates %].
384
                                Waiting at [% Branches.GetName( hold.branchcode ) | html %][% IF ( hold.desk_id ) %], [% Desks.GetName ( hold.desk_id ) | html %][% END %] since [% hold.waitingdate | $KohaDates %].
384
                            [% ELSIF hold.priority == 1 %]
385
                            [% ELSIF hold.priority == 1 %]
385
                                Item-level hold (placed [% hold.reservedate | $KohaDates %]) for delivery at [% Branches.GetName( hold.branchcode ) | html %].
386
                                Item-level hold (placed [% hold.reservedate | $KohaDates %]) for delivery at [% Branches.GetName( hold.branchcode ) | html %].
386
                            [% ELSE %]
387
                            [% ELSE %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-2 / +2 lines)
Lines 2-7 Link Here
2
[% USE Asset %]
2
[% USE Asset %]
3
[% USE KohaDates %]
3
[% USE KohaDates %]
4
[% USE Branches %]
4
[% USE Branches %]
5
[% USE Desks %]
5
[% USE Koha %]
6
[% USE Koha %]
6
[% USE Borrowers %]
7
[% USE Borrowers %]
7
[% USE ItemTypes %]
8
[% USE ItemTypes %]
Lines 468-475 Link Here
468
469
469
                                                <div class="modal-footer">
470
                                                <div class="modal-footer">
470
                                                    <input type="hidden" name="cancel_reserve" value="0" />
471
                                                    <input type="hidden" name="cancel_reserve" value="0" />
471
472
                                                       <button type="submit" class="btn btn-default approve" [% IF (Desks.defined) %]data-dismiss="modal" [% END %]>
472
                                                    <button type="submit" class="btn btn-default approve" data-dismiss="modal">
473
                                                        <i class="fa fa-check"></i> Confirm hold
473
                                                        <i class="fa fa-check"></i> Confirm hold
474
                                                    </button>
474
                                                    </button>
475
475
(-)a/koha-tmpl/intranet-tmpl/prog/js/holds.js (-1 / +7 lines)
Lines 159-167 $(document).ready(function() { Link Here
159
159
160
                                    if ( oObj.waiting_here ) {
160
                                    if ( oObj.waiting_here ) {
161
                                        data += ITEM_IS_WAITING_HERE;
161
                                        data += ITEM_IS_WAITING_HERE;
162
                                        if (oObj.desk_name) {
163
                                            data += ", " + AT.format( oObj.desk_name );
164
                                        }
162
                                    } else {
165
                                    } else {
163
                                        data += ITEM_IS_WAITING;
166
                                        data += ITEM_IS_WAITING;
164
                                        data += " " + AT.format( oObj.waiting_at );
167
                                        data += AT.format( oObj.waiting_at );
168
                                        if (oObj.desk_name) {
169
                                            data += ", " + AT.format( oObj.desk_name );
170
                                        }
165
                                    }
171
                                    }
166
172
167
                                } else if ( oObj.transferred ) {
173
                                } else if ( oObj.transferred ) {
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc (-1 / +2 lines)
Lines 1-4 Link Here
1
[% USE Branches %]
1
[% USE Branches %]
2
[% USE Desks  %]
2
[% USE ItemTypes %]
3
[% USE ItemTypes %]
3
[% USE KohaDates %]
4
[% USE KohaDates %]
4
5
Lines 105-111 Link Here
105
                                <i class="fa fa-exclamation-circle text-warning"></i>
106
                                <i class="fa fa-exclamation-circle text-warning"></i>
106
                                [% IF ( HOLD.is_at_destination ) %]
107
                                [% IF ( HOLD.is_at_destination ) %]
107
                                    [% IF ( HOLD.found ) %]
108
                                    [% IF ( HOLD.found ) %]
108
                                        Item waiting at <b> [% HOLD.branch.branchname | html %]</b>
109
                                        Item waiting at <b> [% HOLD.branch.branchname | html %]</b>[% IF ( HOLD.desk_id ) %], [% Desks.GetName ( HOLD.desk_id ) | html %],[% END %]
109
                                        [% IF ( HOLD.waitingdate ) %]
110
                                        [% IF ( HOLD.waitingdate ) %]
110
                                            since [% HOLD.waitingdate | $KohaDates %]
111
                                            since [% HOLD.waitingdate | $KohaDates %]
111
                                            [% IF HOLD.expirationdate %]
112
                                            [% IF HOLD.expirationdate %]
(-)a/reserve/request.pl (+1 lines)
Lines 654-659 foreach my $biblionumber (@biblionumbers) { Link Here
654
            $reserve{'wbrcode'}       = $res->branchcode();
654
            $reserve{'wbrcode'}       = $res->branchcode();
655
            $reserve{'itemnumber'}    = $res->itemnumber();
655
            $reserve{'itemnumber'}    = $res->itemnumber();
656
            $reserve{'wbrname'}       = $res->branch()->branchname();
656
            $reserve{'wbrname'}       = $res->branch()->branchname();
657
            $reserve{'desk_name'}     = $res->desk()->desk_name();
657
658
658
            if ( $reserve{'holdingbranch'} eq $reserve{'wbrcode'} ) {
659
            if ( $reserve{'holdingbranch'} eq $reserve{'wbrcode'} ) {
659
660
(-)a/svc/holds (-1 / +1 lines)
Lines 98-103 while ( my $h = $holds_rs->next() ) { Link Here
98
        reserve_id     => $h->reserve_id(),
98
        reserve_id     => $h->reserve_id(),
99
        branchcode     => $h->branch()->branchname(),
99
        branchcode     => $h->branch()->branchname(),
100
        branches       => $libraries,
100
        branches       => $libraries,
101
        desk_name      => $h->desk()->desk_name(),
101
        reservedate    => $h->reservedate(),
102
        reservedate    => $h->reservedate(),
102
        expirationdate => $h->expirationdate(),
103
        expirationdate => $h->expirationdate(),
103
        suspend        => $h->suspend(),
104
        suspend        => $h->suspend(),
104
- 

Return to bug 24412