The 'Local Use' system preference addition/modification template provides the following options against "Variable Type" - Choice, YesNo, Integer, Textarea, Float, Themes, Languages, Upload or ClassSource. But there is no option presented for "Free" which seems to be the most used variable type out-of-the-box (i.e. INTRAdidyoumean, OPACdidyoumean, UsageStatsID and UsageStatsLastUpdateTime) This trivial patch proposes to modify the systempreferences.tt and add the option 'Free' to the list offered to users.
Created attachment 38816 [details] [review] Bug 14135 [ENH] Adds 'Free' to variabletypes in systempreferences.tt The 'Local Use' system preference addition/modification template provides the following options against "Variable Type" - Choice, YesNo, Integer, Textarea, Float, Themes, Languages, Uplo There is no option presented for "Free" which seems to be the most used variable type out-of-the-box (i.e. INTRAdidyoumean, OPACdidyoumean, UsageStatsID and UsageStatsLastUpdateTime) This trivial patch proposes to modify the systempreferences.tt and add the option 'Free' to the list offered to users. Test Plan ========= 1/ Go to Home > Administration > System preferences > Local use 2/ Click on 'New preference'. 3/ In the fieldset 'Koha Internal', the variable types offered are Choice, YesNo, Integer, Textarea, Float, Themes, Languages, Upload or ClassSources. 4/ Clicking on 'Choice' should set the 'preftype' field as 'Choice'. 5/ Apply this patch. 6/ Refresh the page. 7/ The variable types list should read - "Free, Choice, YesNo, Integer, Textarea, Float, Themes, Languages, Upload or ClassSources". 8/ Clicking on 'Free' should set the 'preftype' field as 'Free'.
This is not an enhancement. It's a bug fix, since Free should have been there in the first place. This is not adding anything new (another type) that wasn't there before, nor is it brand new functionality.
Obviously, Indranil Das Gupta is the bug taker, not Owen Leonard. :)
Created attachment 38903 [details] [review] Bug 14135 Adds 'Free' to variabletypes in systempreferences.tt The 'Local Use' system preference addition/modification template provides the following options against "Variable Type" - Choice, YesNo, Integer, Textarea, Float, Themes, Languages, Upload or There is no option presented for "Free" which seems to be the most used variable type out-of-the-box (i.e. INTRAdidyoumean, OPACdidyoumean, UsageStatsID and UsageStatsLastUpdateTime) This trivial patch proposes to modify the systempreferences.tt and add the option 'Free' to the list offered to users. Test Plan ========= 1/ Go to Home > Administration > System preferences > Local use 2/ Click on 'New preference'. 3/ In the fieldset 'Koha Internal', the variable types offered are Choice, YesNo, Integer, Textarea, Float, Themes, Languages, Upload or ClassSources. 4/ Clicking on 'Choice' should set the 'preftype' field as 'Choice'. 5/ Apply this patch. 6/ Refresh the page. 7/ The variable types list should read - "Free, Choice, YesNo, Integer, Textarea, Float, Themes, Languages, Upload or ClassSources". 8/ Clicking on 'Free' should set the 'preftype' field as 'Free'. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> NOTE: Discovered that there is no validation on the type field. However, that is beyond the scope of this bug.
(In reply to M. Tompsett from comment #3) > Obviously, Indranil Das Gupta is the bug taker, not Owen Leonard. :) Ack! thanks for the cluebat! :P
Created attachment 39206 [details] [review] Bug 14135 - Local Use syspref addition form missing variable type 'Free' Bug 14135 Adds 'Free' to variabletypes in systempreferences.tt The 'Local Use' system preference addition/modification template provides the following options against "Variable Type" - Choice, YesNo, Integer, Textarea, Float, Themes, Languages, Upload or There is no option presented for "Free" which seems to be the most used variable type out-of-the-box (i.e. INTRAdidyoumean, OPACdidyoumean, UsageStatsID and UsageStatsLastUpdateTime) This trivial patch proposes to modify the systempreferences.tt and add the option 'Free' to the list offered to users. Test Plan ========= 1/ Go to Home > Administration > System preferences > Local use 2/ Click on 'New preference'. 3/ In the fieldset 'Koha Internal', the variable types offered are Choice, YesNo, Integer, Textarea, Float, Themes, Languages, Upload or ClassSources. 4/ Clicking on 'Choice' should set the 'preftype' field as 'Choice'. 5/ Apply this patch. 6/ Refresh the page. 7/ The variable types list should read - "Free, Choice, YesNo, Integer, Textarea, Float, Themes, Languages, Upload or ClassSources". 8/ Clicking on 'Free' should set the 'preftype' field as 'Free'. - No issue found in patch work fine
Just a dumb question: What happens if you translate the staff client with these pref types here? Clicking on a translation would still work (insert the original English), but would the user understand? Should we not convert this text box to a select now ?
(In reply to Marcel de Rooy from comment #7) > Just a dumb question: What happens if you translate the staff client with > these pref types here? Clicking on a translation would still work (insert > the original English), but would the user understand? > Should we not convert this text box to a select now ? Actually, that is a valid point. Converting to a drop down selection list would be better. That would also prevent the entry of invalid types. My sign off was to encourage development. :)
Created attachment 39407 [details] [review] Bug 14135 [ENH] Adds 'Free' to variabletypes in systempreferences.tt The 'Local Use' system preference addition/modification template provides the following options against "Variable Type" - Choice, YesNo, Integer, Textarea, Float, Themes, Languages, Uplo There is no option presented for "Free" which seems to be the most used variable type out-of-the-box (i.e. INTRAdidyoumean, OPACdidyoumean, UsageStatsID and UsageStatsLastUpdateTime) This trivial patch proposes to modify the systempreferences.tt and add the option 'Free' to the list offered to users. Test Plan ========= 1/ Go to Home > Administration > System preferences > Local use 2/ Click on 'New preference'. 3/ In the fieldset 'Koha Internal', the variable types offered are Choice, YesNo, Integer, Textarea, Float, Themes, Languages, Upload or ClassSources. 4/ Clicking on 'Choice' should set the 'preftype' field as 'Choice'. 5/ Apply this patch. 6/ Refresh the page. 7/ The variable types list should read - "Free, Choice, YesNo, Integer, Textarea, Float, Themes, Languages, Upload or ClassSources". 8/ Clicking on 'Free' should set the 'preftype' field as 'Free'. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> NOTE: Discovered that there is no validation on the type field. However, that is beyond the scope of this bug. Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com> Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Created attachment 39408 [details] [review] Bug 14135: Adds 'Free' to variabletypes in systempreferences.tt The 'Local Use' system preference addition/modification template provides the following options against "Variable Type" - Choice, YesNo, Integer, Textarea, Float, Themes, Languages, Upload or ClassSource. There is no option presented for "Free" which seems to be the most used variable type out-of-the-box (i.e. INTRAdidyoumean, OPACdidyoumean, UsageStatsID and UsageStatsLastUpdateTime) This trivial patch proposes to modify the systempreferences.tt and add the option 'Free' to the list offered to users. Test Plan ========= 1/ Go to Home > Administration > System preferences > Local use 2/ Click on 'New preference'. 3/ In the fieldset 'Koha Internal', the variable types offered are Choice, YesNo, Integer, Textarea, Float, Themes, Languages, Upload or ClassSources. 4/ Clicking on 'Choice' should set the 'preftype' field as 'Choice'. 5/ Apply this patch. 6/ Refresh the page. 7/ The variable types list should read - "Free, Choice, YesNo, Integer, Textarea, Float, Themes, Languages, Upload or ClassSources". 8/ Clicking on 'Free' should set the 'preftype' field as 'Free'. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> NOTE: Discovered that there is no validation on the type field. However, that is beyond the scope of this bug. Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com> Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Jonathan: See comments above. I would prefer a select instead of adding more text.
Maybe we could switch this to a select on a separate bug? I wonder why it wasn't one in the first place - maybe to allow adding of new types?
(In reply to Katrin Fischer from comment #12) > Maybe we could switch this to a select on a separate bug? I agree. :) This is a good temporary step.
(In reply to comment #11, comment #12 and comment #13) Hi Katrin / Marcel / Mark, my thoughts - bug 14135 fixes a bug, whereas what you all want is an enhancement. 1/ should the QA manager and RM agree, then lets push this into master 2/ open a new bug which proposes to move to a select 3/ have the types read off (perhaps) a yaml file. less hardcoding, more manageable. I've the patch ready for that. what say you?
(In reply to Indranil Das Gupta from comment #14) > I've the patch ready for that. what say you? Yes. Less talk more bug creation. I need a sign off. ;)
Agreeing to 1 and 2. 3 seems a bit overkill as it seems not very likely that we are going to add more types at the moment.
(In reply to Indranil Das Gupta from comment #14) > (In reply to comment #11, comment #12 and comment #13) > > Hi Katrin / Marcel / Mark, > > my thoughts - bug 14135 fixes a bug, whereas what you all want is an > enhancement. > > 1/ should the QA manager and RM agree, then lets push this into master > > 2/ open a new bug which proposes to move to a select > > 3/ have the types read off (perhaps) a yaml file. less hardcoding, more > manageable. > > I've the patch ready for that. what say you? Indranil: Do not keep your patches there, submit them :) I agree with Katrin about point 3.
(In reply to comment #8, comment #11 and comment #16) New dropdown enhancement patch at Bug 14268 Note: has bug 14135 as dependency
(In reply to Marcel de Rooy from comment #17) > (In reply to Indranil Das Gupta from comment #14) > > (In reply to comment #11, comment #12 and comment #13) <snipped> > > 3/ have the types read off (perhaps) a yaml file. less hardcoding, more > > manageable. > > > > I've the patch ready for that. what say you? > > Indranil: Do not keep your patches there, submit them :) > I agree with Katrin about point 3. Ok! so I'm in a loop here again. Based on 14135, we have the following list - 'Free', 'Choice', 'YesNo', 'Integer', 'Textarea', 'Float', 'Themes', 'Languages', 'Upload' and 'ClassSources' On a hunch, I decided to fire `SELECT DISTINCT type FROM systempreferences`. What is got back was : Choice, YesNo, Free, Textarea, multiple, Integer, ClassSources, Languages, File, Themes, NULL, short I can see the 1-to-1 mapping for most of the types, but not all. Can someone take a look and comment?
(In reply to Indranil Das Gupta from comment #19) > Ok! so I'm in a loop here again. ... we have the following list > - 'Free', 'Choice', 'YesNo', 'Integer', 'Textarea', 'Float', 'Themes', > 'Languages', 'Upload' and 'ClassSources' > > On a hunch, I decided to fire `SELECT DISTINCT type FROM systempreferences`. > What is got back was : Choice, YesNo, Free, Textarea, multiple, Integer, > ClassSources, Languages, File, Themes, NULL, short > > I can see the 1-to-1 mapping for most of the types, but not all. Can > someone take a look and comment? I can confirm seeing 'multiple', 'File', '', and 'short'. I believe this is beyond the scope of this patch, though it may merit a clean up bug report. No need to comment or reply on this bug any further. :)
Patch pushed to master. Thanks Indranil!
Pushed to 3.20.x will be in 3.20.2
Pushed to 3.18.x will be in 3.18.09
Pushed to 3.16.x, will be in 3.16.13