Results 1 to 10 of 10
Like Tree3Likes
  • 1 Post By rafael.q.g@hotmail.com
  • 1 Post By ashdwi1
  • 1 Post By johnvl

Thread: upgrade safe for listViewData.php?

  1. #1
    johnvl is offline Sugar Community Member
    Join Date
    Feb 2011
    Posts
    19

    Default upgrade safe for listViewData.php?

    I've tried to make cross module search to work by editing the $main_query variable in the function "getListViewData" in "include/ListView/listViewData.php".

    I've searched the forum for a way to create listViewData.php file the upgrade-safe way, but I haven't found a solution.

    Have anybody know a way to do that?

    Thanks,

    Little John

  2. #2
    rafael.q.g@hotmail.com's Avatar
    rafael.q.g@hotmail.com is offline Sugar Community Member
    Join Date
    Jun 2011
    Location
    Florianópolis - Brazil
    Posts
    795

    Default Re: upgrade safe for listViewData.php?

    Did you tried place your updated file under:
    custom/include/ListView/listViewData.php?
    johnvl likes this.
    Rafael Queiroz Gonçalves, MSc.
    Advanced OMG UML Certified Professional
    Sun Certified Enterprise Architect for the Java Platform
    Sun Certified Programmer for the Java 2 Platform
    IBM Certified Advanced Application Developer - Lotus Notes and Domino
    IBM Certified Application Developer - IBM WebSphere Portlet Factory
    Master in Computer Science

  3. #3
    johnvl is offline Sugar Community Member
    Join Date
    Feb 2011
    Posts
    19

    Default Re: upgrade safe for listViewData.php?

    Quote Originally Posted by rafael.q.g@hotmail.com View Post
    Did you tried place your updated file under:
    custom/include/ListView/listViewData.php?
    Your question is also the answer i am looking for :-)

    One more question, though.

    Since my custom code in getListViewData function is specifically used by one custom module only. Where should I put the new listViewData.php file?

    Thanks,

    Little John

  4. #4
    rafael.q.g@hotmail.com's Avatar
    rafael.q.g@hotmail.com is offline Sugar Community Member
    Join Date
    Jun 2011
    Location
    Florianópolis - Brazil
    Posts
    795

    Default Re: upgrade safe for listViewData.php?

    This same file is applied to all modules, there is not "file structure" way to defined which modules should use the custom code and which ones not.

    What you could try is in your code, try to identify the module name (maybe in some variable alrady available, or maybe getting from $_GET['module'] variable), and make a condition there. If it is the desired module, execute your custom code, else, execute the standard code.
    Rafael Queiroz Gonçalves, MSc.
    Advanced OMG UML Certified Professional
    Sun Certified Enterprise Architect for the Java Platform
    Sun Certified Programmer for the Java 2 Platform
    IBM Certified Advanced Application Developer - Lotus Notes and Domino
    IBM Certified Application Developer - IBM WebSphere Portlet Factory
    Master in Computer Science

  5. #5
    johnvl is offline Sugar Community Member
    Join Date
    Feb 2011
    Posts
    19

    Default Re: upgrade safe for listViewData.php?

    Thank you for your help, Rafael. I tried your suggestion and noticed the new ListViewData.php file was not used by sugarCRM. I placed it under /custom/include/ListView/ and somehow sugar is still using the built-in ListViewData.php under /include/ListView/. My sugarCRM version is 6.1.4 (CE)

    I wonder what I did wrong this time?

    Thanks,

    LIttle John

  6. #6
    rafael.q.g@hotmail.com's Avatar
    rafael.q.g@hotmail.com is offline Sugar Community Member
    Join Date
    Jun 2011
    Location
    Florianópolis - Brazil
    Posts
    795

    Default Re: upgrade safe for listViewData.php?

    Normally files places under custom directory overwrites the standard files. But maybe for certain files it does not works.
    You could try to make sure:
    - The file is placed exactly the same directory as the original, but under custom folder. (take care with upper and lower case letters)
    - Make sure the file and its parent directories has the proper access rights, to be accessed by your web server.
    - Run repair/rebuild under admin screen to make sure you still not using cached files.
    Rafael Queiroz Gonçalves, MSc.
    Advanced OMG UML Certified Professional
    Sun Certified Enterprise Architect for the Java Platform
    Sun Certified Programmer for the Java 2 Platform
    IBM Certified Advanced Application Developer - Lotus Notes and Domino
    IBM Certified Application Developer - IBM WebSphere Portlet Factory
    Master in Computer Science

  7. #7
    johnvl is offline Sugar Community Member
    Join Date
    Feb 2011
    Posts
    19

    Default Re: upgrade safe for listViewData.php?

    Rafael, I've tried your suggestion (thanks for that), but that didn't work for me. I am not sure what else I can do.

  8. #8
    ashdwi1's Avatar
    ashdwi1 is offline Sugar Community Member
    Join Date
    May 2008
    Location
    Noida
    Posts
    427

    Default Re: upgrade safe for listViewData.php?

    Hi,
    Can you please elaborate , what are you trying to do.
    you can almost things with overriding view.list.php at custom/modules/mod_name/views.
    still if you needed to override ListViewDAta.php , then you need to create a new ListViewSmarty.php which extend your new listviewdata.php .
    thanks
    cent likes this.

  9. #9
    johnvl is offline Sugar Community Member
    Join Date
    Feb 2011
    Posts
    19

    Default Re: upgrade safe for listViewData.php?

    So, my problem is that I have module A and B. module A is related to module B by a many-to-many relationship.
    Now, i need to create a search field in module A's basic & advanced searches that allows users to search for records in module A that matches a field in module B.

    AT this point, I am able to modify the searchdefs.php and SearchFields.php in module A to include the new search field in the basic search layout.

    The problem I am having is that I need to modify the SQL query that sugar generates behind the scene to include a couple INNER JOIN statements that I need to connect with module B and complete the search. I've tested the query that sugar generated and the INNER JOIN statements that I wrote and things work correctly.

    At this point, the only place that I found that will allow me to insert my inner join statement is in function getListViewData(), specifically at this line

    $main_query = $ret_array['select'] . $params['custom_select'] . $ret_array['from'] . $params['custom_from'] . $ret_array['inner_join']. $ret_array['where'] . $params['custom_where'] . $ret_array['order_by'] . $params['custom_order_by'];


    Is there any other place(s) that allow me to modify the inner_join statement for the search query that would be upgrade safe?

    or better yet, is there another way for me to implement the cross module search functionality?

    Thank you in advance,

    Little John
    cent likes this.

  10. #10
    cent Guest

    Default Re: upgrade safe for listViewData.php?

    Dear john and friends,
    I am also looking same for my case to tweak the advanced search in Contacts module . But I cannot find a method to cutomize that inner join . My objective is to implement
    the functionality mention in thread : Adding an advanced search field in Contacts

    If any one know a method , please let me know

    Thanks,
    Anes

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Upgrade safe
    By abhax in forum Developer Help
    Replies: 1
    Last Post: 2010-07-29, 07:55 AM
  2. upgrade safe ????
    By atik in forum Developer Help
    Replies: 6
    Last Post: 2009-03-30, 11:42 AM
  3. upgrade safe ???
    By atik in forum Developer Help
    Replies: 9
    Last Post: 2009-03-19, 08:37 AM
  4. Replies: 2
    Last Post: 2009-03-17, 10:16 PM
  5. vardefs - upgrade safe changes
    By mikesolomon in forum Help
    Replies: 1
    Last Post: 2008-05-09, 09:43 AM

Tags for this Thread

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
  •