[Vtigercrm-developers] [2.] How to redirect a view in vtiger 6.1 ?

Holbok István holbok at gmail.com
Mon Jul 14 19:07:20 GMT 2014


Dear Vtiger Community,

I would like to redirect a view in vtiger 6.1. What is the best 
suggested way to do it?

Case:
There is an event handler registered to the Contacts (standard) module 
in my Custom module.
The Save action in the Contacts module triggered the event handler and I 
could see, the program executed. The red line log the info to the logfile.

         if($eventName == 'vtiger.entity.aftersave') {
             // Entity has been saved, take next action
*$log->debug('Contacts: vtiger.entity.aftersave --- fired in 
Custommodule directory');*

            // Check some conditions

              // If the conditions true, redirect the view
             $redirectUrl = 
'index.php?module=*Custommodule*&view=*Customview*';
             header("Location: $redirectUrl");
*exit();*

         }

Adding the command *exit();* after the line of header the redirection 
started work.

But the question is still exist: *Is this way the best method to change 
vtiger view depending a condition?*


Other question is: How to do different modal popup windows related to 
the 'vtiger.entity.aftersave' event of the Contacts module without 
rewriting the original code?

Any suggestion is appreciated.

Kindest regards:
Istvan


-- 
üdvözlettel:

*Holbok István*

+3670-342-0900
*e-mail:* holbok at gmail.com
*SkyPe:* holboki

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20140714/46358c7e/attachment.html>


More information about the vtigercrm-developers mailing list