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

(-)a/C4/Reserves.pm (-3 / +3 lines)
Lines 1122-1128 sub ModReserveStatus { Link Here
1122
1122
1123
=head2 ModReserveAffect
1123
=head2 ModReserveAffect
1124
1124
1125
  &ModReserveAffect($itemnumber,$borrowernumber,$diffBranchSend,$reserve_id);
1125
  &ModReserveAffect($itemnumber,$borrowernumber,$diffBranchSend,$reserve_id, $desk_id);
1126
1126
1127
This function affect an item and a status for a given reserve, either fetched directly
1127
This function affect an item and a status for a given reserve, either fetched directly
1128
by record_id, or by borrowernumber and itemnumber or biblionumber. If only biblionumber
1128
by record_id, or by borrowernumber and itemnumber or biblionumber. If only biblionumber
Lines 1136-1142 take care of the waiting status Link Here
1136
=cut
1136
=cut
1137
1137
1138
sub ModReserveAffect {
1138
sub ModReserveAffect {
1139
    my ( $itemnumber, $borrowernumber, $transferToDo, $reserve_id ) = @_;
1139
    my ( $itemnumber, $borrowernumber, $transferToDo, $reserve_id, $desk_id ) = @_;
1140
    my $dbh = C4::Context->dbh;
1140
    my $dbh = C4::Context->dbh;
1141
1141
1142
    # we want to attach $itemnumber to $borrowernumber, find the biblionumber
1142
    # we want to attach $itemnumber to $borrowernumber, find the biblionumber
Lines 1161-1167 sub ModReserveAffect { Link Here
1161
    my $already_on_shelf = $hold->found && $hold->found eq 'W';
1161
    my $already_on_shelf = $hold->found && $hold->found eq 'W';
1162
1162
1163
    $hold->itemnumber($itemnumber);
1163
    $hold->itemnumber($itemnumber);
1164
    $hold->set_waiting($transferToDo);
1164
    $hold->set_waiting($transferToDo, $desk_id);
1165
1165
1166
    if( !$transferToDo ){
1166
    if( !$transferToDo ){
1167
        _koha_notify_reserve( $hold->reserve_id ) unless $already_on_shelf;
1167
        _koha_notify_reserve( $hold->reserve_id ) unless $already_on_shelf;
(-)a/Koha/Hold.pm (-1 / +18 lines)
Lines 158-164 sub delete { Link Here
158
=cut
158
=cut
159
159
160
sub set_waiting {
160
sub set_waiting {
161
    my ( $self, $transferToDo ) = @_;
161
    my ( $self, $transferToDo, $desk_id ) = @_;
162
162
163
    $self->priority(0);
163
    $self->priority(0);
164
164
Lines 171-178 sub set_waiting { Link Here
171
    my $values = {
171
    my $values = {
172
        found => 'W',
172
        found => 'W',
173
        waitingdate => $today->ymd,
173
        waitingdate => $today->ymd,
174
        desk_id => $desk_id,
174
    };
175
    };
175
176
177
    if (defined $desk_id) { $values->{'desk_id'} = $desk_id };
178
176
    my $requested_expiration;
179
    my $requested_expiration;
177
    if ($self->expirationdate) {
180
    if ($self->expirationdate) {
178
        $requested_expiration = dt_from_string($self->expirationdate);
181
        $requested_expiration = dt_from_string($self->expirationdate);
Lines 321-326 sub branch { Link Here
321
    return $self->{_branch};
324
    return $self->{_branch};
322
}
325
}
323
326
327
=head3 desk
328
329
Returns the related Koha::Library object for this Hold
330
331
=cut
332
333
sub desk {
334
    my ($self) = @_;
335
336
    $self->{_desk} ||= Koha::Desks->find( $self->desk_id() );
337
338
    return $self->{_desk};
339
}
340
324
=head3 borrower
341
=head3 borrower
325
342
326
Returns the related Koha::Patron object for this Hold
343
Returns the related Koha::Patron object for this Hold
(-)a/Koha/Template/Plugin/Desks.pm (+14 lines)
Lines 36-41 got or the current one. Link Here
36
36
37
=head2 Methods
37
=head2 Methods
38
38
39
=head3 GetName
40
41
[% Desk.GetName(desk_id) %]
42
43
return desk name or empty string
44
45
=cut
46
47
sub GetName {
48
    my ( $self, $desk_id ) = @_;
49
    my $d = Koha::Desks->find( $desk_id );
50
    return (defined $d) ? $d->unblessed->{'desk_name'} : q{};
51
}
52
39
=head3 GetLoggedInDeskId
53
=head3 GetLoggedInDeskId
40
54
41
[% Desks.GetLoggedInDeskId %]
55
[% Desks.GetLoggedInDeskId %]
(-)a/circ/returns.pl (-2 / +3 lines)
Lines 71-76 my ( $template, $librarian, $cookie, $flags ) = get_template_and_user( Link Here
71
71
72
my $sessionID = $query->cookie("CGISESSID");
72
my $sessionID = $query->cookie("CGISESSID");
73
my $session = get_session($sessionID);
73
my $session = get_session($sessionID);
74
my $desk_id = C4::Context->userenv->{"desk_id"} || '';
74
75
75
# Print a reserve slip on this page
76
# Print a reserve slip on this page
76
if ( $query->param('print_slip') ) {
77
if ( $query->param('print_slip') ) {
Lines 155-161 if ( $query->param('reserve_id') ) { Link Here
155
        my $diffBranchSend = ($userenv_branch ne $diffBranchReturned) ? $diffBranchReturned : undef;
156
        my $diffBranchSend = ($userenv_branch ne $diffBranchReturned) ? $diffBranchReturned : undef;
156
        # diffBranchSend tells ModReserveAffect whether document is expected in this library or not,
157
        # diffBranchSend tells ModReserveAffect whether document is expected in this library or not,
157
        # i.e., whether to apply waiting status
158
        # i.e., whether to apply waiting status
158
        ModReserveAffect( $itemnumber, $borrowernumber, $diffBranchSend, $reserve_id );
159
        ModReserveAffect( $itemnumber, $borrowernumber, $diffBranchSend, $reserve_id, $desk_id );
159
    }
160
    }
160
#   check if we have other reserves for this document, if we have a return send the message of transfer
161
#   check if we have other reserves for this document, if we have a return send the message of transfer
161
    my ( $messages, $nextreservinfo ) = GetOtherReserves($itemnumber);
162
    my ( $messages, $nextreservinfo ) = GetOtherReserves($itemnumber);
Lines 414-420 if ( $messages->{'ResFound'}) { Link Here
414
        my $biblio = $item->biblio;
415
        my $biblio = $item->biblio;
415
416
416
        my $diffBranchSend = !$branchCheck ? $reserve->{branchcode} : undef;
417
        my $diffBranchSend = !$branchCheck ? $reserve->{branchcode} : undef;
417
        ModReserveAffect( $reserve->{itemnumber}, $reserve->{borrowernumber}, $diffBranchSend, $reserve->{reserve_id} );
418
        ModReserveAffect( $reserve->{itemnumber}, $reserve->{borrowernumber}, $diffBranchSend, $reserve->{reserve_id}, $desk_id );
418
        my ( $messages, $nextreservinfo ) = GetOtherReserves($reserve->{itemnumber});
419
        my ( $messages, $nextreservinfo ) = GetOtherReserves($reserve->{itemnumber});
419
        $template->param(
420
        $template->param(
420
            hold_auto_filled => 1,
421
            hold_auto_filled => 1,
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc (-1 / +5 lines)
Lines 1-6 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
<<<<<<< HEAD
2
[% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
3
[% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
3
[% USE AuthorisedValues %]
4
[% USE AuthorisedValues %]
5
=======
6
[% USE Desks %]
7
>>>>>>> Bug 24412: Attach waiting reserve to desk
4
<table>
8
<table>
5
    <tr>
9
    <tr>
6
        [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
10
        [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
Lines 121-127 Link Here
121
                [% IF ( hold.found ) %]
125
                [% IF ( hold.found ) %]
122
                    [% IF ( hold.atdestination ) %]
126
                    [% IF ( hold.atdestination ) %]
123
                        [% IF ( hold.found ) %]
127
                        [% IF ( hold.found ) %]
124
                            Item waiting at <b> [% hold.wbrname | html %]</b> <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" /> since [% hold.waiting_date | $KohaDates %]
128
                            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 %]
125
                        [% ELSE %]
129
                        [% ELSE %]
126
                            Waiting to be pulled <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" />
130
                            Waiting to be pulled <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" />
127
                        [% END %]
131
                        [% 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 TablesSettings %]
9
[% USE TablesSettings %]
9
[% PROCESS 'i18n.inc' %]
10
[% PROCESS 'i18n.inc' %]
Lines 443-449 Note that permanent location is a code, and location may be an authval. Link Here
443
                        [% SET hold = item.first_hold %]
444
                        [% SET hold = item.first_hold %]
444
                        [% IF hold %]
445
                        [% IF hold %]
445
                            [% IF hold.waitingdate %]
446
                            [% IF hold.waitingdate %]
446
                                <span class="waitingat">Waiting at [% Branches.GetName( hold.branchcode ) | html %] since [% hold.waitingdate | $KohaDates %].</span>
447
                                <span class="waitingat">Waiting at [% Branches.GetName( hold.branchcode ) | html %][% IF ( hold.desk_id ) %], [% Desks.GetName ( hold.desk_id ) | html %][% END %] since [% hold.waitingdate | $KohaDates %].</span>
447
                                [% IF canreservefromotherbranches AND ( hold.waitingdate OR hold.priority == 1 ) %]
448
                                [% IF canreservefromotherbranches AND ( hold.waitingdate OR hold.priority == 1 ) %]
448
                                    <span class="heldfor">Hold for:</span>
449
                                    <span class="heldfor">Hold for:</span>
449
                                    [% INCLUDE 'patron-title.inc' patron=hold.borrower hide_patron_infos_if_needed=1 %]
450
                                    [% INCLUDE 'patron-title.inc' patron=hold.borrower hide_patron_infos_if_needed=1 %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-1 / +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 461-467 Link Here
461
                                                    <input type="hidden" name="cancel_reserve" value="0" />
462
                                                    <input type="hidden" name="cancel_reserve" value="0" />
462
                                                    <input type="hidden" name="barcode" value="[% barcode | html %]" />
463
                                                    <input type="hidden" name="barcode" value="[% barcode | html %]" />
463
464
464
                                                    <button type="submit" class="btn btn-default approve" data-dismiss="modal">
465
                                                       <button type="submit" class="btn btn-default approve" [% IF ( Desks.ListForLibrary ) %]data-dismiss="modal" [% END %]>
465
                                                        <i class="fa fa-check"></i> Confirm hold
466
                                                        <i class="fa fa-check"></i> Confirm hold
466
                                                    </button>
467
                                                    </button>
467
468
(-)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 / +4 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" aria-hidden="true"></i>
106
                                <i class="fa fa-exclamation-circle text-warning" aria-hidden="true"></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 <strong> [% HOLD.branch.branchname | html %]</strong>
109
110
                                        Item waiting at <strong> [% HOLD.branch.branchname | html %]</strong>[% IF ( HOLD.desk_id ) %], [% Desks.GetName ( HOLD.desk_id ) | html %],[% END %]
111
109
                                        [% IF ( HOLD.waitingdate ) %]
112
                                        [% IF ( HOLD.waitingdate ) %]
110
                                            since [% HOLD.waitingdate | $KohaDates %]
113
                                            since [% HOLD.waitingdate | $KohaDates %]
111
                                            [% IF HOLD.expirationdate %]
114
                                            [% IF HOLD.expirationdate %]
(-)a/reserve/request.pl (+1 lines)
Lines 663-668 foreach my $biblionumber (@biblionumbers) { Link Here
663
            $reserve{'wbrcode'}       = $res->branchcode();
663
            $reserve{'wbrcode'}       = $res->branchcode();
664
            $reserve{'itemnumber'}    = $res->itemnumber();
664
            $reserve{'itemnumber'}    = $res->itemnumber();
665
            $reserve{'wbrname'}       = $res->branch()->branchname();
665
            $reserve{'wbrname'}       = $res->branch()->branchname();
666
            $reserve{'desk_name'}     = $res->desk()->desk_name();
666
667
667
            if ( $reserve{'holdingbranch'} eq $reserve{'wbrcode'} ) {
668
            if ( $reserve{'holdingbranch'} eq $reserve{'wbrcode'} ) {
668
669
(-)a/svc/holds (-1 / +1 lines)
Lines 97-102 while ( my $h = $holds_rs->next() ) { Link Here
97
        reserve_id     => $h->reserve_id(),
97
        reserve_id     => $h->reserve_id(),
98
        branchcode     => $h->branch()->branchname(),
98
        branchcode     => $h->branch()->branchname(),
99
        branches       => $libraries,
99
        branches       => $libraries,
100
        desk_name      => $h->desk()->desk_name(),
100
        reservedate    => $h->reservedate(),
101
        reservedate    => $h->reservedate(),
101
        expirationdate => $h->expirationdate(),
102
        expirationdate => $h->expirationdate(),
102
        suspend        => $h->suspend(),
103
        suspend        => $h->suspend(),
103
- 

Return to bug 24412