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

(-)a/C4/ILSDI/Services.pm (-2 / +2 lines)
Lines 531-540 sub GetPatronInfo { Link Here
531
            delete $issue->{'more_subfields_xml'};
531
            delete $issue->{'more_subfields_xml'};
532
532
533
            # Is the item already on hold by another user?
533
            # Is the item already on hold by another user?
534
            $issue->{'itemonhold'} = Koha::Holds->search({ itemnumber => $issue->{'itemnumber'} })->count;
534
            $issue->{'holds_on_item'} = Koha::Holds->search({ itemnumber => $issue->{'itemnumber'} })->count;
535
535
536
            # Is the record (next available item) on hold by another user?
536
            # Is the record (next available item) on hold by another user?
537
            $issue->{'recordonhold'} = Koha::Holds->search({ biblionumber => $issue->{'biblionumber'} })->count;
537
            $issue->{'holds_on_record'} = Koha::Holds->search({ biblionumber => $issue->{'biblionumber'} })->count;
538
538
539
            push @checkouts, $issue
539
            push @checkouts, $issue
540
        }
540
        }
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt (-4 / +4 lines)
Lines 650-657 Link Here
650
      <location>Salle de lecture</location>
650
      <location>Salle de lecture</location>
651
      <itemlost>0</itemlost>
651
      <itemlost>0</itemlost>
652
      <publicationyear>1985</publicationyear>
652
      <publicationyear>1985</publicationyear>
653
      <recordonhold>0</recordonhold>
653
      <holds_on_record>0</holds_on_record>
654
      <itemonhold>0</itemonhold>
654
      <holds_on_item>0</holds_on_item>
655
      <issues>1</issues>
655
      <issues>1</issues>
656
      <homebranch>BIB</homebranch>
656
      <homebranch>BIB</homebranch>
657
      <holdingbranch>BIB</holdingbranch>
657
      <holdingbranch>BIB</holdingbranch>
Lines 690-697 Link Here
690
      <location>Salle de lecture</location>
690
      <location>Salle de lecture</location>
691
      <itemlost>0</itemlost>
691
      <itemlost>0</itemlost>
692
      <publicationyear>2007</publicationyear>
692
      <publicationyear>2007</publicationyear>
693
      <recordonhold>1</recordonhold>
693
      <holds_on_record>1</holds_on_record>
694
      <itemonhold>1</itemonhold>
694
      <holds_on_item>1</holds_on_item>
695
      <issues>1</issues>
695
      <issues>1</issues>
696
      <homebranch>BIB</homebranch>
696
      <homebranch>BIB</homebranch>
697
      <holdingbranch>BIB</holdingbranch>
697
      <holdingbranch>BIB</holdingbranch>
(-)a/t/db_dependent/ILSDI_Services.t (-9 / +8 lines)
Lines 179-186 subtest 'GetPatronInfo test for holds' => sub { Link Here
179
    my $reply = C4::ILSDI::Services::GetPatronInfo( $query );
179
    my $reply = C4::ILSDI::Services::GetPatronInfo( $query );
180
180
181
    # Check that this loan is not on hold
181
    # Check that this loan is not on hold
182
    is ( $reply->{loans}->{loan}[0]->{recordonhold}, "0", "Record is not on hold");
182
    is ( $reply->{loans}->{loan}[0]->{holds_on_record}, "0", "Record is not on hold");
183
    is ( $reply->{loans}->{loan}[0]->{itemonhold}, "0", "Item is not on hold");
183
    is ( $reply->{loans}->{loan}[0]->{holds_on_item}, "0", "Item is not on hold");
184
184
185
    # Place a loan
185
    # Place a loan
186
    # Add a hold on the biblio
186
    # Add a hold on the biblio
Lines 188-195 subtest 'GetPatronInfo test for holds' => sub { Link Here
188
188
189
    # Check that it is on hold on biblio level
189
    # Check that it is on hold on biblio level
190
    $reply = C4::ILSDI::Services::GetPatronInfo( $query );
190
    $reply = C4::ILSDI::Services::GetPatronInfo( $query );
191
    is ( $reply->{loans}->{loan}[0]->{recordonhold}, "1", "Record is on hold");
191
    is ( $reply->{loans}->{loan}[0]->{holds_on_record}, "1", "Record is on hold");
192
    is ( $reply->{loans}->{loan}[0]->{itemonhold}, "0", "Item is on hold");
192
    is ( $reply->{loans}->{loan}[0]->{holds_on_item}, "0", "Item is on hold");
193
193
194
    # Delete holds
194
    # Delete holds
195
    $schema->resultset( 'Reserve' )->delete_all;
195
    $schema->resultset( 'Reserve' )->delete_all;
Lines 204-219 subtest 'GetPatronInfo test for holds' => sub { Link Here
204
204
205
    # When a specific item has a reserve, the item is on hold as well as the record
205
    # When a specific item has a reserve, the item is on hold as well as the record
206
    $reply = C4::ILSDI::Services::GetPatronInfo( $query );
206
    $reply = C4::ILSDI::Services::GetPatronInfo( $query );
207
    is ( $reply->{loans}->{loan}[0]->{recordonhold}, "1", "Record is on hold");
207
    is ( $reply->{loans}->{loan}[0]->{holds_on_record}, "1", "Record is on hold");
208
    is ( $reply->{loans}->{loan}[0]->{itemonhold}, "1", "Item is on hold");
208
    is ( $reply->{loans}->{loan}[0]->{holds_on_item}, "1", "Item is on hold");
209
209
210
    # Add another hold on the biblio
210
    # Add another hold on the biblio
211
    $biblioreserve = AddReserve({ branchcode => $library->branchcode, borrowernumber => $brwr3->borrowernumber, biblionumber => $biblio->biblionumber });
211
    $biblioreserve = AddReserve({ branchcode => $library->branchcode, borrowernumber => $brwr3->borrowernumber, biblionumber => $biblio->biblionumber });
212
212
213
    # Check that there are 2 holds on the biblio and 1 on this specific item
213
    # Check that there are 2 holds on the biblio and 1 on this specific item
214
    $reply = C4::ILSDI::Services::GetPatronInfo( $query );
214
    $reply = C4::ILSDI::Services::GetPatronInfo( $query );
215
    is ( $reply->{loans}->{loan}[0]->{recordonhold}, "2", "Record is on hold twice");
215
    is ( $reply->{loans}->{loan}[0]->{holds_on_record}, "2", "Record is on hold twice");
216
    is ( $reply->{loans}->{loan}[0]->{itemonhold}, "1", "Item is on hold");
216
    is ( $reply->{loans}->{loan}[0]->{holds_on_item}, "1", "Item is on hold");
217
217
218
    # Cleanup
218
    # Cleanup
219
    $schema->storage->txn_rollback;
219
    $schema->storage->txn_rollback;
220
- 

Return to bug 21284