The general consensus based on the comment thread of bug 14135 is that it would be better to convert the entry field to a drop-down from the present text input box.
Created attachment 39484 [details] [review] Bug 14268 - Dropdown to select 'preftype' 'preftype' for Local Use sysprefs is presently set by free form input box (no UI level validation that leaves the user free to enter arbitrary values). This patch addresses that in part by changing it to a dropdown. The patch depends on patch at Bug 14135 Test plan ========= 1/ apply patch available against 14135 (attachment 39408 [details] [review]) 2/ apply this patch 3/ visit admin/systempreferences.pl?op=add_form note the dropdown against 'Variable type' for fieldset 'Koha internals'. By default, the type 'Free' would be selected.
Comment on attachment 39484 [details] [review] Bug 14268 - Dropdown to select 'preftype' Review of attachment 39484 [details] [review]: ----------------------------------------------------------------- ::: koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tt @@ +200,5 @@ > <div class="hint">Note: you should have no reasons to modify the following default values</div> > <ol> > <li><label for="preftype">Variable type:</label> > + <select name="preftype" id="preftype"> > + <option value="Choice">Choice</option> None of the options have 'selected'. You need to have logic in the perl script which passes a hash to the template of { value=>$value, selected=>$selected } where $value is generated by a nice loop, and $selected is set to '' or the appropriate HTML triggering a selection. And then this option loop would output the hash in a nicely formatted manner.
Moving back to ASSIGNED due to comment #2.
Created attachment 39493 [details] [review] Bug 14268: counter-patch -- dropdown for Variable type The information needed to build the dropdown is already passed. This patch uses it to build the variable type dropdown correctly. TEST PLAN --------- 1) Apply 14135 2) In the staff client: Home -> Global system preferences -> Local use 3) Click 'Edit' on any system preference. 4) Note all the types listed. 5) Click 'Cancel' 6) Apply this patch 7) Click '+New Preference' 8) Enter data to have a decent 'Free' type preference. 9) Click 'Save' 10) For each type noted in step 4 (do 'Free' again last) a) Click 'Edit' for the added system preference -- it should be the last saved variable type. b) Change the variable type to the next type. c) Click 'Save' d) Repeat steps (a) through (c) until all the types have been done. -- NOTE: Yes, there are other strange things here, but those are beyond the scope of this bug. 11) Run koha qa test tools
Created attachment 39494 [details] [review] Bug 14268: counter-patch -- dropdown for Variable type The information needed to build the dropdown is already passed. This patch uses it to build the variable type dropdown correctly. TEST PLAN --------- 1) Apply 14135 2) In the staff client: Home -> Global system preferences -> Local use 3) Click 'Edit' on any system preference. 4) Note all the types listed. 5) Click 'Cancel' 6) Apply this patch 7) Click '+New Preference' 8) Enter data to have a decent 'Free' type preference. 9) Click 'Save' 10) For each type noted in step 4 (do 'Free' again last) a) Click 'Edit' for the added system preference -- it should be the last saved variable type. b) Change the variable type to the next type. c) Click 'Save' d) Repeat steps (a) through (c) until all the types have been done. -- NOTE: Yes, there are other strange things here, but those are beyond the scope of this bug. 11) Run koha qa test tools Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Created attachment 39495 [details] [review] Followup - remove redundant instruction for preftype removes the now redundant instruction "Note: you should have no reasons to modify the following default values"
Created attachment 39496 [details] [review] Followup - instruction for preftype selection removes the now redundant instruction "Note: you should have no reasons to modify the following default values" and replaces it with "Note: change the variable type to one of the dropdown values as needed"
Created attachment 39580 [details] [review] Bug 14268: counter-patch -- dropdown for Variable type The information needed to build the dropdown is already passed. This patch uses it to build the variable type dropdown correctly. TEST PLAN --------- 1) Apply 14135 2) In the staff client: Home -> Global system preferences -> Local use 3) Click 'Edit' on any system preference. 4) Note all the types listed. 5) Click 'Cancel' 6) Apply this patch 7) Click '+New Preference' 8) Enter data to have a decent 'Free' type preference. 9) Click 'Save' 10) For each type noted in step 4 (do 'Free' again last) a) Click 'Edit' for the added system preference -- it should be the last saved variable type. b) Change the variable type to the next type. c) Click 'Save' d) Repeat steps (a) through (c) until all the types have been done. -- NOTE: Yes, there are other strange things here, but those are beyond the scope of this bug. 11) Run koha qa test tools Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com> Signed-off-by: Tadeasm <tadeas.moravec@gmail.com>
Created attachment 39581 [details] [review] Followup - instruction for preftype selection removes the now redundant instruction "Note: you should have no reasons to modify the following default values" and replaces it with "Note: change the variable type to one of the dropdown values as needed" http://bugs.koha-community.org/show_bug.cgi?id=14268 Signed-off-by: Tadeasm <tadeas.moravec@gmail.com>
Created attachment 39589 [details] [review] Bug 14268: Use dropdown for variable types The information needed to build the dropdown is already passed. This patch uses it to build the variable type dropdown correctly. TEST PLAN --------- 1) Apply 14135 2) In the staff client: Home -> Global system preferences -> Local use 3) Click 'Edit' on any system preference. 4) Note all the types listed. 5) Click 'Cancel' 6) Apply this patch 7) Click '+New Preference' 8) Enter data to have a decent 'Free' type preference. 9) Click 'Save' 10) For each type noted in step 4 (do 'Free' again last) a) Click 'Edit' for the added system preference -- it should be the last saved variable type. b) Change the variable type to the next type. c) Click 'Save' d) Repeat steps (a) through (c) until all the types have been done. -- NOTE: Yes, there are other strange things here, but those are beyond the scope of this bug. 11) Run koha qa test tools Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com> Signed-off-by: Tadeasm <tadeas.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Created attachment 39590 [details] [review] Bug 14268: Followup - instruction for preftype selection removes the now redundant instruction "Note: you should have no reasons to modify the following default values" and replaces it with "Note: change the variable type to one of the dropdown values as needed" Signed-off-by: Tadeasm <tadeas.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Patches pushed to master. Thanks Mark and Indranil!