As part of the bookings workflow, we should add support for making bookings from the OPAC as a patron.
Created attachment 171841 [details] [review] Bug 33738: Add bookings to the OPAC This is a rough draft of an OPAC integration. - The display of bookings already works more or less fine - In the patron's summary table - In the new bookings tab that doubles as the base for the placement modal - The placement of new bookings is still more of a demo, because we still need to integrate all of the logic in modals/place_booking.js for flatpickr => To try it out anyway: 1) Make an item bookable 2) Open the OPAC 3) Login 4) Go to opac-detail.pl for that item's biblio 5) Note the 'Place Booking' entry in opac-detail-sidebar.inc and click 6) Hit '+ New booking' (this is going to change of course) 7) Fill in some details and pick a start date (for demo purposes it just adds a week) I'd be very interested in opinions, feedback, or follow-up patches (on vacation next week).
Hi, I've just tested it and liked it. I just think around the way to place a booking on the OPAC side, what do you think about adding a sort of form when patron can add many items (with barcode or by search) to make "multiple bookings on different item in one click" ? ( Maybe on a separate patch ?)
Edit : I also wonder if it's linked to the "demo effect" but we can't make a booking on the same item (to another period).
(In reply to Thibaud Guillot from comment #3) > Edit : I also wonder if it's linked to the "demo effect" but we can't make a > booking on the same item (to another period). "Sub-Edit" : when we stay on the page after placing a booking on the item we can't see the same itemnumber in the select. We must restart the process to see it appended in the select
There's also my original implementation of this https://github.com/PTFS-Europe/koha/tree/bug_33738_opac_bookings now rebased. I think we can borrow some things from that to help enhance this further too. It's a big task, I'm not sure how best to split out the work between us.
1. I like your idea Thibaud (comment #2). 2. Responding to you, Martin (comment #5), I'd say that I'll try to merge the two implementations, picking the base parts of each one. => I think during the merge I can look for areas that need improvement, and line them out in a comment here. Then we can derive some additional tasks from it.
Hi Paul, There is precisely a patch that was submitted during KohaCon on the multiple addition of booking on items, it is bug 38019. The logic is close to this kind of functionality (multiple addition)
*** Bug 38834 has been marked as a duplicate of this bug. ***
Created attachment 176235 [details] [review] Bug 33738 : Add bookings feature on the OPAC side Inspired by the work of Paul and Martin, I'm submitting this proposal for the bookings functionality on the OPAC side. Bookings are perform as on the staff side with the api, adding, cancelling and modifying the pickup library works (normally :) ). Test plan: 1) Apply this patch and restart_all 2) Having a bookable item 3) Go to the OPAC side and click on “Place booking” in the menu. 4) Add a booking; if there is an error, it will appear in the modal (preparation of errors linked to circulation rules). 5) Cancel or Modify pickup library Thanks for testing
Thanks Thibaud, I will play around with it tomorrow.
Created attachment 176548 [details] [review] Bug 33738: Add bookings feature on the OPAC side Inspired by the work of Paul and Martin, I'm submitting this proposal for the bookings functionality on the OPAC side. Bookings are perform as on the staff side with the api, adding, cancelling and modifying the pickup library works (normally :) ). Test plan: 1) Apply this patch and restart_all 2) Having a bookable item 3) Go to the OPAC side and click on “Place booking” in the menu. 4) Add a booking; if there is an error, it will appear in the modal (preparation of errors linked to circulation rules). 5) Cancel or Modify pickup library Thanks for testing
My apologies if this is obvious when testing (and I haven't taken the time to check the patch): are you creating a system preference for this similar to OPACHoldRequests, so librarians may decide whether bookings are allowed from the OPAC? Some library teams will prefer bookings to only be placed by themselves in the staff interface and not by patrons in the OPAC.
(In reply to Aude Charillon from comment #12) > My apologies if this is obvious when testing (and I haven't taken the time > to check the patch): are you creating a system preference for this similar > to OPACHoldRequests, so librarians may decide whether bookings are allowed > from the OPAC? Some library teams will prefer bookings to only be placed by > themselves in the staff interface and not by patrons in the OPAC. Hello Aude, At this moment there is no syspref to handle that. It's just a proposal for now to add bookings on the OPAC side, a kind of demo as Paul said
I tested this and these are my results: I had an item that was bookable, logged in to the OPAC and searched for the title. I could see Place booking. Clicked on Place booking and it took me to the patron bookings screen. The table was empty and did not include my item. I then clicked on +New booking. The bibliographic record/item barcode was not available in the modal. It gave me: 1. Item > Any item 2. Pickup at: No options were available 3. Booking dates: I could only select a starting date and not an end date. I received an error message in the modal "Authorization failure. Missing required permissions(s). I'm not sure if there were other things that I should have setup, like circulation rules?
(In reply to Esther Melander from comment #14) > I tested this and these are my results: > > I had an item that was bookable, logged in to the OPAC and searched for the > title. I could see Place booking. Clicked on Place booking and it took me to > the patron bookings screen. The table was empty and did not include my item. > > I then clicked on +New booking. The bibliographic record/item barcode was > not available in the modal. It gave me: > > 1. Item > Any item > > 2. Pickup at: No options were available > > 3. Booking dates: I could only select a starting date and not an end date. > > I received an error message in the modal "Authorization failure. Missing > required permissions(s). > > I'm not sure if there were other things that I should have setup, like > circulation rules? Hello Esther, Your test makes me wonder: The behavior you mention seems to be one where the “biblio_id” parameter is missing from the url. Check that you are on a biblio record, select “place booking” then “New booking”. This behavior has been solved on another BZ (bug 38493 which adds the possibility of selecting items via their barcode if this parameter is absent). On the other hand, the fact that you can only enter a start date corresponds to the previous behavior that Paul had written... Make sure you apply the patch and restart Koha services (restart_all from a KTD). Thank you very much.
I spun up a sandbox to test. After the sandbox was created, I applied the patch and restarted services. I then rebuilt the CSS and JS. I went through the test plan again: 1. Made an item bookable. 2. Logged in as a patron in OPAC. 3. Searched for the book. 4. In the bibliographic detail view of the book, clicked on place booking. I can see the bibliographic record ID in the URL. I was redirected to the patron account > your bookings. The title does not show in the table. I can see the bibliographic record ID in the URL: /cgi-bin/koha/opac-bookings.pl?biblio_id=20 5. Clicked on +New booking Same results as described above. There could be a problem with the sandbox? If the steps I took to build the sandbox need adjustment, I am happy to try again.