This is part of the refactoring happening in bug 30975
Created attachment 146078 [details] [review] Bug 32820: Fix cataloguing/value_builder/stocknumberAV.pl Use event parameter This is part of the refactoring happening in bug 30975 Test plan: 1. Verify that the plugin continues to work as before
This works, but similar to bug 32814 when I click on the three dots it jumps to the top of the screen. It does this when using an authorized value term and just a numerical value. It didn't do this before the patch was applied (and after a flush_memcached and restart_all). How I tested ~~~~~~~~~~~~ 1. Add the stocknumberAV.pl plugin to 952$i 2. Add a new authorized valued category called INVENTORY 3. Add some new authorized value, for example: TEST, TEST1 4. Adding an inventory number with a prefix from the INVENTORY authorized values: 4.1 Enter "TEST" to an item for a record 4.2 Click the three dots ==> A number should be added, for example: TEST 0000000001 4.3 Repeat for another item using the same authorized value ==> This should increment, for example: TEST 0000000002 5. Adding a numerical inventory number: 5.1 Add a numerical number without a prefix to an item for a record, for example: 98765 5.2 Click the three dots ==> There should be no change (as expected) Description of plugin ~~~~~~~~~~~~~~~~~~~~~ This plugin is based on authorised values from INVENTORY. It is used for stocknumber computation. If no prefix is submitted, or the prefix does contain only numbers, it returns the inserted code (= keep the field unchanged). If a prefix is submitted, we look for the highest stocknumber with this prefix and return it incremented. In this case, a stocknumber has this form (e.g. "PREFIX 0009678570"): PREFIX containing letters, a space separator and 10 digits with leading 0s if needed.
Created attachment 146757 [details] [review] Bug 32820: Fix cataloguing/value_builder/stocknumberAV.pl Use event parameter This is part of the refactoring happening in bug 30975 Test plan: 1. Verify that the plugin continues to work as before
(In reply to David Nind from comment #2) > This works, but similar to bug 32814 when I click on the three dots it jumps > to the top of the screen. Thank you for the feedback. This issue concerns a lot of these "framework plugins" patches. The current framework plugin manager do things differently depending on the name of the first parameter: it adds "return false" at the end, which prevents the jump to the top of the page, but only when the first parameter is not "e", "ev" or "event". This won't be an issue after bug 30975 is pushed but for now we need to add event.preventDefault() at the beginning of all "click" event handlers. All bugs have been updated
(In reply to Julian Maurice from comment #4) > All bugs have been updated Thanks Julian! More sign-offs on the way...
Created attachment 146929 [details] [review] Bug 32820: Fix cataloguing/value_builder/stocknumberAV.pl Use event parameter This is part of the refactoring happening in bug 30975 Test plan: 1. Verify that the plugin continues to work as before Signed-off-by: David Nind <david@davidnind.com>
Created attachment 147351 [details] [review] Bug 32820: Fix cataloguing/value_builder/stocknumberAV.pl Use event parameter This is part of the refactoring happening in bug 30975 Test plan: 1. Verify that the plugin continues to work as before Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Pushed to master for 23.05. Nice work everyone, thanks!
Nice work everyone! Pushed to stable for 22.11.x
Backported to 22.05.x for upcoming 22.05.11.
applied to 21.11 for 21.11.19
Not backported to 21.05.x