Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Need help learning Sugar structure

  1. #1
    jim.thornton is offline Sugar Community Member
    Join Date
    Apr 2008
    Posts
    257

    Default Need help learning Sugar structure

    I would like to modify the contacts module. I would like the ability to add in multiple addresses, so that I can use it for past, current and alternate. But I would like each contact to just like the different addresses.

    If I were coding it in PHP/MySQL myself, I would want to create a table just for addresses and assign a user ID to each address that I add to the table.

    How do I do this in Sugar. I basically want to have a field edit spot for number, street, street type, city, state, country, postal code along with an "add address" button.

    When you add an address it will add to a list of addresses for that contact.

    Please advise.
    ________
    JEYCY.BIGASS
    Last edited by jim.thornton; 2011-09-08 at 04:22 AM.

  2. #2
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Need help learning Sugar structure

    Hi, jim.thornton

    It is a very hard task.
    You should have to:
    create a new module containing the address fields;
    modify the view.edit.php for Contacts, to show that button and add a new address information,
    create a relationship between Contacts and this new module: Addresses
    define a logic hook before save to save all new address for that contact.

    It certainly will take a lot of time.
    I suggest you to create a couple of fields of Address type and modify the view.edit.php to show them when clicked to same button you just cited.
    To add the type and number into Address you have to create these custom fields, one for each address type and extend the Address field definition (include/SugarFields/Fields/Address).
    You have to modify its layout and behavior to work with the new fields.

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  3. #3
    SugarDev.net is offline Sugar Community Member
    Join Date
    Feb 2008
    Posts
    1,401

    Default Re: Need help learning Sugar structure

    Take your inspiration from the EmailAdresses modules that is in place. It's essentially the same, but for emailadresses instead of adresses.

    In fact, I hope that Sugar will implement this feature. More and more clients want to be able to administer old adresses, different locations, etc. all in one account.
    Developers go here
    Businesses go there (Dutch)

    Modules:
    SugarDev.net Developer Tools | Config | Dutch Language Pack
    "Nothing gets fixed unless there is a bug"

  4. #4
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Need help learning Sugar structure

    Him SugarDev.net

    I just submitted a bug feature asking for that.
    #21882

    Have a nice weekend, Sugar aholic.
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  5. #5
    SugarDev.net is offline Sugar Community Member
    Join Date
    Feb 2008
    Posts
    1,401

    Default Re: Need help learning Sugar structure

    Quote Originally Posted by andopes
    Him SugarDev.net

    I just submitted a bug feature asking for that.
    #21882

    Have a nice weekend, Sugar aholic.
    Thnx, let's hope that the Sugar Team responds to the feature request.

    Sugar-A-Holic? I like Diabetes type III better .
    Developers go here
    Businesses go there (Dutch)

    Modules:
    SugarDev.net Developer Tools | Config | Dutch Language Pack
    "Nothing gets fixed unless there is a bug"

  6. #6
    jim.thornton is offline Sugar Community Member
    Join Date
    Apr 2008
    Posts
    257

    Default Re: Need help learning Sugar structure

    Quote Originally Posted by andopes
    Hi, jim.thornton

    You should have to:
    create a new module containing the address fields;
    Thanks for the response. So, by creating a module, that is how I create a table in the database?

    So, can I just think of modules as tables then?
    ________
    WELLBUTRIN LAWYER
    Last edited by jim.thornton; 2011-09-08 at 04:23 AM.

  7. #7
    SugarDev.net is offline Sugar Community Member
    Join Date
    Feb 2008
    Posts
    1,401

    Default Re: Need help learning Sugar structure

    Almost. Modules consist of fields. Those fields are either:

    - Fields in the module's table
    - Fields from another module's (related) table
    - Calculated, concatenated, constant, or 'made up' fields. You can do put much anything in these fields.
    Developers go here
    Businesses go there (Dutch)

    Modules:
    SugarDev.net Developer Tools | Config | Dutch Language Pack
    "Nothing gets fixed unless there is a bug"

  8. #8
    jim.thornton is offline Sugar Community Member
    Join Date
    Apr 2008
    Posts
    257

    Default Re: Need help learning Sugar structure

    Are there any tutorials that I can see this?

    I've been searching and searching but I can't find anything. I would have figured with such a large community that there would be something.

    Jim
    ________
    GLASS WEED PIPE
    Last edited by jim.thornton; 2011-09-08 at 04:23 AM.

  9. #9
    DragonflyMaster is offline Sugar Community Member
    Join Date
    Dec 2007
    Location
    Rimini, Italy
    Posts
    1,421

    Default Re: Need help learning Sugar structure

    Quote Originally Posted by jim.thornton
    Are there any tutorials that I can see this?

    I've been searching and searching but I can't find anything. I would have figured with such a large community that there would be something.

    Jim
    Welcome to SugarCRM....
    Sugar it's a great CRM, it just lacks a bit of technical documentation...
    Mostly, you can learn Sugar from this forum, from the Developer Wiki, from the "manuals", from the developers page.
    Enjoy!
    What do you think the cookie monster eats ?

  10. #10
    jim.thornton is offline Sugar Community Member
    Join Date
    Apr 2008
    Posts
    257

    Default Re: Need help learning Sugar structure

    Okay... I've been pretty busy lately, so I had to put it on hold for a bit. But... I have now done the following:

    1. I've created a new package called Miscellaneous: I figure I can put any odd-ball modules in here.

    2. I've created a new module called addresses (basic type).

    3. Ive created a bunch of fields:
    - addr_status - dropdown with selections of current/previous
    - addr_unit - textfield upto 6 characters (apartment #)
    - addr_num - textfield upto 6 characters (house number)
    - addr_street_name - textfield upto 50 characters
    - addr_street_type - dropdown to select road/street/court/etc.
    - addr_street_dir - dropdown to select N/E/S/W/NE/SE/SW/NW

    I want to add another field, but I don't know how to. I need to now link/relate it to the client number so that the appropriate addresses only show up for each client. But how?

    Also... I changed the layout and fields of the contacts module that is built in. would it be better for me to completely build my own clients module or just continue using the contacts module??
    ________
    WATER BONGS
    Last edited by jim.thornton; 2011-09-08 at 04:23 AM.

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Sugar University content available
    By andydreisch in forum Announcements
    Replies: 0
    Last Post: 2006-11-09, 09:34 PM
  2. Sugar Open Source 3.5.1e Available for Download
    By clint in forum Announcements
    Replies: 0
    Last Post: 2005-12-10, 06:29 AM
  3. Who is working on which translations?
    By clint in forum Translators
    Replies: 5
    Last Post: 2005-08-26, 02:44 PM
  4. Sugar Suite 3.5 Beta Now Available
    By clint in forum Announcements
    Replies: 0
    Last Post: 2005-08-01, 02:03 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
  •