<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body smarttemplateinserted="true" text="#000000" bgcolor="#FFFFFF">
Dear Vtiger Community,<br>
<br>
I would like to redirect a view in vtiger 6.1. What is the best
suggested way to do it?<br>
<br>
Case:<br>
There is an event handler registered to the Contacts (standard)
module in my Custom module.<br>
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.<br>
<br>
if($eventName == 'vtiger.entity.aftersave') {<br>
// Entity has been saved, take next action<br>
<b><font color="#cc0000">$log->debug('Contacts:
vtiger.entity.aftersave --- fired in Custommodule directory');</font></b><br>
<br>
// Check some conditions<br>
<br>
// If the conditions true, redirect the view<br>
$redirectUrl = 'index.php?module=<b><font
color="#cc0000">Custommodule</font></b>&view=<b><font
color="#cc0000">Customview</font></b>';<br>
header("Location: $redirectUrl");<br>
<br>
}<br>
<br>
But this method did not work as the http header is already sent.<br>
<br>
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.<br>
<br>
I did not find how to do the similar redirect in the vtiger MVC
hierarchy.<br>
<br>
Is there any suggestion how to do it? What is the best way?<br>
<br>
Other way to do the wanted function is to create a modal popup
window instead of the redirect in this place.<br>
But I also did not find a way to create a modal popup window in the
Contacts module without rewriting the original code.<br>
<br>
Any suggestion is appreciated.<br>
<br>
Kindest regards:<br>
Istvan<br>
<br>
<br>
<div class="moz-signature">-- <br>
üdvözlettel:<br>
<br>
<b>Holbok István</b><br>
<br>
+3670-342-0900<br>
<b>e-mail:</b> <a class="moz-txt-link-abbreviated" href="mailto:holbok@gmail.com">holbok@gmail.com</a><br>
<b>SkyPe:</b> holboki<br>
<br>
</div>
</body>
</html>