Results 1 to 5 of 5

Thread: How do you change the url of contact's listview?

  1. #1
    gtg182s is offline Member
    Join Date
    Jun 2008
    Posts
    11

    Default How do you change the url of contact's listview?

    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

  2. #2
    eNick is offline Sugar Community Member
    Join Date
    Apr 2008
    Location
    UK
    Posts
    282

    Default Re: How do you change the url of contact's listview?

    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

  3. #3
    gtg182s is offline Member
    Join Date
    Jun 2008
    Posts
    11

    Default Re: How do you change the url of contact's listview?

    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

    Quote Originally Posted by eNick
    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!

  4. #4
    eNick is offline Sugar Community Member
    Join Date
    Apr 2008
    Location
    UK
    Posts
    282

    Default Re: How do you change the url of contact's listview?

    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

  5. #5
    gtg182s is offline Member
    Join Date
    Jun 2008
    Posts
    11

    Default Re: How do you change the url of contact's listview?

    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. how to change sugarcrm access url?
    By ineedhelp in forum Installation and Upgrade Help
    Replies: 4
    Last Post: 2011-05-23, 08:56 PM
  2. Replies: 5
    Last Post: 2008-01-07, 12:11 PM
  3. change listview color
    By souza in forum Help
    Replies: 3
    Last Post: 2007-09-12, 10:51 PM
  4. Replies: 0
    Last Post: 2006-09-22, 06:26 AM
  5. Contacts change
    By ziplizard in forum Developer Help
    Replies: 6
    Last Post: 2006-02-16, 10:38 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •