Bug 14268 - Change Localsyspref type entry to dropdown
Summary: Change Localsyspref type entry to dropdown
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Indranil Das Gupta
QA Contact: Testopia
URL:
Keywords:
Depends on: 14135
Blocks:
  Show dependency treegraph
 
Reported: 2015-05-25 09:45 UTC by Indranil Das Gupta
Modified: 2016-12-05 21:23 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 14268 - Dropdown to select 'preftype' (2.93 KB, patch)
2015-05-25 11:18 UTC, Indranil Das Gupta
Details | Diff | Splinter Review
Bug 14268: counter-patch -- dropdown for Variable type (4.89 KB, patch)
2015-05-25 19:47 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 14268: counter-patch -- dropdown for Variable type (4.96 KB, patch)
2015-05-25 20:51 UTC, Indranil Das Gupta
Details | Diff | Splinter Review
Followup - remove redundant instruction for preftype (1.14 KB, patch)
2015-05-25 20:55 UTC, Indranil Das Gupta
Details | Diff | Splinter Review
Followup - instruction for preftype selection (1.34 KB, patch)
2015-05-25 21:19 UTC, Indranil Das Gupta
Details | Diff | Splinter Review
Bug 14268: counter-patch -- dropdown for Variable type (5.01 KB, patch)
2015-05-27 10:52 UTC, tadeas.moravec
Details | Diff | Splinter Review
Followup - instruction for preftype selection (1.39 KB, patch)
2015-05-27 10:52 UTC, tadeas.moravec
Details | Diff | Splinter Review
Bug 14268: Use dropdown for variable types (5.07 KB, patch)
2015-05-27 13:44 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 14268: Followup - instruction for preftype selection (1.42 KB, patch)
2015-05-27 13:45 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 (tcohen) 2015-07-24 17:13:02 UTC
Patches pushed to master.

Thanks Mark and Indranil!