The url name field of Contact record has a return_module = Contacts and action=DetailView. How do I change it to have return_module=MyModule and action=SomeAction?
Thanks,
Tri
The url name field of Contact record has a return_module = Contacts and action=DetailView. How do I change it to have return_module=MyModule and action=SomeAction?
Thanks,
Tri
I haven't tried this - so it's a guess.
But essentially those values are passed in the request data. You should be able to overwrite them with an after_retrieve logic hook for the contact module. This happens before the screen is drawn so the hidden values on the screen form should get updated.
If you try it, let me know if it works!
T H E S U G A R R E F I N E R Y ™
: : : SugarCrm Customisation and Integration Services : : :
SugarCRM Systems Integration Partner
Trusted with SugarCRM
http://www.theSugarRefinery.com ::: sales@{removethis}theSugarRefinery.com
What php file do I need to open to do what you've suggested?
I thought there's an easy way to do it. Like make changes to Contact/listviewdefs.php.
Thanks for the help,
Tri
Originally Posted by eNick
Hi Tri,
I just tried out what I said.
Changing the return module and action, in the way I suggested, works well for the Cancel button but totally breaks the Save button.
You could change the listview def to do this I guess.
T H E S U G A R R E F I N E R Y ™
: : : SugarCrm Customisation and Integration Services : : :
SugarCRM Systems Integration Partner
Trusted with SugarCRM
http://www.theSugarRefinery.com ::: sales@{removethis}theSugarRefinery.com
I got this to work.
What I did to make it work is to create a new template for contact module, a copy from ListViewGeneric.tpl.
Here are the changes I've made:
==============MVC/View/views/view.list.php
if($this->module == 'Contacts') {
$lv->setup($seed, 'modules/Contacts/tpls/ContactListView.tpl', $where, $params);
}
==============
=============='modules/Contacts/tpls/ContactListView.tpl
<{$pageData.tag.$id[$params.ACLTag]|default:$pageData.tag.$id.MAIN} href="#" onMouseOver="javascript:lvg_nav('{if $params.dynamic_module}{$rowData[$params.dynamic_module]}{else}{$params.module|default:$pageData.bean.modu leDir}{/if}', '{$rowData[$params.id]|default:$rowData.ID}', 'MyAction', {$offset}, this)" onFocus="javascript:lvg_nav('{if $params.dynamic_module}{$rowData[$params.dynamic_module]}{else}{$params.module|default:$pageData.bean.modu leDir}{/if}', '{$rowData[$params.id]|default:$rowData.ID}', 'MyAction', {$offset}, this)" class='listViewTdLinkS1'>{$rowData.$col}</{$pageData.tag.$id[$params.ACLTag]|default:$pageData.tag.$id.MAIN}>
...
{literal}function lvg_nav(m,id,act,offset,t){if(t.href.search(/#/) < 0){return;}else{if(act=='d'){ act='DetailView';}else if(act=='MyAction'){ act='MyAction';}else{ act='EditView';}{/literal}url = 'index.php?module='+m+'&offset=' + offset + '&stamp={$pageData.stamp}&return_module={$pageData .bean.moduleDir}&action='+act+'&record='+id;t.href =url;{literal}}}{/literal}
==============
I couldn't make it to work with the other methods, changes to listviewdefs or eNick's suggestion.
But I dont know if this is a good way to do it. Anyway, hope it helps for someone facing the same problem.
-Tri
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks