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

Prochaines Sessions

Les prochaines formations et démonstrations sont ouvertes, inscrivez-vous rapidement !

 

Démonstration de ProjeQtOr

(gratuit, sur inscription)
 

13 mai 2025 (10h30-12h)

5 juin 2025 (16h-17h30)

 
 

Planifiez avec ProjeQtOr

14 et 15 mai 2025 (9h-12h30)

18 et 19 juin 2025 (9h-12h30)

 
 

Administrez avec ProjeQtOr

20 et 21 mai (9h-12h30)

25 et 26 juin (9h-12h30)

 

 

 

Screen Customization : eval in default value

More
17 Déc 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 Connexion or Create an account to join the conversation.

More
17 Déc 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 Connexion or Create an account to join the conversation.

More
17 Déc 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 Connexion or Create an account to join the conversation.

More
18 Déc 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 Connexion or Create an account to join the conversation.

More
18 Déc 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 Connexion or Create an account to join the conversation.

More
18 Déc 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 Connexion or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.046 seconds

Paramétrages de cookies

×

Cookies fonctionnels

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

Veuillez vous connecter pour voir vos activités!

Autres cookies

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