コード例 #1
0
ファイル: view.popup.php プロジェクト: jglaine/sugar761-ent
 function display()
 {
     global $popupMeta, $mod_strings;
     if ($this->bean instanceof SugarBean && !$this->bean->ACLAccess('list')) {
         ACLController::displayNoAccess();
         sugar_cleanup(true);
     }
     if (isset($_REQUEST['metadata']) && strpos($_REQUEST['metadata'], "..") !== false) {
         ACLController::displayNoAccess();
         sugar_cleanup(true);
     }
     $popupMeta = SugarAutoLoader::loadPopupMeta($this->module, isset($_REQUEST['metadata']) ? $_REQUEST['metadata'] : null);
     $defs = $this->loadWithPopup('listviewdefs');
     if (is_array($defs)) {
         $listViewDefs[$this->module] = $defs;
     } elseif (!empty($defs)) {
         require $defs;
     }
     $defs = $this->loadWithPopup('searchdefs');
     if (is_array($defs)) {
         $searchdefs[$this->module]['layout']['advanced_search'] = $defs;
     } elseif (!empty($defs)) {
         require $defs;
     }
     if (!empty($this->bean) && isset($_REQUEST[$this->module . '2_' . strtoupper($this->bean->object_name) . '_offset'])) {
         //if you click the pagination button, it will populate the search criteria here
         if (!empty($_REQUEST['current_query_by_page'])) {
             $blockVariables = array('mass', 'uid', 'massupdate', 'delete', 'merge', 'selectCount', 'lvso', 'sortOrder', 'orderBy', 'request_data', 'current_query_by_page');
             $current_query_by_page = unserialize(base64_decode($_REQUEST['current_query_by_page']));
             foreach ($current_query_by_page as $search_key => $search_value) {
                 if ($search_key != $this->module . '2_' . strtoupper($this->bean->object_name) . '_offset' && !in_array($search_key, $blockVariables)) {
                     $_REQUEST[$search_key] = $GLOBALS['db']->quote($search_value);
                 }
             }
         }
     }
     foreach (SugarAutoLoader::existing('modules/' . $this->module . '/Popup_picker.php', 'include/Popups/Popup_picker.php') as $file) {
         require_once $file;
         break;
     }
     $popup = new Popup_Picker();
     $popup->_hide_clear_button = true;
     echo $popup->process_page();
 }
コード例 #2
0
 * terms available at
 * http://support.sugarcrm.com/06_Customer_Center/10_Master_Subscription_Agreements/.
 * If you do not agree to all of the applicable terms or do not have the
 * authority to bind the entity as an authorized representative, then do not
 * install or use this SugarCRM file.
 *
 * Copyright (C) SugarCRM Inc. All rights reserved.
 */
/*********************************************************************************
 * Description:  TODO: To be written.
 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
 * All Rights Reserved.
 * Contributor(s): ______________________________________..
 ********************************************************************************/
