Change web entry information screen in hosted version

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.
mkloepper
Posts: 2
Joined: Mon Oct 23, 2017 3:54 pm
Country: Germany

Change web entry information screen in hosted version

Unread postby mkloepper » Mon Oct 23, 2017 4:06 pm

Hi all,
I'm evaluating ProcessMaker 3.2 in the hosted version.
My boss insists that we could only use the software if there is any way to customize or at least translate the information screen that is shown after creating a case via web entry.

Since we use the hosted version I can't modify the xxxPost.php files. When trying to redirect via G::Header I get an error message, that no XML data could be received.

I would appreciate if anyone could guide me on how to customize or translate the info screen.

Greetings,
Matthias

amosbatto
Posts: 5564
Joined: Mon Jun 22, 2009 10:28 am
Country: Bolivia
Location: La Paz

Re: Change web entry information screen in hosted version

Unread postby amosbatto » Tue Oct 24, 2017 12:26 am

I see that you already figured out that you need to change this file:
<INSTALL-DIRECTORY>/shared/sites/<WORKSPACE>/public/<PROCESS-UID>/<STARTING-EVENT-UID>Post.php
These examples might help you:
viewtopic.php?f=41&t=712867&p=794179&hilit=web+entry#p794179
viewtopic.php?f=41&t=713347

Note: If you change the settings of your web entry, the xxxxPost.php file will be overwritten, so make a backup.

If you are a client that is paying for hosting service with ProcessMaker, Inc., you can give us the custom xxxPost.php file to place on the server. If you aren't planning on using our hosting service, then you should probably do your own installation of PM on your own server so you can do these modifications.

If all you want to do is submit the web entry form and then redirect to another page, then you can add this JavaScript to your DynaForm:

Code: Select all

if ($("#dyn_forward").length) {
  $("#dyn_forward").parent().hide();
}

$("#redirectButton").click(function() {
   $("form").submitForm();
   location.href = "http://example.com/"; //change URL
})

Where "redirectButton" is the ID of a generic button.

Here is a sample process that you can try:
Check_web_entry-1.pmx
(28.57 KiB) Downloaded 6 times


The problem with using this JavaScript is that there is no way to know the case number and assigned user of the case that was just created. If you want that information, the only solution is to change the xxxxPost.php file.
Amos B. Batto ♦ ProcessMaker Technical Documentation Writer & Forum Manager ♦ Cofounder of ILLA (http://www.illa-a.org)

mkloepper
Posts: 2
Joined: Mon Oct 23, 2017 3:54 pm
Country: Germany

Re: Change web entry information screen in hosted version

Unread postby mkloepper » Tue Oct 24, 2017 3:43 am

Good morning and thank you very much for your help which is appreciated very much.

There seems to be one little problem with our code:
Running only the code you provided I get redirected to the desirec webpage but no new case is created in ProcessMaker. I could solve that problem by integrating a tiny relay into the code:

Code: Select all

$("#submitRequestCustom").click(function() {
  $("form").submitForm();
  setTimeout(function(){location.href="http://www.ba-com.net";}, 1);                                   
})


Is this solution the way to go? Or did I miss something with the code you provided?

Greetings and thanks again,
Mattias

amosbatto
Posts: 5564
Joined: Mon Jun 22, 2009 10:28 am
Country: Bolivia
Location: La Paz

Re: Change web entry information screen in hosted version

Unread postby amosbatto » Tue Oct 24, 2017 4:54 pm

mkloepper wrote:Running only the code you provided I get redirected to the desirec webpage but no new case is created in ProcessMaker. I could solve that problem by integrating a tiny relay into the code:

Code: Select all

$("#submitRequestCustom").click(function() {
 $("form").submitForm();
 setTimeout(function(){location.href="http://www.ba-com.net";}, 1);
})

Is this solution the way to go? Or did I miss something with the code you provided?

Yes, it's a good idea to use a timeout.
It's strange that I didn't see that problem, but I'm working on a laptop with a Celeron processor, so maybe it takes my computer longer to execute the JavaScript than yours.
Amos B. Batto ♦ ProcessMaker Technical Documentation Writer & Forum Manager ♦ Cofounder of ILLA (http://www.illa-a.org)


Return to “Developing processes & programming”

Who is online

Users browsing this forum: No registered users and 2 guests