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

(-)a/C4/Reserves.pm (-9 / +16 lines)
Lines 714-719 sub GetReserveStatus { Link Here
714
714
715
    if(defined $found) {
715
    if(defined $found) {
716
        return 'Waiting'  if $found eq 'W' and $priority == 0;
716
        return 'Waiting'  if $found eq 'W' and $priority == 0;
717
        return 'Processing'  if $found eq 'P';
717
        return 'Finished' if $found eq 'F';
718
        return 'Finished' if $found eq 'F';
718
    }
719
    }
719
720
Lines 828-834 sub CheckReserves { Link Here
828
            if ( $res->{'itemnumber'} && $res->{'itemnumber'} == $itemnumber && $res->{'priority'} == 0) {
829
            if ( $res->{'itemnumber'} && $res->{'itemnumber'} == $itemnumber && $res->{'priority'} == 0) {
829
                if ($res->{'found'} eq 'W') {
830
                if ($res->{'found'} eq 'W') {
830
                    return ( "Waiting", $res, \@reserves ); # Found it, it is waiting
831
                    return ( "Waiting", $res, \@reserves ); # Found it, it is waiting
831
                } else {
832
                } elsif ($res->{'found'} eq 'P') {
833
                    return ( "Processing", $res, \@reserves ); # Found determinated hold, e. g. the tranferred one
834
                 } else {
832
                    return ( "Reserved", $res, \@reserves ); # Found determinated hold, e. g. the tranferred one
835
                    return ( "Reserved", $res, \@reserves ); # Found determinated hold, e. g. the tranferred one
833
                }
836
                }
834
            } else {
837
            } else {
Lines 1159-1165 sub ModReserveAffect { Link Here
1159
1162
1160
    $hold->itemnumber($itemnumber);
1163
    $hold->itemnumber($itemnumber);
1161
1164
1162
    if( !$transferToDo ){
1165
    if ($transferToDo) {
1166
        $hold->set_transfer();
1167
    } elsif (C4::Context->preference('HoldsNeedProcessingSIP')
1168
             && C4::Context->interface eq 'sip'
1169
             && !$already_on_shelf) {
1170
        $hold->set_processing();
1171
    } else {
1163
        $hold->set_waiting();
1172
        $hold->set_waiting();
1164
        _koha_notify_reserve( $hold->reserve_id ) unless $already_on_shelf;
1173
        _koha_notify_reserve( $hold->reserve_id ) unless $already_on_shelf;
1165
        my $transfers = Koha::Item::Transfers->search({
1174
        my $transfers = Koha::Item::Transfers->search({
Lines 1169-1177 sub ModReserveAffect { Link Here
1169
        while( my $transfer = $transfers->next ){
1178
        while( my $transfer = $transfers->next ){
1170
            $transfer->datearrived( dt_from_string() )->store;
1179
            $transfer->datearrived( dt_from_string() )->store;
1171
        };
1180
        };
1172
     } else {
1181
    }
1173
        $hold->set_transfer();
1174
     }
1175
1182
1176
1183
1177
    _FixPriority( { biblionumber => $biblionumber } );
1184
    _FixPriority( { biblionumber => $biblionumber } );
Lines 1550-1556 sub _FixPriority { Link Here
1550
            UPDATE reserves
1557
            UPDATE reserves
1551
            SET    priority = 0
1558
            SET    priority = 0
1552
            WHERE reserve_id = ?
1559
            WHERE reserve_id = ?
1553
            AND found IN ('W', 'T')
1560
            AND found IN ('W', 'T', 'P')
1554
        ";
1561
        ";
1555
        my $sth = $dbh->prepare($query);
1562
        my $sth = $dbh->prepare($query);
1556
        $sth->execute( $reserve_id );
1563
        $sth->execute( $reserve_id );
Lines 1562-1568 sub _FixPriority { Link Here
1562
        SELECT reserve_id, borrowernumber, reservedate
1569
        SELECT reserve_id, borrowernumber, reservedate
1563
        FROM   reserves
1570
        FROM   reserves
1564
        WHERE  biblionumber   = ?
1571
        WHERE  biblionumber   = ?
1565
          AND  ((found <> 'W' AND found <> 'T') OR found IS NULL)
1572
          AND  ((found <> 'W' AND found <> 'T' AND found <> 'P') OR found IS NULL)
1566
        ORDER BY priority ASC
1573
        ORDER BY priority ASC
1567
    ";
1574
    ";
1568
    my $sth = $dbh->prepare($query);
1575
    my $sth = $dbh->prepare($query);
Lines 1977-1983 sub MergeHolds { Link Here
1977
"UPDATE reserves SET priority = ? WHERE biblionumber = ? AND borrowernumber = ?
1984
"UPDATE reserves SET priority = ? WHERE biblionumber = ? AND borrowernumber = ?
1978
        AND reservedate = ? AND (itemnumber = ? or itemnumber is NULL) "
1985
        AND reservedate = ? AND (itemnumber = ? or itemnumber is NULL) "
1979
        );
1986
        );
1980
        $sth->execute( $to_biblio, 'W', 'T' );
1987
        $sth->execute( $to_biblio, 'W', 'T', 'P' );
1981
        my $priority = 1;
1988
        my $priority = 1;
1982
        while ( my $reserve = $sth->fetchrow_hashref() ) {
1989
        while ( my $reserve = $sth->fetchrow_hashref() ) {
1983
            $upd_sth->execute(
1990
            $upd_sth->execute(
Lines 2147-2153 sub CalculatePriority { Link Here
2147
        AND   priority > 0
2154
        AND   priority > 0
2148
        AND   (found IS NULL OR found = '')
2155
        AND   (found IS NULL OR found = '')
2149
    };
2156
    };
2150
    #skip found==W or found==T (waiting or transit holds)
2157
    #skip found==W or found==T or found==P (waiting, transit or processing holds)
2151
    if( $resdate ) {
2158
    if( $resdate ) {
2152
        $sql.= ' AND ( reservedate <= ? )';
2159
        $sql.= ' AND ( reservedate <= ? )';
2153
    }
2160
    }
(-)a/C4/RotatingCollections.pm (-1 / +1 lines)
Lines 452-458 sub TransferCollection { Link Here
452
            barcode => $item->{barcode},
452
            barcode => $item->{barcode},
453
            ignore_reserves => 1,
453
            ignore_reserves => 1,
454
            trigger => 'RotatingCollection'
454
            trigger => 'RotatingCollection'
455
        }) unless ( $status eq 'Waiting' || @transfers );
455
        }) unless ( $status eq 'Waiting' || $status eq 'Processing' || @transfers );
456
    }
456
    }
457
457
458
    return 1;
458
    return 1;
(-)a/C4/SIP/ILS/Item.pm (-12 / +12 lines)
Lines 106-113 sub new { Link Here
106
    my $biblio = Koha::Biblios->find( $self->{biblionumber} );
106
    my $biblio = Koha::Biblios->find( $self->{biblionumber} );
107
    my $holds = $biblio->current_holds->unblessed;
107
    my $holds = $biblio->current_holds->unblessed;
108
    $self->{hold_queue} = $holds;
108
    $self->{hold_queue} = $holds;
109
    $self->{hold_shelf}    = [( grep {   defined $_->{found}  and $_->{found} eq 'W' } @{$self->{hold_queue}} )];
109
    $self->{hold_attached} = [( grep { defined $_->{found}  and ( $_->{found} eq 'W' or $_->{found} eq 'P' ) } @{$self->{hold_queue}} )];
110
    $self->{pending_queue} = [( grep {(! defined $_->{found}) or  $_->{found} ne 'W' } @{$self->{hold_queue}} )];
110
    $self->{pending_queue} = [( grep {(! defined $_->{found}) or ( $_->{found} ne 'W' and $_->{found} ne 'P' ) } @{$self->{hold_queue}} )];
111
    $self->{title} = $biblio->title;
111
    $self->{title} = $biblio->title;
112
    $self->{author} = $biblio->author;
112
    $self->{author} = $biblio->author;
113
    bless $self, $type;
113
    bless $self, $type;
Lines 144-151 my %fields = ( Link Here
144
144
145
sub next_hold {
145
sub next_hold {
146
    my $self = shift;
146
    my $self = shift;
147
    # use Data::Dumper; warn "next_hold() hold_shelf: " . Dumper($self->{hold_shelf}); warn "next_hold() pending_queue: " . $self->{pending_queue};
147
    # use Data::Dumper; warn "next_hold() hold_attached: " . Dumper($self->{hold_attached}); warn "next_hold() pending_queue: " . $self->{pending_queue};
148
    foreach (@{$self->hold_shelf}) {    # If this item was taken from the hold shelf, then that reserve still governs
148
    foreach (@{$self->hold_attached}) {    # If this item was taken from the hold shelf, then that reserve still governs
149
        next unless ($_->{itemnumber} and $_->{itemnumber} == $self->{itemnumber});
149
        next unless ($_->{itemnumber} and $_->{itemnumber} == $self->{itemnumber});
150
        return $_;
150
        return $_;
151
    }
151
    }
Lines 271-277 sub sip_circulation_status { Link Here
271
    elsif ( $self->{borrowernumber} ) {
271
    elsif ( $self->{borrowernumber} ) {
272
        return '04';    # charged
272
        return '04';    # charged
273
    }
273
    }
274
    elsif ( grep { $_->{itemnumber} == $self->{itemnumber}  } @{ $self->{hold_shelf} } ) {
274
    elsif ( grep { $_->{itemnumber} == $self->{itemnumber}  } @{ $self->{hold_attached} } ) {
275
        return '08';    # waiting on hold shelf
275
        return '08';    # waiting on hold shelf
276
    }
276
    }
277
    else {
277
    else {
Lines 310-319 sub pending_queue { Link Here
310
	(defined $self->{pending_queue}) or return [];
310
	(defined $self->{pending_queue}) or return [];
311
    return $self->{pending_queue};
311
    return $self->{pending_queue};
312
}
312
}
313
sub hold_shelf {
313
sub hold_attached {
314
    my $self = shift;
314
    my $self = shift;
315
	(defined $self->{hold_shelf}) or return [];
315
	(defined $self->{hold_attached}) or return [];
316
    return $self->{hold_shelf};
316
    return $self->{hold_attached};
317
}
317
}
318
318
319
sub hold_queue_position {
319
sub hold_queue_position {
Lines 355-361 sub hold_pickup_date { Link Here
355
#    AND no pending (i.e. non-W) hold queue
355
#    AND no pending (i.e. non-W) hold queue
356
# OR
356
# OR
357
# 2) not checked out
357
# 2) not checked out
358
#    AND (not on hold_shelf OR is on hold_shelf for patron)
358
#    AND (not on hold_attached OR is on hold_attached for patron)
359
#
359
#
360
# What this means is we are consciously allowing the patron to checkout (but not renew) an item that DOES
360
# What this means is we are consciously allowing the patron to checkout (but not renew) an item that DOES
361
# have non-W holds on it, but has not been "picked" from the stacks.  That is to say, the
361
# have non-W holds on it, but has not been "picked" from the stacks.  That is to say, the
Lines 367-379 sub hold_pickup_date { Link Here
367
sub available {
367
sub available {
368
	my ($self, $for_patron) = @_;
368
	my ($self, $for_patron) = @_;
369
	my $count  = (defined $self->{pending_queue}) ? scalar @{$self->{pending_queue}} : 0;
369
	my $count  = (defined $self->{pending_queue}) ? scalar @{$self->{pending_queue}} : 0;
370
	my $count2 = (defined $self->{hold_shelf}   ) ? scalar @{$self->{hold_shelf}   } : 0;
370
	my $count2 = (defined $self->{hold_attached}   ) ? scalar @{$self->{hold_attached}   } : 0;
371
	$debug and print STDERR "availability check: pending_queue size $count, hold_shelf size $count2\n";
371
	$debug and print STDERR "availability check: pending_queue size $count, hold_attached size $count2\n";
372
    if (defined($self->{borrowernumber})) {
372
    if (defined($self->{borrowernumber})) {
373
        ($self->{borrowernumber} eq $for_patron) or return 0;
373
        ($self->{borrowernumber} eq $for_patron) or return 0;
374
		return ($count ? 0 : 1);
374
		return ($count ? 0 : 1);
375
	} else {	# not checked out
375
	} else {	# not checked out
376
        ($count2) and return $self->barcode_is_borrowernumber($for_patron, $self->{hold_shelf}[0]->{borrowernumber});
376
        ($count2) and return $self->barcode_is_borrowernumber($for_patron, $self->{hold_attached}[0]->{borrowernumber});
377
	}
377
	}
378
	return 0;
378
	return 0;
379
}
379
}
(-)a/C4/SIP/ILS/Transaction/Checkout.pm (-3 / +3 lines)
Lines 48-54 sub new { Link Here
48
sub do_checkout {
48
sub do_checkout {
49
	my $self = shift;
49
	my $self = shift;
50
	siplog('LOG_DEBUG', "ILS::Transaction::Checkout performing checkout...");
50
	siplog('LOG_DEBUG', "ILS::Transaction::Checkout performing checkout...");
51
	my $shelf          = $self->{item}->hold_shelf;
51
	my $shelf          = $self->{item}->hold_attached;
52
	my $barcode        = $self->{item}->id;
52
	my $barcode        = $self->{item}->id;
53
    my $patron         = Koha::Patrons->find($self->{patron}->{borrowernumber});
53
    my $patron         = Koha::Patrons->find($self->{patron}->{borrowernumber});
54
    my $overridden_duedate; # usually passed as undef to AddIssue
54
    my $overridden_duedate; # usually passed as undef to AddIssue
Lines 111-118 sub do_checkout { Link Here
111
        ($_->{itemnumber} eq $itemnumber) or next;    # skip it if not this item
111
        ($_->{itemnumber} eq $itemnumber) or next;    # skip it if not this item
112
        ($_->{borrowernumber} == $patron->borrowernumber) and last;
112
        ($_->{borrowernumber} == $patron->borrowernumber) and last;
113
            # if item was waiting for this patron, we're done.  AddIssue takes care of the "W" hold.
113
            # if item was waiting for this patron, we're done.  AddIssue takes care of the "W" hold.
114
        $debug and warn "Item is on hold shelf for another patron.";
114
        $debug and warn "Item is on hold for another patron.";
115
        $self->screen_msg("Item is on hold shelf for another patron.");
115
        $self->screen_msg("Item is on hold for another patron.");
116
        $noerror = 0;
116
        $noerror = 0;
117
    }
117
    }
118
    my ($fee, undef) = GetIssuingCharges($itemnumber, $patron->borrowernumber);
118
    my ($fee, undef) = GetIssuingCharges($itemnumber, $patron->borrowernumber);
(-)a/Koha/Hold.pm (-2 / +33 lines)
Lines 96-101 sub suspend_hold { Link Here
96
        elsif ( $self->is_in_transit ) {
96
        elsif ( $self->is_in_transit ) {
97
            Koha::Exceptions::Hold::CannotSuspendFound->throw( status => 'T' );
97
            Koha::Exceptions::Hold::CannotSuspendFound->throw( status => 'T' );
98
        }
98
        }
99
        elsif ( $self->is_in_processing ) {
100
            Koha::Exceptions::Hold::CannotSuspendFound->throw( status => 'P' );
101
        }
99
        else {
102
        else {
100
            Koha::Exceptions::Hold::CannotSuspendFound->throw(
103
            Koha::Exceptions::Hold::CannotSuspendFound->throw(
101
                      'Unhandled data exception on found hold (id='
104
                      'Unhandled data exception on found hold (id='
Lines 217-225 sub set_waiting { Link Here
217
    return $self;
220
    return $self;
218
}
221
}
219
222
223
=head3 set_processing
224
225
=cut
226
227
sub set_processing {
228
    my ( $self ) = @_;
229
230
    $self->priority(0);
231
    $self->found('P');
232
    $self->store();
233
234
    return $self;
235
}
236
220
=head3 is_found
237
=head3 is_found
221
238
222
Returns true if hold is a waiting or in transit
239
Returns true if hold is waiting, in transit or in processing
223
240
224
=cut
241
=cut
225
242
Lines 229-234 sub is_found { Link Here
229
    return 0 unless $self->found();
246
    return 0 unless $self->found();
230
    return 1 if $self->found() eq 'W';
247
    return 1 if $self->found() eq 'W';
231
    return 1 if $self->found() eq 'T';
248
    return 1 if $self->found() eq 'T';
249
    return 1 if $self->found() eq 'P';
232
}
250
}
233
251
234
=head3 is_waiting
252
=head3 is_waiting
Lines 257-262 sub is_in_transit { Link Here
257
    return $self->found() eq 'T';
275
    return $self->found() eq 'T';
258
}
276
}
259
277
278
=head3 is_in_processing
279
280
Returns true if hold is a in_processing hold
281
282
=cut
283
284
sub is_in_processing {
285
    my ($self) = @_;
286
287
    return 0 unless $self->found();
288
    return $self->found() eq 'P';
289
}
290
260
=head3 is_cancelable_from_opac
291
=head3 is_cancelable_from_opac
261
292
262
Returns true if hold is a cancelable hold
293
Returns true if hold is a cancelable hold
Lines 271-277 sub is_cancelable_from_opac { Link Here
271
    my ($self) = @_;
302
    my ($self) = @_;
272
303
273
    return 1 unless $self->is_found();
304
    return 1 unless $self->is_found();
274
    return 0; # if ->is_in_transit or if ->is_waiting
305
    return 0; # if ->is_in_transit or if ->is_waiting or ->is_in_processing
275
}
306
}
276
307
277
=head3 is_at_destination
308
=head3 is_at_destination
(-)a/circ/returns.pl (-15 / +11 lines)
Lines 431-451 if ( $messages->{'ResFound'}) { Link Here
431
                diffbranch     => 1,
431
                diffbranch     => 1,
432
            );
432
            );
433
        }
433
        }
434
    }
434
    } elsif ( $reserve->{'ResFound'} eq "Waiting" ) {
435
    elsif ( $reserve->{'ResFound'} eq "Waiting" or $reserve->{'ResFound'} eq "Reserved" ) {
435
        $template->param(
436
        if ( $reserve->{'ResFound'} eq "Waiting" ) {
436
            waiting      => $branchCheck ? 1 : undef,
437
            $template->param(
437
        );
438
                waiting      => $branchCheck ? 1 : undef,
438
    } elsif ( $reserve->{'ResFound'} eq "Reserved" || $reserve->{'ResFound'} eq "Processing" ) {
439
            );
439
        $template->param(
440
        } elsif ( $reserve->{'ResFound'} eq "Reserved" ) {
440
            intransit    => $branchCheck ? undef : 1,
441
            $template->param(
441
            transfertodo => $branchCheck ? undef : 1,
442
                intransit    => $branchCheck ? undef : 1,
442
            reserve_id   => $reserve->{reserve_id},
443
                transfertodo => $branchCheck ? undef : 1,
443
            reserved     => 1,
444
                reserve_id   => $reserve->{reserve_id},
444
        );
445
                reserved     => 1,
446
            );
447
        }
448
449
    } # else { ; }  # error?
445
    } # else { ; }  # error?
450
446
451
    # same params for Waiting or Reserved
447
    # same params for Waiting or Reserved
(-)a/installer/data/mysql/atomicupdate/bug_12556.perl (+8 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do(q{
4
        INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
5
        ('HoldsNeedProcessingSIP', '0', NULL, 'Require staff to check-in before hold is set to waiting state', 'YesNo' )
6
    });
7
    NewVersion( $DBversion, 12556, "Add new syspref HoldsNeedProcessingSIP");
8
}
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 228-233 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
228
('HoldsAutoFill','0',NULL,'If on, librarian will not be asked if hold should be filled, it will be filled automatically','YesNo'),
228
('HoldsAutoFill','0',NULL,'If on, librarian will not be asked if hold should be filled, it will be filled automatically','YesNo'),
229
('HoldsAutoFillPrintSlip','0',NULL,'If on, hold slip print dialog will be displayed automatically','YesNo'),
229
('HoldsAutoFillPrintSlip','0',NULL,'If on, hold slip print dialog will be displayed automatically','YesNo'),
230
('HoldsLog','0',NULL,'If ON, log create/cancel/suspend/resume actions on holds.','YesNo'),
230
('HoldsLog','0',NULL,'If ON, log create/cancel/suspend/resume actions on holds.','YesNo'),
231
('HoldsNeedProcessingSIP', '0', NULL, 'Require staff to check-in before hold is set to waiting state', 'YesNo' ),
231
('HoldsQueueSkipClosed', '0', NULL, 'If enabled, any libraries that are closed when the holds queue is built will be ignored for the purpose of filling holds.', 'YesNo'),
232
('HoldsQueueSkipClosed', '0', NULL, 'If enabled, any libraries that are closed when the holds queue is built will be ignored for the purpose of filling holds.', 'YesNo'),
232
('HoldsSplitQueue','nothing','nothing|branch|itemtype|branch_itemtype','In the staff interface, split the holds view by the given criteria','Choice'),
233
('HoldsSplitQueue','nothing','nothing|branch|itemtype|branch_itemtype','In the staff interface, split the holds view by the given criteria','Choice'),
233
('HoldsToPullStartDate','2',NULL,'Set the default start date for the Holds to pull list to this many days ago','Integer'),
234
('HoldsToPullStartDate','2',NULL,'Set the default start date for the Holds to pull list to this many days ago','Integer'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc (-5 / +5 lines)
Lines 41-46 Link Here
41
                    [% IF ( hold.found ) %]
41
                    [% IF ( hold.found ) %]
42
                        [% IF ( hold.intransit ) %]
42
                        [% IF ( hold.intransit ) %]
43
                            <option value="T" selected="selected">In transit</option>
43
                            <option value="T" selected="selected">In transit</option>
44
                        [% ELSIF (hold.inprocessing) %]
45
                            <option value="P" selected="selected">In processing</option>
44
                        [% ELSE %]
46
                        [% ELSE %]
45
                            <option value="W" selected="selected">Waiting</option>
47
                            <option value="W" selected="selected">Waiting</option>
46
                        [% END %]
48
                        [% END %]
Lines 120-132 Link Here
120
            <td>
122
            <td>
121
                [% IF ( hold.found ) %]
123
                [% IF ( hold.found ) %]
122
                    [% IF ( hold.atdestination ) %]
124
                    [% IF ( hold.atdestination ) %]
123
                        [% 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 %]
125
                            Item waiting at <b> [% hold.wbrname | html %]</b> <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" /> since [% hold.waiting_date | $KohaDates %]
125
                        [% ELSE %]
126
                    [% ELSIF (hold.intransit) %]
126
                            Waiting to be pulled <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" />
127
                        [% END %]
128
                    [% ELSE %]
129
                        Item being transferred to <b> [% hold.wbrname | html %]</b> <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" />
127
                        Item being transferred to <b> [% hold.wbrname | html %]</b> <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" />
128
                    [% ELSIF (hold.inprocessing) %]
129
                        Item being processed at <b> [% hold.wbrname | html %]</b> <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" />
130
                    [% END %]
130
                    [% END %]
131
                [% ELSE %]
131
                [% ELSE %]
132
                    [% IF Koha.Preference('IndependentBranches') && Branches.all().size == 1 %]
132
                    [% IF Koha.Preference('IndependentBranches') && Branches.all().size == 1 %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+6 lines)
Lines 545-550 Circulation: Link Here
545
                  no: "Don't"
545
                  no: "Don't"
546
            - automatically fill holds instead of asking the librarian.
546
            - automatically fill holds instead of asking the librarian.
547
        -
547
        -
548
            - pref: HoldsNeedProcessingSIP
549
              choices:
550
                  yes: "Don't fulfill"
551
                  no: Fulfill
552
            - holds automatically if matching item is returned via SIP protocol.
553
        -
548
            - pref: HoldsAutoFillPrintSlip
554
            - pref: HoldsAutoFillPrintSlip
549
              choices:
555
              choices:
550
                  yes: Do
556
                  yes: Do
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt (+2 lines)
Lines 102-107 Link Here
102
                [% END %]
102
                [% END %]
103
          [% ELSIF hold.found == 'W' %]
103
          [% ELSIF hold.found == 'W' %]
104
              Waiting
104
              Waiting
105
          [% ELSIF hold.found == 'P' %]
106
              Processing
105
          [% ELSIF hold.found == 'T' %]
107
          [% ELSIF hold.found == 'T' %]
106
              In transit
108
              In transit
107
          [% ELSE %]
109
          [% ELSE %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc (-1 / +3 lines)
Lines 34-40 Link Here
34
            <tbody>
34
            <tbody>
35
                [% SET all_holds_waiting = 1 %]
35
                [% SET all_holds_waiting = 1 %]
36
                [% FOREACH HOLD IN HOLDS %]
36
                [% FOREACH HOLD IN HOLDS %]
37
                    [% UNLESS ( HOLD.is_waiting || HOLD.is_in_transit ) %]
37
                    [% UNLESS ( HOLD.is_waiting || HOLD.is_in_transit || HOLD.is_in_processing) %]
38
                        [% SET all_holds_waiting = 0 %]
38
                        [% SET all_holds_waiting = 0 %]
39
                    [% END %]
39
                    [% END %]
40
                    [% IF ( HOLD.is_at_destination ) %]
40
                    [% IF ( HOLD.is_at_destination ) %]
Lines 114-119 Link Here
114
                                    [% SET transfer = HOLD.item.get_transfer %]
114
                                    [% SET transfer = HOLD.item.get_transfer %]
115
                                    Item in transit from <strong> [% Branches.GetName( transfer.frombranch ) | html %]</strong> since
115
                                    Item in transit from <strong> [% Branches.GetName( transfer.frombranch ) | html %]</strong> since
116
                                    [% transfer.datesent | $KohaDates %]
116
                                    [% transfer.datesent | $KohaDates %]
117
                                [% ELSIF ( HOLD.is_in_processing ) %]
118
                                    Item in processing
117
                                [% ELSIF ( HOLD.suspend ) %]
119
                                [% ELSIF ( HOLD.suspend ) %]
118
                                    Suspended [% IF ( HOLD.suspend_until ) %] until [% HOLD.suspend_until | $KohaDates %] [% END %]
120
                                    Suspended [% IF ( HOLD.suspend_until ) %] until [% HOLD.suspend_until | $KohaDates %] [% END %]
119
                                [% ELSE %]
121
                                [% ELSE %]
(-)a/reserve/request.pl (+1 lines)
Lines 665-670 foreach my $biblionumber (@biblionumbers) { Link Here
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{'found'}     = $res->is_found();
667
            $reserve{'found'}     = $res->is_found();
668
            $reserve{'inprocessing'} = $res->is_in_processing();
668
            $reserve{'intransit'} = $res->is_in_transit();
669
            $reserve{'intransit'} = $res->is_in_transit();
669
        }
670
        }
670
        elsif ( $res->priority() > 0 ) {
671
        elsif ( $res->priority() > 0 ) {
(-)a/t/db_dependent/Hold.t (-3 / +18 lines)
Lines 29-35 use Koha::Item; Link Here
29
use Koha::DateUtils;
29
use Koha::DateUtils;
30
use t::lib::TestBuilder;
30
use t::lib::TestBuilder;
31
31
32
use Test::More tests => 29;
32
use Test::More tests => 33;
33
use Test::Exception;
33
use Test::Exception;
34
use Test::Warn;
34
use Test::Warn;
35
35
Lines 112-121 isnt( $hold->is_waiting, 1, 'The hold is not waiting (T)' ); Link Here
112
is( $hold->is_found, 1, 'The hold is found');
112
is( $hold->is_found, 1, 'The hold is found');
113
is( $hold->is_in_transit, 1, 'The hold is in transit' );
113
is( $hold->is_in_transit, 1, 'The hold is in transit' );
114
114
115
$hold->found('P');
116
is( $hold->is_found, 1, 'The hold is found');
117
is( $hold->is_in_processing, 1, 'The hold is in processing' );
118
115
$hold->found(q{});
119
$hold->found(q{});
116
isnt( $hold->is_waiting, 1, 'The hold is not waiting (W)' );
120
isnt( $hold->is_waiting, 1, 'The hold is not waiting (W)' );
117
is( $hold->is_found, 0, 'The hold is not found' );
121
is( $hold->is_found, 0, 'The hold is not found' );
118
ok( !$hold->is_in_transit, 'The hold is not in transit' );
122
ok( !$hold->is_in_transit, 'The hold is not in transit' );
123
ok( !$hold->is_in_processing, 'The hold is not in processing' );
119
124
120
# Test method is_cancelable_from_opac
125
# Test method is_cancelable_from_opac
121
$hold->found(undef);
126
$hold->found(undef);
Lines 124-129 $hold->found('W'); Link Here
124
is( $hold->is_cancelable_from_opac, 0, "Waiting hold is not cancelable" );
129
is( $hold->is_cancelable_from_opac, 0, "Waiting hold is not cancelable" );
125
$hold->found('T');
130
$hold->found('T');
126
is( $hold->is_cancelable_from_opac, 0, "In transit hold is not cancelable" );
131
is( $hold->is_cancelable_from_opac, 0, "In transit hold is not cancelable" );
132
$hold->found('P');
133
is( $hold->is_cancelable_from_opac, 0, "In processing hold is not cancelable" );
127
134
128
# Test method is_at_destination
135
# Test method is_at_destination
129
$hold->found(undef);
136
$hold->found(undef);
Lines 178-184 subtest "delete() tests" => sub { Link Here
178
185
179
subtest 'suspend() tests' => sub {
186
subtest 'suspend() tests' => sub {
180
187
181
    plan tests => 16;
188
    plan tests => 18;
182
189
183
    $schema->storage->txn_begin;
190
    $schema->storage->txn_begin;
184
191
Lines 232-237 subtest 'suspend() tests' => sub { Link Here
232
239
233
    is( $@->status, 'T', 'Exception gets the \'status\' parameter set correctly' );
240
    is( $@->status, 'T', 'Exception gets the \'status\' parameter set correctly' );
234
241
242
    # set hold found=T
243
    $hold->set_processing();
244
    throws_ok
245
        { $hold->suspend_hold; }
246
        'Koha::Exceptions::Hold::CannotSuspendFound',
247
        'Exception is thrown when a found hold is tried to suspend';
248
249
    is( $@->status, 'P', 'Exception gets the \'status\' parameter set correctly' );
250
235
    my $holds_module = Test::MockModule->new('Koha::Hold');
251
    my $holds_module = Test::MockModule->new('Koha::Hold');
236
    $holds_module->mock( 'is_found', 1 );
252
    $holds_module->mock( 'is_found', 1 );
237
253
238
- 

Return to bug 12556