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

Thread: How do I change the 'create' button to go direct to a 'Full Form'?

  1. #1
    jspencer is offline Sugar Community Member
    Join Date
    Jun 2007
    Location
    Orlando, Fl
    Posts
    85

    Default How do I change the 'create' button to go direct to a 'Full Form'?

    Is there a way to remove the 'quick create' subpanel short form 'create' button and go direct to the full form? I have made additional fields required for several of the modules and if our user tries to use the quick form it doesn't let them save it. I considered hacking the short form to include the extra fields, but I tried this a bit ago and it never worked.

    Instead of changing several modules subpanel areas, I was thinking it may be quicker to just send them direct to the full form. I searched (both on here and through the source php/html files in the modules) and didn't see an easy way to do it. Any suggestions?
    -Jeff

    SugarCRM CE 5.0a - Ubuntu 6.04 - Apache 2 - PHP 5 - Mysql 5

  2. #2
    john30043 is offline Sugar Community Member
    Join Date
    Nov 2007
    Location
    Atlanta, GA
    Posts
    17

    Default Re: How do I change the 'create' button to go direct to a 'Full Form'?

    You need to override the layoutdef for the relationship at /custom/Extension/modules/YourModule/Ext/LayoutDefs/yourObj.php (mileage may vary)
    and redefine your layout button with
    'top_buttons' => array(
    array('widget_class' => 'SubPanelTopCreateButton'),
    array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect')
    ),

    use 'SubPanelTopCreateButton' instead of quick create.
    John Zhang
    [Server: WinXP]
    [Sugar v5.0.0 GA]
    [Apache 2.2.5]
    [MySQL 5.0.45]

  3. #3
    jspencer is offline Sugar Community Member
    Join Date
    Jun 2007
    Location
    Orlando, Fl
    Posts
    85

    Default Re: How do I change the 'create' button to go direct to a 'Full Form'?

    The modules in question are internal ones (accounts, contacts, etc). I didn't quite follow your suggestion, is that the only file I would need to edit to change the "Create" button to "Full Form" so that the page will not show the quick create form?

    For example, what I want is when a user is looking at an account and ready to create a contact, that instead of a "Create" button there is ONLY a "Full Form" button.

    Not that I expect you to take it this far (I'm happy with the button change for now), but in my opinion the best solution would be to simply show the entire editview for the desired object (contact, call, meeting, etc) as the quickcreate form and eliminate the need for the Full Form button. I also suggest this happen automatically without me needing to edit the quickcreate php files (etc) as I edit modules in the studio :-)

    Thanks for your help,
    Last edited by jspencer; 2007-12-05 at 06:56 PM.
    -Jeff

    SugarCRM CE 5.0a - Ubuntu 6.04 - Apache 2 - PHP 5 - Mysql 5

  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: How do I change the 'create' button to go direct to a 'Full Form'?

    Hi, Jay.

    You can do that editing the custom metadata modules:

    custom/modules/YourModule/Ext/Layoutdefs/layoutdefs.ext.php

    In case of Opportunities, put this lines inside the file custom/modules/Opportunities/Ext/Layoutdefs/layoutdefs.ext.php:

    PHP Code:
    <?php
    foreach($layout_defs['Opportunities']['subpanel_setup']['contacts']['top_buttons'] as $id => $defs) {
        if(
    $defs['widget_class'] == 'SubPanelTopCreateAccountNameButton') {
            
    $layout_defs['Opportunities']['subpanel_setup']['contacts']['top_buttons'][$id]['widget_class'] = 'SubPanelTopCreateButton';
        }
    }
    ?>
    Do it for every module you want to modify their subpanels.
    This is an upgrade safe customization.

    Cheers.

    --
    André Lopes
    Lâmpada Global Services
    Rua Bela Cintra, 299 conjunto. 51
    São Paulo, SP 01415-000
    tel1. 55 11 3237-3110
    cel. 55 11 7636-5859
    e-mail: info@lampadacrm.com.br

  5. #5
    jspencer is offline Sugar Community Member
    Join Date
    Jun 2007
    Location
    Orlando, Fl
    Posts
    85

    Default Re: How do I change the 'create' button to go direct to a 'Full Form'?

    Ok, I just gave it a try and it didn't seem to change anything. The module worked the same as before.

    I then tried to move it to custom/modules/Contacts/Ext/Layoutdefs with the hopes of redefining the 'Schedule Call' button. I changed the text as seemed appropriate (for example to $layout_defs['Contacts']['subpanel_setup']['activities']['top_buttons'] and 'SubPanelTopCreateAccountNameButton' to 'SubPanelTopScheduleCallButton') and that just broke the page.

    I then looked in my generic/SugarWidgets folder and didn't see a SugarWidgetSubPanelTopCreateButton.php file. Should there be one? Was this hack for v4.5.1h (Build 1104)?

    Thanks,
    -Jeff

    SugarCRM CE 5.0a - Ubuntu 6.04 - Apache 2 - PHP 5 - Mysql 5

  6. #6
    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: How do I change the 'create' button to go direct to a 'Full Form'?

    Quote Originally Posted by jspencer
    Ok, I just gave it a try and it didn't seem to change anything. The module worked the same as before.

    I then tried to move it to custom/modules/Contacts/Ext/Layoutdefs with the hopes of redefining the 'Schedule Call' button. I changed the text as seemed appropriate (for example to $layout_defs['Contacts']['subpanel_setup']['activities']['top_buttons'] and 'SubPanelTopCreateAccountNameButton' to 'SubPanelTopScheduleCallButton') and that just broke the page.

    I then looked in my generic/SugarWidgets folder and didn't see a SugarWidgetSubPanelTopCreateButton.php file. Should there be one? Was this hack for v4.5.1h (Build 1104)?

    Thanks,
    Hi, Jay.

    Schedule Call has a different behavior. You can't redefine it this way. You must edit the modules/Calls/tpl/QuickCreate.tpl

    And add some code to redirect to FullForm.

    We have did it for a customer.

    Cheers

    --
    André Lopes
    Lâmpada Global Services
    Rua Bela Cintra, 299 conjunto. 51
    São Paulo, SP 01415-000
    tel1. 55 11 3237-3110
    cel. 55 11 7636-5859
    e-mail: info@lampadacrm.com.br

  7. #7
    HMayes is offline Junior Member
    Join Date
    Jan 2008
    Posts
    2

    Default Re: How do I change the 'create' button to go direct to a 'Full Form'?

    I'd like to do this to, but with the project task quick create. I created a file called layoutdefs.ext.php and added this to it;

    <?php
    foreach($layout_defs['Project']['subpanel_setup']['projecttask']['top_buttons'] as $id => $defs) {
    if($defs['widget_class'] == 'SubPanelTopCreateProjectTaskButton') {
    $layout_defs['Project']['subpanel_setup']['projecttask']['top_buttons'][$id]['widget_class'] = 'SubPanelTopCreateButton';
    }
    }
    ?>

    Also, in /custom/Extension/modules/Project/Ext/Layoutdefs/:

    the file ProjectProjectTaskdefault.php only contains:

    <?php
    //auto-generated file DO NOT EDIT
    $layout_defs['Project']['subpanel_setup']['projecttask']['override_subpanel_name'] = 'Projectdefault';
    ?>

    do I need to do something in here, too?
    Last edited by HMayes; 2008-02-19 at 06:49 PM.

  8. #8
    ftloop is offline Sugar Community Member
    Join Date
    Jul 2007
    Posts
    11

    Default Re: How do I change the 'create' button to go direct to a 'Full Form'?

    Quote Originally Posted by andopes View Post
    Schedule Call has a different behavior. You can't redefine it this way. You must edit the modules/Calls/tpl/QuickCreate.tpl

    And add some code to redirect to FullForm.

    We have did it for a customer.
    Do you have an example of the code to handle the redirect?

    thanks

    tom

  9. #9
    JVWay is offline Sugar Community Member
    Join Date
    Sep 2007
    Location
    Corvallis, Oregon
    Posts
    452

    Default Re: How do I change the 'create' button to go direct to a 'Full Form'?

    For anybody looking for the answer to this question look at http://www.sugarcrm.com/forums/showthread.php?t=36530

    What the Andopes meant in this thread is what he has in the thread I reference above. If you do what's in the current thread it will get overritten. Instead you create the layoutdefs.ext.php in the path I list here. Then when you rebuild Extensions it will write the changes into the file noted in the quote below.

    Just create the file custom/Extension/modules/<ModuleName>/Ext/Layoutdefs/layoutdefs.ext.php
    For example, I wanted to get rid of the quick create form and just go to full form but also leave the ability to select opportunities manually. So I created a layoutdefs.ext.php in Contacts folder in the above mentioned path. Then rebuilt extensions. Got what I wanted.

    Much thanks to Andopes

    Code:
    <?php
    $layout_defs["Contacts"]["subpanel_setup"]["opportunities"]["top_buttons"] = array(
      array('widget_class' => 'SubPanelTopCreateButton'),
      array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect'),
      );
    
    ?>
    Quote Originally Posted by andopes View Post
    Hi, Jay.

    You can do that editing the custom metadata modules:

    custom/modules/YourModule/Ext/Layoutdefs/layoutdefs.ext.php

    In case of Opportunities, put this lines inside the file custom/modules/Opportunities/Ext/Layoutdefs/layoutdefs.ext.php:

    PHP Code:
    <?php
    foreach($layout_defs['Opportunities']['subpanel_setup']['contacts']['top_buttons'] as $id => $defs) {
        if(
    $defs['widget_class'] == 'SubPanelTopCreateAccountNameButton') {
            
    $layout_defs['Opportunities']['subpanel_setup']['contacts']['top_buttons'][$id]['widget_class'] = 'SubPanelTopCreateButton';
        }
    }
    ?>
    Do it for every module you want to modify their subpanels.
    This is an upgrade safe customization.

    Cheers.

    --
    André Lopes
    Lâmpada Global Services
    Rua Bela Cintra, 299 conjunto. 51
    São Paulo, SP 01415-000
    tel1. 55 11 3237-3110
    cel. 55 11 7636-5859
    e-mail: info@lampadacrm.com.br
    Jerry Way
    Business Process Administrator

    Sugar 6.1.4 Professional
    (Testing 6.1.2)
    LAMP on Centos 5
    PHP 5
    MySQL 5
    Apache 2.2

  10. #10
    Nomi13ok is offline Junior Member
    Join Date
    Apr 2009
    Posts
    4

    Default Re: How do I change the 'create' button to go direct to a 'Full Form'?

    Thanks john30043

    It worked for me. Thank You everybody you saved my hours

    Cheers

    Nouman Naseer
    www.rolustech.com

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. Replies: 3
    Last Post: 2008-07-30, 06:22 PM
  2. Replies: 1
    Last Post: 2007-09-03, 09:44 AM
  3. Replies: 9
    Last Post: 2007-07-02, 02:00 PM
  4. Replies: 2
    Last Post: 2007-06-01, 02:57 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
  •