Function for multivaluated syspref

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Function for multivaluated syspref

Baptiste Wojtkowski
Hi,

Is there any function to check if a value is checked in a multivaluated
syspref ? I don't see any and the few multivaluated function I saw seem
using long template line code to do this simple thing.

Could this be a good idea to write one ?

Baptiste

_______________________________________________
Koha-devel mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

Re: Function for multivaluated syspref

Jonathan Druart
Hello Baptiste,

Are you talking about prefs like OpacAdvSearchOptions?
It's not mandatory to have at least one option, so I do not think it's is a good idea :)

Cheers,
Jonathan

On Thu, 2 Mar 2017 at 13:32 Baptiste Wojtkowski <[hidden email]> wrote:
Hi,

Is there any function to check if a value is checked in a multivaluated
syspref ? I don't see any and the few multivaluated function I saw seem
using long template line code to do this simple thing.

Could this be a good idea to write one ?

Baptiste

_______________________________________________
Koha-devel mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

_______________________________________________
Koha-devel mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

Re: Function for multivaluated syspref

Jonathan Druart
Baptiste,
Do not forget to answer to the list :)
I do not think that would bring a big improvement, what code do you want to simplify?

On Tue, 7 Mar 2017 at 13:42 Baptiste Wojtkowski <[hidden email]> wrote:

Hi,

Indeed I talk about this syspref for example

I mean a function like : inPref('myPref', ''myValue") which returns true if MyValue is checked, instead of split around comas or using a grep ;) In order to have the same function as Preference, but for multivaluated function.

I would like to have some function to check directly if the value I need to do a specific action is Checked, and I don't see how it is a problem, even if it's not mandatory to have at least one option ;)

Cheers,

Baptiste


Le 07/03/2017 à 17:00, Jonathan Druart a écrit :
Hello Baptiste,

Are you talking about prefs like OpacAdvSearchOptions?
It's not mandatory to have at least one option, so I do not think it's is a good idea :)

Cheers,
Jonathan

On Thu, 2 Mar 2017 at 13:32 Baptiste Wojtkowski <[hidden email]> wrote:
Hi,

Is there any function to check if a value is checked in a multivaluated
syspref ? I don't see any and the few multivaluated function I saw seem
using long template line code to do this simple thing.

Could this be a good idea to write one ?

Baptiste

_______________________________________________
Koha-devel mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


_______________________________________________
Koha-devel mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


_______________________________________________
Koha-devel mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

Re: Function for multivaluated syspref

Jonathan Druart
Is that the long template lines you are talking about?
OpacAdvSearchOptions     and OpacAdvSearchOptions.grep('itemtype').size > 0

On Tue, 7 Mar 2017 at 14:33 Jonathan Druart <[hidden email]> wrote:
Baptiste,
Do not forget to answer to the list :)
I do not think that would bring a big improvement, what code do you want to simplify?


On Tue, 7 Mar 2017 at 13:42 Baptiste Wojtkowski <[hidden email]> wrote:

Hi,

Indeed I talk about this syspref for example

I mean a function like : inPref('myPref', ''myValue") which returns true if MyValue is checked, instead of split around comas or using a grep ;) In order to have the same function as Preference, but for multivaluated function.

I would like to have some function to check directly if the value I need to do a specific action is Checked, and I don't see how it is a problem, even if it's not mandatory to have at least one option ;)

Cheers,

Baptiste


Le 07/03/2017 à 17:00, Jonathan Druart a écrit :
Hello Baptiste,

Are you talking about prefs like OpacAdvSearchOptions?
It's not mandatory to have at least one option, so I do not think it's is a good idea :)

Cheers,
Jonathan

On Thu, 2 Mar 2017 at 13:32 Baptiste Wojtkowski <[hidden email]> wrote:
Hi,

Is there any function to check if a value is checked in a multivaluated
syspref ? I don't see any and the few multivaluated function I saw seem
using long template line code to do this simple thing.

Could this be a good idea to write one ?

Baptiste

_______________________________________________
Koha-devel mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


_______________________________________________
Koha-devel mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


_______________________________________________
Koha-devel mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/