This plugin could be updated to use Koha::Object instead of SQL queries.
Created attachment 83776 [details] [review] Bug 22098: Update stocknumberAV cataloguing plugin to use objects This patch: - changes SQL to Koha::AuthorisedValues - remove type param from script tag - fixes the plugin description 0) Do not apply the patch 1) Set the plugin 1.1) Update a biblio framework and link plugin stocknumberAV.pl to some item subfield 1.2) Add authorised values category called "INVENTORY" 1.3) Add some authorised values: authorised value is prefix and description is a current stock/inventory number 2) Add an item and try to use this plugin to ensure you set it correctly 2.1) Use a defined prefix to see if the number is correct 2.2) Ensure the number is correctly incremented in authorised values 2.3) Use not defined prefix to see the error message 2.4) Insert a not prefix string (eg number) to see it is not changed 3) Apply the patch 4) Repeat 2) and see it is working the same 5) Look into patch and confirm the description does make sense and is rigth according to what you see in UI 6) Sign off :D
Created attachment 91421 [details] [review] Bug 22098: (follow-up) fix grammar/formating Perldoc - nubers => numbers - some vertical spacing - !}fmt -w65 - "contains of letters" => "containing letters" TEST PLAN --------- perldoc cataloguing/value_builder/stocknumberAV.pl apply patch perldoc cataloguing/value_builder/stocknumberAV.pl -- after the patch is more readable.
Created attachment 101329 [details] [review] Bug 22098: Update stocknumberAV cataloguing plugin to use objects This patch: - changes SQL to Koha::AuthorisedValues - remove type param from script tag - fixes the plugin description 0) Do not apply the patch 1) Set the plugin 1.1) Update a biblio framework and link plugin stocknumberAV.pl to some item subfield 1.2) Add authorised values category called "INVENTORY" 1.3) Add some authorised values: authorised value is prefix and description is a current stock/inventory number 2) Add an item and try to use this plugin to ensure you set it correctly 2.1) Use a defined prefix to see if the number is correct 2.2) Ensure the number is correctly incremented in authorised values 2.3) Use not defined prefix to see the error message 2.4) Insert a not prefix string (eg number) to see it is not changed 3) Apply the patch 4) Repeat 2) and see it is working the same 5) Look into patch and confirm the description does make sense and is rigth according to what you see in UI 6) Sign off :D Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Created attachment 101330 [details] [review] Bug 22098: (follow-up) fix grammar/formating Perldoc - nubers => numbers - some vertical spacing - !}fmt -w65 - "contains of letters" => "containing letters" TEST PLAN --------- perldoc cataloguing/value_builder/stocknumberAV.pl apply patch perldoc cataloguing/value_builder/stocknumberAV.pl -- after the patch is more readable. Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Looks good, nice job
Created attachment 101373 [details] [review] Bug 22098: Update stocknumberAV cataloguing plugin to use objects This patch: - changes SQL to Koha::AuthorisedValues - remove type param from script tag - fixes the plugin description 0) Do not apply the patch 1) Set the plugin 1.1) Update a biblio framework and link plugin stocknumberAV.pl to some item subfield 1.2) Add authorised values category called "INVENTORY" 1.3) Add some authorised values: authorised value is prefix and description is a current stock/inventory number 2) Add an item and try to use this plugin to ensure you set it correctly 2.1) Use a defined prefix to see if the number is correct 2.2) Ensure the number is correctly incremented in authorised values 2.3) Use not defined prefix to see the error message 2.4) Insert a not prefix string (eg number) to see it is not changed 3) Apply the patch 4) Repeat 2) and see it is working the same 5) Look into patch and confirm the description does make sense and is rigth according to what you see in UI 6) Sign off :D Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 101374 [details] [review] Bug 22098: Update stocknumberAV cataloguing plugin to use objects This patch: - changes SQL to Koha::AuthorisedValues - remove type param from script tag - fixes the plugin description 0) Do not apply the patch 1) Set the plugin 1.1) Update a biblio framework and link plugin stocknumberAV.pl to some item subfield 1.2) Add authorised values category called "INVENTORY" 1.3) Add some authorised values: authorised value is prefix and description is a current stock/inventory number 2) Add an item and try to use this plugin to ensure you set it correctly 2.1) Use a defined prefix to see if the number is correct 2.2) Ensure the number is correctly incremented in authorised values 2.3) Use not defined prefix to see the error message 2.4) Insert a not prefix string (eg number) to see it is not changed 3) Apply the patch 4) Repeat 2) and see it is working the same 5) Look into patch and confirm the description does make sense and is rigth according to what you see in UI 6) Sign off :D Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 101375 [details] [review] Bug 22098: (follow-up) fix grammar/formating Perldoc - nubers => numbers - some vertical spacing - !}fmt -w65 - "contains of letters" => "containing letters" TEST PLAN --------- perldoc cataloguing/value_builder/stocknumberAV.pl apply patch perldoc cataloguing/value_builder/stocknumberAV.pl -- after the patch is more readable. Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 101376 [details] [review] Bug 22098: (QA follow-up) Improving documentation Improves the documentation of the script a bit, but makes one important change: -If no prefix is submitted, or prefix does not contain only -numbers, it returns the inserted code (= keep a field unchanged) +If no prefix is submitted, or the prefix does contain only +numbers, it returns the inserted code (= keep the field unchanged). To test: - Add an authorised INVENTORY value with 2020 as prefix - After linking the stocknumberAV.pl to the 952$i in the frameworks - Edit an item - Add 2020 in the stocknumber field - Trigger plugin - Verify nothing happens If the prefix contains only numbers... nothing happens. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Nice work everyone! Pushed to master for 20.05
enhancement not backported to 19.11.x