Results 1 to 9 of 9

Thread: Search for personalized fields since(as,like) adding fields to a pop-up???

  1. #1
    ezcurrax is offline Sugar Community Member
    Join Date
    Apr 2008
    Location
    Spain
    Posts
    194

    Exclamation Search for personalized fields since(as,like) adding fields to a pop-up???

    The question is the following one: I go one month trying to add fields to a form pop-up of search to be able to select the contacts that I want in the database ... I have modified the file searchdefs.php that you said it to me again of his directory(board of directors) in modules/contacts/metadata and have not seen change reflected ... that is what I have to touch to be able to add fields to this pop - up? It is the pop-up that you appears in campaigns, List of objective public, you select list, contacts and when you give him(her) the select this pop-up appears:

    " "http://localhost/SugarCE50bueno/index.php?module=Contacts&action=Popup&hide_clear_ button=true&mode=MultiSelect&create=true&metadata= undefined" "

    someone to say to me that it is what I have to do?

    a lot of thanks.....

  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: Search for personalized fields since(as,like) adding fields to a pop-up???

    Hi, ezcurrax

    Try to modify the custom/modules/Contacts/metadata/popupdefs.php
    I believe you have to repair template metadata after that.

    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
    ezcurrax is offline Sugar Community Member
    Join Date
    Apr 2008
    Location
    Spain
    Posts
    194

    Cool Re: Search for personalized fields since(as,like) adding fields to a pop-up???

    repair metadata? explain it a little more....

  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: Search for personalized fields since(as,like) adding fields to a pop-up???

    Hi, ezcurrax

    Sorry.

    The correct is: Clear Template Data Cache

    Best regards.
    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
    ezcurrax is offline Sugar Community Member
    Join Date
    Apr 2008
    Location
    Spain
    Posts
    194

    Exclamation Re: Search for personalized fields since(as,like) adding fields to a pop-up???

    please ..... visit this link:
    http://www.sugarcrm.com/wiki/index.p...in_target_list
    "http://www.sugarcrm.com/wiki/index.php?title=Use_custom_field_account_to_search _contact_in_target_list"

    is this the doc i need? i `ve been reading... and seems to be the one i want...

    what do u think??

    have i got to do what this doc says or i have to do anything different....

    thanks ..... sugar hero....

  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: Search for personalized fields since(as,like) adding fields to a pop-up???

    Hi, ezcurrax
    This article is for SugarCRM 4.5 only.
    Not working for you.

    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.

  7. #7
    ezcurrax is offline Sugar Community Member
    Join Date
    Apr 2008
    Location
    Spain
    Posts
    194

    Wink Re: Search for personalized fields since(as,like) adding fields to a pop-up???

    what a pitty.....

    i suppose that this article could works.... i `m studing what changes from 4.5 to ver 5.0c....

    have u got any idea of what i have to change in the doc i sent you?

    a lot of thanks.... it seems that you are the only one who solve dudes on posts....

    thanks..... hero

  8. #8
    ezcurrax is offline Sugar Community Member
    Join Date
    Apr 2008
    Location
    Spain
    Posts
    194

    Red face Re: Search for personalized fields since(as,like) adding fields to a pop-up???

    the first change i see is that popup_picker.html doesn`t exists now is php.... popup_picker.php



    my popup_picker.php is like this....

    <?php
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');




    global $theme;

    require_once('modules/Contacts/Contact.php');
    require_once('modules/Contacts/ContactFormBase.php');
    require_once('themes/'.$theme.'/layout_utils.php');

    require_once('XTemplate/xtpl.php');
    require_once('include/ListView/ListView.php');

    $image_path = 'themes/'.$theme.'/images/';

    class Popup_Picker
    {


    /*
    *
    */
    function Popup_Picker() ** ¡¡¡¡¡¡¡Why this function is empty????????? maybe this is the place where i have to make changes???????????***
    {

    }

    /*
    *
    */
    function _get_where_clause()
    {
    $where = '';
    if(isset($_REQUEST['query']))
    {
    $where_clauses = array();
    append_where_clause($where_clauses, "first_name", "contacts.first_name");
    append_where_clause($where_clauses, "last_name", "contacts.last_name");
    append_where_clause($where_clauses, "account_name", "accounts.name");
    append_where_clause($where_clauses, "account_id", "accounts.id");
    $where = generate_where_statement($where_clauses);
    }
    return $where;
    }

    /**
    *
    */
    function process_page_for_address()
    {
    global $theme;
    global $mod_strings;
    global $app_strings;
    global $currentModule;
    global $sugar_version, $sugar_config;

    $output_html = '';
    $where = '';

    $where = $this->_get_where_clause();
    $image_path = 'themes/'.$theme.'/images/';

    $formBase = new ContactFormBase();
    if(isset($_REQUEST['doAction']) && $_REQUEST['doAction'] == 'save')
    {
    $formBase->handleSave('', false, true);
    }

    $first_name = empty($_REQUEST['first_name']) ? '' : $_REQUEST['first_name'];
    $last_name = empty($_REQUEST['last_name']) ? '' : $_REQUEST['last_name'];
    $account_name = empty($_REQUEST['account_name']) ? '' : $_REQUEST['account_name'];
    $request_data = empty($_REQUEST['request_data']) ? '' : $_REQUEST['request_data'];
    $hide_clear_button = empty($_REQUEST['hide_clear_button']) ? false : true;
    $lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
    $lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY'];
    $lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL'];

    // TODO: cleanup the construction of $addform
    $formbody = $formBase->getFormBody('','','EmailEditView');
    $addform = '<table><tr><td nowrap="nowrap" valign="top">'
    .str_replace('<br>', '</td><td nowrap="nowrap" valign="top">&nbsp;', $formbody)
    . '</td></tr></table>'
    . '<input type="hidden" name="action" value="Popup" />';
    $formSave = <<<EOQ
    <input type="submit" name="button" class="button" title="$lbl_save_button_title" accesskey="$lbl_save_button_key" value=" $lbl_save_button_label " />
    <input type="button" name="button" class="button" title="{$app_strings['LBL_CANCEL_BUTTON_TITLE']}" accesskey="{$app_strings['LBL_CANCEL_BUTTON_KEY']}" value="{$app_strings['LBL_CANCEL_BUTTON_LABEL']}" onclick="toggleDisplay('addform');" />
    EOQ;
    $createContact = <<<EOQ
    <input type="button" name="showAdd" class="button" value="{$mod_strings['LNK_NEW_CONTACT']}" onclick="toggleDisplay('addform');" />
    EOQ;
    $addformheader = get_form_header($mod_strings['LNK_NEW_CONTACT'], $formSave, false);
    $button = "<form action='index.php' method='post' name='form' id='form'>\n";
    if(!$hide_clear_button)
    {
    $button .= "<input type='button' name='button' class='button' onclick=\"send_back('','');\" title='"
    .$app_strings['LBL_CLEAR_BUTTON_TITLE']."' accesskey='"
    .$app_strings['LBL_CLEAR_BUTTON_KEY']."' value=' "
    .$app_strings['LBL_CLEAR_BUTTON_LABEL']." ' />\n";
    }
    $button .= "<input type='submit' name='button' class='button' onclick=\"window.close();\" title='"
    .$app_strings['LBL_CANCEL_BUTTON_TITLE']."' accesskey='"
    .$app_strings['LBL_CANCEL_BUTTON_KEY']."' value=' "
    .$app_strings['LBL_CANCEL_BUTTON_LABEL']." ' />\n";
    $button .= "</form>\n";

    $form = new XTemplate('modules/Contacts/Address_picker.html');
    $form->assign('MOD', $mod_strings);
    $form->assign('APP', $app_strings);
    $form->assign('ADDFORMHEADER', $addformheader);
    $form->assign('ADDFORM', $addform);
    $form->assign('THEME', $theme);
    $form->assign('MODULE_NAME', $currentModule);
    $form->assign('FIRST_NAME', $first_name);
    $form->assign('LAST_NAME', $last_name);
    $form->assign('ACCOUNT_NAME', $account_name);
    $form->assign('request_data', $request_data);

    // fill in for mass update
    $button = "<input type='hidden' name='module' value='Contacts'>".
    "<input type='hidden' id='form_action' name='action' value='CloseContactAddressPopup'>".
    "<input type='hidden' name='massupdate' value='true'>".
    "<input type='hidden' name='delete' value='false'>".
    "<input type='hidden' name='mass' value='Array'>".
    "<input type='hidden' name='Update' value='Update'>";

    if(isset($_REQUEST['mass']) && is_array($_REQUEST['mass'])) {
    foreach(array_unique($_REQUEST['mass']) as $record) {
    $button .= "<input style='display: none' checked type='checkbox' name='mass[]' value='$record'>\n";
    }
    }

    $button .= "<input type='hidden' name='query' value='true'>";
    $button .= "<input type='hidden' name='saved_associated_data' value=''>";
    $button .= "<input type='hidden' name='close_window' value='true'>";
    $button .= "<input type='hidden' name='html' value='change_address'>";
    $button .= "<input type='hidden' name='account_name' value='$account_name'>";
    $button .= "<span style='display: none'><textarea name='primary_address_street'>" . str_replace("&lt;br&gt;", "\n", $_REQUEST["primary_address_street"]) . "</textarea></span>";
    $button .= "<input type='hidden' name='primary_address_city' value='". $_REQUEST["primary_address_city"] ."'>";
    $button .= "<input type='hidden' name='primary_address_state' value='". $_REQUEST["primary_address_state"] ."'>";
    $button .= "<input type='hidden' name='primary_address_postalcode' value='". $_REQUEST["primary_address_postalcode"] ."'>";
    $button .= "<input type='hidden' name='primary_address_country' value='". $_REQUEST["primary_address_country"] ."'>";
    $button .= "<input title='".$mod_strings['LBL_COPY_ADDRESS_CHECKED']."' class='button' LANGUAGE=javascript type='submit' name='button' value=' ".$mod_strings['LBL_COPY_ADDRESS_CHECKED']." '>\n";
    $button .= "<input title='".$app_strings['LBL_CANCEL_BUTTON_TITLE']."' accessKey='".$app_strings['LBL_CANCEL_BUTTON_KEY']."' class='button' LANGUAGE=javascript onclick=\"window.close()\" type='submit' name='button' value=' ".$app_strings['LBL_CANCEL_BUTTON_LABEL']." '>\n";

    ob_start();
    insert_popup_header($theme);
    $output_html .= ob_get_contents();
    ob_end_clean();

    $output_html .= get_form_footer();

    // Reset the sections that are already in the page so that they do not print again later.
    $form->reset('main.SearchHeader');

    // create the listview
    $seed_bean = new Contact();
    $ListView = new ListView();
    $ListView->show_export_button = false;
    $ListView->process_for_popups = true;
    $ListView->show_delete_button = false;
    $ListView->show_select_menu = false;
    $ListView->setXTemplate($form);
    $ListView->setHeaderTitle($mod_strings['LBL_LIST_FORM_TITLE']);
    $ListView->setHeaderText($button);
    $ListView->setQuery($where, '', '', 'CONTACT');
    $ListView->setModStrings($mod_strings);

    ob_start();
    $ListView->processListViewMulti($seed_bean, 'main', 'CONTACT');
    $output_html .= ob_get_contents();
    ob_end_clean();

    // Regular Expression to override sListView
    $exp = '/sListView.save_checks/si';
    $change = 'save_checks';
    $output_html = preg_replace(array($exp), array($change), $output_html);

    $output_html .= '<script>
    checked_items = Array();
    inputs_array = document.MassUpdate.elements;

    for(wp = 0 ; wp < inputs_array.length; wp++) {
    if(inputs_array[wp].name == "mass[]" && inputs_array[wp].style.display == "none") {
    checked_items.push(inputs_array[wp].value);
    }
    }
    for(i in checked_items) {
    for(wp = 0 ; wp < inputs_array.length; wp++) {
    if(inputs_array[wp].name == "mass[]" && inputs_array[wp].value == checked_items[i]) {
    inputs_array[wp].checked = true;
    }
    }
    }</script>';

    $output_html .= get_form_footer();
    $output_html .= insert_popup_footer();
    return $output_html;
    }
    }
    ?>

  9. #9
    tbarca is offline Junior Member
    Join Date
    Aug 2009
    Posts
    2

    Default Re: Search for personalized fields since(as,like) adding fields to a pop-up???

    Hi,

    did you ever find the solution to this problem? i am trying to do the same thing

    Thanks,
    tim

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Adding Search fields to Popup_picker?
    By tj@estreet.com in forum Help
    Replies: 4
    Last Post: 2007-03-13, 02:50 PM
  2. Replies: 1
    Last Post: 2006-09-11, 03:38 PM
  3. BUG In Search/Edit Layout???
    By tj@estreet.com in forum Help
    Replies: 13
    Last Post: 2006-06-10, 05:43 AM
  4. Adding search Fields?
    By karim18 in forum Developer Help
    Replies: 1
    Last Post: 2005-06-08, 04:24 PM
  5. Replies: 0
    Last Post: 2005-05-10, 12:55 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
  •