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

Holbok István holbok at gmail.com
Mon Jul 14 17:55:50 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");

         }

But this method did not work as the http header is already sent.

For example in Joomla CMS MVC pattern there is the built in redirect 
method to set redirect URL and redirect to a new URL inside the program.

I did not find how to do the similar redirect in the vtiger MVC hierarchy.

Is there any suggestion how to do it? What is the best way?

Other way to do the wanted function is to create a modal popup window 
instead of the redirect in this place.
But I also did not find a way to create a modal popup window in 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/8fe43db8/attachment.html>


More information about the vtigercrm-developers mailing list