Results 1 to 9 of 9

Thread: How to remove searchfields from Popup window?

  1. #1
    dekleinemedia is offline A Prolific Poster
    Join Date
    May 2009
    Location
    Netherlands
    Posts
    241

    Question How to remove searchfields from Popup window?

    Hi,

    I have the following issue of which i hope someone could help me with.

    I have created 2 custom modules named; Municipality and Contracts. I have created a one-to-one relation between these custom modules.
    Now i have a related field in Contracts, where i can search for a Municipality. When I use "Select" button to search for a "Municipality" i get a PopUp window
    link: /index.php?module=Muni_Municipalities&action=Popup& mode=single&create=true&metadata=undefined

    Now I want to modify this Popup screen and remove some fields from search. I did the following to achieve this, but unfortunately nothing has changed;

    I copied the file popupdefs.php from modules\Muni_Municipalities\metadata and saved this file in
    custom\modules\Muni_Municipalities\metadata

    This is the code of my custom popupdefs.php;
    PHP Code:
    <?php

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

    $module_name 'Muni_Municipalities';
    $_module_name 'muni_municipalities';
    $popupMeta = array('moduleMain' => $module_name,
                            
    'varName' => $module_name,
                            
    'orderBy' => $_module_name.'.name',
                            
    'whereClauses' => 
                                array(
    'name' => $_module_name.'.name'),
                            
    'searchInputs' =>
                                array(
    'name'),
                            );
    ?>
    here is the code of my custom SearchFields.php
    PHP Code:
    <?php

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

    $module_name 'Muni_Municipalities';
    $searchFields[$module_name] = 
        array (
            
    'name' => array( 'query_type'=>'default'),
        );
    ?>
    This doesn't seems to change anything. Can someone tell me what i did wrong? Or have i forgot something?
    I have Developer Mode enabled.

    Thanks in advance
    Last edited by dekleinemedia; 2009-08-06 at 01:28 PM.
    Kind regards,

    De Kleine Media


    SugarCRM CE v.5.2.0h
    Windows platform
    MySQL v.5.1
    phpMyAdmin - 2.11.2.2
    Apache Server v.2.0

  2. #2
    dekleinemedia is offline A Prolific Poster
    Join Date
    May 2009
    Location
    Netherlands
    Posts
    241

    Default Re: How to remove searchfields from Popup window?

    Hmm..... seems that I have to create a new Popup.php and Popup_picker.php

    I will give a try first. I will come back with the result
    Kind regards,

    De Kleine Media


    SugarCRM CE v.5.2.0h
    Windows platform
    MySQL v.5.1
    phpMyAdmin - 2.11.2.2
    Apache Server v.2.0

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

    Default Re: How to remove searchfields from Popup window?

    Are you very sure? Most modules use popupdefs.php.
    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
    dekleinemedia is offline A Prolific Poster
    Join Date
    May 2009
    Location
    Netherlands
    Posts
    241

    Default Re: How to remove searchfields from Popup window?

    Hi,

    Thanks for your reply. You're right, but that doesn't seems to solve the issue. Can you see anything strange in my code above? I only want to search for 'name' in PopUp window, but instead i get a bunch of fields to search for.
    This is Searchfields.php in module/Muni_Municipalities/metadata

    PHP Code:
    <?php
    $module_name 
    'Muni_Municipalities';
    $searchFields[$module_name] = 
        array (
            
    'name' => array( 'query_type'=>'default'),
            
    'account_type'=> array('query_type'=>'default''options' => 'account_type_dom''template_var' => 'ACCOUNT_TYPE_OPTIONS'),
            
    'industry'=> array('query_type'=>'default''options' => 'industry_dom''template_var' => 'INDUSTRY_OPTIONS'),
            
    'annual_revenue'=> array('query_type'=>'default'),
            
    'address_street'=> array('query_type'=>'default','db_field'=>array('billing_address_street','shipping_address_street')),
            
    'address_city'=> array('query_type'=>'default','db_field'=>array('billing_address_city','shipping_address_city')),
            
    'address_state'=> array('query_type'=>'default','db_field'=>array('billing_address_state','shipping_address_state')),
            
    'address_postalcode'=> array('query_type'=>'default','db_field'=>array('billing_address_postalcode','shipping_address_postalcode')),
            
    'address_country'=> array('query_type'=>'default','db_field'=>array('billing_address_country','shipping_address_country')),
            
    'rating'=> array('query_type'=>'default'),
            
    'phone'=> array('query_type'=>'default','db_field'=>array('phone_office')),
            
    'email'=> array('query_type'=>'default','db_field'=>array('email1','email2')),
            
    'website'=> array('query_type'=>'default'),
            
    'ownership'=> array('query_type'=>'default'),
            
    'employees'=> array('query_type'=>'default'),
            
    'ticker_symbol'=> array('query_type'=>'default'),
            
    'current_user_only'=> array('query_type'=>'default','db_field'=>array('assigned_user_id'),'my_items'=>true'vname' => 'LBL_CURRENT_USER_FILTER''type' => 'bool'),
            
    'assigned_user_id'=> array('query_type'=>'default'),
        );
    ?>
    This is my custom Searchfields.php in custom/modules/Muni_Municipalities/metadata

    PHP Code:
    <?php

    $searchFields
    [$module_name] = 
        array (
            
    'name' => array( 'query_type'=>'default'),
            
    'current_user_only'=> array('query_type'=>'default','db_field'=>array('assigned_user_id'),'my_items'=>true'vname' => 'LBL_CURRENT_USER_FILTER''type' => 'bool'),
        );
    ?>
    Thanks in advance
    Kind regards,

    De Kleine Media


    SugarCRM CE v.5.2.0h
    Windows platform
    MySQL v.5.1
    phpMyAdmin - 2.11.2.2
    Apache Server v.2.0

  5. #5
    avdhesh is offline Sugar Community Member
    Join Date
    May 2008
    Location
    Noida
    Posts
    64

    Default Re: How to remove searchfields from Popup window?

    you can edit popupdefs.php file to add or remove searchfields.
    you can add in this array.........'searchdefs' => array(
    'first_name',
    'last_name',
    array('name' => 'account_name', 'displayParams' => array('hideButtons'=>'true', 'size'=>30, 'class'=>'sqsEnabled sqsNoAutofill')),

    )


    then rebuild relationships from Admin panel.

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

    Default Re: How to remove searchfields from Popup window?

    Ok, a few things:

    - SearchFields.php has nothing to do with this, also do not change it unless you need to because it is not customizable
    - If there is a Popup.php in the module dir, then that one is used. Otherwise popupdefs is used if there is not some action_file_map.php or other major MVC override present.
    - popupdefs.php is metadata and Smarty data and therefore cached, so whatever you do, enable Developer Mode first
    - There is no need to rebuild relationships (that is for TableDictionary). If you do not enable dev mode then you may use Clear Template Data Cache, or just Quick Repair
    Developers go here
    Businesses go there (Dutch)

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

  7. #7
    dekleinemedia is offline A Prolific Poster
    Join Date
    May 2009
    Location
    Netherlands
    Posts
    241

    Default Re: How to remove searchfields from Popup window?

    Quote Originally Posted by SugarDev.net View Post
    Ok, a few things:

    - SearchFields.php has nothing to do with this, also do not change it unless you need to because it is not customizable
    - If there is a Popup.php in the module dir, then that one is used. Otherwise popupdefs is used if there is not some action_file_map.php or other major MVC override present.
    - popupdefs.php is metadata and Smarty data and therefore cached, so whatever you do, enable Developer Mode first
    - There is no need to rebuild relationships (that is for TableDictionary). If you do not enable dev mode then you may use Clear Template Data Cache, or just Quick Repair
    Thanks for the info SugarDev. This makes it a lot easier to understand now. I still wonder why my PopUp search fields still show these searchfields, when I want this to only show the 'name' field.
    See screenshot.

    Thanks for all the help, I appreciate it
    Attached Images Attached Images  
    Kind regards,

    De Kleine Media


    SugarCRM CE v.5.2.0h
    Windows platform
    MySQL v.5.1
    phpMyAdmin - 2.11.2.2
    Apache Server v.2.0

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

    Default Re: How to remove searchfields from Popup window?

    I see $searchFields[$module_name] in your popupdefs.php

    Is that variable set?
    Developers go here
    Businesses go there (Dutch)

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

  9. #9
    dekleinemedia is offline A Prolific Poster
    Join Date
    May 2009
    Location
    Netherlands
    Posts
    241

    Default Re: How to remove searchfields from Popup window?

    Quote Originally Posted by SugarDev.net View Post
    I see $searchFields[$module_name] in your popupdefs.php

    Is that variable set?
    Hi,

    I think there was something wrong with my custom searchdefs.php file. I created a new one, customized the advance search defs and now it works like it should be

    Thanks for all the help!
    Kind regards,

    De Kleine Media


    SugarCRM CE v.5.2.0h
    Windows platform
    MySQL v.5.1
    phpMyAdmin - 2.11.2.2
    Apache Server v.2.0

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. New field in popup window
    By fbrites in forum Help
    Replies: 10
    Last Post: 2008-06-26, 11:42 AM
  2. Field in popup window
    By fbrites in forum Developer Help
    Replies: 0
    Last Post: 2008-05-27, 03:47 PM
  3. problem with popup window
    By sjilumudi in forum Developer Help
    Replies: 0
    Last Post: 2006-08-09, 12:40 PM
  4. Get theme for popup window
    By aheuermann in forum Help
    Replies: 0
    Last Post: 2006-06-26, 06:33 PM
  5. Popup Window Title
    By thehurlster in forum Help
    Replies: 0
    Last Post: 2006-01-15, 04:32 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
  •