<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>
<b><font color="#000099"> exit();</font></b><br>
<br>
}<br>
<br>
Adding the command <b><font color="#000099">exit();</font></b>
after the line of header the redirection started work.<br>
<br>
But the question is still exist: <b>Is this way the best method to
change vtiger view depending a condition?</b><br>
<br>
<br>
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?<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>