require_once 'modules/Documents/Popup_picker.php';
$popup = new Popup_Picker();
global $theme;
global $current_mod_strings;
global $app_strings;
global $currentModule;
global $sugar_version, $sugar_config;
global $app_list_strings;
$current_mod_strings = return_module_language($current_language, 'Documents');
$output_html = '';
$where = '';
$where = $popup->_get_where_clause();
// We can't attach remote documents to emails because we can't necessarialy fetch a copy of them to include.
if (!empty($where)) {
    $where .= ' AND ';
}
$where .= "documents.doc_type IN ( '', 'Sugar')";
コード例 #3
0
ファイル: view.popup.php プロジェクト: delkyd/sugarcrm_dev
 function display()
 {
     global $popupMeta, $mod_strings;
     if ($this->bean instanceof SugarBean && !$this->bean->ACLAccess('list')) {
         ACLController::displayNoAccess();
         sugar_cleanup(true);
     }
     if (isset($_REQUEST['metadata']) && strpos($_REQUEST['metadata'], "..") !== false) {
         die("Directory navigation attack denied.");
     }
     if (!empty($_REQUEST['metadata']) && $_REQUEST['metadata'] != 'undefined' && file_exists('custom/modules/' . $this->module . '/metadata/' . $_REQUEST['metadata'] . '.php')) {
         require 'custom/modules/' . $this->module . '/metadata/' . $_REQUEST['metadata'] . '.php';
     } elseif (!empty($_REQUEST['metadata']) && $_REQUEST['metadata'] != 'undefined' && file_exists('modules/' . $this->module . '/metadata/' . $_REQUEST['metadata'] . '.php')) {
         require 'modules/' . $this->module . '/metadata/' . $_REQUEST['metadata'] . '.php';
     } elseif (file_exists('custom/modules/' . $this->module . '/metadata/popupdefs.php')) {
         require 'custom/modules/' . $this->module . '/metadata/popupdefs.php';
     } elseif (file_exists('modules/' . $this->module . '/metadata/popupdefs.php')) {
         require 'modules/' . $this->module . '/metadata/popupdefs.php';
     }
     if (!empty($popupMeta) && !empty($popupMeta['listviewdefs'])) {
         if (is_array($popupMeta['listviewdefs'])) {
             //if we have an array, then we are not going to include a file, but rather the
             //listviewdefs will be defined directly in the popupdefs file
             $listViewDefs[$this->module] = $popupMeta['listviewdefs'];
         } else {
             //otherwise include the file
             require_once $popupMeta['listviewdefs'];
         }
     } elseif (file_exists('custom/modules/' . $this->module . '/metadata/listviewdefs.php')) {
         require_once 'custom/modules/' . $this->module . '/metadata/listviewdefs.php';
     } elseif (file_exists('modules/' . $this->module . '/metadata/listviewdefs.php')) {
         require_once 'modules/' . $this->module . '/metadata/listviewdefs.php';
     }
     //check for searchdefs as well
     if (!empty($popupMeta) && !empty($popupMeta['searchdefs'])) {
         if (is_array($popupMeta['searchdefs'])) {
             //if we have an array, then we are not going to include a file, but rather the
             //searchdefs will be defined directly in the popupdefs file
             $searchdefs[$this->module]['layout']['advanced_search'] = $popupMeta['searchdefs'];
         } else {
             //otherwise include the file
             require_once $popupMeta['searchdefs'];
         }
     } else {
         if (empty($searchdefs) && file_exists('custom/modules/' . $this->module . '/metadata/searchdefs.php')) {
             require_once 'custom/modules/' . $this->module . '/metadata/searchdefs.php';
         } else {
             if (empty($searchdefs) && file_exists('modules/' . $this->module . '/metadata/searchdefs.php')) {
                 require_once 'modules/' . $this->module . '/metadata/searchdefs.php';
             }
         }
     }
     //if you click the pagination button, it will populate the search criteria here
     if (!empty($this->bean) && isset($_REQUEST[$this->module . '2_' . strtoupper($this->bean->object_name) . '_offset'])) {
         if (!empty($_REQUEST['current_query_by_page'])) {
             $blockVariables = array('mass', 'uid', 'massupdate', 'delete', 'merge', 'selectCount', 'sortOrder', 'orderBy', 'request_data', 'current_query_by_page');
             $current_query_by_page = unserialize(base64_decode($_REQUEST['current_query_by_page']));
             foreach ($current_query_by_page as $search_key => $search_value) {
                 if ($search_key != $this->module . '2_' . strtoupper($this->bean->object_name) . '_offset' && !in_array($search_key, $blockVariables)) {
                     if (!is_array($search_value)) {
                         $_REQUEST[$search_key] = securexss($search_value);
                     } else {
                         foreach ($search_value as $key => &$val) {
                             $val = securexss($val);
                         }
                         $_REQUEST[$search_key] = $search_value;
                     }
                 }
             }
         }
     }
     if (!empty($listViewDefs) && !empty($searchdefs)) {
         require_once 'include/Popups/PopupSmarty.php';
         $displayColumns = array();
         $filter_fields = array();
         $popup = new PopupSmarty($this->bean, $this->module);
         foreach ($listViewDefs[$this->module] as $col => $params) {
             $filter_fields[strtolower($col)] = true;
             if (!empty($params['related_fields'])) {
                 foreach ($params['related_fields'] as $field) {
                     //id column is added by query construction function. This addition creates duplicates
                     //and causes issues in oracle. #10165
                     if ($field != 'id') {
                         $filter_fields[$field] = true;
                     }
                 }
             }
             if (!empty($params['default']) && $params['default']) {
                 $displayColumns[$col] = $params;
             }
         }
         $popup->displayColumns = $displayColumns;
         $popup->filter_fields = $filter_fields;
         $popup->mergeDisplayColumns = true;
         //check to see if popupdefs contains searchdefs
         $popup->_popupMeta = $popupMeta;
         $popup->listviewdefs = $listViewDefs;
         $popup->searchdefs = $searchdefs;
         if (isset($_REQUEST['query'])) {
             $popup->searchForm->populateFromRequest();
         }
         $massUpdateData = '';
         if (isset($_REQUEST['mass'])) {
             foreach (array_unique($_REQUEST['mass']) as $record) {
                 $massUpdateData .= "<input style='display: none' checked type='checkbox' name='mass[]' value='{$record}'>\n";
             }
         }
         $popup->massUpdateData = $massUpdateData;
         $tpl = 'include/Popups/tpls/PopupGeneric.tpl';
         if (file_exists($this->getCustomFilePathIfExists("modules/{$this->module}/tpls/popupGeneric.tpl"))) {
             $tpl = $this->getCustomFilePathIfExists("modules/{$this->module}/tpls/popupGeneric.tpl");
         }
         if (file_exists($this->getCustomFilePathIfExists("modules/{$this->module}/tpls/popupHeader.tpl"))) {
             $popup->headerTpl = $this->getCustomFilePathIfExists("modules/{$this->module}/tpls/popupHeader.tpl");
         }
         if (file_exists($this->getCustomFilePathIfExists("modules/{$this->module}/tpls/popupFooter.tpl"))) {
             $popup->footerTpl = $this->getCustomFilePathIfExists("modules/{$this->module}/tpls/popupFooter.tpl");
         }
         $popup->setup($tpl);
         //We should at this point show the header and javascript even if to_pdf is true.
         //The insert_popup_header javascript is incomplete and shouldn't be relied on.
         if (isset($this->options['show_all']) && $this->options['show_all'] == false) {
             unset($this->options['show_all']);
             $this->options['show_javascript'] = true;
             $this->options['show_header'] = true;
             $this->_displayJavascript();
         }
         insert_popup_header(null, false);
         if (isset($this->override_popup['template_data']) && is_array($this->override_popup['template_data'])) {
             $popup->th->ss->assign($this->override_popup['template_data']);
         }
         echo $popup->display();
     } else {
         if (file_exists('modules/' . $this->module . '/Popup_picker.php')) {
             require_once 'modules/' . $this->module . '/Popup_picker.php';
         } else {
             require_once 'include/Popups/Popup_picker.php';
         }
         $popup = new Popup_Picker();
         $popup->_hide_clear_button = true;
         echo $popup->process_page();
     }
 }
