Description
Alex Buckley
2018-08-08 00:56:03 UTC
Created attachment 77547 [details] [review] Bug 21173 - Customize age unit and starting point for automatic item modification by age tool and cronjob. This allows librarians to define either the item creation date or items last altered timestamp as the starting point for the age of the item so the autmatic_item_modification_by_age.pl can alter item statuses for example for items which have been in the catalogue for a while. A use case for this functionality is: * When an items shelving location changes from 'In processing' to 'Shelving trolley' after 1 hour the status 'Shelving trolley' is removed for the item. The unit 'Hours' can now be set (extending the functionality of this cronjob from just calculating item age in days) and the age starting point of 'Last altered' can be defined so existing items in the catalogue like this example item will be altered by the cronjob. Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 77548 [details] [review] Bug 21173 - Fixed 2 template and SQL typos I understand this is an enh to the tool, that might be generally helfpul. But was wondering because of the given use case, if misc / cronjobs / cart_to_shelf.pl would not already work here? For the cart using the existing feature seems nice, because it will allow you to use location for other things as well, switching back from cart to a permanent_location. Created attachment 77604 [details] [review] Bug 21173 - Customize age unit and starting point for automatic item modification by age tool and cronjob. This allows librarians to define either the item creation date or items last altered timestamp as the starting point for the age of the item so the autmatic_item_modification_by_age.pl can alter item fields for example for items which have been in the catalogue for a while. A use case for this functionality is: * When an items shelving location changes from 'In processing' to 'Shelving trolley' after 1 hour the status 'Shelving trolley' is removed for the item. The unit 'Hours' can now be set (extending the functionality of this cronjob from just calculating item age in days) and the age starting point of 'Last altered' can be defined so existing items in the catalogue like this example item will be altered by the cronjob. Test plan: 1. Go to Tools->Automatic item modifications by age and create a new rule by selecting the 'Edit rules' button 2. Notice you can only set the age in the unit of days not hours. Also alsthough not visible in the interface the rule will calculate the age of the item based on when it was created (i.e. added to Koha). 3. Apply patch and run ./updatedatabase.pl in the koha-shell 4. Now revisit Tools->Automatic item modifications by age. Notice the table of existing rules now contains a new column 'Age starting point' this is the date from which the item age is calculated. This enhancement offers you two options as the age starting point: Created (displayed in this table as 'itemcreated') or Last altered (displayed in this table as 'itemaltered'). 5. Click 'Edit rules' to create a new rule. Notice in the form for creating the new rule you can set the unit to either 'Hours' or 'Days'. When you select 'Days' then the Age starting point selection will appear where you can specify if you want the rule to work on the number of days since the item was last altered or number of days since the item was created. NOTE: If you select 'Hours' as the unit type when creating a new rule then the Age starting point selection area is hidden. This is because the item creation value is saved in the database as a date not a datetime. Therefore we cannot calculate the number of hours since the item was created in the Koha catalog. Therefore if the unit is set to 'Hours' then by default the item will use the item last altered value (stored as a date time) as the age starting point. For existing rules if they have the unit set to 'Hours' then the Age starting point area is hidden by default when the page loads. 6. In the new rule set the following values: Age: 1, Unit: Hours, condition items.location = 'CART', items.location = '' 7. Now save the rule and confirm the correct values are dispayed in the rules table which is loaded 8. Click 'Edit rules' button again. 9. Modify the rule you just created changing Age to 2 and create another new rule with the following values: Age='1', Unit='Days', 'Age starting point'='Created', Condition 'items.homebranch'='<a branchcode of a branch in your Koha instance>', substituions 'items.homebranch'='<another branchcode in your Koha instance>' 10. Now click 'Save' and confirm the data displayed for both rules is correct. 11. In the database manually set the location field of two items to 'CART' and set their timestamp value to 2 hours before the current time 12. Exit out of the database terminal and manually run the automatic_item_modification_by_age.pl cronjob from the koha-shell with this command: ./automatic_item_modification_by_age.pl --confirm 13. Now return to the database and notice the two items you set have a location of 'CART' now have a blank location field because the manually run cronjob altered them as they meet the conditions of the rule. 14. Repeat step 11 and enter this text into your /etc/cron.d/koha-common file: */2 * * * * root koha-foreach --enabled /usr/share/koha/bin/cronjobs/automatic_item_modification_by_age.pl --confirm This will make the cronjob run every 2 minutes. 15. Now restart koha-common with this command: sudo /etc/init.d/koha-common restart 16. Now wait for more than 2 minutes and check the database again and notice that the two items have blank location fields as the automatically running cronjob altered the items. Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Hi Katrin Your right that with the use case outlined by Toi Ohomai they could indeed simply use the misc/cronjobs/cart_to_shelf.pl however that would require them to either ask a member of IT staff or their Koha support vendor to add/modify the number of hours since item last modified. Whereas this enhancement allows librarians to have control over this and provides scope for library staff to not just change item.location based on the number of hours since the item was modified but also many other conditions and substitutions are available to them. i.e. this gives librarians more control and lets them set many values other than items.location based on the number of hours or days since the item was last altered. What are your thoughts? Hi Alex, not trying to block this one - as you said, it's a general feature that will allow for other things as well and I was not sure if you were away of the in-built cart feature that allows to return from cart to a former location. Hi Katrin Thanks for bringing the other inbuilt cart feature to my attention as I wasn't previously aware of it before writing this enhancement. I have just rebased the commits down to a single commit. I just have to obsolete the commit I just added as I noticed a template typo then it should be pretty close to being ready for being set to 'Needs signoff'. This commit and several others I have/am writing at the moment are for Toi Ohomai who you may have seen in the July community newsletter that they have recently gone live with Koha :) Created attachment 77605 [details] [review] Bug 21173 - Customize age unit and starting point for automatic item modification by age tool and cronjob. This allows librarians to define either the item creation date or items last altered timestamp as the starting point for the age of the item so the autmatic_item_modification_by_age.pl can alter item fields for example for items which have been in the catalogue for a while. A use case for this functionality is: * When an items shelving location changes from 'In processing' to 'Shelving trolley' after 1 hour the status 'Shelving trolley' is removed for the item. The unit 'Hours' can now be set (extending the functionality of this cronjob from just calculating item age in days) and the age starting point of 'Last altered' can be defined so existing items in the catalogue like this example item will be altered by the cronjob. Test plan: 1. Go to Tools->Automatic item modifications by age and create a new rule by selecting the 'Edit rules' button 2. Notice you can only set the age in the unit of days not hours. Also alsthough not visible in the interface the rule will calculate the age of the item based on when it was created (i.e. added to Koha). 3. Apply patch and run ./updatedatabase.pl in the koha-shell 4. Now revisit Tools->Automatic item modifications by age. Notice the table of existing rules now contains a new column 'Age starting point' this is the date from which the item age is calculated. This enhancement offers you two options as the age starting point: Created (displayed in this table as 'itemcreated') or Last altered (displayed in this table as 'itemaltered'). 5. Click 'Edit rules' to create a new rule. Notice in the form for creating the new rule you can set the unit to either 'Hours' or 'Days'. When you select 'Days' then the Age starting point selection will appear where you can specify if you want the rule to work on the number of days since the item was last altered or number of days since the item was created. NOTE: If you select 'Hours' as the unit type when creating a new rule then the Age starting point selection area is hidden. This is because the item creation value is saved in the database as a date not a datetime. Therefore we cannot calculate the number of hours since the item was created in the Koha catalog. Therefore if the unit is set to 'Hours' then by default the item will use the item last altered value (stored as a date time) as the age starting point. For existing rules if they have the unit set to 'Hours' then the Age starting point area is hidden by default when the page loads. 6. In the new rule set the following values: Age: 1, Unit: Hours, condition items.location = 'CART', items.location = '' 7. Now save the rule and confirm the correct values are dispayed in the rules table which is loaded 8. Click 'Edit rules' button again. 9. Modify the rule you just created changing Age to 2 and create another new rule with the following values: Age='1', Unit='Days', 'Age starting point'='Created', Condition 'items.homebranch'='<a branchcode of a branch in your Koha instance>', substituions 'items.homebranch'='<another branchcode in your Koha instance>' 10. Now click 'Save' and confirm the data displayed for both rules is correct. 11. In the database manually set the location field of two items to 'CART' and set their timestamp value to 2 hours before the current time 12. Exit out of the database terminal and manually run the automatic_item_modification_by_age.pl cronjob from the koha-shell with this command: ./automatic_item_modification_by_age.pl --confirm 13. Now return to the database and notice the two items you set have a location of 'CART' now have a blank location field because the manually run cronjob altered them as they meet the conditions of the rule. 14. Repeat step 11 and enter this text into your /etc/cron.d/koha-common file: */2 * * * * root koha-foreach --enabled /usr/share/koha/bin/cronjobs/automatic_item_modification_by_age.pl --confirm This will make the cronjob run every 2 minutes. 15. Now restart koha-common with this command: sudo /etc/init.d/koha-common restart 16. Now wait for more than 2 minutes and check the database again and notice that the two items have blank location fields as the automatically running cronjob altered the items. Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Can we please move this patch along. It is currently being used in production by Toi Ohomai Institute of Technology of New Zealand. Created attachment 78917 [details] [review] Bug 21173 - Customize age unit and starting point for automatic item modification by age tool and cronjob. This allows librarians to define either the item creation date or items last altered timestamp as the starting point for the age of the item so the autmatic_item_modification_by_age.pl can alter item fields for example for items which have been in the catalogue for a while. A use case for this functionality is: * When an items shelving location changes from 'In processing' to 'Shelving trolley' after 1 hour the status 'Shelving trolley' is removed for the item. The unit 'Hours' can now be set (extending the functionality of this cronjob from just calculating item age in days) and the age starting point of 'Last altered' can be defined so existing items in the catalogue like this example item will be altered by the cronjob. Test plan: 1. Go to Tools->Automatic item modifications by age and create a new rule by selecting the 'Edit rules' button 2. Notice you can only set the age in the unit of days not hours. Also alsthough not visible in the interface the rule will calculate the age of the item based on when it was created (i.e. added to Koha). 3. Apply patch and run ./updatedatabase.pl in the koha-shell 4. Now revisit Tools->Automatic item modifications by age. Notice the table of existing rules now contains a new column 'Age starting point' this is the date from which the item age is calculated. This enhancement offers you two options as the age starting point: Created (displayed in this table as 'itemcreated') or Last altered (displayed in this table as 'itemaltered'). 5. Click 'Edit rules' to create a new rule. Notice in the form for creating the new rule you can set the unit to either 'Hours' or 'Days'. When you select 'Days' then the Age starting point selection will appear where you can specify if you want the rule to work on the number of days since the item was last altered or number of days since the item was created. NOTE: If you select 'Hours' as the unit type when creating a new rule then the Age starting point selection area is hidden. This is because the item creation value is saved in the database as a date not a datetime. Therefore we cannot calculate the number of hours since the item was created in the Koha catalog. Therefore if the unit is set to 'Hours' then by default the item will use the item last altered value (stored as a date time) as the age starting point. For existing rules if they have the unit set to 'Hours' then the Age starting point area is hidden by default when the page loads. 6. In the new rule set the following values: Age: 1, Unit: Hours, condition items.location = 'CART', items.location = '' 7. Now save the rule and confirm the correct values are dispayed in the rules table which is loaded 8. Click 'Edit rules' button again. 9. Modify the rule you just created changing Age to 2 and create another new rule with the following values: Age='1', Unit='Days', 'Age starting point'='Created', Condition 'items.homebranch'='<a branchcode of a branch in your Koha instance>', substituions 'items.homebranch'='<another branchcode in your Koha instance>' 10. Now click 'Save' and confirm the data displayed for both rules is correct. 11. In the database manually set the location field of two items to 'CART' and set their timestamp value to 2 hours before the current time 12. Exit out of the database terminal and manually run the automatic_item_modification_by_age.pl cronjob from the koha-shell with this command: ./automatic_item_modification_by_age.pl --confirm 13. Now return to the database and notice the two items you set have a location of 'CART' now have a blank location field because the manually run cronjob altered them as they meet the conditions of the rule. 14. Repeat step 11 and enter this text into your /etc/cron.d/koha-common file: */2 * * * * root koha-foreach --enabled /usr/share/koha/bin/cronjobs/automatic_item_modification_by_age.pl --confirm This will make the cronjob run every 2 minutes. 15. Now restart koha-common with this command: sudo /etc/init.d/koha-common restart 16. Now wait for more than 2 minutes and check the database again and notice that the two items have blank location fields as the automatically running cronjob altered the items. Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Rebased against master on 16th of sept 2018. (In reply to Alex Buckley from comment #11) > Rebased against master on 16th of sept 2018. - <input type="text" value="[% substitution.value | html %]" name="substitution_value_[% id | html %]" /> + <input type="text" value="[% substitution.value %]" name="substitution_value_[% id %]" /> Rebase is wrong, you removed the filters. Created attachment 79914 [details] [review] Bug 21173: Fixed rebase removal of filters and changed items.dateaccessioned to datetime datatype This means we can make the auto item modification tool work for hours since item was created Updated test plan: 1. Go to Tools->Automatic item modifications by age and create a new rule by selecting the 'Edit rules' button 2. Notice you can only set the age in the unit of days not hours. Also although not visible in the interface the rule will calculate the age of the item based on when it was created (i.e. added to Koha). 3. Apply patch and run ./updatedatabase.pl in the koha-shell 4. Now revisit Tools->Automatic item modifications by age. Notice the table of existing rules now contains a new column 'Age starting point' this is the date from which the item age is calculated. This enhancement offers you two options as the age starting point: Created (displayed in this table as 'itemcreated') or Last altered (displayed in this table as 'itemaltered'). 5. Click 'Edit rules' to create a new rule. Notice in the form for creating the new rule you can set the unit to either 'Hours' or 'Days'. 6. In the new rule set the following values: Age: 1, Unit: Hours, condition items.location = 'CART', items.location = '' 7. Now save the rule and confirm the correct values are dispayed in the rules table which is loaded 8. Click 'Edit rules' button again. 9. Modify the rule you just created changing Age to 2 and create another new rule with the following values: Age='1', Unit='Hour', 'Age starting point'='Created', Condition 'items.homebranch'='<a branchcode of a branch in your Koha instance>', substituions 'items.homebranch'='<another branchcode in your Koha instance>' 10. Now click 'Save' and confirm the data displayed for both rules is correct. 11. Create two new items and set their location field to 'CART'. Then in the database set their dateaccessioned value to 2 hours before the current time 12. Exit out of the database terminal and manually run the automatic_item_modification_by_age.pl cronjob from the koha-shell with this command: ./automatic_item_modification_by_age.pl --confirm 13. Now return to the database and notice the two items you set have a location of 'CART' now have a blank location field because the manually run cronjob altered them as they meet the conditions of the rule. 14. Repeat step 11 but this time change the rule in the Auto item modification tool interface to 'Age starting point='Altered'' so we can test the auto item mod tool on items that have been last altered more than 2 hours ago. 15. Enter this text into your /etc/cron.d/koha-common file: */2 * * * * root koha-foreach --enabled /usr/share/koha/bin/cronjobs/automatic_item_modification_by_age.pl --confirm This will make the cronjob run every 2 minutes. 16. Now restart koha-common with this command: sudo /etc/init.d/koha-common restart 17. Now wait for more than 2 minutes and check the database again and notice that the two items have blank location fields as the automatically running cronjob altered the items. 18. Repeat steps 9-17 with the new rules in the auto item modification tool for the following rule conditions: New rule: Age: 2 Age starting point: Created Units: Days Condition 'items.homebranch'='<a branchcode of a branch in your Koha instance>', Substitutions 'items.homebranch'='<another branchcode in your Koha instance>' New rule: Age: 2 Age starting point: Altered Units: Days Condition 'items.homebranch'='<a branchcode of a branch in your Koha instance>', Substitutions 'items.homebranch'='<another branchcode in your Koha instance>' Sponsored-By: Toi Ohomai Institute of Technology, New Zealand (In reply to Jonathan Druart in comment 12): Thanks Jonathan, I have fixed that up in the patch I just applied and added another change to store the items.dateaccessioned field as a datetime so the automatic item modification tool can now work on the number of hours since an item was created as well as since it was last altered. This has allowed me to remove some of the JS to prevent users from trying to select the age starting point of 'created' and the unit of 'hours', and it makes the tool more useful. Can you please test. >Bug 21173: Fixed rebase removal of filters and changed items.dateaccessioned to >datetime datatype
I am worried by this change. We have a lot of libraries who set the date manually in items, typing it in like: 2010-01-01. It will auto-fill, but for retro-cataloguing they want it to reflect the real date. Maybe it would be better to introduce a completely new column created_on with an automatic timestamp?
It's also missing changes to kohastructure and deleteditems. The more I think about it, the more I think this change would likely have many unwanted side effects: - dateaccesioned is indexed in Zebra and used in several spots like in the labels module for finding new items - Acq also sets it at some point as a date. - The value builder/catalouging plugin linked to the field uses a date - Used in hardcoded reports - ... (git grep dateaccessioned :) ) Working on reviving this patchset. Created attachment 138870 [details] [review] Bug 21173: Template and JavaScript changes Sponsored-by: Toi Ohomai Institute of Technology, New Zealand Created attachment 138871 [details] [review] Bug 21173: Add Hours as an age unit to auto item modifications by age items.damaged_on, items.itemlost_on, and items.withdrawn_on are datetime fields, so it could be useful to configure rules based on the number of hours since these values. All other fields in the automatic item modifications by age tool will use the days unit. Test plan: 1. Go to Tools->Automatic item modifications by age 2. Create a new rule 3. Apply patches and restart services 4. Confirm the rule you created has an 'Age unit' displayed of 'Days' 5. Edit the existing rule. Notice if your 'Age field' is not set to items.damaged_on, items.itemlost_on or items.withdrawn_on then the 'Age unit' dropdown is disabled 6. Confirm if you try to save a rule with age unit = 'Hours' and a field other than items.damaged_on, items.itemlost_on, or items.withdrawn_on then the 'List of rules' table shows that rule with the unit of 'Days' 7. Click 'Add rule'. Observe the 'Age unit' dropdown is initially disabled and set to 'Days' until you change the 'Age field' dropdown to items.damaged_on, items.itemlost_on, or items.withdrawn_on 8. Save the rule: Age: 1 Age unit: Hours Age field: items.itemlost_on Conditions: items.barcode = TEST Substitutions: items.barcode = TEST1 9. Find an item. Set it's barcode to TEST. In the database change it's items.itemlost_on to more than 1 hour ago 10. Restart services 11. Run the automatic_item_modification_by_age.pl script: sudo koha-shell kohadev ./misc/cronjobs/automatic_item_modification_by_age.pl -c 12. Confirm the item's barcode has changed to TEST1 Sponsored-by: Toi Ohomai Institute of Technology, New Zealand Created attachment 138872 [details] [review] Bug 21173: Unit tests Test plan: 1. sudo koha-shell kohadev 2. prove t/db_dependent/Items/AutomaticItemModificationByAge.t Sponsored-by: Toi Ohomai Institute of Technology, New Zealand Hi all, In the interests of upstreaming I have re-written this patchset. This patchset now adds the ability to set a unit of 'Hours' for automatic item modification by age rules on the three existing item datetime columns: items.damaged_on, items.itemlost_on, items.withdrawn_on. This is instead of trying to change existing items date columns to the datetime datatype, or adding new datetime columns. I think adding a new column such as 'created_on' with an automatic timestamp (as Katrin noted in comment #15), could be added in a follow-up bug report, and it's best to get a smaller part of this functionality upstreamed initially. Ready for testing again! Thanks, Alex Created attachment 138894 [details] [review] Bug 21173: Template and JavaScript changes Sponsored-by: Toi Ohomai Institute of Technology, New Zealand Created attachment 138895 [details] [review] Bug 21173: Add Hours as an age unit to auto item modifications by age items.damaged_on, items.itemlost_on, and items.withdrawn_on are datetime fields, so it could be useful to configure rules based on the number of hours since these values. All other fields in the automatic item modifications by age tool will use the days unit. Test plan: 1. Go to Tools->Automatic item modifications by age 2. Create a new rule 3. Apply patches and restart services 4. Confirm the rule you created has an 'Age unit' displayed of 'Days' 5. Edit the existing rule. Notice if your 'Age field' is not set to items.damaged_on, items.itemlost_on or items.withdrawn_on then the 'Age unit' dropdown is disabled 6. Confirm if you try to save a rule with age unit = 'Hours' and a field other than items.damaged_on, items.itemlost_on, or items.withdrawn_on then the 'List of rules' table shows that rule with the unit of 'Days' 7. Click 'Add rule'. Observe the 'Age unit' dropdown is initially disabled and set to 'Days' until you change the 'Age field' dropdown to items.damaged_on, items.itemlost_on, or items.withdrawn_on 8. Save the rule: Age: 1 Age unit: Hours Age field: items.itemlost_on Conditions: items.barcode = TEST Substitutions: items.barcode = TEST1 9. Find an item. Set it's barcode to TEST. In the database change it's items.itemlost_on to more than 1 hour ago 10. Restart services 11. Run the automatic_item_modification_by_age.pl script: sudo koha-shell kohadev ./misc/cronjobs/automatic_item_modification_by_age.pl -c 12. Confirm the item's barcode has changed to TEST1 Sponsored-by: Toi Ohomai Institute of Technology, New Zealand Created attachment 138896 [details] [review] Bug 21173: Unit tests Test plan: 1. sudo koha-shell kohadev 2. prove t/db_dependent/Items/AutomaticItemModificationByAge.t Sponsored-by: Toi Ohomai Institute of Technology, New Zealand Removed unused JS variable and warn and re-attached patchset. Ready for testing again. Still applies cleanly on master/main Created attachment 156137 [details] [review] Bug 21173: Template and JavaScript changes Sponsored-by: Toi Ohomai Institute of Technology, New Zealand Signed-off-by: David Nind <david@davidnind.com> Created attachment 156138 [details] [review] Bug 21173: Add Hours as an age unit to auto item modifications by age items.damaged_on, items.itemlost_on, and items.withdrawn_on are datetime fields, so it could be useful to configure rules based on the number of hours since these values. All other fields in the automatic item modifications by age tool will use the days unit. Test plan: 1. Go to Tools->Automatic item modifications by age 2. Create a new rule 3. Apply patches and restart services 4. Confirm the rule you created has an 'Age unit' displayed of 'Days' 5. Edit the existing rule. Notice if your 'Age field' is not set to items.damaged_on, items.itemlost_on or items.withdrawn_on then the 'Age unit' dropdown is disabled 6. Confirm if you try to save a rule with age unit = 'Hours' and a field other than items.damaged_on, items.itemlost_on, or items.withdrawn_on then the 'List of rules' table shows that rule with the unit of 'Days' 7. Click 'Add rule'. Observe the 'Age unit' dropdown is initially disabled and set to 'Days' until you change the 'Age field' dropdown to items.damaged_on, items.itemlost_on, or items.withdrawn_on 8. Save the rule: Age: 1 Age unit: Hours Age field: items.itemlost_on Conditions: items.barcode = TEST Substitutions: items.barcode = TEST1 9. Find an item. Set it's barcode to TEST. In the database change it's items.itemlost_on to more than 1 hour ago 10. Restart services 11. Run the automatic_item_modification_by_age.pl script: sudo koha-shell kohadev ./misc/cronjobs/automatic_item_modification_by_age.pl -c 12. Confirm the item's barcode has changed to TEST1 Sponsored-by: Toi Ohomai Institute of Technology, New Zealand Signed-off-by: David Nind <david@davidnind.com> Created attachment 156139 [details] [review] Bug 21173: Unit tests Test plan: 1. sudo koha-shell kohadev 2. prove t/db_dependent/Items/AutomaticItemModificationByAge.t Sponsored-by: Toi Ohomai Institute of Technology, New Zealand Signed-off-by: David Nind <david@davidnind.com> 1) Needs a bit of perltidy. 2) The GUI is a little confusing. What happens: * When the form is shown the first time, the 'Hours' value is selected * Switch the field to items.withdrawn_on and it changes to "Choose an age unit" * Switch the field back to "items.dateaccessioned" * The drop down still shows "Choose an age unit", but can no longer be changed. Suggested behavior: * When the form is shown the first time, the 'Hours' value is selected * Switch the field to items.withdrawn_on the field unlocks and is now editable * Switch to "Hours" * Switch the field back to "items.dateaccessioned", the field locks with "Hours" set Alternatively we could also only show the units pull down if one of the 3 fields where it applies is picked? Hi (In reply to Katrin Fischer from comment #31) > 1) Needs a bit of perltidy. > 2) The GUI is a little confusing. What happens: > > * When the form is shown the first time, the 'Hours' value is selected > * Switch the field to items.withdrawn_on and it changes to "Choose an age > unit" > * Switch the field back to "items.dateaccessioned" > * The drop down still shows "Choose an age unit", but can no longer be > changed. > > Suggested behavior: > > * When the form is shown the first time, the 'Hours' value is selected > * Switch the field to items.withdrawn_on the field unlocks and is now > editable > * Switch to "Hours" > * Switch the field back to "items.dateaccessioned", the field locks with > "Hours" set > > Alternatively we could also only show the units pull down if one of the 3 > fields where it applies is picked? Hi Katrin, Thank you for doing QA. I will work through each of your points and fix up this enhancement :) Alex What if we change the order of the fields? 1. Age field 2. Age unit 3. Age Then you're not backtracking in the form if you select a field which offers other unit choices. Created attachment 158574 [details] [review] Bug 21173: (follow-up) Perltidy Sponsored-by: Toi Ohomai Institute of Technology, New Zealand Created attachment 158575 [details] [review] Bug 21173: (follow-up) Re-ordering input fields in item modification by age form Sponsored-by: Toi Ohomai Institute of Technology, New Zealand Thanks Katrin and Owen! Great suggestions, I am just trying them out in those follow-ups. This isn't ready to testing yet, I'll change the status when it is :) Hi Katrin and Owen, Happy holidays! I think this one is ready for testing now. I've checked and it does still apply cleanly on master and the order of the fields is as follows: 1. Age field 2. Age unit 3. Age Please do let me know if there is anything else you would like me to alter? Thanks so much, Alex Please update the test plan to reflect the current location of the 'Automatic Item Modifications by Age' feature. It is no longer found under 'Tools' but has been moved to 'Cataloging'. Created attachment 160715 [details] [review] Bug 21173: (follow-up) Re-ordering input fields in item modification by age form Sponsored-by: Toi Ohomai Institute of Technology, New Zealand Signed-off-by: matthias le gac <matthias@babel.inlibro.net> Created attachment 160716 [details] [review] Bug 21173: (follow-up) Re-ordering input fields in item modification by age form Sponsored-by: Toi Ohomai Institute of Technology, New Zealand Signed-off-by: Phan Tung Bui <phan-tung.bui@inlibro.com> Note: To avoid confusion, when selecting a rule other than 'items.damaged_on', 'items.itemlost_on', or 'items.withdrawn_on', the option 'Hours' should be disabled since these specific fields are associated with the 'Days' unit. Enabling 'Hours' for other fields may lead to misinterpretation of the rule's intended behavior. Disabling 'Hours' ensures consistency in the presentation of rules and helps users make accurate selections. No longer applies cleanly to current main |