Testing on Main, the Patron Bookings tab appears on the Patron page, and will indicate if there is a number of bookings, but nothing appears if the tab is clicked. To test: 1. Create an item bookable. 2. Book an item for a patron. 3. Either click the patron's name from the booking or go to the patron's detail page. 4. See they have a Booking (1) in their tab. 5. Click this tab, but nothing appears. Bug 33737 shows that should appear here.
The bookings does appear from the moremember detail page, but not from the circulation.pl page
Created attachment 167640 [details] [review] Bug 37047: Make Patron Bookings table visible from Patrons Checkout page This patch makes it so that the patron bookings table loads properly from teh checkout page. Previously, it was only loading correctly from the details page. To test: 1. Create an item bookable. 2. Book an item for a patron. 3. Go to the patron's checkout page. 4. See they have a Booking (1) in their tab. 5. Click this tab, but nothing appears. 6. Apply patch, restart_all 7. See they still have a Booking (1) in their tab. 8. Click this tab, table loads as expected.
Created attachment 167650 [details] [review] Bug 37047: Make Patron Bookings table visible from Patrons Checkout page This patch makes it so that the patron bookings table loads properly from teh checkout page. Previously, it was only loading correctly from the details page. To test: 1. Create an item bookable. 2. Book an item for a patron. 3. Go to the patron's checkout page. 4. See they have a Booking (1) in their tab. 5. Click this tab, but nothing appears. 6. Apply patch, restart_all 7. See they still have a Booking (1) in their tab. 8. Click this tab, table loads as expected. Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Created attachment 167651 [details] [review] Bug 37047: Move bookings table JS table to its own file For reusability Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Created attachment 167652 [details] [review] Bug 37047: Make use of DRY bookings-table.js in moremember.tt Test plan: No functionality change, follow the original test plan and make sure the table is displayed correctly on both screens: <intra>/cgi-bin/koha/circ/circulation.pl?borrowernumber= <intra>/cgi-bin/koha/members/moremember.pl?borrowernumber=1 Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment on attachment 167651 [details] [review] Bug 37047: Move bookings table JS table to its own file Review of attachment 167651 [details] [review]: ----------------------------------------------------------------- I really like where this is headed and it was always my intention to do this work so thanks for taking it on. ::: koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -1051,5 @@ > - }); > - > - $("#view_guarantees_finesandcharges").on("click",function(){ > - $('#guarantees_finesandcharges-tab').click(); > - }); These info_digests, finesholdissues, restrictions and guarantees pieces are all unrelated to bookings.. I think they should be left out here.
Looking at DRYing this out further now.. it would be nice to use the same table js on the bookings management page too.
Created attachment 167742 [details] [review] Bug 37047: Make Patron Bookings table visible from Patrons Checkout page This patch makes it so that the patron bookings table loads properly from teh checkout page. Previously, it was only loading correctly from the details page. To test: 1. Create an item bookable. 2. Book an item for a patron. 3. Go to the patron's checkout page. 4. See they have a Booking (1) in their tab. 5. Click this tab, but nothing appears. 6. Apply patch, restart_all 7. See they still have a Booking (1) in their tab. 8. Click this tab, table loads as expected. Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 167743 [details] [review] Bug 37047: Move bookings table JS table to its own file For reusability Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 167744 [details] [review] Bug 37047: Make use of DRY bookings-table.js in moremember.tt Test plan: No functionality change, follow the original test plan and make sure the table is displayed correctly on both screens: <intra>/cgi-bin/koha/circ/circulation.pl?borrowernumber= <intra>/cgi-bin/koha/members/moremember.pl?borrowernumber=1 Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 167745 [details] [review] Bug 37047: (QA follow-up) Move non-bookings code back We inadvertantly adding a little more than just the bookings table js into it's own asset. This patch moves that code back and also renames the asset file to /tables/bookings.js from /bookings-table.js as is the scheme we're attempting to follow now (see '/modals/'). Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment on attachment 167745 [details] [review] Bug 37047: (QA follow-up) Move non-bookings code back Review of attachment 167745 [details] [review]: ----------------------------------------------------------------- ::: koha-tmpl/intranet-tmpl/prog/js/bookings-table.js @@ -1,1 @@ > -$(document).ready(function () { This double nesting of document ready looks a little suspicious.
Testing now whether the nesting can be removed and all continue to work, then I'll PQA this one. Thanks guys.
Created attachment 167924 [details] [review] Bug 37047: Make Patron Bookings table visible from Patrons Checkout page This patch makes it so that the patron bookings table loads properly from teh checkout page. Previously, it was only loading correctly from the details page. To test: 1. Create an item bookable. 2. Book an item for a patron. 3. Go to the patron's checkout page. 4. See they have a Booking (1) in their tab. 5. Click this tab, but nothing appears. 6. Apply patch, restart_all 7. See they still have a Booking (1) in their tab. 8. Click this tab, table loads as expected. Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 167925 [details] [review] Bug 37047: Move bookings table JS table to its own file For reusability Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 167926 [details] [review] Bug 37047: Make use of DRY bookings-table.js in moremember.tt Test plan: No functionality change, follow the original test plan and make sure the table is displayed correctly on both screens: <intra>/cgi-bin/koha/circ/circulation.pl?borrowernumber= <intra>/cgi-bin/koha/members/moremember.pl?borrowernumber=1 Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 167927 [details] [review] Bug 37047: (QA follow-up) Move non-bookings code back We inadvertantly adding a little more than just the bookings table js into it's own asset. This patch moves that code back and also renames the asset file to /tables/bookings.js from /bookings-table.js as is the scheme we're attempting to follow now (see '/modals/'). Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 167928 [details] [review] Bug 37047: (QA follow-up) Remove nesting of document ready function Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
All working well including with QA follow-ups. Passing QA
OK, 2 things here: 1) This one is new for me, so I need a little pointer maybe: FAIL koha-tmpl/intranet-tmpl/prog/js/tables/bookings.js FAIL Tidiness File is not tidy, please run `yarn run prettier --trailing-comma es5 --arrow-parens avoid --write /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/js/tables/bookings.js` 2) Translatability Some JavaScript code was moved from .tt to .js - we now need to adjust the translation "markers" to double underscore ( _() to __()) Exemplae: title: _("Booking ID"), Please follow-up!
Created attachment 167958 [details] [review] Bug 37047: Make Patron Bookings table visible from Patrons Checkout page This patch makes it so that the patron bookings table loads properly from teh checkout page. Previously, it was only loading correctly from the details page. To test: 1. Create an item bookable. 2. Book an item for a patron. 3. Go to the patron's checkout page. 4. See they have a Booking (1) in their tab. 5. Click this tab, but nothing appears. 6. Apply patch, restart_all 7. See they still have a Booking (1) in their tab. 8. Click this tab, table loads as expected. Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 167959 [details] [review] Bug 37047: Move bookings table JS table to its own file For reusability Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 167960 [details] [review] Bug 37047: Make use of DRY bookings-table.js in moremember.tt Test plan: No functionality change, follow the original test plan and make sure the table is displayed correctly on both screens: <intra>/cgi-bin/koha/circ/circulation.pl?borrowernumber= <intra>/cgi-bin/koha/members/moremember.pl?borrowernumber=1 Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 167961 [details] [review] Bug 37047: (QA follow-up) Move non-bookings code back We inadvertantly adding a little more than just the bookings table js into it's own asset. This patch moves that code back and also renames the asset file to /tables/bookings.js from /bookings-table.js as is the scheme we're attempting to follow now (see '/modals/'). Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 167962 [details] [review] Bug 37047: (QA follow-up) Remove nesting of document ready function Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 167963 [details] [review] Bug 37047: (QA follow-up) Fix translations
Thanks for the quick follow-up!
Pushed for 24.11! Well done everyone, thank you!
Backported to 24.05.x for upcoming 24.05.02
Depends on Bug 33737 not in 23.11.x