コード例 #4
0
        $last_search['NAME'] = $_REQUEST['name'];
    }
    if (isset($_REQUEST['category'])) {
        $last_search['CATEGORY'] = $_REQUEST['category'];
    }
    if (isset($last_search)) {
        $form->assign("LAST_SEARCH", $last_search);
    }
    $form->parse("main.SearchHeader");
    $form->out("main.SearchHeader");
    echo get_form_footer();
    $form->parse("main.SearchHeaderEnd");
    $form->out("main.SearchHeaderEnd");
    // Reset the sections that are already in the page so that they do not print again later.
    $form->reset("main.SearchHeader");
    $form->reset("main.SearchHeaderEnd");
    // Stick the form header out there.
    $ListView = new ListView();
    $ListView->setXTemplate($form);
    $ListView->setHeaderTitle($mod_strings['LBL_LIST_FORM_TITLE']);
    $ListView->setHeaderText($button);
    $ListView->setQuery($where, "", "num, name", "MATERIAL");
    $ListView->setModStrings($mod_strings);
    $ListView->process_for_popups = true;
    $ListView->processListView($seed_object, "main", "MATERIAL");
    insert_popup_footer();
} else {
    require_once 'include/Popups/Popup_picker.php';
    $popup = new Popup_Picker();
    echo $popup->process_page();
}
コード例 #5
0
 function display()
 {
     global $popupMeta, $mod_strings;
     if (isset($_REQUEST['metadata']) && strpos($_REQUEST['metadata'], "..") !== false) {
         die("Directory navigation attack denied.");
     }
     if (!empty($_REQUEST['metadata']) && $_REQUEST['metadata'] != 'undefined' && file_exists('modules/' . $this->module . '/metadata/' . $_REQUEST['metadata'] . '.php')) {
         // if custom metadata is requested
         require_once 'modules/' . $this->module . '/metadata/' . $_REQUEST['metadata'] . '.php';
     } elseif (file_exists('custom/modules/' . $this->module . '/metadata/popupdefs.php')) {
         require_once 'custom/modules/' . $this->module . '/metadata/popupdefs.php';
     } elseif (file_exists('modules/' . $this->module . '/metadata/popupdefs.php')) {
         require_once 'modules/' . $this->module . '/metadata/popupdefs.php';
     }
     if (!empty($popupMeta) && !empty($popupMeta['listviewdefs'])) {
         if (is_array($popupMeta['listviewdefs'])) {
             //if we have an array, then we are not going to include a file, but rather the
             //listviewdefs will be defined directly in the popupdefs file
             $listViewDefs[$this->module] = $popupMeta['listviewdefs'];
         } else {
             //otherwise include the file
             require_once $popupMeta['listviewdefs'];
         }
     } elseif (file_exists('custom/modules/' . $this->module . '/metadata/listviewdefs.php')) {
         require_once 'custom/modules/' . $this->module . '/metadata/listviewdefs.php';
     } elseif (file_exists('modules/' . $this->module . '/metadata/listviewdefs.php')) {
         require_once 'modules/' . $this->module . '/metadata/listviewdefs.php';
     }
     //check for searchdefs as well
     if (!empty($popupMeta) && !empty($popupMeta['searchdefs'])) {
         if (is_array($popupMeta['searchdefs'])) {
             //if we have an array, then we are not going to include a file, but rather the
             //searchdefs will be defined directly in the popupdefs file
             $searchdefs[$this->module]['layout']['advanced_search'] = $popupMeta['searchdefs'];
         } else {
             //otherwise include the file
             require_once $popupMeta['searchdefs'];
         }
     } else {
         if (empty($searchdefs) && file_exists('modules/' . $this->module . '/metadata/searchdefs.php')) {
             require_once 'modules/' . $this->module . '/metadata/searchdefs.php';
         }
     }
     if (!empty($this->bean) && isset($_REQUEST[$this->module . '2_' . strtoupper($this->bean->object_name) . '_offset'])) {
         //if you click the pagination button, it will poplate the search criteria here
         if (!empty($_REQUEST['current_query_by_page'])) {
             $blockVariables = array('mass', 'uid', 'massupdate', 'delete', 'merge', 'selectCount', 'lvso', 'sortOrder', 'orderBy', 'request_data', 'current_query_by_page');
             $current_query_by_page = unserialize(base64_decode($_REQUEST['current_query_by_page']));
             foreach ($current_query_by_page as $search_key => $search_value) {
                 if ($search_key != $this->module . '2_' . strtoupper($this->bean->object_name) . '_offset' && !in_array($search_key, $blockVariables)) {
                     $_REQUEST[$search_key] = $search_value;
                 }
             }
         }
     }
     if (!empty($listViewDefs) && !empty($searchdefs)) {
         require_once 'include/Popups/PopupSmarty.php';
         $displayColumns = array();
         $filter_fields = array();
         $popup = new PopupSmarty($this->bean, $this->module);
         foreach ($listViewDefs[$this->module] as $col => $params) {
             $filter_fields[strtolower($col)] = true;
             if (!empty($params['related_fields'])) {
                 foreach ($params['related_fields'] as $field) {
                     //id column is added by query construction function. This addition creates duplicates
                     //and causes issues in oracle. #10165
                     if ($field != 'id') {
                         $filter_fields[$field] = true;
                     }
                 }
             }
             if (!empty($params['default']) && $params['default'] && $col != 'TEAM_NAME') {
                 $displayColumns[$col] = $params;
             }
         }
         $popup->displayColumns = $displayColumns;
         $popup->filter_fields = $filter_fields;
         //check to see if popupdes contains searchdefs
         $popup->_popupMeta = $popupMeta;
         $popup->listviewdefs = $listViewDefs;
         $popup->searchdefs = $searchdefs;
         if (isset($_REQUEST['query'])) {
             $popup->searchForm->populateFromRequest();
         }
         $massUpdateData = '';
         if (isset($_REQUEST['mass'])) {
             foreach (array_unique($_REQUEST['mass']) as $record) {
                 $massUpdateData .= "<input style='display: none' checked type='checkbox' name='mass[]' value='{$record}'>\n";
             }
         }
         $popup->massUpdateData = $massUpdateData;
         $popup->setup('include/Popups/tpls/PopupGeneric.tpl');
         insert_popup_header();
         echo $popup->display();
     } else {
         if (file_exists('modules/' . $this->module . '/Popup_picker.php')) {
             require_once 'modules/' . $this->module . '/Popup_picker.php';
         } else {
             require_once 'include/Popups/Popup_picker.php';
         }
         $popup = new Popup_Picker();
         $popup->_hide_clear_button = true;
         echo $popup->process_page();
     }
 }
