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 1169-1175 sub ModReserveAffect { Link Here
1169
             && !$already_on_shelf) {
1169
             && !$already_on_shelf) {
1170
        $hold->set_processing();
1170
        $hold->set_processing();
1171
    } else {
1171
    } else {
1172
        $hold->set_waiting();
1172
        $hold->set_waiting($desk_id);
1173
        _koha_notify_reserve( $hold->reserve_id ) unless $already_on_shelf;
1173
        _koha_notify_reserve( $hold->reserve_id ) unless $already_on_shelf;
1174
        my $transfers = Koha::Item::Transfers->search({
1174
        my $transfers = Koha::Item::Transfers->search({
1175
            itemnumber => $itemnumber,
1175
            itemnumber => $itemnumber,
(-)a/Koha/Hold.pm (-1 / +18 lines)
Lines 175-181 sub set_transfer { Link Here
175
=cut
175
=cut
176
176
177
sub set_waiting {
177
sub set_waiting {
178
    my ( $self ) = @_;
178
    my ( $self, $desk_id ) = @_;
179
179
180
    $self->priority(0);
180
    $self->priority(0);
181
181
Lines 183-190 sub set_waiting { Link Here
183
    my $values = {
183
    my $values = {
184
        found => 'W',
184
        found => 'W',
185
        waitingdate => $today->ymd,
185
        waitingdate => $today->ymd,
186
        desk_id => $desk_id,
186
    };
187
    };
187
188
189
    if (defined $desk_id) { $values->{'desk_id'} = $desk_id };
190
188
    my $requested_expiration;
191
    my $requested_expiration;
189
    if ($self->expirationdate) {
192
    if ($self->expirationdate) {
190
        $requested_expiration = dt_from_string($self->expirationdate);
193
        $requested_expiration = dt_from_string($self->expirationdate);
Lines 365-370 sub branch { Link Here
365
    return $self->{_branch};
368
    return $self->{_branch};
366
}
369
}
367
370
371
=head3 desk
372
373
Returns the related Koha::Library object for this Hold
374
375
=cut
376
377
sub desk {
378
    my ($self) = @_;
379
380
    $self->{_desk} ||= Koha::Desks->find( $self->desk_id() );
381
382
    return $self->{_desk};
383
}
384
368
=head3 borrower
385
=head3 borrower
369
386
370
Returns the related Koha::Patron object for this Hold
387
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 422-428 if ( $messages->{'ResFound'}) { Link Here
422
        my $biblio = $item->biblio;
423
        my $biblio = $item->biblio;
423
424
424
        my $diffBranchSend = !$branchCheck ? $reserve->{branchcode} : undef;
425
        my $diffBranchSend = !$branchCheck ? $reserve->{branchcode} : undef;
425
        ModReserveAffect( $reserve->{itemnumber}, $reserve->{borrowernumber}, $diffBranchSend, $reserve->{reserve_id} );
426
        ModReserveAffect( $reserve->{itemnumber}, $reserve->{borrowernumber}, $diffBranchSend, $reserve->{reserve_id}, $desk_id );
426
        my ( $messages, $nextreservinfo ) = GetOtherReserves($reserve->{itemnumber});
427
        my ( $messages, $nextreservinfo ) = GetOtherReserves($reserve->{itemnumber});
427
428
428
        $template->param(
429
        $template->param(
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc (-1 / +2 lines)
Lines 1-6 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
2
[% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
3
[% USE AuthorisedValues %]
3
[% USE AuthorisedValues %]
4
[% USE Desks %]
4
<table>
5
<table>
5
    <tr>
6
    <tr>
6
        [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
7
        [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
Lines 122-128 Link Here
122
            <td>
123
            <td>
123
                [% IF ( hold.found ) %]
124
                [% IF ( hold.found ) %]
124
                    [% IF ( hold.atdestination ) %]
125
                    [% IF ( hold.atdestination ) %]
125
                            Item waiting at <strong> [% hold.wbrname | html %]</strong> <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" /> since [% hold.waiting_date | $KohaDates %]
126
                            Item waiting at <strong> [% hold.wbrname | html %]</strong>[% IF hold.desk_name %], [% hold.desk_name | html %],[% END %] <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" /> since [% hold.waiting_date | $KohaDates %]
126
                    [% ELSIF (hold.intransit) %]
127
                    [% ELSIF (hold.intransit) %]
127
                        Item being transferred to <strong> [% hold.wbrname | html %]</strong> <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" />
128
                        Item being transferred to <strong> [% hold.wbrname | html %]</strong> <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" />
128
                    [% ELSIF (hold.inprocessing) %]
129
                    [% ELSIF (hold.inprocessing) %]
(-)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 37-43 Link Here
37
                    [% END %]
38
                    [% END %]
38
                </td>
39
                </td>
39
                <td>[% Branches.GetName( reserveloo.item.homebranch ) | html %]</td>
40
                <td>[% Branches.GetName( reserveloo.item.homebranch ) | html %]</td>
40
                <td>[% Branches.GetName( reserveloo.item.holdingbranch ) | html %]</td>
41
                <td>[% Branches.GetName( reserveloo.item.holdingbranch ) | html %][% IF (reserveloo.desk_id  ) %], [% Desks.GetName (reserveloo.desk_id) | html %][% END %]</td>
41
                <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => reserveloo.item.location) | html %]</td>
42
                <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => reserveloo.item.location) | html %]</td>
42
                <td>[% reserveloo.item.itemcallnumber | html %]</td>
43
                <td>[% reserveloo.item.itemcallnumber | html %]</td>
43
                <td>[% reserveloo.item.copynumber | html %]</td>
44
                <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 460-466 Note that permanent location is a code, and location may be an authval. Link Here
460
                        [% SET hold = item.first_hold %]
461
                        [% SET hold = item.first_hold %]
461
                        [% IF hold %]
462
                        [% IF hold %]
462
                            [% IF hold.waitingdate %]
463
                            [% IF hold.waitingdate %]
463
                                <span class="waitingat">Waiting at [% Branches.GetName( hold.branchcode ) | html %] since [% hold.waitingdate | $KohaDates %].</span>
464
                                <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>
464
                                [% IF canreservefromotherbranches AND ( hold.waitingdate OR hold.priority == 1 ) %]
465
                                [% IF canreservefromotherbranches AND ( hold.waitingdate OR hold.priority == 1 ) %]
465
                                    <span class="heldfor">Hold for:</span>
466
                                    <span class="heldfor">Hold for:</span>
466
                                    [% INCLUDE 'patron-title.inc' patron=hold.borrower hide_patron_infos_if_needed=1 %]
467
                                    [% 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 501-507 Link Here
501
                                                    <input type="hidden" name="cancel_reserve" value="0" />
502
                                                    <input type="hidden" name="cancel_reserve" value="0" />
502
                                                    <input type="hidden" name="barcode" value="[% barcode | html %]" />
503
                                                    <input type="hidden" name="barcode" value="[% barcode | html %]" />
503
504
504
                                                    <button type="submit" class="btn btn-default approve" data-dismiss="modal">
505
                                                       <button type="submit" class="btn btn-default approve" [% IF ( Desks.ListForLibrary ) %]data-dismiss="modal" [% END %]>
505
                                                        <i class="fa fa-check"></i> Confirm hold
506
                                                        <i class="fa fa-check"></i> Confirm hold
506
                                                    </button>
507
                                                    </button>
507
508
(-)a/koha-tmpl/intranet-tmpl/prog/js/holds.js (+7 lines)
Lines 161-169 $(document).ready(function() { Link Here
161
161
162
                                    if ( oObj.waiting_here ) {
162
                                    if ( oObj.waiting_here ) {
163
                                        data += __("Item is <strong>waiting here</strong>");
163
                                        data += __("Item is <strong>waiting here</strong>");
164
					if (oObj.desk_name) {
165
					    data += ", " + __("at %s").format( oObj.desk_name );
166
					}
164
                                    } else {
167
                                    } else {
165
                                        data += __("Item is <strong>waiting</strong>");
168
                                        data += __("Item is <strong>waiting</strong>");
166
                                        data += " " + __("at %s").format(oObj.waiting_at);
169
                                        data += " " + __("at %s").format(oObj.waiting_at);
170
					if (oObj.desk_name) {
171
					    data += ", " + __("at %s").format( oObj.desk_name );
172
					}
173
167
                                    }
174
                                    }
168
175
169
                                } else if ( oObj.transferred ) {
176
                                } else if ( oObj.transferred ) {
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc (+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
[% PROCESS 'i18n.inc' %]
5
[% PROCESS 'i18n.inc' %]
Lines 100-105 Link Here
100
                                <i class="fa fa-exclamation-circle text-warning" aria-hidden="true"></i>
101
                                <i class="fa fa-exclamation-circle text-warning" aria-hidden="true"></i>
101
                                [% IF ( HOLD.is_at_destination ) %]
102
                                [% IF ( HOLD.is_at_destination ) %]
102
                                    Item waiting at <strong> [% HOLD.branch.branchname | html %]</strong>
103
                                    Item waiting at <strong> [% HOLD.branch.branchname | html %]</strong>
104
				    [% IF ( HOLD.desk_id ) %], [% Desks.GetName ( HOLD.desk_id ) | html %],[% END %]
103
                                    [% IF ( HOLD.waitingdate ) %]
105
                                    [% IF ( HOLD.waitingdate ) %]
104
                                        since [% HOLD.waitingdate | $KohaDates %]
106
                                        since [% HOLD.waitingdate | $KohaDates %]
105
                                        [% IF HOLD.expirationdate %]
107
                                        [% IF HOLD.expirationdate %]
(-)a/reserve/request.pl (+1 lines)
Lines 664-669 foreach my $biblionumber (@biblionumbers) { Link Here
664
            $reserve{'itemnumber'}    = $res->itemnumber();
664
            $reserve{'itemnumber'}    = $res->itemnumber();
665
            $reserve{'wbrname'}       = $res->branch()->branchname();
665
            $reserve{'wbrname'}       = $res->branch()->branchname();
666
            $reserve{'atdestination'} = $res->is_at_destination();
666
            $reserve{'atdestination'} = $res->is_at_destination();
667
            $reserve{'desk_name'}     = $res->desk()->desk_name();
667
            $reserve{'found'}     = $res->is_found();
668
            $reserve{'found'}     = $res->is_found();
668
            $reserve{'inprocessing'} = $res->is_in_processing();
669
            $reserve{'inprocessing'} = $res->is_in_processing();
669
            $reserve{'intransit'} = $res->is_in_transit();
670
            $reserve{'intransit'} = $res->is_in_transit();
(-)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