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

(-)a/C4/Reserves.pm (-3 / +3 lines)
Lines 1107-1113 sub ModReserveStatus { Link Here
1107
1107
1108
=head2 ModReserveAffect
1108
=head2 ModReserveAffect
1109
1109
1110
  &ModReserveAffect($itemnumber,$borrowernumber,$diffBranchSend,$reserve_id);
1110
  &ModReserveAffect($itemnumber,$borrowernumber,$diffBranchSend,$reserve_id, $desk_id);
1111
1111
1112
This function affect an item and a status for a given reserve, either fetched directly
1112
This function affect an item and a status for a given reserve, either fetched directly
1113
by record_id, or by borrowernumber and itemnumber or biblionumber. If only biblionumber
1113
by record_id, or by borrowernumber and itemnumber or biblionumber. If only biblionumber
Lines 1121-1127 take care of the waiting status Link Here
1121
=cut
1121
=cut
1122
1122
1123
sub ModReserveAffect {
1123
sub ModReserveAffect {
1124
    my ( $itemnumber, $borrowernumber, $transferToDo, $reserve_id ) = @_;
1124
    my ( $itemnumber, $borrowernumber, $transferToDo, $reserve_id, $desk_id ) = @_;
1125
    my $dbh = C4::Context->dbh;
1125
    my $dbh = C4::Context->dbh;
1126
1126
1127
    # we want to attach $itemnumber to $borrowernumber, find the biblionumber
1127
    # we want to attach $itemnumber to $borrowernumber, find the biblionumber
Lines 1146-1152 sub ModReserveAffect { Link Here
1146
    my $already_on_shelf = $hold->found && $hold->found eq 'W';
1146
    my $already_on_shelf = $hold->found && $hold->found eq 'W';
1147
1147
1148
    $hold->itemnumber($itemnumber);
1148
    $hold->itemnumber($itemnumber);
1149
    $hold->set_waiting($transferToDo);
1149
    $hold->set_waiting($transferToDo, $desk_id);
1150
1150
1151
    if( !$transferToDo ){
1151
    if( !$transferToDo ){
1152
        _koha_notify_reserve( $hold->reserve_id ) unless $already_on_shelf;
1152
        _koha_notify_reserve( $hold->reserve_id ) unless $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 319-324 sub branch { Link Here
319
    return $self->{_branch};
322
    return $self->{_branch};
320
}
323
}
321
324
325
=head3 desk
326
327
Returns the related Koha::Library object for this Hold
328
329
=cut
330
331
sub desk {
332
    my ($self) = @_;
333
334
    $self->{_desk} ||= Koha::Desks->find( $self->desk_id() );
335
336
    return $self->{_desk};
337
}
338
322
=head3 borrower
339
=head3 borrower
323
340
324
Returns the related Koha::Patron object for this Hold
341
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 156-162 if ( $query->param('reserve_id') ) { Link Here
156
        my $diffBranchSend = ($userenv_branch ne $diffBranchReturned) ? $diffBranchReturned : undef;
157
        my $diffBranchSend = ($userenv_branch ne $diffBranchReturned) ? $diffBranchReturned : undef;
157
        # diffBranchSend tells ModReserveAffect whether document is expected in this library or not,
158
        # diffBranchSend tells ModReserveAffect whether document is expected in this library or not,
158
        # i.e., whether to apply waiting status
159
        # i.e., whether to apply waiting status
159
        ModReserveAffect( $itemnumber, $borrowernumber, $diffBranchSend, $reserve_id );
160
        ModReserveAffect( $itemnumber, $borrowernumber, $diffBranchSend, $reserve_id, $desk_id );
160
    }
161
    }
161
#   check if we have other reserves for this document, if we have a return send the message of transfer
162
#   check if we have other reserves for this document, if we have a return send the message of transfer
162
    my ( $messages, $nextreservinfo ) = GetOtherReserves($itemnumber);
163
    my ( $messages, $nextreservinfo ) = GetOtherReserves($itemnumber);
Lines 415-421 if ( $messages->{'ResFound'}) { Link Here
415
        my $biblio = $item->biblio;
416
        my $biblio = $item->biblio;
416
417
417
        my $diffBranchSend = !$branchCheck ? $reserve->{branchcode} : undef;
418
        my $diffBranchSend = !$branchCheck ? $reserve->{branchcode} : undef;
418
        ModReserveAffect( $reserve->{itemnumber}, $reserve->{borrowernumber}, $diffBranchSend, $reserve->{reserve_id} );
419
        ModReserveAffect( $reserve->{itemnumber}, $reserve->{borrowernumber}, $diffBranchSend, $reserve->{reserve_id}, $desk_id );
419
        my ( $messages, $nextreservinfo ) = GetOtherReserves($reserve->{itemnumber});
420
        my ( $messages, $nextreservinfo ) = GetOtherReserves($reserve->{itemnumber});
420
        $template->param(
421
        $template->param(
421
            hold_auto_filled => 1,
422
            hold_auto_filled => 1,
(-)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 TablesSettings %]
9
[% USE TablesSettings %]
9
[% PROCESS 'i18n.inc' %]
10
[% PROCESS 'i18n.inc' %]
Lines 384-390 Note that permanent location is a code, and location may be an authval. Link Here
384
                        [% SET hold = item.first_hold %]
385
                        [% SET hold = item.first_hold %]
385
                        [% IF hold %]
386
                        [% IF hold %]
386
                            [% IF hold.waitingdate %]
387
                            [% IF hold.waitingdate %]
387
                                <span class="waitingat">Waiting at [% Branches.GetName( hold.branchcode ) | html %] since [% hold.waitingdate | $KohaDates %].</span>
388
                                <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>
388
                                [% IF canreservefromotherbranches AND ( hold.waitingdate OR hold.priority == 1 ) %]
389
                                [% IF canreservefromotherbranches AND ( hold.waitingdate OR hold.priority == 1 ) %]
389
                                    <span class="heldfor">Hold for:</span>
390
                                    <span class="heldfor">Hold for:</span>
390
                                    [% INCLUDE 'patron-title.inc' patron=hold.borrower hide_patron_infos_if_needed=1 %]
391
                                    [% 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 459-466 Link Here
459
460
460
                                                <div class="modal-footer">
461
                                                <div class="modal-footer">
461
                                                    <input type="hidden" name="cancel_reserve" value="0" />
462
                                                    <input type="hidden" name="cancel_reserve" value="0" />
462
463
                                                       <button type="submit" class="btn btn-default approve" [% IF ( Desks.ListForLibrary ) %]data-dismiss="modal" [% END %]>
463
                                                    <button type="submit" class="btn btn-default approve" data-dismiss="modal">
464
                                                        <i class="fa fa-check"></i> Confirm hold
464
                                                        <i class="fa fa-check"></i> Confirm hold
465
                                                    </button>
465
                                                    </button>
466
466
(-)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