コード例 #6
0
 function display()
 {
     $this->renderJavascript();
     $popup = new Popup_Picker();
     echo $popup->process_page_for_address();
 }
コード例 #7
0
 function display()
 {
     $popup = new Popup_Picker();
     echo $popup->process_page_for_merge();
 }
コード例 #8
0
 function display()
 {
     // this is a copy of ViewPopup::display() except the marked region at the bottom. have fun reading it :)
     //////////////////////////////////////////////////////////////////////////////////////////////////
     global $popupMeta, $mod_strings, $sugar_version;
     if (isset($_REQUEST['metadata']) && strpos($_REQUEST['metadata'], "..") !== false) {
         die("Directory navigation attack denied.");
     }
     if (!empty($_REQUEST['metadata']) && $_REQUEST['metadata'] != 'undefined' && file_exists('modules/' . $this->module . '/metadata/' . $_REQUEST['metadata'] . '.php')) {
         // if custom metadata is requested
         require_once 'modules/' . $this->module . '/metadata/' . $_REQUEST['metadata'] . '.php';
     } elseif (file_exists('custom/modules/' . $this->module . '/metadata/popupdefs.php')) {
         require_once 'custom/modules/' . $this->module . '/metadata/popupdefs.php';
     } elseif (file_exists('modules/' . $this->module . '/metadata/popupdefs.php')) {
         require_once 'modules/' . $this->module . '/metadata/popupdefs.php';
     }
     if (!empty($popupMeta) && !empty($popupMeta['listviewdefs'])) {
         if (is_array($popupMeta['listviewdefs'])) {
             //if we have an array, then we are not going to include a file, but rather the
             //listviewdefs will be defined directly in the popupdefs file
             $listViewDefs[$this->module] = $popupMeta['listviewdefs'];
         } else {
             //otherwise include the file
             require_once $popupMeta['listviewdefs'];
         }
     } elseif (file_exists('custom/modules/' . $this->module . '/metadata/listviewdefs.php')) {
         require_once 'custom/modules/' . $this->module . '/metadata/listviewdefs.php';
     } elseif (file_exists('modules/' . $this->module . '/metadata/listviewdefs.php')) {
         require_once 'modules/' . $this->module . '/metadata/listviewdefs.php';
     }
     //check for searchdefs as well
     if (!empty($popupMeta) && !empty($popupMeta['searchdefs'])) {
         if (is_array($popupMeta['searchdefs'])) {
             //if we have an array, then we are not going to include a file, but rather the
             //searchdefs will be defined directly in the popupdefs file
             $searchdefs[$this->module]['layout']['advanced_search'] = $popupMeta['searchdefs'];
         } else {
             //otherwise include the file
             require_once $popupMeta['searchdefs'];
         }
     } else {
         if (empty($searchdefs) && file_exists('modules/' . $this->module . '/metadata/searchdefs.php')) {
             require_once 'modules/' . $this->module . '/metadata/searchdefs.php';
         }
     }
     if (!empty($this->bean) && isset($_REQUEST[$this->module . '2_' . strtoupper($this->bean->object_name) . '_offset'])) {
         //if you click the pagination button, it will poplate the search criteria here
         if (!empty($_REQUEST['current_query_by_page'])) {
             $blockVariables = array('mass', 'uid', 'massupdate', 'delete', 'merge', 'selectCount', 'lvso', 'sortOrder', 'orderBy', 'request_data', 'current_query_by_page');
             $current_query_by_page = unserialize(base64_decode($_REQUEST['current_query_by_page']));
             foreach ($current_query_by_page as $search_key => $search_value) {
                 if ($search_key != $this->module . '2_' . strtoupper($this->bean->object_name) . '_offset' && !in_array($search_key, $blockVariables)) {
                     $_REQUEST[$search_key] = $search_value;
                 }
             }
         }
     }
     if (!empty($listViewDefs) && !empty($searchdefs)) {
         //		require_once('include/Popups/PopupSmarty.php');
         $displayColumns = array();
         $filter_fields = array();
         $whereClauses = array();
         $initialFilterClauses = array();
         $popup = new oqc_ProductPopupSmarty($this->bean, $this->module);
         // exclude product with given id and products that contain other products (packages)
         //////////////////////////////////////////////////////////////////////////////////////////////////
         $formFields = array();
         if (isset($_REQUEST['not_this_product_id']) && !empty($_REQUEST['not_this_product_id'])) {
             $formFields['not_this_product_id'] = $_REQUEST['not_this_product_id'];
             $whereClauses = array($this->bean->table_name . ".id != '{$_REQUEST['not_this_product_id']}'", $this->bean->table_name . ".active != '0'", $this->bean->table_name . ".is_latest != '0'");
         } else {
             $formFields['not_this_product_id'] = '';
             $whereClauses = array($this->bean->table_name . ".active != '0'", $this->bean->table_name . ".is_latest != '0'");
         }
         if (isset($_REQUEST['is_option']) && $_REQUEST['is_option'] != '') {
             $formFields['is_option'] = $_REQUEST['is_option'];
             //if isset product_id found all options that are associated with this product 2.0
             if (isset($_REQUEST['product_id']) && !empty($_REQUEST['product_id'])) {
                 $product = new oqc_Product();
                 if ($product->retrieve($_REQUEST['product_id'])) {
                     $formFields['product_id'] = $_REQUEST['product_id'];
                     if (!empty($product->optionssequence)) {
                         $optionsIds = explode(' ', $product->optionssequence);
                         $productClauses = array();
                         foreach ($optionsIds as $optionId) {
                             //						$option = new oqc_Product();
                             $latestOptionId = $product->getLatestRevisionFromId($optionId);
                             $productClauses[] = $this->bean->table_name . ".id = '{$latestOptionId}'";
                         }
                         $productClause = implode(' or ', $productClauses);
                         $whereClauses[] = '(' . $productClause . ')';
                     } else {
                         $whereClauses[] = $this->bean->table_name . ".id = ''";
                     }
                 } else {
                     $whereClauses[] = $this->bean->table_name . ".id = ''";
                 }
             }
             $whereClauses[] = $this->bean->table_name . ".is_option = '{$_REQUEST['is_option']}'";
         } else {
             // 2.0 If user push Clear button then no Products will be displayed ! Its is real Clear Button! :-)
             //				$whereClauses[] = $this->bean->table_name.".id = ''";
             $whereClauses[] = $this->bean->table_name . ".is_option = '0'";
             $formFields['is_option'] = 0;
         }
         if (isset($_REQUEST['is_recurring']) && $_REQUEST['is_recurring'] != '') {
             $formFields['is_recurring'] = $_REQUEST['is_recurring'];
             if ($_REQUEST['is_recurring'] == '0') {
                 $whereClauses[] = $this->bean->table_name . ".is_recurring = '0'";
             } else {
                 $whereClauses[] = $this->bean->table_name . ".is_recurring = '1'";
             }
         }
         if (isset($_REQUEST['status']) && !empty($_REQUEST['status'])) {
             $formFields['status'] = $_REQUEST['status'];
             $initialFilterClauses = array($this->bean->table_name . ".status = '{$_REQUEST['status']}'");
         }
         $finalwhereClauses = array_merge($whereClauses, $initialFilterClauses);
         //$GLOBALS['log']->error('Popup where clauses: '. var_export($finalwhereClauses,true));
         $popup->searchForm = new ProductSearchForm($this->bean, $this->module, "index", $finalwhereClauses);
         //////////////////////////////////////////////////////////////////////////////////////////////////
         foreach ($listViewDefs[$this->module] as $col => $params) {
             $filter_fields[strtolower($col)] = true;
             if (!empty($params['related_fields'])) {
                 foreach ($params['related_fields'] as $field) {
                     //id column is added by query construction function. This addition creates duplicates
                     //and causes issues in oracle. #10165
                     if ($field != 'id') {
                         $filter_fields[$field] = true;
                     }
                 }
             }
             if (!empty($params['default']) && $params['default'] && $col != 'TEAM_NAME') {
                 $displayColumns[$col] = $params;
             }
         }
         $popup->displayColumns = $displayColumns;
         $popup->filter_fields = $filter_fields;
         //check to see if popupdes contains searchdefs
         $popup->_popupMeta = $popupMeta;
         $popup->listviewdefs = $listViewDefs;
         $popup->searchdefs = $searchdefs;
         if (isset($_REQUEST['query'])) {
             //2.2RC1 we unset Request fields for which we already produced sql query
             foreach ($formFields as $field => $value) {
                 unset($_REQUEST[$field]);
             }
             $popup->searchForm->populateFromRequest();
         }
         $massUpdateData = '';
         if (isset($_REQUEST['mass'])) {
             foreach (array_unique($_REQUEST['mass']) as $record) {
                 $massUpdateData .= "<input style='display: none' checked type='checkbox' name='mass[]' value='{$record}'>\n";
             }
         }
         $popup->massUpdateData = $massUpdateData;
         global $theme, $image_path;
         // 2.2RC1 PopupGeneric does not handle currency field properly- currency is always formatted with default currency symbol
         if (floatval(substr($sugar_version, 0, 3)) > 6.4) {
             $popup->setup('modules/oqc_Product/views/oqcProductPopup65.tpl');
         } elseif (floatval(substr($sugar_version, 0, 3)) > 6.3) {
             $popup->setup('modules/oqc_Product/views/oqcProductPopup64.tpl');
         } elseif (floatval(substr($sugar_version, 0, 3)) >= 6.0 && floatval(substr($sugar_version, 0, 3)) <= 6.3) {
             $popup->setup('modules/oqc_Product/views/oqcProductPopup62.tpl');
         } else {
             $popup->setup('include/Popups/tpls/PopupGeneric.tpl');
         }
         //$popup->setup('include/Popups/tpls/PopupGeneric.tpl');
         insert_popup_header($theme);
         //Quick Search support
         $sqsJavascript = '<script type="text/javascript" src="include/oqc/QuickSearch/oqcQS.js"></script>';
         echo $sqsJavascript;
         echo $popup->display(true, $formFields);
     } else {
         if (file_exists('modules/' . $this->module . '/Popup_picker.php')) {
             require_once 'modules/' . $this->module . '/Popup_picker.php';
         } else {
             require_once 'include/Popups/Popup_picker.php';
         }
         $popup = new Popup_Picker();
         $popup->_hide_clear_button = true;
         echo $popup->process_page();
     }
 }