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

(-)a/koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js (-9 / +22 lines)
Lines 566-579 $("#placeBookingModal").on("show.bs.modal", function (e) { Link Here
566
                                        continue;
566
                                        continue;
567
                                    }
567
                                    }
568
568
569
                                    // check that there are available items
569
                                    // check availability based on selection type
570
                                    // available = all bookable items - booked items - booked biblios
570
                                    if (
571
                                    let total_available =
571
                                        booking_item_id &&
572
                                        bookable_items.length -
572
                                        booking_item_id != 0
573
                                        unavailable_items.length -
573
                                    ) {
574
                                        biblio_bookings.length;
574
                                        // Specific item selected - check if that item is unavailable
575
                                    if (total_available === 0) {
575
                                        if (
576
                                        return true;
576
                                            unavailable_items.indexOf(
577
                                                parseInt(booking_item_id)
578
                                            ) !== -1
579
                                        ) {
580
                                            return true;
581
                                        }
582
                                    } else {
583
                                        // "Any item" selected - check if all items are unavailable
584
                                        let total_available =
585
                                            bookable_items.length -
586
                                            unavailable_items.length -
587
                                            biblio_bookings.length;
588
                                        if (total_available === 0) {
589
                                            return true;
590
                                        }
577
                                    }
591
                                    }
578
                                }
592
                                }
579
593
580
- 

Return to bug 39584