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 108-115 sub new { Link Here
108
    my $biblio = Koha::Biblios->find( $self->{biblionumber} );
108
    my $biblio = Koha::Biblios->find( $self->{biblionumber} );
109
    my $holds = $biblio->current_holds->unblessed;
109
    my $holds = $biblio->current_holds->unblessed;
110
    $self->{hold_queue} = $holds;
110
    $self->{hold_queue} = $holds;
111
    $self->{hold_shelf}    = [( grep {   defined $_->{found}  and $_->{found} eq 'W' } @{$self->{hold_queue}} )];
111
    $self->{hold_attached} = [( grep { defined $_->{found}  and ( $_->{found} eq 'W' or $_->{found} eq 'P' ) } @{$self->{hold_queue}} )];
112
    $self->{pending_queue} = [( grep {(! defined $_->{found}) or  $_->{found} ne 'W' } @{$self->{hold_queue}} )];
112
    $self->{pending_queue} = [( grep {(! defined $_->{found}) or ( $_->{found} ne 'W' and $_->{found} ne 'P' ) } @{$self->{hold_queue}} )];
113
    $self->{title} = $biblio->title;
113
    $self->{title} = $biblio->title;
114
    $self->{author} = $biblio->author;
114
    $self->{author} = $biblio->author;
115
    bless $self, $type;
115
    bless $self, $type;
Lines 148-155 my %fields = ( Link Here
148
148
149
sub next_hold {
149
sub next_hold {
150
    my $self = shift;
150
    my $self = shift;
151
    # use Data::Dumper; warn "next_hold() hold_shelf: " . Dumper($self->{hold_shelf}); warn "next_hold() pending_queue: " . $self->{pending_queue};
151
    # use Data::Dumper; warn "next_hold() hold_attached: " . Dumper($self->{hold_attached}); warn "next_hold() pending_queue: " . $self->{pending_queue};
152
    foreach (@{$self->hold_shelf}) {    # If this item was taken from the hold shelf, then that reserve still governs
152
    foreach (@{$self->hold_attached}) {    # If this item was taken from the hold shelf, then that reserve still governs
153
        next unless ($_->{itemnumber} and $_->{itemnumber} == $self->{itemnumber});
153
        next unless ($_->{itemnumber} and $_->{itemnumber} == $self->{itemnumber});
154
        return $_;
154
        return $_;
155
    }
155
    }
Lines 275-281 sub sip_circulation_status { Link Here
275
    elsif ( $self->{borrowernumber} ) {
275
    elsif ( $self->{borrowernumber} ) {
276
        return '04';    # charged
276
        return '04';    # charged
277
    }
277
    }
278
    elsif ( grep { $_->{itemnumber} == $self->{itemnumber}  } @{ $self->{hold_shelf} } ) {
278
    elsif ( grep { $_->{itemnumber} == $self->{itemnumber}  } @{ $self->{hold_attached} } ) {
279
        return '08';    # waiting on hold shelf
279
        return '08';    # waiting on hold shelf
280
    }
280
    }
281
    else {
281
    else {
Lines 314-323 sub pending_queue { Link Here
314
	(defined $self->{pending_queue}) or return [];
314
	(defined $self->{pending_queue}) or return [];
315
    return $self->{pending_queue};
315
    return $self->{pending_queue};
316
}
316
}
317
sub hold_shelf {
317
sub hold_attached {
318
    my $self = shift;
318
    my $self = shift;
319
	(defined $self->{hold_shelf}) or return [];
319
	(defined $self->{hold_attached}) or return [];
320
    return $self->{hold_shelf};
320
    return $self->{hold_attached};
321
}
321
}
322
322
323
sub hold_queue_position {
323
sub hold_queue_position {
Lines 359-365 sub hold_pickup_date { Link Here
359
#    AND no pending (i.e. non-W) hold queue
359
#    AND no pending (i.e. non-W) hold queue
360
# OR
360
# OR
361
# 2) not checked out
361
# 2) not checked out
362
#    AND (not on hold_shelf OR is on hold_shelf for patron)
362
#    AND (not on hold_attached OR is on hold_attached for patron)
363
#
363
#
364
# What this means is we are consciously allowing the patron to checkout (but not renew) an item that DOES
364
# What this means is we are consciously allowing the patron to checkout (but not renew) an item that DOES
365
# have non-W holds on it, but has not been "picked" from the stacks.  That is to say, the
365
# have non-W holds on it, but has not been "picked" from the stacks.  That is to say, the
Lines 371-383 sub hold_pickup_date { Link Here
371
sub available {
371
sub available {
372
	my ($self, $for_patron) = @_;
372
	my ($self, $for_patron) = @_;
373
	my $count  = (defined $self->{pending_queue}) ? scalar @{$self->{pending_queue}} : 0;
373
	my $count  = (defined $self->{pending_queue}) ? scalar @{$self->{pending_queue}} : 0;
374
	my $count2 = (defined $self->{hold_shelf}   ) ? scalar @{$self->{hold_shelf}   } : 0;
374
	my $count2 = (defined $self->{hold_attached}   ) ? scalar @{$self->{hold_attached}   } : 0;
375
	$debug and print STDERR "availability check: pending_queue size $count, hold_shelf size $count2\n";
375
	$debug and print STDERR "availability check: pending_queue size $count, hold_attached size $count2\n";
376
    if (defined($self->{borrowernumber})) {
376
    if (defined($self->{borrowernumber})) {
377
        ($self->{borrowernumber} eq $for_patron) or return 0;
377
        ($self->{borrowernumber} eq $for_patron) or return 0;
378
		return ($count ? 0 : 1);
378
		return ($count ? 0 : 1);
379
	} else {	# not checked out
379
	} else {	# not checked out
380
        ($count2) and return $self->barcode_is_borrowernumber($for_patron, $self->{hold_shelf}[0]->{borrowernumber});
380
        ($count2) and return $self->barcode_is_borrowernumber($for_patron, $self->{hold_attached}[0]->{borrowernumber});
381
	}
381
	}
382
	return 0;
382
	return 0;
383
}
383
}
(-)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 115-122 sub do_checkout { Link Here
115
        ($_->{itemnumber} eq $itemnumber) or next;    # skip it if not this item
115
        ($_->{itemnumber} eq $itemnumber) or next;    # skip it if not this item
116
        ($_->{borrowernumber} == $patron->borrowernumber) and last;
116
        ($_->{borrowernumber} == $patron->borrowernumber) and last;
117
            # if item was waiting for this patron, we're done.  AddIssue takes care of the "W" hold.
117
            # if item was waiting for this patron, we're done.  AddIssue takes care of the "W" hold.
118
        $debug and warn "Item is on hold shelf for another patron.";
118
        $debug and warn "Item is on hold for another patron.";
119
        $self->screen_msg("Item is on hold shelf for another patron.");
119
        $self->screen_msg("Item is on hold for another patron.");
120
        $noerror = 0;
120
        $noerror = 0;
121
    }
121
    }
122
    my ($fee, undef) = GetIssuingCharges($itemnumber, $patron->borrowernumber);
122
    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 439-459 if ( $messages->{'ResFound'}) { Link Here
439
                diffbranch       => 1,
439
                diffbranch       => 1,
440
            );
440
            );
441
        }
441
        }
442
    }
442
    } elsif ( $reserve->{'ResFound'} eq "Waiting" ) {
443
    elsif ( $reserve->{'ResFound'} eq "Waiting" or $reserve->{'ResFound'} eq "Reserved" ) {
443
        $template->param(
444
        if ( $reserve->{'ResFound'} eq "Waiting" ) {
444
            waiting      => $branchCheck ? 1 : undef,
445
            $template->param(
445
        );
446
                waiting      => $branchCheck ? 1 : undef,
446
    } elsif ( $reserve->{'ResFound'} eq "Reserved" || $reserve->{'ResFound'} eq "Processing" ) {
447
            );
447
        $template->param(
448
        } elsif ( $reserve->{'ResFound'} eq "Reserved" ) {
448
            intransit    => $branchCheck ? undef : 1,
449
            $template->param(
449
            transfertodo => $branchCheck ? undef : 1,
450
                intransit    => $branchCheck ? undef : 1,
450
            reserve_id   => $reserve->{reserve_id},
451
                transfertodo => $branchCheck ? undef : 1,
451
            reserved     => 1,
452
                reserve_id   => $reserve->{reserve_id},
452
        );
453
                reserved     => 1,
454
            );
455
        }
456
457
    } # else { ; }  # error?
453
    } # else { ; }  # error?
458
454
459
    # same params for Waiting or Reserved
455
    # 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 <strong> [% hold.wbrname | html %]</strong> <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" /> since [% hold.waiting_date | $KohaDates %]
125
                            Item waiting at <strong> [% hold.wbrname | html %]</strong> <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 <strong> [% hold.wbrname | html %]</strong> <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" />
127
                        Item being transferred to <strong> [% hold.wbrname | html %]</strong> <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" />
128
                    [% ELSIF (hold.inprocessing) %]
129
                        Item being processed at <strong> [% hold.wbrname | html %]</strong> <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 551-556 Circulation: Link Here
551
                  no: "Don't"
551
                  no: "Don't"
552
            - automatically fill holds instead of asking the librarian.
552
            - automatically fill holds instead of asking the librarian.
553
        -
553
        -
554
            - pref: HoldsNeedProcessingSIP
555
              choices:
556
                  yes: "Don't fulfill"
557
                  no: Fulfill
558
            - holds automatically if matching item is returned via SIP protocol.
559
        -
554
            - pref: HoldsAutoFillPrintSlip
560
            - pref: HoldsAutoFillPrintSlip
555
              choices:
561
              choices:
556
                  yes: Do
562
                  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