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

(-)a/C4/Reserves.pm (-3 / +3 lines)
Lines 1098-1104 sub ModReserveStatus { Link Here
1098
1098
1099
=head2 ModReserveAffect
1099
=head2 ModReserveAffect
1100
1100
1101
  &ModReserveAffect($itemnumber,$borrowernumber,$diffBranchSend,$reserve_id);
1101
  &ModReserveAffect($itemnumber,$borrowernumber,$diffBranchSend,$reserve_id, $desk_id);
1102
1102
1103
This function affect an item and a status for a given reserve, either fetched directly
1103
This function affect an item and a status for a given reserve, either fetched directly
1104
by record_id, or by borrowernumber and itemnumber or biblionumber. If only biblionumber
1104
by record_id, or by borrowernumber and itemnumber or biblionumber. If only biblionumber
Lines 1112-1118 take care of the waiting status Link Here
1112
=cut
1112
=cut
1113
1113
1114
sub ModReserveAffect {
1114
sub ModReserveAffect {
1115
    my ( $itemnumber, $borrowernumber, $transferToDo, $reserve_id ) = @_;
1115
    my ( $itemnumber, $borrowernumber, $transferToDo, $reserve_id, $desk_id ) = @_;
1116
    my $dbh = C4::Context->dbh;
1116
    my $dbh = C4::Context->dbh;
1117
1117
1118
    # we want to attach $itemnumber to $borrowernumber, find the biblionumber
1118
    # we want to attach $itemnumber to $borrowernumber, find the biblionumber
Lines 1137-1143 sub ModReserveAffect { Link Here
1137
    my $already_on_shelf = $hold->found && $hold->found eq 'W';
1137
    my $already_on_shelf = $hold->found && $hold->found eq 'W';
1138
1138
1139
    $hold->itemnumber($itemnumber);
1139
    $hold->itemnumber($itemnumber);
1140
    $hold->set_waiting($transferToDo);
1140
    $hold->set_waiting($transferToDo, $desk_id);
1141
1141
1142
    _koha_notify_reserve( $hold->reserve_id )
1142
    _koha_notify_reserve( $hold->reserve_id )
1143
      if ( !$transferToDo && !$already_on_shelf );
1143
      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 (+14 lines)
Lines 37-42 got or the current one. Link Here
37
37
38
=head2 Methods
38
=head2 Methods
39
39
40
=head3 GetName
41
42
[% Desk.GetName(desk_id) %]
43
44
return desk name or empty string
45
46
=cut
47
48
sub GetName {
49
    my ( $self, $desk_id ) = @_;
50
    my $d = Koha::Desks->find( $desk_id );
51
    return (defined $d) ? $d->unblessed->{'desk_name'} : q{};
52
}
53
40
=head3 GetLoggedInDeskId
54
=head3 GetLoggedInDeskId
41
55
42
[% Desks.GetLoggedInDeskId %]
56
[% Desks.GetLoggedInDeskId %]
(-)a/circ/returns.pl (-2 / +3 lines)
Lines 72-77 my ( $template, $librarian, $cookie, $flags ) = get_template_and_user( Link Here
72
72
73
my $sessionID = $query->cookie("CGISESSID");
73
my $sessionID = $query->cookie("CGISESSID");
74
my $session = get_session($sessionID);
74
my $session = get_session($sessionID);
75
my $desk_id = C4::Context->userenv->{"desk_id"} || '';
75
76
76
# Print a reserve slip on this page
77
# Print a reserve slip on this page
77
if ( $query->param('print_slip') ) {
78
if ( $query->param('print_slip') ) {
Lines 158-164 if ( $query->param('reserve_id') ) { Link Here
158
        my $diffBranchSend = ($userenv_branch ne $diffBranchReturned) ? $diffBranchReturned : undef;
159
        my $diffBranchSend = ($userenv_branch ne $diffBranchReturned) ? $diffBranchReturned : undef;
159
        # diffBranchSend tells ModReserveAffect whether document is expected in this library or not,
160
        # diffBranchSend tells ModReserveAffect whether document is expected in this library or not,
160
        # i.e., whether to apply waiting status
161
        # i.e., whether to apply waiting status
161
        ModReserveAffect( $itemnumber, $borrowernumber, $diffBranchSend, $reserve_id );
162
        ModReserveAffect( $itemnumber, $borrowernumber, $diffBranchSend, $reserve_id, $desk_id );
162
    }
163
    }
163
#   check if we have other reserves for this document, if we have a return send the message of transfer
164
#   check if we have other reserves for this document, if we have a return send the message of transfer
164
    my ( $messages, $nextreservinfo ) = GetOtherReserves($itemnumber);
165
    my ( $messages, $nextreservinfo ) = GetOtherReserves($itemnumber);
Lines 417-423 if ( $messages->{'ResFound'}) { Link Here
417
        my $biblio = $item->biblio;
418
        my $biblio = $item->biblio;
418
419
419
        my $diffBranchSend = !$branchCheck ? $reserve->{branchcode} : undef;
420
        my $diffBranchSend = !$branchCheck ? $reserve->{branchcode} : undef;
420
        ModReserveAffect( $reserve->{itemnumber}, $reserve->{borrowernumber}, $diffBranchSend, $reserve->{reserve_id} );
421
        ModReserveAffect( $reserve->{itemnumber}, $reserve->{borrowernumber}, $diffBranchSend, $reserve->{reserve_id}, $desk_id );
421
        my ( $messages, $nextreservinfo ) = GetOtherReserves($reserve->{itemnumber});
422
        my ( $messages, $nextreservinfo ) = GetOtherReserves($reserve->{itemnumber});
422
423
423
        my $patron = Koha::Patrons->find( $nextreservinfo );
424
        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
                                [% IF canreservefromotherbranches AND ( hold.waitingdate OR hold.priority == 1 ) %]
385
                                [% IF canreservefromotherbranches AND ( hold.waitingdate OR hold.priority == 1 ) %]
385
                                    Hold for:
386
                                    Hold for:
386
                                    [% INCLUDE 'patron-title.inc' patron=hold.borrower hide_patron_infos_if_needed=1 %]
387
                                    [% INCLUDE 'patron-title.inc' patron=hold.borrower hide_patron_infos_if_needed=1 %]
(-)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 ItemTypes %]
7
[% USE ItemTypes %]
7
[% USE AuthorisedValues %]
8
[% USE AuthorisedValues %]
Lines 467-474 Link Here
467
468
468
                                                <div class="modal-footer">
469
                                                <div class="modal-footer">
469
                                                    <input type="hidden" name="cancel_reserve" value="0" />
470
                                                    <input type="hidden" name="cancel_reserve" value="0" />
470
471
                                                       <button type="submit" class="btn btn-default approve" [% IF (Desks.defined) %]data-dismiss="modal" [% END %]>
471
                                                    <button type="submit" class="btn btn-default approve" data-dismiss="modal">
472
                                                        <i class="fa fa-check"></i> Confirm hold
472
                                                        <i class="fa fa-check"></i> Confirm hold
473
                                                    </button>
473
                                                    </button>
474
474
(-)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 665-670 foreach my $biblionumber (@biblionumbers) { Link Here
665
            $reserve{'wbrcode'}       = $res->branchcode();
665
            $reserve{'wbrcode'}       = $res->branchcode();
666
            $reserve{'itemnumber'}    = $res->itemnumber();
666
            $reserve{'itemnumber'}    = $res->itemnumber();
667
            $reserve{'wbrname'}       = $res->branch()->branchname();
667
            $reserve{'wbrname'}       = $res->branch()->branchname();
668
            $reserve{'desk_name'}     = $res->desk()->desk_name();
668
669
669
            if ( $reserve{'holdingbranch'} eq $reserve{'wbrcode'} ) {
670
            if ( $reserve{'holdingbranch'} eq $reserve{'wbrcode'} ) {
670
671
(-)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