Bug 14268

Summary: Change Localsyspref type entry to dropdown
Product: Koha Reporter: Indranil Das Gupta <indradg>
Component: TemplatesAssignee: Indranil Das Gupta <indradg>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: mtompset, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 14135    
Bug Blocks:    
Attachments: Bug 14268 - Dropdown to select 'preftype'
Bug 14268: counter-patch -- dropdown for Variable type
Bug 14268: counter-patch -- dropdown for Variable type
Followup - remove redundant instruction for preftype
Followup - instruction for preftype selection
Bug 14268: counter-patch -- dropdown for Variable type
Followup - instruction for preftype selection
Bug 14268: Use dropdown for variable types
Bug 14268: Followup - instruction for preftype selection

Description Indranil Das Gupta 2015-05-25 09:45:59 UTC
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.
Comment 1 Indranil Das Gupta 2015-05-25 11:18:08 UTC Comment hidden (obsolete)
Comment 2 Mark Tompsett 2015-05-25 17:50:31 UTC
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.
Comment 3 Mark Tompsett 2015-05-25 17:51:12 UTC
Moving back to ASSIGNED due to comment #2.
Comment 4 Mark Tompsett 2015-05-25 19:47:07 UTC Comment hidden (obsolete)
Comment 5 Indranil Das Gupta 2015-05-25 20:51:10 UTC Comment hidden (obsolete)
Comment 6 Indranil Das Gupta 2015-05-25 20:55:49 UTC Comment hidden (obsolete)
Comment 7 Indranil Das Gupta 2015-05-25 21:19:56 UTC Comment hidden (obsolete)
Comment 8 tadeas.moravec 2015-05-27 10:52:20 UTC Comment hidden (obsolete)
Comment 9 tadeas.moravec 2015-05-27 10:52:25 UTC Comment hidden (obsolete)
Comment 10 Jonathan Druart 2015-05-27 13:44:58 UTC
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>
Comment 11 Jonathan Druart 2015-05-27 13:45:04 UTC
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>
Comment 12 Tomás Cohen Arazi 2015-07-24 17:13:02 UTC
Patches pushed to master.

Thanks Mark and Indranil!