Now that a patron's checkouts are loaded asynchronously, we can further improve Koha's performance by not loading the checkouts table when it is not needed. For example, if a librarian is checking out 5 items to a patron, we really don't need to load the table during the scanning of items 1 to 4, just for item 5. Another example would be browsing to the patron details table in order to change a patron's password. I propose we add two separate system preferences to add a timer for loading the patron's checkouts table, one for circulation and one for patron details. That way a library can choose to have enough delay so that most librarians can scan items repeatedly without loading the checkouts table, and can have the patron details table load more quickly if they wish. In addition, setting one or both timeouts to 0 will cause the system to act as it currently does.
Created attachment 29609 [details] [review] Bug 12550 - Add ability to delay loading of patron's checkouts in circulation and patron details Now that a patron's checkouts are loaded asynchronously, we can further improve Koha's performance by not loading the checkouts table when it is not needed. For example, if a librarian is checking out 5 items to a patron, we really don't need to load the table during the scanning of items 1 to 4, just for item 5. Another example would be browsing to the patron details table in order to change a patron's password. I propose we add two separate system preferences to add a timer for loading the patron's checkouts table, one for circulation and one for patron details. That way a library can choose to have enough delay so that most librarians can scan items repeatedly without loading the checkouts table, and can have the patron details table load more quickly if they wish. In addition, setting one or both timeouts to 0 will cause the system to act as it currently does. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Test circulation and patron details, no changes should be noted 4) Set CheckoutsTableSecondsToLoadCirculation and CheckoutsTableSecondsToLoadPatronDetails to some number of seconds. 5) Test again, note tables load after the set number of seconds 6) Test the "Load now" button, note it triggers the table to load immediately
Created attachment 29610 [details] [review] Bug 12550 - Add ability to delay loading of patron's checkouts in circulation and patron details Now that a patron's checkouts are loaded asynchronously, we can further improve Koha's performance by not loading the checkouts table when it is not needed. For example, if a librarian is checking out 5 items to a patron, we really don't need to load the table during the scanning of items 1 to 4, just for item 5. Another example would be browsing to the patron details table in order to change a patron's password. I propose we add two separate system preferences to add a timer for loading the patron's checkouts table, one for circulation and one for patron details. That way a library can choose to have enough delay so that most librarians can scan items repeatedly without loading the checkouts table, and can have the patron details table load more quickly if they wish. In addition, setting one or both timeouts to 0 will cause the system to act as it currently does. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Test circulation and patron details, no changes should be noted 4) Set CheckoutsTableSecondsToLoadCirculation and CheckoutsTableSecondsToLoadPatronDetails to some number of seconds. 5) Test again, note tables load after the set number of seconds 6) Test the "Load now" button, note it triggers the table to load immediately
Quick feedback: Joubu: khall: don't you think it would be better to display the tables on demand? Joubu: with a link "load checkout table" gmcharlt: I agree with Joubu - and maybe make it so that a circ desk operator can use a checkbox or a toggle that sets a cookie to determine if the table displays automatically when a patron is retrieved
Created attachment 29615 [details] [review] Bug 12550 - Add ability to delay loading of patron's checkouts in circulation and patron details Now that a patron's checkouts are loaded asynchronously, we can further improve Koha's performance by not loading the checkouts table when it is not needed. For example, if a librarian is checking out 5 items to a patron, we really don't need to load the table during the scanning of items 1 to 4, just for item 5. Another example would be browsing to the patron details table in order to change a patron's password. Test Plan: 1) Apply this patch 2) Browse to circulation.pl for a patron 3) Note the table is not loaded automatically 4) Click the "Show checkouts" button 5) Note the checkouts table loads 6) Check the "Always show checkouts immediately" checkbox 7) Reload the page, the checkouts should now load immediately 8) Repeat steps 3-7 for the patron details page ( moremember.pl )
Created attachment 29618 [details] [review] Bug 12550 - Add ability to delay loading of patron's checkouts in circulation and patron details Now that a patron's checkouts are loaded asynchronously, we can further improve Koha's performance by not loading the checkouts table when it is not needed. For example, if a librarian is checking out 5 items to a patron, we really don't need to load the table during the scanning of items 1 to 4, just for item 5. Another example would be browsing to the patron details table in order to change a patron's password. Test Plan: 1) Apply this patch 2) Browse to circulation.pl for a patron 3) Note the table is not loaded automatically 4) Click the "Show checkouts" button 5) Note the checkouts table loads 6) Check the "Always show checkouts immediately" checkbox 7) Reload the page, the checkouts should now load immediately 8) Repeat steps 3-7 for the patron details page ( moremember.pl ) Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Amended patch: remove trailing spaces. Note: I am not sure the checkbox is at the best place, but I don't have a better suggestion.
This one is on top now. Will add this report to my QA to-do list (for nontrivial patches :) But if someone else wants to QA this first, no problem whatsoever..
(In reply to M. de Rooy from comment #6) > Will add this report to my QA to-do list (for nontrivial patches :) If I remember correctly, this is more a simple patch than a medium. Most of the part of the changes is indentation.
(In reply to Jonathan Druart from comment #7) > (In reply to M. de Rooy from comment #6) > > Will add this report to my QA to-do list (for nontrivial patches :) > > If I remember correctly, this is more a simple patch than a medium. Most of > the part of the changes is indentation. Could be. I just looked at the number of lines while scrolling through.. Thx
Created attachment 31160 [details] [review] [PASSED QA] Bug 12550 - Add ability to delay loading of patron's checkouts in circulation and patron details Now that a patron's checkouts are loaded asynchronously, we can further improve Koha's performance by not loading the checkouts table when it is not needed. For example, if a librarian is checking out 5 items to a patron, we really don't need to load the table during the scanning of items 1 to 4, just for item 5. Another example would be browsing to the patron details table in order to change a patron's password. Test Plan: 1) Apply this patch 2) Browse to circulation.pl for a patron 3) Note the table is not loaded automatically 4) Click the "Show checkouts" button 5) Note the checkouts table loads 6) Check the "Always show checkouts immediately" checkbox 7) Reload the page, the checkouts should now load immediately 8) Repeat steps 3-7 for the patron details page ( moremember.pl ) Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Amended patch: remove trailing spaces. Note: I am not sure the checkbox is at the best place, but I don't have a better suggestion. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Happy to pass this. It, is indeed, actually a pretty trivial patch; some minor re-factoring which knocks out allot of indenting and then a few extra bits of code for functionality. I'm happy there are no regressions and it's a very worthwhile addition. I do agree with what Jonathan says about the check box not feeling quite right.. but can't come up with a better position either.. I'll ask Owen to take a look at some point ;)
(In reply to Martin Renvoize from comment #10) > I do agree with what Jonathan says about the check box not feeling quite > right.. I think the checkbox placement seems logical. I think the only change I would make is that checking the check box should immediately load the table of checkouts. I don't believe the opposite should happen though (hiding the table if you uncheck it).
Created attachment 31965 [details] [review] Bug 12550 - Add ability to delay loading of patron's checkouts in circulation and patron details Rebased patch.
Created attachment 31968 [details] [review] Bug 12550 [QA Followup] - Make checking the checkbox load the table of checkouts
Patches pushed to master. Thanks Kyle!
skipping ENH bug for inclusion in 3.16.x