View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Support us on Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - Screen Customization : eval in default value - ProjeQtOr
 

Screen Customization : eval in default value

More
17 Dec 2020 18:00 #1 by fsouliers
Hello,

I use Screen Customization plugin, quite often I use the eval trick to set a default value and I now have a problem for which I don't even know how to look for some information :
For the project entity, I would like to set a default value for the description field depending of the type of the project.
Basically I thought something dirty like $this->idProjectType == 173 ? "Specific default val": "really default val" could work ... but no ...

Can anyone give me some help ?

Please Log in or Create an account to join the conversation.

More
17 Dec 2020 18:05 #2 by babynus
I think you should use parenthesis for condition
($this->idProjectType == 173) ? "Specific default val": "really default val"

Possibly you can try also to specifically use $value as result
[code]$value=($this->idProjectType == 173) ? "Specific default val": "really default val"
[/code]

Babynus
Administrator of ProjeQtOr web site

Please Log in or Create an account to join the conversation.

More
17 Dec 2020 20:31 #3 by fsouliers
Well, I have the same result in both cases and it does not work :(
I imagine this is because my project does not exist yet in the database.

But worse, I tried to look at the code and set the default value to
RequestHandler::getValue('idProjectType');
(why ... because I guess I am tired) ... and now I can't even log anymore to Projeqtor, as I have an error "exception occured at {time of the error}" :( :( :(

... how can I unset this change ?
Looking at the code, I thought there was a verification about the viability of the formula .... but it seems it's not enough .... :(

where in the database can I unset this default value ? (I imagine I have to erase a cell in the DB)

Please Log in or Create an account to join the conversation.

More
18 Dec 2020 14:34 #4 by fsouliers
So ...
I changed the file model/custom/Project.php to remove this dumb default value (I set it to a single word).

... but I still can’t connect to Projeqtor anymore ... :(

what happens ?

Please Log in or Create an account to join the conversation.

More
18 Dec 2020 14:53 #5 by babynus
To retreive connection, rename file model/custom/Project.php to model/custom/Project.php.old
Post here this file, we'll have a look

Babynus
Administrator of ProjeQtOr web site

Please Log in or Create an account to join the conversation.

More
18 Dec 2020 15:37 #6 by fsouliers
OK, my second problem is solved : my stupid default value added a "); in the Project.php so all the end of the file was erroneous.

So back to my first problem ... if anybody knows how to set a default value according to the project type, it would be welcome :)

Please Log in or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.044 seconds

Cookies settings

×

Functional Cookies

Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.

Session

Please login to see yours activities!

Other cookies

Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.