Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.

Moderator: amosbatto

Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
#815220
Hello

I am a Beginner here so I ask for your patience.

I need to obtain and save into variables the name of user, username an email in order to show them in my dynaform.
I think this should be made in "Edit" part of the dynaform but I do not have clear how the code should be write to do it.
I am using ProcessMaker 3
Please would you give me some examples?

really thanks
#815223
Create three text fields in your Dynaform which are associated with the variables "username", "name" and "email".

Then, create the following trigger:
Code: Select all
$aUser = userInfo(@@USER_LOGGED);
@@username = $aUser['username'];
@@name = $aUser['firstname'] .' '. $aUser['lastname'];
@@email = $aUser['mail'];
Set this trigger to execute before the Dynaform in the "Steps" of the task.
See: http://wiki.processmaker.com/3.1/Proces ... Info.28.29
#824727
Is there anything special we need to do to get this to work with a Web Entry form? Our users have the ability to login via SSO via SAML and we would like to have their names prepopulate in the forms. I've tried the code above in a trigger before the dynaform and tested it out, but it doesn't seem to work.
#824728
incitegraphics wrote:Is there anything special we need to do to get this to work with a Web Entry form? Our users have the ability to login via SSO via SAML and we would like to have their names prepopulate in the forms. I've tried the code above in a trigger before the dynaform and tested it out, but it doesn't seem to work.
Have you tried using the Single Sign On feature in the Enterprise Edition? If you combine that with the "Require user login" option in the Web Entry properties, then you should be able to obtain the username of the logged-in user.

If you marked the option "Authentication" > "Require User Login" in the Web Entry properties, then you can get the username of the logged-in user with this JavaScript code in the Web Entry's Dynaform and place the username in a textbox whose ID is "loggedUser":
Code: Select all
var loggedUsername = $("#userInformation", top.document).text().match(/\((\w*)\)/)[1];
$("#loggedUser").setValue( loggedUsername );

Genial!!! gracias. :D i need to translate an[…]

Are you sure that you only have one case open at[…]

Deleting the processes.

Are you sure that you are using version 1.245 f[…]

Changing the login page

In your pmos.conf, try changing from: Redir[…]