Results 1 to 2 of 2

Thread: create Createbutton in User popup

  1. #1
    mohadeseh is offline Member
    Join Date
    Apr 2010
    Posts
    9

    Default create Createbutton in User popup

    hi.
    i want to have create button in user popup.
    i have 2 solution for this
    1.my first solution is:
    act such as accounts module (edite popup_picker.html and popupdefs )
    a -> in popup.defs add this code:
    PHP Code:
    'create' =>
        array(
    'formBase' => 'UserFormBase.php',
                
    'formBaseClass' => 'UserFormBase',
                
    'getFormBodyParams' => array('','','UsersSave'),
                
    'createButton' =>'create users'// $mod_strings['LNK_NEW_User']
                
    ), 
    b->then create 'UserFormBase.php
    c->.and in Popup_picker.html add this code
    PHP Code:
    <p>
    <
    div id='addformlink'>{CREATEBUTTON}</div>
    <
    div id='addform' style='display:none;position:relative;z-index:2;left:0px;top:0px;'>
    <
    form name="UserSave" onsubmit="return check_form('UserSave');" method="post" action="index.php">
    {
    ADDFORMHEADER}
    <
    table cellpadding="0" cellspacing="0" border="0" width="100%" class="edit view">
    <
    tr>
    <
    td>
    <
    table width="100%" border="0" cellspacing="0" cellpadding="0">
    <
    tr><td>
    <
    input type="hidden" name="module" value="{MODULE_NAME}" />
    <
    input type="hidden" name="action" value="Popup" />
    <
    input type="hidden" name="doAction" value="save" />
    <
    input type="hidden" name="query" value="true" />
    {
    ADDFORM}
    </
    td></tr>
    </
    table></td></tr></table>
    </
    form>
    </
    div>
    </
    p

    2.my second solution is
    create a new button in Popup_picker.html that in onclick attribute call a javascript my function .

    PHP Code:
    <input  type="button"  name="btn_create_new" class="button" onclick="open_new_user()"
    value="new user from EditView"/></td
    PHP Code:
    <script type="text/javascript">
    {
    function 
    open_new_user() {
        
        
    URL="index.php?module=Users&action=EditView&return_module=Users&return_action=DetailView";
        
    windowName 'new user';
        
    windowFeatures 'width=800' ',height=600' ',resizable=1,scrollbars=1';
        
        
    win window.open(URLwindowNamewindowFeatures);
            
        if(
    window.focus) {
            
    // put the focus on the popup if the browser supports the focus() method
            
    win.focus();
        }
        }
    }
    </script> 
    but, I don't know in second solution why this new window don't show for me.
    any one have any solution for my problem?

    best regards.

  2. #2
    mahe11 is offline Member
    Join Date
    Jun 2010
    Posts
    11

    Question Re: create Createbutton in User popup

    hi ,
    I used ur big tips but what about "UserFormBase.php" this file which code be inserted int that. means there is no code for " UserFormBase class ". So plz help me so what i do . I m beginner in SugarCRM

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 11
    Last Post: 2012-01-27, 03:41 PM
  2. Information about how to create new popup
    By bhawin13 in forum Developer Help
    Replies: 11
    Last Post: 2011-03-11, 06:09 AM
  3. Create Contact in a popup
    By projectsugar in forum Help
    Replies: 2
    Last Post: 2009-03-20, 12:49 PM
  4. How to create another popup
    By bhawin13 in forum Developer Help
    Replies: 1
    Last Post: 2007-03-23, 06:45 AM
  5. Create Popup
    By Tavares in forum Developer Help
    Replies: 1
    Last Post: 2007-02-23, 09:04 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
  •