Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

[SOLVED] Screen Cus...
 
Notifications
Clear all

[SOLVED] Screen Customization Plugin Question

7 Posts
3 Users
0 Reactions
7,771 Views
(@karl-binet)
Posts: 128
Active Member
Topic starter
 
[#5063]

Hi,

I'm using the screen customization plugin to set fields as required when creating a project for example.

By default, when setting a field to "Required", when i create a new project, the field is required but there is a default value in the field.

To me, the purpose of setting a field "Required" is to force the user to select the value in this field, since there is a default value in the field, the user can forget to change the value and save the project without even modifiying the required field.

Is there a way to set the field as required but leave the field BLANK to force the user to populate the field before saving a new project ?

Projeqtor version V7.0.1
ScreenCustomization V5.1

Regards

Karl


 
Posted : 04 Apr 2018 18H28
(@alain-fourastie)
Posts: 366
Active Member Moderator
 

HI,

This is default behaviour of all required fields in ProjeQtOr. Field as Combolist is always initialized as first item of the list.

Anyway, there is a tricky workaround with screen customization plugin : enter default value as
###EVAL###$value=" "
The value will be set to space.
I tested right now, it works as you expected.


 
Posted : 04 Apr 2018 18H53
(@karl-binet)
Posts: 128
Active Member
Topic starter
 

hi Alainforma,

thanks for the reply,

Your solution is working but for some field i'm getting an error,

first, field organisation in project, when i enter your value, i get this screen when i create a new project

and this error in the log file

2018-04-04 13:09:41.801 ** ERROR ** [V7.0.1] ERROR **
2018-04-04 13:09:41.801
** ERROR ** [V7.0.1] on file '/var/www/html/tool/html.php' at line (571)
2018-04-04 13:09:41.801
** ERROR ** [V7.0.1] cause = Undefined index:

second field, manager in project, when i enter your value, i get this error when i save in screen customization

and this error in the log file

2018-04-04 13:16:01.771 ** ERROR ** [V7.0.1] ERROR **
2018-04-04 13:16:01.771 ** ERROR ** [V7.0.1] on file '/var/www/html/tool/formatter.php' at line (186)
2018-04-04 13:16:01.771 ** ERROR ** [V7.0.1] cause = A non-numeric value encountered

any other workaround ? maybe an issue ?

Regards

Karl


 
Posted : 04 Apr 2018 21H19
babynus
(@babynus)
Posts: 14953
Main Contributor Admin
 

Hi,

This is because workaround used " " as default value, but some formatting function expects it to be numeric

Try and replace line 186 in tool/formatter.php from

$ind=($idUser)?$idUser%count($arrayColors):0;

to

$ind=(trim($idUser))?$idUser%count($arrayColors):0;

 
Posted : 05 Apr 2018 2H16
(@karl-binet)
Posts: 128
Active Member
Topic starter
 

Hi Babynus,

Your suggested modification of formater.php worked for the field manager, but i'm still having an error with the Organization Field,

Getting this error in log file

2018-04-05 08:39:32.396 ** ERROR ** [V7.0.1] ERROR **
2018-04-05 08:39:32.396
** ERROR ** [V7.0.1] on file '/var/www/html/tool/html.php' at line (571)
2018-04-05 08:39:32.396
** ERROR ***** [V7.0.1] cause = Undefined index:

Any other suggestions ?

Also, do I need to write down the modification of the file formater.php, or it will be included in futur version ?

Regards

Kaarl


 
Posted : 05 Apr 2018 16H52
babynus
(@babynus)
Posts: 14953
Main Contributor Admin
 

Replace line 570 (or about) in /tool/html.php from

      if ($col=="idOrganization" and $sepChar!='no') { 

to

      if ($col=="idOrganization" and $sepChar!='no' and isset($orgaList[$key])) { 

 
Posted : 06 Apr 2018 21H47
(@karl-binet)
Posts: 128
Active Member
Topic starter
 

Hi Babynus

Thanks, everything is working.


 
Posted : 09 Apr 2018 21H36
Share:

Scroll to Top