Results 1 to 9 of 9

Thread: Need a sugar hero

  1. #1
    manthos is offline Member
    Join Date
    Oct 2009
    Posts
    10

    Exclamation Need a sugar hero

    Good evening.

    Sorry for my bad gammatical english i hope you people understand.

    Well my isue is this one:

    I work in a insurance company, we knew about sugar 3 months ago we want to implement this software to our bussines, in fact we have a small bussines, this program its asome but i we want make sugar more dinamic for example in the image you can see the fields wee want to apear automaticaly, i had search in the forums and they talk about a javascript, unfortunally i'm Industrial Engieneer and i dont know nothing about doint programs, can anyone help me pleasee!!

    I almost forgot i found a code in molues/notes/note.php i tried to modify it but every time i put te name of my modules sugar crashes, my custom fields are in notes_sctm and contacts_sctm my fields are called pruebaa for notes and prueba for contacts, can anyone help me in the code too ?? MY EMAIL ITS sipofv@yahoo.com.mx

    For yout atencion thank you very much
    Attached Images Attached Images  
    Attached Files Attached Files

  2. #2
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: Need a sugar hero

    No entiendo muy bien lo que desea hacer o modificar. Podria darnos una explicacion en Español?
    Regards,

    Angel Magaña
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  3. #3
    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 a sugar hero

    Quote Originally Posted by manthos View Post
    Good evening.

    Sorry for my bad gammatical english i hope you people understand.

    Well my isue is this one:

    I work in a insurance company, we knew about sugar 3 months ago we want to implement this software to our bussines, in fact we have a small bussines, this program its asome but i we want make sugar more dinamic for example in the image you can see the fields wee want to apear automaticaly, i had search in the forums and they talk about a javascript, unfortunally i'm Industrial Engieneer and i dont know nothing about doint programs, can anyone help me pleasee!!

    I almost forgot i found a code in molues/notes/note.php i tried to modify it but every time i put te name of my modules sugar crashes, my custom fields are in notes_sctm and contacts_sctm my fields are called pruebaa for notes and prueba for contacts, can anyone help me in the code too ?? MY EMAIL ITS sipofv@yahoo.com.mx

    For yout atencion thank you very much

    Hi manthos

    It seems you are trying to copy the custom field "Prueba" from Contacts to new Note, been created.
    You need some sugar skills to accomplish that, because you need to create a new pseudo module inherited from Notes.
    Inside this pseudo module you have to add into attribute "additional_column_fields" the custom field you want. Then you need to update the History subpanel under Contacts to retrieve data from this pseudo module, rather than default Notes.

    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.

  4. #4
    manthos is offline Member
    Join Date
    Oct 2009
    Posts
    10

    Exclamation Re: Need a sugar hero

    Bueno basicamente como se ve en la imagen el campo Nombre aparece completo en el subpanel Historial en el campo de contacto, basicamente lo que quiero es que los caracteres capturados en el campo Prueba de la ficha de contacto se copien en el subpanel historial en el campo creado llamado Pruebaa, por lo que leí tengo que hacer un serie de movimientos con dar de alta mis campos como un submodulo, pero el problemilla es que no se como se podría hacer.

    Si no me entienden mmm intentare explicarlo mas explicitamente, ha se me olvidaba los campos creados estan en las tablas contacts_sctm y notes_sctm, digo tablas porque asi las veo por medio de mysql y por lo que acabo de leer todavia no son modulos o no estan dados de alta como tales.

    Y si es asi, me podrian dar una ayuda en como darlos de alta??

  5. #5
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: Need a sugar hero

    Ya entiendo mejor, gracias.

    Como explica Andre, ese tipo de personalizacion es un poco complicado.

    La unica manera mas o menos facil que yo he usado para algo similar en el pasado es modificar el archivo:

    SugarWidgetSubPanelTopButtonQuickCreate.php

    Ahi puede agregar los campos adicionales que desea copiar. El unico problema es que aun que es facil la modificacion, no se rinde bien para actualizaciones de Sugar, ya que uno estaria modificando el codigo base del sistema.
    Regards,

    Angel Magaña
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  6. #6
    manthos is offline Member
    Join Date
    Oct 2009
    Posts
    10

    Default Re: Need a sugar hero

    Muchas gracias... creo que voy a guardar el archivos base .php para que despues que se valla a hacer una actulización solo sustituyo el original, mmm lo que me queda de pendiente es.. si hago eso podria llegar a afectar la funcionalidad de sugar??

  7. #7
    manthos is offline Member
    Join Date
    Oct 2009
    Posts
    10

    Exclamation Re: Need a sugar hero

    y se me olvidaba, mmm no cree que se pueda hacer con un javascript?? porque segun esto el javascript solo se ejecutara en la paguína del usuario y no se llevará acabo el proceso en el servidor, por lo cualo creo que sería mas sencillo asi, no?

  8. #8
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: Need a sugar hero

    No lo creo (afectar la funcionalidad). Lo unico que hace ese archivo es copiar los datos de un modulo al otro cuando uno presiona el boton para crear un nuevo registro.

    No he visto ningun problem en el sistema donde lo aplique.

    Con respeto a javascript, no creo que lo podria hacer en esa manera, pero no estoy seguro. Me imagino que si hay manera, seria mas complicada.
    Regards,

    Angel Magaña
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  9. #9
    manthos is offline Member
    Join Date
    Oct 2009
    Posts
    10

    Exclamation Re: Need a sugar hero

    He estado buscando como modificarlo, y la verdad estoy un poco perdido, para empezar a que tengo que hacer referencia?? se que es a los campos que ya cree pero en las tablas del sql vienen como notes_sctm y contacts_sctm, me podrian ayudar en saber en donde estan de alta los campos creados?? y como los podria dar de alta para saber a que puedo hacer referencia?? poruqe el codigo php modificado segun yo es el siguiente:

    PHP Code:
    <?php
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
    require_once(
    'include/generic/SugarWidgets/SugarWidgetSubPanelTopButton.php');

    class 
    SugarWidgetSubPanelTopButtonQuickCreate extends SugarWidgetSubPanelTopButton
    {
        
        function &
    _get_form($defines$additionalFormFields null)
        {
            global 
    $app_strings;
            global 
    $currentModule;
        
            
    // Create the additional form fields with real values if they were not passed in
            
    if(empty($additionalFormFields) && $this->additional_form_fields)
            {
                foreach(
    $this->additional_form_fields as $key=>$value)
                {
                    if(!empty(
    $defines['focus']->$value))
                    {
                        
    $additionalFormFields[$key] = $defines['focus']->$value;
                    }
                    else
                    {
                        
    $additionalFormFields[$key] = '';
                    }
                }
            }
            
            if(!empty(
    $this->module))
            {
                
    $defines['child_module_name'] = $this->module;
            }
            else
            {
                
    $defines['child_module_name'] = $defines['module'];
            }

            
    $defines['parent_bean_name'] = get_class$defines['focus']);

            
    $form 'form' $defines['child_module_name'];
            
    $button '<form onsubmit="return SUGAR.subpanelUtils.sendAndRetrieve(this.id, \'subpanel_' strtolower($defines['child_module_name']) . '\', \'' addslashes($app_strings['LBL_LOADING']) . '\', \'' strtolower($defines['child_module_name']) . '\');" action="index.php" method="post" name="form" id="form' $form "\">\n";

            
    //module_button is used to override the value of module name
            
    $button .= "<input type='hidden' name='target_module' value='".$defines['child_module_name']."'>\n";
            
    $button .= "<input type='hidden' name='".strtolower($defines['parent_bean_name'])."_id' value='".$defines['focus']->id."'>\n";

            if(isset(
    $defines['focus']->name))
            {
                
    $button .= "<input type='hidden' name='".strtolower($defines['parent_bean_name'])."_name' value='".$defines['focus']->name."'>";
            }
            if(!empty(
    $defines['view']))
            
    $button .= '<input type="hidden" name="target_view" value="'$defines['view'] . '" />';
            
    $button .= '<input type="hidden" name="to_pdf" value="true" />';
            
    $button .= '<input type="hidden" name="tpl" value="QuickCreate.tpl" />';
            
    $button .= '<input type="hidden" name="return_module" value="' $currentModule "\" />\n";
            
    $button .= '<input type="hidden" name="return_action" value="' $defines['action'] . "\" />\n";
            
    $button .= '<input type="hidden" name="return_id" value="' $defines['focus']->id "\" />\n";
             
            
    // TODO: move this out and get $additionalFormFields working properly
            
    if(empty($additionalFormFields['parent_type']))
            {
                if(
    $defines['focus']->object_name=='Contact') {
                    
    $additionalFormFields['parent_type'] = 'Accounts';
                }
                else {
                    
    $additionalFormFields['parent_type'] = $defines['focus']->module_dir;
                }
            }
            if(empty(
    $additionalFormFields['parent_name']))
            {
                if(
    $defines['focus']->object_name=='Contact') {
                    
    $additionalFormFields['parent_name'] = $defines['focus']->account_name;
                    
    $additionalFormFields['account_name'] = $defines['focus']->account_name;
                }
                else {
                    
    $additionalFormFields['parent_name'] = $defines['focus']->name;
                }
            }
            if(empty(
    $additionalFormFields['parent_name']))
            {
                if(
    $defines['focus']->object_name=='Poliza') {
                    
    $additionalFormFields['poliza'] = $defines['focus']->poliza;
                    
    $additionalFormFields['poliza'] = $defines['focus']->poliza;
                }
                else {
                    
    $additionalFormFields['parent_name'] = $defines['focus']->poliza;
                }
            }
            if(empty(
    $additionalFormFields['parent_id']))
            {
                if(
    $defines['focus']->object_name=='Contact') {
                    
    $additionalFormFields['parent_id'] = $defines['focus']->account_id;
                    
    $additionalFormFields['account_id'] = $defines['focus']->account_id;
                }
                else {
                    
    $additionalFormFields['parent_id'] = $defines['focus']->id;
                }
            }

            if(
    strtolower($defines['child_module_name']) =='contracts') {
                
    //set variables to account name, or parent account name
                
    if(strtolower($defines['parent_bean_name']) == 'account' ){
                    
    //if account is parent bean, then get focus id/focus name                
                    
    if(isset($defines['focus']->id))$additionalFormFields['account_id'] = $defines['focus']->id;
                    if(isset(
    $defines['focus']->id))$additionalFormFields['notes_sct_id'] = $defines['focus']->id;
                    if(isset(
    $defines['focus']->name))$additionalFormFields['account_name'] = $defines['focus']->name;
                    if(isset(
    $defines['focus']->name))$additionalFormFields['poliza'] = $defines['focus']->poliza;
                }elseif(
    strtolower($defines['parent_bean_name']) == 'quote' ){
                    
    //if quote is parent bean, then get billing_account_id/billing_account_name                
                    
    if(isset($defines['focus']->billing_account_id))$additionalFormFields['account_id'] = $defines['focus']->billing_account_id;
                    if(isset(
    $defines['focus']->billing_account_name))$additionalFormFields['account_name'] = $defines['focus']->billing_account_name;
                }else{
                    if(isset(
    $defines['focus']->account_id))$additionalFormFields['account_id'] = $defines['focus']->account_id;
                    if(isset(
    $defines['focus']->account_name))$additionalFormFields['account_name'] = $defines['focus']->account_name;
                }            
            }

            
    $button .= '<input type="hidden" name="action" value="SubpanelCreates" />' "\n";
            
    $button .= '<input type="hidden" name="module" value="Home" />' "\n";
            
    $button .= '<input type="hidden" name="target_action" value="EditView" />' "\n";
            
            
    // fill in additional form fields for all but action
            
    foreach($additionalFormFields as $key => $value)
            {
                if(
    $key != 'action')
                {
                    
    $button .= '<input type="hidden" name="' $key '" value=\'' $value '\' />' "\n";
                }
            }

            return 
    $button;
        }
    }
    ?>
    Alguna ayuda??

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 8
    Last Post: 2008-07-12, 06:13 PM
  2. Se busca Sugar Hero foro español
    By ezcurrax in forum Español
    Replies: 3
    Last Post: 2008-04-30, 12:58 PM
  3. New Sugar Hero -- Angel
    By andydreisch in forum Musings, Mullings, and Mutterings
    Replies: 1
    Last Post: 2007-06-07, 11:19 PM

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
  •