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

(-)a/C4/Letters.pm (-1 / +1 lines)
Lines 751-757 sub _parseletter_sth { Link Here
751
    ($table eq 'serial') ? "SELECT * FROM $table WHERE serialid = ?" :
751
    ($table eq 'serial') ? "SELECT * FROM $table WHERE serialid = ?" :
752
    ($table eq 'problem_reports') ? "SELECT * FROM $table WHERE reportid = ?" :
752
    ($table eq 'problem_reports') ? "SELECT * FROM $table WHERE reportid = ?" :
753
    ($table eq 'additional_contents' || $table eq 'opac_news') ? "SELECT * FROM additional_contents WHERE idnew = ?" :
753
    ($table eq 'additional_contents' || $table eq 'opac_news') ? "SELECT * FROM additional_contents WHERE idnew = ?" :
754
    ($table eq 'recalls') ? "SELECT * FROM $table WHERE id = ?" :
754
    ($table eq 'recalls') ? "SELECT * FROM $table WHERE recall_id = ?" :
755
    undef ;
755
    undef ;
756
    unless ($query) {
756
    unless ($query) {
757
        warn "ERROR: No _parseletter_sth query for table '$table'";
757
        warn "ERROR: No _parseletter_sth query for table '$table'";
(-)a/Koha/Recall.pm (-1 / +1 lines)
Lines 354-360 sub set_waiting { Link Here
354
            biblio => $self->biblio_id,
354
            biblio => $self->biblio_id,
355
            borrowers => $self->patron_id,
355
            borrowers => $self->patron_id,
356
            items => $itemnumber,
356
            items => $itemnumber,
357
            recalls => $self->id,
357
            recalls => $self->recall_id,
358
        },
358
        },
359
    );
359
    );
360
360
(-)a/t/db_dependent/Koha/Recalls.t (-11 / +10 lines)
Lines 146-164 is( $messages_count, 3, "RETURN_RECALLED_ITEM notice successfully sent to checko Link Here
146
my $message = Koha::Recalls->move_recall;
146
my $message = Koha::Recalls->move_recall;
147
is( $message, 'no recall_id provided', "Can't move a recall without specifying which recall" );
147
is( $message, 'no recall_id provided', "Can't move a recall without specifying which recall" );
148
148
149
$message = Koha::Recalls->move_recall({ recall_id => $recall->id });
149
$message = Koha::Recalls->move_recall({ recall_id => $recall->recall_id });
150
is( $message, 'no action provided', "No clear action to perform on recall" );
150
is( $message, 'no action provided', "No clear action to perform on recall" );
151
$message = Koha::Recalls->move_recall({ recall_id => $recall->id, action => 'whatever' });
151
$message = Koha::Recalls->move_recall({ recall_id => $recall->recall_id, action => 'whatever' });
152
is( $message, 'no action provided', "Legal action not provided to perform on recall" );
152
is( $message, 'no action provided', "Legal action not provided to perform on recall" );
153
153
154
$recall->set_waiting({ item => $item1 });
154
$recall->set_waiting({ item => $item1 });
155
ok( $recall->waiting, "Recall is waiting" );
155
ok( $recall->waiting, "Recall is waiting" );
156
Koha::Recalls->move_recall({ recall_id => $recall->id, action => 'revert' });
156
Koha::Recalls->move_recall({ recall_id => $recall->recall_id, action => 'revert' });
157
$recall = Koha::Recalls->find( $recall->id );
157
$recall = Koha::Recalls->find( $recall->recall_id );
158
ok( $recall->requested, "Recall reverted to requested with move_recall" );
158
ok( $recall->requested, "Recall reverted to requested with move_recall" );
159
159
160
Koha::Recalls->move_recall({ recall_id => $recall->id, action => 'cancel' });
160
Koha::Recalls->move_recall({ recall_id => $recall->recall_id, action => 'cancel' });
161
$recall = Koha::Recalls->find( $recall->id );
161
$recall = Koha::Recalls->find( $recall->recall_id );
162
ok( $recall->cancelled, "Recall cancelled with move_recall" );
162
ok( $recall->cancelled, "Recall cancelled with move_recall" );
163
163
164
( $recall, $due_interval, $due_date ) = Koha::Recalls->add_recall({
164
( $recall, $due_interval, $due_date ) = Koha::Recalls->add_recall({
Lines 169-176 ok( $recall->cancelled, "Recall cancelled with move_recall" ); Link Here
169
    expirationdate => undef,
169
    expirationdate => undef,
170
    interface => 'COMMANDLINE',
170
    interface => 'COMMANDLINE',
171
});
171
});
172
$message = Koha::Recalls->move_recall({ recall_id => $recall->id, item => $item2, borrowernumber => $patron1->borrowernumber });
172
$message = Koha::Recalls->move_recall({ recall_id => $recall->recall_id, item => $item2, borrowernumber => $patron1->borrowernumber });
173
$recall = Koha::Recalls->find( $recall->id );
173
$recall = Koha::Recalls->find( $recall->recall_id );
174
ok( $recall->fulfilled, "Recall fulfilled with move_recall" );
174
ok( $recall->fulfilled, "Recall fulfilled with move_recall" );
175
175
176
$schema->storage->txn_rollback();
176
$schema->storage->txn_rollback();
Lines 191-197 subtest 'filter_by_current() and filter_by_finished() tests' => sub { Link Here
191
191
192
    my $recalls = Koha::Recalls->search(
192
    my $recalls = Koha::Recalls->search(
193
        {
193
        {
194
            id => [
194
            recall_id => [
195
                $in_transit->id,
195
                $in_transit->id,
196
                $overdue->id,
196
                $overdue->id,
197
                $requested->id,
197
                $requested->id,
Lines 201-207 subtest 'filter_by_current() and filter_by_finished() tests' => sub { Link Here
201
                $fulfilled->id,
201
                $fulfilled->id,
202
            ]
202
            ]
203
        },
203
        },
204
        { order_by => [ 'id' ] }
204
        { order_by => [ 'recall_id' ] }
205
    );
205
    );
206
206
207
    is( $recalls->count, 7, 'Resultset count is correct' );
207
    is( $recalls->count, 7, 'Resultset count is correct' );
208
- 

Return to bug 30291