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.
#790233
How to skip Previous Step page on Processmaker?
Attachments
Screen Shot 2017-04-11 at 2.41.46 PM.png
Screen Shot 2017-04-11 at 2.41.46 PM.png (32.3 KiB) Viewed 1586 times
Screen Shot 2017-04-11 at 2.41.46 PM.png
Screen Shot 2017-04-11 at 2.41.46 PM.png (32.3 KiB) Viewed 1586 times
#790242
Hello rayigo,

If you want the hide the screen shown in the Screenshots, you need to create a trigger with the following code:
Code: Select all
PMFDerivateCase(@@APPLICATION, @%INDEX);
G::header("Location: casesListExtJsRedirector");
die();
The task, where you want to hide this trigger, set this trigger to fire Before Assignment.

Hope this helps.

Best Regards,
Zainab Sabunwala
#790252
You can permanently remove the "Previous Step" link, by editing the file workflow/engine/templates/cases/cases_ScreenDerivation.html and changing the code from:
Code: Select all
                  {if $PREVIOUS_PAGE}
                  <td valign='top' class='tableOption' width='33%' align="left">
                  <table cellspacing="0" cellpadding="0" width='100%'>
                    <tr>
                      <td class='tableOption' align="left" width="120"><img src="/images/bulletButtonLeft.gif" width="6" />&nbsp; <a class="tableOption" href='{$PREVIOUS_PAGE}' id="form[DYN_BACKWARD]" name="form[DYN_BACKWARD]" onclick="">{$PREVIOUS_PAGE_LABEL}</a></td>
                      <td class='tableOption'>&nbsp;</td>
                    </tr>
                  </table>
                  </td>
                  {/if}
To:
Code: Select all
                  <!--
                  {if $PREVIOUS_PAGE}
                  <td valign='top' class='tableOption' width='33%' align="left">
                  <table cellspacing="0" cellpadding="0" width='100%'>
                    <tr>
                      <td class='tableOption' align="left" width="120"><img src="/images/bulletButtonLeft.gif" width="6" />&nbsp; <a class="tableOption" href='{$PREVIOUS_PAGE}' id="form[DYN_BACKWARD]" name="form[DYN_BACKWARD]" onclick="">{$PREVIOUS_PAGE_LABEL}</a></td>
                      <td class='tableOption'>&nbsp;</td>
                    </tr>
                  </table>
                  </td>
                  {/if}
                  -->
The problem is that this eliminates the Previous Step link for ALL processes. If you only want to eliminate the link for certain processes, then you need to add code like this to workflow/engine/methods/cases/cases_Step.php. In line 777, change this code:
Code: Select all
        case 'ASSIGN_TASK':
            $oDerivation = new Derivation();
            $oProcess = new Process();
            $aData = $oCase->loadCase( $_SESSION['APPLICATION'] );

            $aFields['PROCESS'] = $oProcess->load( $_SESSION['PROCESS'] );
            $aFields['PREVIOUS_PAGE'] = $aPreviousStep['PAGE'];
Add a array of IDs for processes which should not have the "Previous Step" link displayed:
Code: Select all
        case 'ASSIGN_TASK':
            //set to the IDs of processes which should not display the Previous Step link:
            $aProcessesNoPreviousLink = array(
               '12067430558ded97f8666c8026604805', 
               '20419177758dec3f7bedd17038026045', 
               '34414124958d30cc2853ae9014839646'
            );
            $oDerivation = new Derivation();
            $oProcess = new Process();
            $aData = $oCase->loadCase( $_SESSION['APPLICATION'] );

            $aFields['PROCESS'] = $oProcess->load( $_SESSION['PROCESS'] );
            if (in_array($_SESSION['PROCESS'], $aProcessesNoPreviousLink))
               $aFields['PREVIOUS_PAGE'] = null;
            else
               $aFields['PREVIOUS_PAGE'] = $aPreviousStep['PAGE'];

As you have got seen that after every single updat[…]

issue with processmaker 3.2

Hello! The solution to your question is the foll[…]

BPMN project disappeared

Hi Alex! , maybe you forgot to save your process[…]

mcrypt extension is deprecated!

Hello Ehsan! If you did not find the mcrypt ext[…]