Bug 14707 - Change UsageStatsCountry from free text to a dropdown list
Summary: Change UsageStatsCountry from free text to a dropdown list
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low trivial (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 11926
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-21 14:41 UTC by Julian FIOL
Modified: 2017-06-14 22:13 UTC (History)
8 users (show)

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


Attachments
Bug 14707 : Replace UsageStatsCountry and UsageStatsLibraryType syspref from free text to a dropdown list. This will avoid syntax problems with Hea when a user will fill this 2 sysprefs (13.38 KB, patch)
2015-08-21 14:46 UTC, Julian FIOL
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 14707 : Replace UsageStatsCountry and UsageStatsLibraryType syspref from free text to a dropdown list. (13.55 KB, patch)
2015-11-17 17:41 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 14707 : Replace UsageStatsCountry syspref from free text to a dropdown list. (13.59 KB, patch)
2016-09-14 10:10 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 14707: Update existing installations and correct wrong values (3.31 KB, patch)
2016-09-14 10:10 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 14707: Update existing installations and correct wrong values (3.31 KB, patch)
2016-09-14 12:00 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 14707 : Replace UsageStatsCountry syspref from free text to a dropdown list. (13.59 KB, patch)
2016-09-18 08:16 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 14707: Update existing installations and correct wrong values (3.31 KB, patch)
2016-09-18 08:16 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Julian FIOL 2015-08-21 14:41:50 UTC
This patch avoid issues with Hea.
With Bug 14608 we add UsageStatsCountry and UsageStatsLibraryType in the stats for Hea (http://hea.koha-community.org/).
But if this 2 syspref are free text, we could have some syntax issues.
(ex : US / United States / USA will be count in 3 different country)
This patch is supposed to normalize the country and type possibilities.

The default choice for UsageStatsLibraryType and UsageStatsCountry is 'empty'
    
Test Plan
---------
    
1. Create a new Koha install
2. Go to the 'Administration' page
3. Go to 'Global system preferences'
4. Go to 'Administration'
5. At the end of this page you should see a dropdown menu for
    - UsageStatsCountry with all countries
    - UsageStatsLibraryType with all type of library
    They both should be empty by default.
Comment 1 Julian FIOL 2015-08-21 14:46:42 UTC Comment hidden (obsolete)
Comment 2 Tomás Cohen Arazi 2015-08-21 14:47:05 UTC
Is it a good idea to have a country dropdown?
Comment 3 Julian FIOL 2015-08-24 08:08:13 UTC
Hi Tomás, 

We need to standardize users answers for 'country' and 'type' to avoid Hea issues. 

Why do you think a country dropdown would be a bad idea ?

Do you have another solution in mind ?

Thanks
Comment 4 Katrin Fischer 2015-09-01 19:40:48 UTC
Hm, UsageStatsLibraryType already is a drop down, without this patch for me? 
I am also a bit worried about the country, because how complete of a list can we get and where?
Comment 5 Julian Maurice 2015-09-02 06:43:00 UTC
(In reply to Katrin Fischer from comment #4)
> Hm, UsageStatsLibraryType already is a drop down, without this patch for me?

Probably an error in the commit message, the patch only adds en empty choice for UsageStatsLibraryType
 
> I am also a bit worried about the country, because how complete of a list
> can we get and where?

Even if we can't be sure we have the exhaustive list of countries, I think it is still better than having all possible forms of USA counted as different countries, not to mention spelling mistakes.
Comment 6 Katrin Fischer 2015-09-02 07:18:07 UTC
I have to admit... I don't see a better solution :) Translating all those countries is a bit of a scary thought tho...
Comment 7 Mark Tompsett 2015-09-09 04:14:48 UTC
There is no atomic update perl script which attempts to match the list to ensure it is in the drop down data set, because an upgrade won't necessarily be in the list. Isn't this a problem?
Comment 8 Bernardo Gonzalez Kriegel 2015-11-17 17:41:20 UTC Comment hidden (obsolete)
Comment 9 Katrin Fischer 2015-11-18 21:46:20 UTC
Hm, wondering:

1) The changes for the library type don't match up:
societyAssoc: "society or association"
vs
societyAssociation

2) How can we handle installations that already have the preference set up, but the setting doesn't match one of the provided countries?

3) Please correct bug title and commit message - UsageStatsLibraryType already is a pull down on master.
Comment 10 Jonathan Druart 2016-09-14 09:58:20 UTC
I am going to work on this one.
Comment 11 Jonathan Druart 2016-09-14 10:10:21 UTC
Created attachment 55550 [details] [review]
Bug 14707 : Replace UsageStatsCountry syspref from free text to a dropdown list.

