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

(-)a/C4/Reserves.pm (-3 / +3 lines)
Lines 1076-1082 sub ModReserveStatus { Link Here
1076
1076
1077
=head2 ModReserveAffect
1077
=head2 ModReserveAffect
1078
1078
1079
  &ModReserveAffect($itemnumber,$borrowernumber,$diffBranchSend,$reserve_id);
1079
  &ModReserveAffect($itemnumber,$borrowernumber,$diffBranchSend,$reserve_id, $desk);
1080
1080
1081
This function affect an item and a status for a given reserve, either fetched directly
1081
This function affect an item and a status for a given reserve, either fetched directly
1082
by record_id, or by borrowernumber and itemnumber or biblionumber. If only biblionumber
1082
by record_id, or by borrowernumber and itemnumber or biblionumber. If only biblionumber
Lines 1090-1096 take care of the waiting status Link Here
1090
=cut
1090
=cut
1091
1091
1092
sub ModReserveAffect {
1092
sub ModReserveAffect {
1093
    my ( $itemnumber, $borrowernumber, $transferToDo, $reserve_id ) = @_;
1093
    my ( $itemnumber, $borrowernumber, $transferToDo, $reserve_id, $desk_id ) = @_;
1094
    my $dbh = C4::Context->dbh;
1094
    my $dbh = C4::Context->dbh;
1095
1095
1096
    # we want to attach $itemnumber to $borrowernumber, find the biblionumber
1096
    # we want to attach $itemnumber to $borrowernumber, find the biblionumber
Lines 1115-1121 sub ModReserveAffect { Link Here
1115
    my $already_on_shelf = $hold->found && $hold->found eq 'W';
1115
    my $already_on_shelf = $hold->found && $hold->found eq 'W';
1116
1116
1117
    $hold->itemnumber($itemnumber);
1117
    $hold->itemnumber($itemnumber);
1118
    $hold->set_waiting($transferToDo);
1118
    $hold->set_waiting($transferToDo, $desk_id);
1119
1119
1120
    _koha_notify_reserve( $hold->reserve_id )
1120
    _koha_notify_reserve( $hold->reserve_id )
1121
      if ( !$transferToDo && !$already_on_shelf );
1121
      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 28-35 use Koha::Desks; Link Here
28
28
29
sub GetName {
29
sub GetName {
30
    my ( $self, $desk_id ) = @_;
30
    my ( $self, $desk_id ) = @_;
31
    my $d = Koha::Desks->search( { desk_id => $desk_id} )->unblessed;
31
    my $d = Koha::Desks->find( $desk_id );
32
    return @$d ? $d->{'desk_name'} : q{};
32
    return (defined $d) ? $d->unblessed->{'desk_name'} : q{};
33
}
33
}
34
34
35
sub GetLoggedInDeskId {
35
sub 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 %],[% 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) %][% 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 358-364 Link Here
358
                        [% SET hold = item.first_hold %]
359
                        [% SET hold = item.first_hold %]
359
                        [% IF hold %]
360
                        [% IF hold %]
360
                            [% IF hold.waitingdate %]
361
                            [% IF hold.waitingdate %]
361
                                Waiting at [% Branches.GetName( hold.branchcode ) | html %] since [% hold.waitingdate | $KohaDates %].
362
                                Waiting at [% Branches.GetName( hold.branchcode ) | html %][% IF ( hold.desk_id ) %], [% Desks.GetName ( hold.desk_id ) %][% END %] since [% hold.waitingdate | $KohaDates %].
362
                            [% ELSIF hold.priority == 1 %]
363
                            [% ELSIF hold.priority == 1 %]
363
                                Item-level hold (placed [% hold.reservedate | $KohaDates %]) for delivery at [% Branches.GetName( hold.branchcode ) | html %].
364
                                Item-level hold (placed [% hold.reservedate | $KohaDates %]) for delivery at [% Branches.GetName( hold.branchcode ) | html %].
364
                            [% ELSE %]
365
                            [% 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 158-166 $(document).ready(function() { Link Here
158
158
159
                                    if ( oObj.waiting_here ) {
159
                                    if ( oObj.waiting_here ) {
160
                                        data += ITEM_IS_WAITING_HERE;
160
                                        data += ITEM_IS_WAITING_HERE;
161
                                        if (oObj.desk_name) {
162
                                            data += ", " + AT.format( oObj.desk_name );
163
                                        }
161
                                    } else {
164
                                    } else {
162
                                        data += ITEM_IS_WAITING;
165
                                        data += ITEM_IS_WAITING;
163
                                        data += " " + AT.format( oObj.waiting_at );
166
                                        data += AT.format( oObj.waiting_at );
167
                                        if (oObj.desk_name) {
168
                                            data += ", " + AT.format( oObj.desk_name );
169
                                        }
164
                                    }
170
                                    }
165
171
166
                                } else if ( oObj.transferred ) {
172
                                } 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 ) %],[% 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 650-655 foreach my $biblionumber (@biblionumbers) { Link Here
650
            $reserve{'wbrcode'}       = $res->branchcode();
650
            $reserve{'wbrcode'}       = $res->branchcode();
651
            $reserve{'itemnumber'}    = $res->itemnumber();
651
            $reserve{'itemnumber'}    = $res->itemnumber();
652
            $reserve{'wbrname'}       = $res->branch()->branchname();
652
            $reserve{'wbrname'}       = $res->branch()->branchname();
653
            $reserve{'desk_name'}     = $res->desk()->desk_name();
653
654
654
            if ( $reserve{'holdingbranch'} eq $reserve{'wbrcode'} ) {
655
            if ( $reserve{'holdingbranch'} eq $reserve{'wbrcode'} ) {
655
656
(-)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