This will avoid syntax problems with Hea when a user will fill this 2 sysprefs

The default choice for UsageStatsLibraryType and UsageStatsCountry is 'empty'

Test Plan
---------

1. Create a new Koha install
2. Go to the 'Administration' page
3. Go to 'Global system preferences'
4. Go to 'Administration'
5. At the end of this page you should see a dropdown menu for
- UsageStatsCountry with all countries
- UsageStatsLibraryType with all type of library
They both should be empty by default.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Not a complete list but is a start
Lots of new strings to translate :)
No errors

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 12 Jonathan Druart 2016-09-14 10:10:25 UTC Comment hidden (obsolete)
Comment 13 Jonathan Druart 2016-09-14 10:11:16 UTC
We need this one to avoid other people to enter wrong data.
Please QA, push and backport it ASAP.
Comment 14 Jonathan Druart 2016-09-14 12:00:58 UTC
Created attachment 55552 [details] [review]
Bug 14707: Update existing installations and correct wrong values

See http://hea.koha-community.org/, the countries are filled is wrong
values.
If we decide to update the free text with a dropdown list, we need to
handle these wrong data.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 15 Katrin Fischer 2016-09-18 08:16:24 UTC
Created attachment 55637 [details] [review]
Bug 14707 : Replace UsageStatsCountry syspref from free text to a dropdown list.

This will avoid syntax problems with Hea when a user will fill this 2 sysprefs

The default choice for UsageStatsLibraryType and UsageStatsCountry is 'empty'

Test Plan
---------

1. Create a new Koha install
2. Go to the 'Administration' page
3. Go to 'Global system preferences'
4. Go to 'Administration'
5. At the end of this page you should see a dropdown menu for
- UsageStatsCountry with all countries
- UsageStatsLibraryType with all type of library
They both should be empty by default.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Not a complete list but is a start
Lots of new strings to translate :)
No errors

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 16 Katrin Fischer 2016-09-18 08:16:52 UTC
Created attachment 55638 [details] [review]
Bug 14707: Update existing installations and correct wrong values

See http://hea.koha-community.org/, the countries are filled is wrong
values.
If we decide to update the free text with a dropdown list, we need to
handle these wrong data.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 17 Kyle M Hall 2016-09-27 11:16:46 UTC
Pushed to master for 16.11, thanks Jonathan!
Comment 18 Frédéric Demians 2016-09-30 09:03:22 UTC
Pushed in 16.05. Will be in 16.05.05.
Comment 19 Julian Maurice 2016-10-14 12:33:20 UTC
Pushed to 3.22.x, will be in 3.22.12
Comment 20 Marc Véron 2016-10-24 08:17:43 UTC
Question regarding translating:

Should the translations keep the English names?
Comment 21 Mark Tompsett 2016-10-24 10:03:11 UTC
(In reply to Marc Véron from comment #20)
> Question regarding translating:
> 
> Should the translations keep the English names?

Trinidad & Tob. -- why not Tobago in full?
CZ and GR were mapped to words. -- Why not "{description} ({code})"?
In fact, why not everything just {code}?

Why isn't the system preferences the code, and the pref file the one with the '{code}: "{description} ({code})"'?

The description and code will make it easier to switch when dealing with a foreign UI language. There is nothing worse than changing your language in your electronics and not being able to figure out how to get back to the one you understand, because you can't read it.

I think perhaps this should be a follow up bug?