• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP UnifiedSearchAdvanced类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中UnifiedSearchAdvanced的典型用法代码示例。如果您正苦于以下问题:PHP UnifiedSearchAdvanced类的具体用法?PHP UnifiedSearchAdvanced怎么用?PHP UnifiedSearchAdvanced使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了UnifiedSearchAdvanced类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: setUp

 public function setUp()
 {
     global $beanList, $beanFiles;
     include 'include/modules.php';
     //Reload langauge strings
     $GLOBALS['app_strings'] = return_application_language($GLOBALS['current_language']);
     $GLOBALS['app_list_strings'] = return_app_list_strings_language($GLOBALS['current_language']);
     $GLOBALS['mod_strings'] = return_module_language($GLOBALS['current_language'], 'Accounts');
     //Create an anonymous user for login purposes/
     $this->_user = new User();
     $this->_user->retrieve('1');
     $GLOBALS['current_user'] = $this->_user;
     self::$helperObject = new APIv3Helper();
     if (file_exists(sugar_cached('modules/unified_search_modules.php'))) {
         $this->unified_search_modules_content = file_get_contents(sugar_cached('modules/unified_search_modules.php'));
         unlink(sugar_cached('modules/unified_search_modules.php'));
     }
     require_once 'modules/Home/UnifiedSearchAdvanced.php';
     $unifiedSearchAdvanced = new UnifiedSearchAdvanced();
     $_REQUEST['enabled_modules'] = 'Accounts,Contacts,Opportunities';
     $unifiedSearchAdvanced->saveGlobalSearchSettings();
     $GLOBALS['db']->query("DELETE FROM accounts WHERE name like 'UNIT TEST%' ");
     $GLOBALS['db']->query("DELETE FROM opportunities WHERE name like 'UNIT TEST%' ");
     $GLOBALS['db']->query("DELETE FROM contacts WHERE first_name like 'UNIT TEST%' ");
     $GLOBALS['db']->query("DELETE FROM calls WHERE name like 'UNIT TEST%' ");
     $GLOBALS['db']->query("DELETE FROM tasks WHERE name like 'UNIT TEST%' ");
     $GLOBALS['db']->query("DELETE FROM meetings WHERE name like 'UNIT TEST%' ");
     //$this->useOutputBuffering = false;
 }
开发者ID:netconstructor,项目名称:sugarcrm_dev,代码行数:29,代码来源:RESTAPI3Test.php


示例2: display

    /**
     * @see SugarView::display()
     */
    public function display()
    {
        global $mod_strings;
        echo '<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr><td colspan="100"><h2>' . $this->getModuleTitle(false) . '</h2></td></tr><tr><td colspan="100">' . $mod_strings['LBL_GLOBAL_SEARCH_SETTINGS_TITLE'] . '</td></tr><tr><td><br></td></tr><tr><td colspan="100">';
        //echo $this->getModuleTitle();
        require_once 'modules/Home/UnifiedSearchAdvanced.php';
        $usa = new UnifiedSearchAdvanced();
        echo $usa->modifyGlobalSearchSettings();
    }
开发者ID:sysraj86,项目名称:carnivalcrm,代码行数:13,代码来源:view.globalsearchsettings.php


示例3: testFisrtUnifiedSearchWithoutUserPreferences

 public function testFisrtUnifiedSearchWithoutUserPreferences()
 {
     //Enable the Tasks, Accounts and Contacts modules
     require_once 'modules/Home/UnifiedSearchAdvanced.php';
     $_REQUEST = array();
     $_REQUEST['enabled_modules'] = 'Tasks,Accounts,Contacts';
     $unifiedSearchAdvanced = new UnifiedSearchAdvanced();
     $unifiedSearchAdvanced->saveGlobalSearchSettings();
     $_REQUEST = array();
     $_REQUEST['advanced'] = 'false';
     $unifiedSearchAdvanced->query_stirng = 'blah';
     $unifiedSearchAdvanced->search();
     global $current_user;
     $users_modules = $current_user->getPreference('globalSearch', 'search');
     $this->assertTrue(!empty($users_modules), 'Assert we have set the user preferences properly');
     $this->assertTrue(isset($users_modules['Tasks']), 'Assert that we have added the Tasks module');
     $this->assertEquals(count($users_modules), 3, 'Assert that we have 3 modules in user preferences for global search');
 }
开发者ID:jgera,项目名称:sugarcrm_dev,代码行数:18,代码来源:Bug43653Test.php


示例4: display

 /**
  * @see SugarView::display()
  */
 public function display()
 {
     require_once 'modules/Home/UnifiedSearchAdvanced.php';
     $usa = new UnifiedSearchAdvanced();
     global $mod_strings, $app_strings, $app_list_strings;
     $sugar_smarty = new Sugar_Smarty();
     $sugar_smarty->assign('APP', $app_strings);
     $sugar_smarty->assign('MOD', $mod_strings);
     $sugar_smarty->assign('moduleTitle', $this->getModuleTitle(false));
     $modules = $usa->retrieveEnabledAndDisabledModules();
     $sugar_smarty->assign('enabled_modules', json_encode($modules['enabled']));
     $sugar_smarty->assign('disabled_modules', json_encode($modules['disabled']));
     $tpl = 'modules/Administration/templates/GlobalSearchSettings.tpl';
     if (file_exists('custom/' . $tpl)) {
         $tpl = 'custom/' . $tpl;
     }
     echo $sugar_smarty->fetch($tpl);
 }
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:21,代码来源:view.globalsearchsettings.php


示例5: testBuildCache

 /**
  * @brief generation of new cache file and search for force_unifiedsearch fields in it
  * @group 42961
  */
 public function testBuildCache()
 {
     $beanList = array();
     $beanFiles = array();
     require 'include/modules.php';
     $GLOBALS['beanList'] = $beanList;
     $GLOBALS['beanFiles'] = $beanFiles;
     $unifiedSearchAdvanced = new UnifiedSearchAdvanced();
     $unifiedSearchAdvanced->buildCache();
     $this->assertFileExists($GLOBALS['sugar_config']['cache_dir'] . 'modules/unified_search_modules.php', 'Here should be cache file with data');
     include $GLOBALS['sugar_config']['cache_dir'] . 'modules/unified_search_modules.php';
     $force_unifiedsearch = 0;
     foreach ($unified_search_modules as $moduleName => $moduleInformation) {
         foreach ($moduleInformation['fields'] as $fieldName => $fieldInformation) {
             if (key_exists('force_unifiedsearch', $fieldInformation)) {
                 $force_unifiedsearch++;
             }
         }
     }
     $this->assertGreaterThan(0, $force_unifiedsearch, 'Here should be fields with force_unifiedsearch key');
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:25,代码来源:Bug42961Test.php


示例6: display

 /**
  * @see SugarView::display()
  */
 public function display()
 {
     require_once 'modules/Home/UnifiedSearchAdvanced.php';
     $usa = new UnifiedSearchAdvanced();
     global $mod_strings, $app_strings, $app_list_strings, $current_user;
     $sugar_smarty = new Sugar_Smarty();
     $sugar_smarty->assign('APP', $app_strings);
     $sugar_smarty->assign('MOD', $mod_strings);
     $sugar_smarty->assign('moduleTitle', $this->getModuleTitle(false));
     $modules = $usa->retrieveEnabledAndDisabledModules();
     $sugar_smarty->assign('enabled_modules', json_encode($modules['enabled']));
     $sugar_smarty->assign('disabled_modules', json_encode($modules['disabled']));
     $defaultEngine = SugarSearchEngineFactory::getFTSEngineNameFromConfig();
     $config = $GLOBALS['sugar_config']['full_text_engine'][$defaultEngine];
     $justRequestedAScheduledIndex = !empty($_REQUEST['sched']) ? true : false;
     $hide_fts_config = isset($GLOBALS['sugar_config']['hide_full_text_engine_config']) ? $GLOBALS['sugar_config']['hide_full_text_engine_config'] : false;
     $showSchedButton = $defaultEngine != '' && $this->isFTSConnectionValid() ? true : false;
     $sugar_smarty->assign("showSchedButton", $showSchedButton);
     $sugar_smarty->assign("hide_fts_config", $hide_fts_config);
     $sugar_smarty->assign("fts_type", get_select_options_with_id($app_list_strings['fts_type'], $defaultEngine));
     $sugar_smarty->assign("fts_host", $config['host']);
     $sugar_smarty->assign("fts_port", $config['port']);
     $sugar_smarty->assign("fts_scheduled", !empty($schedulerID) && !$schedulerCompleted);
     $sugar_smarty->assign('justRequestedAScheduledIndex', $justRequestedAScheduledIndex);
     //End FTS
     if (is_admin($current_user)) {
         if (!empty($GLOBALS['sugar_config']['fts_disable_notification'])) {
             displayAdminError(translate('LBL_FTS_DISABLED', 'Administration'));
         }
         // if fts indexing is done, show the notification to admin
         $admin = Administration::getSettings();
         if (!empty($admin->settings['info_fts_index_done'])) {
             displayAdminError(translate('LBL_FTS_INDEXING_DONE', 'Administration'));
             // reset flag
             $admin->saveSetting('info', 'fts_index_done', 0);
         }
     }
     echo $sugar_smarty->fetch(SugarAutoLoader::existingCustomOne('modules/Administration/templates/GlobalSearchSettings.tpl'));
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:42,代码来源:view.globalsearchsettings.php


示例7: setUp

 public function setUp()
 {
     //Create an anonymous user for login purposes/
     $this->_user = SugarTestUserUtilities::createAnonymousUser();
     $GLOBALS['current_user'] = $this->_user;
     self::$helperObject = new APIv3Helper();
     if (file_exists(sugar_cached('modules/unified_search_modules.php'))) {
         $this->unified_search_modules_content = file_get_contents(sugar_cached('modules/unified_search_modules.php'));
         unlink(sugar_cached('modules/unified_search_modules.php'));
     }
     require_once 'modules/Home/UnifiedSearchAdvanced.php';
     $unifiedSearchAdvanced = new UnifiedSearchAdvanced();
     $_REQUEST['enabled_modules'] = 'Accounts,Contacts,Opportunities';
     $unifiedSearchAdvanced->saveGlobalSearchSettings();
     $GLOBALS['db']->query("DELETE FROM accounts WHERE name like 'UNIT TEST%' ");
     $GLOBALS['db']->query("DELETE FROM opportunities WHERE name like 'UNIT TEST%' ");
     $GLOBALS['db']->query("DELETE FROM contacts WHERE first_name like 'UNIT TEST%' ");
     $GLOBALS['db']->query("DELETE FROM calls WHERE name like 'UNIT TEST%' ");
     $GLOBALS['db']->query("DELETE FROM tasks WHERE name like 'UNIT TEST%' ");
     $GLOBALS['db']->query("DELETE FROM meetings WHERE name like 'UNIT TEST%' ");
     $GLOBALS['db']->commit();
     //$this->useOutputBuffering = false;
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:23,代码来源:RESTAPI3Test.php


示例8: test_create_unified_search_modules_display

 public function test_create_unified_search_modules_display()
 {
     if (file_exists('custom/modules/unified_search_modules_display.php')) {
         unlink('custom/modules/unified_search_modules_display.php');
     }
     require_once 'modules/UpgradeWizard/uw_utils.php';
     $usa = new UnifiedSearchAdvanced();
     $_REQUEST['enabled_modules'] = 'Accounts,Bug36845Test';
     $usa->saveGlobalSearchSettings();
     $this->assertTrue(file_exists('custom/modules/unified_search_modules_display.php'), 'Assert that unified_search_modules_display.php file was created');
 }
开发者ID:rgauss,项目名称:sugarcrm_dev,代码行数:11,代码来源:Bug36845Test.php


示例9: action_DeployPackage

 function action_DeployPackage()
 {
     if (defined('TEMPLATE_URL')) {
         sugar_cache_reset();
         SugarTemplateUtilities::disableCache();
     }
     $mb = new ModuleBuilder();
     $load = $_REQUEST['package'];
     $message = $GLOBALS['mod_strings']['LBL_MODULE_DEPLOYED'];
     if (!empty($load)) {
         $zip = $mb->getPackage($load);
         require_once 'ModuleInstall/PackageManager/PackageManager.php';
         $pm = new PackageManager();
         $info = $mb->packages[$load]->build(false);
         mkdir_recursive($GLOBALS['sugar_config']['cache_dir'] . '/upload/upgrades/module/');
         rename($info['zip'], $GLOBALS['sugar_config']['cache_dir'] . '/' . 'upload/upgrades/module/' . $info['name'] . '.zip');
         copy($info['manifest'], $GLOBALS['sugar_config']['cache_dir'] . '/' . 'upload/upgrades/module/' . $info['name'] . '-manifest.php');
         $_REQUEST['install_file'] = $GLOBALS['sugar_config']['cache_dir'] . '/' . 'upload/upgrades/module/' . $info['name'] . '.zip';
         $GLOBALS['mi_remove_tables'] = false;
         $pm->performUninstall($load);
         //#23177 , js cache clear
         clearAllJsAndJsLangFilesWithoutOutput();
         //#30747, clear the cache in memory
         $cache_key = 'app_list_strings.' . $GLOBALS['current_language'];
         sugar_cache_clear($cache_key);
         sugar_cache_reset();
         //clear end
         $pm->performInstall($_REQUEST['install_file'], true);
         //clear the unified_search_module.php file
         require_once 'modules/Home/UnifiedSearchAdvanced.php';
         UnifiedSearchAdvanced::unlinkUnifiedSearchModulesFile();
     }
     echo 'complete';
 }
开发者ID:nartnik,项目名称:sugarcrm_test,代码行数:34,代码来源:controller.php


示例10: testUserPreferencesSearch

 public function testUserPreferencesSearch()
 {
     global $mod_strings, $modListHeader, $app_strings, $beanList, $beanFiles, $current_user;
     require 'config.php';
     require 'include/modules.php';
     $usa = new UnifiedSearchAdvanced();
     $_REQUEST['enabled_modules'] = 'Accounts,Contacts';
     $usa->saveGlobalSearchSettings();
     $current_user->setPreference('globalSearch', array('Accounts', 'Contacts'), 0, 'search');
     $current_user->savePreferencesToDB();
     $_REQUEST = array();
     $_REQUEST['query_string'] = $this->_contact->first_name . ' ' . $this->_contact->last_name;
     $_REQUEST['module'] = 'Home';
     $usa->search();
     $modules = $current_user->getPreference('globalSearch', 'search');
     $this->assertEquals(count($modules), 2, 'Assert that there are two modules in the user preferences as defined from the global search');
     $this->assertEquals('Accounts', $modules[0], 'Assert that the Accounts module has been added');
     $this->assertEquals('Contacts', $modules[1], 'Assert that the Contacts module has been added');
 }
开发者ID:netconstructor,项目名称:sugarcrm_dev,代码行数:19,代码来源:UnifiedSearchAdvancedTest.php


示例11: getSearchModules

 /**
  * Determine which modules should be searched against.
  *
  * @return array
  */
 protected function getSearchModules()
 {
     $usa = new UnifiedSearchAdvanced();
     $unified_search_modules_display = $usa->getUnifiedSearchModulesDisplay();
     // load the list of unified search enabled modules
     $modules = array();
     //check to see if the user has  customized the list of modules available to search
     $users_modules = $GLOBALS['current_user']->getPreference('globalSearch', 'search');
     if (!empty($users_modules)) {
         // use user's previous selections
         foreach ($users_modules as $key => $value) {
             if (isset($unified_search_modules_display[$key]) && !empty($unified_search_modules_display[$key]['visible'])) {
                 $modules[$key] = $key;
             }
         }
     } else {
         foreach ($unified_search_modules_display as $key => $data) {
             if (!empty($data['visible'])) {
                 $modules[$key] = $key;
             }
         }
     }
     // make sure the current module appears first in the list
     if (isset($modules[$this->module])) {
         unset($modules[$this->module]);
         $modules = array_merge(array($this->module => $this->module), $modules);
     }
     return $modules;
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:34,代码来源:SugarSpot.php


示例12: action_saveglobalsearchsettings

 /**
  * action_saveglobalsearchsettings
  *
  * This method handles saving the selected modules to display in the Global Search Settings.
  * It instantiates an instance of UnifiedSearchAdvanced and then calls the saveGlobalSearchSettings
  * method.
  *
  */
 public function action_saveglobalsearchsettings()
 {
     global $current_user, $app_strings;
     if (!is_admin($current_user)) {
         sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']);
     }
     try {
         require_once 'modules/Home/UnifiedSearchAdvanced.php';
         $unifiedSearchAdvanced = new UnifiedSearchAdvanced();
         $unifiedSearchAdvanced->saveGlobalSearchSettings();
         //Save FTS Settings
         $type = !empty($_REQUEST['type']) ? $_REQUEST['type'] : '';
         $host = !empty($_REQUEST['host']) ? $_REQUEST['host'] : '';
         $port = !empty($_REQUEST['port']) ? $_REQUEST['port'] : '';
         $ftsConfig = $this->mergeFtsConfig($type, array('port' => $port, 'host' => $host));
         $this->cfg = new Configurator();
         $this->cfg->config['full_text_engine'] = '';
         $this->cfg->saveConfig();
         $ftsConnectionValid = TRUE;
         if (!empty($type)) {
             //Check if the connection is valid on save:
             require_once 'include/SugarSearchEngine/SugarSearchEngineFactory.php';
             $searchEngine = SugarSearchEngineFactory::getInstance($type, $ftsConfig);
             $result = $searchEngine->getServerStatus();
             if (!$result['valid']) {
                 $ftsConnectionValid = FALSE;
             }
             // bug 54274 -- only bother with an override if we have data to place there, empty string breaks Sugar On-Demand!
             $ftsConfig['valid'] = $ftsConnectionValid;
             $this->cfg->config['full_text_engine'] = array($type => $ftsConfig);
             $this->cfg->handleOverride();
         }
         // Refresh the server info & module list sections of the metadata
         MetaDataManager::refreshSectionCache(array(MetaDataManager::MM_SERVERINFO, MetaDataManager::MM_MODULES));
         if (!$ftsConnectionValid) {
             echo $GLOBALS['mod_strings']['LBL_FTS_CONNECTION_INVALID'];
         } else {
             echo "true";
         }
     } catch (Exception $ex) {
         echo "false";
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:51,代码来源:controller.php


示例13: search_by_module

 /**
  * Given a list of modules to search and a search string, return the id, module_name, along with the fields
  * We will support Accounts, Bug Tracker, Cases, Contacts, Leads, Opportunities, Project, ProjectTask, Quotes
  *
  * @param string $session			- Session ID returned by a previous call to login.
  * @param string $search_string 	- string to search
  * @param string[] $modules			- array of modules to query
  * @param int $offset				- a specified offset in the query
  * @param int $max_results			- max number of records to return
  * @return Array 'entry_list' -- Array('Accounts' => array(array('name' => 'first_name', 'value' => 'John', 'name' => 'last_name', 'value' => 'Do')))
  * @exception 'SoapFault' -- The SOAP error, if any
  */
 function search_by_module($session, $search_string, $modules, $offset, $max_results)
 {
     $GLOBALS['log']->info('Begin: SugarWebServiceImpl->search_by_module');
     global $beanList, $beanFiles;
     global $sugar_config, $current_language;
     $error = new SoapError();
     $output_list = array();
     if (!self::$helperObject->checkSessionAndModuleAccess($session, 'invalid_session', '', '', '', $error)) {
         $error->set_error('invalid_login');
         $GLOBALS['log']->info('End: SugarWebServiceImpl->search_by_module');
         return;
     }
     global $current_user;
     if ($max_results > 0) {
         $sugar_config['list_max_entries_per_page'] = $max_results;
     }
     require_once 'modules/Home/UnifiedSearchAdvanced.php';
     require_once 'include/utils.php';
     $usa = new UnifiedSearchAdvanced();
     if (!file_exists($cachedfile = sugar_cached('modules/unified_search_modules.php'))) {
         $usa->buildCache();
     }
     include $cachedfile;
     $modules_to_search = array();
     $unified_search_modules['Users'] = array('fields' => array());
     $unified_search_modules['ProjectTask'] = array('fields' => array());
     foreach ($unified_search_modules as $module => $data) {
         if (in_array($module, $modules)) {
             $modules_to_search[$module] = $beanList[$module];
         }
         // if
     }
     // foreach
     $GLOBALS['log']->info('SugarWebServiceImpl->search_by_module - search string = ' . $search_string);
     if (!empty($search_string) && isset($search_string)) {
         $search_string = trim($GLOBALS['db']->quote(securexss(from_html(clean_string($search_string, 'UNIFIED_SEARCH')))));
         foreach ($modules_to_search as $name => $beanName) {
             $where_clauses_array = array();
             $unifiedSearchFields = array();
             foreach ($unified_search_modules[$name]['fields'] as $field => $def) {
                 $unifiedSearchFields[$name][$field] = $def;
                 $unifiedSearchFields[$name][$field]['value'] = $search_string;
             }
             $seed = BeanFactory::getBean($name);
             require_once 'include/SearchForm/SearchForm2.php';
             if ($beanName == "User" || $beanName == "ProjectTask") {
                 if (!self::$helperObject->check_modules_access($current_user, $seed->module_dir, 'read')) {
                     continue;
                 }
                 // if
                 if (!$seed->ACLAccess('ListView')) {
                     continue;
                 }
                 // if
             }
             if ($beanName != "User" && $beanName != "ProjectTask") {
                 $searchForm = new SearchForm($seed, $name);
                 $searchForm->setup(array($name => array()), $unifiedSearchFields, '', 'saved_views');
                 $where_clauses = $searchForm->generateSearchWhere();
                 require_once 'include/SearchForm/SearchForm2.php';
                 $searchForm = new SearchForm($seed, $name);
                 $searchForm->setup(array($name => array()), $unifiedSearchFields, '', 'saved_views');
                 $where_clauses = $searchForm->generateSearchWhere();
                 $emailQuery = false;
                 $where = '';
                 if (count($where_clauses) > 0) {
                     $where = '(' . implode(' ) OR ( ', $where_clauses) . ')';
                 }
                 $mod_strings = return_module_language($current_language, $seed->module_dir);
                 require_once SugarAutoLoader::loadWithMetafiles($seed->module_dir, 'listviewdefs');
                 $filterFields = array();
                 foreach ($listViewDefs[$seed->module_dir] as $colName => $param) {
                     if (!empty($param['default']) && $param['default'] == true) {
                         $filterFields[] = strtolower($colName);
                     }
                     // if
                 }
                 // foreach
                 if (!in_array('id', $filterFields)) {
                     $filterFields[] = 'id';
                 }
                 // if
                 $ret_array = $seed->create_new_list_query('', $where, $filterFields, array(), 0, '', true, $seed, true);
                 if (empty($params) or !is_array($params)) {
                     $params = array();
                 }
                 if (!isset($params['custom_select'])) {
                     $params['custom_select'] = '';
//.........这里部分代码省略.........
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:101,代码来源:SugarWebServiceImpl.php


示例14: UnifiedSearchAdvanced

 * 02110-1301 USA.
 * 
 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
 * SW2-130, Cupertino, CA 95014, USA. or at email address [email protected].
 * 
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by SugarCRM".
 ********************************************************************************/
/*********************************************************************************
 * Description:  TODO: To be written.
 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
 * All Rights Reserved.
 * Contributor(s): ______________________________________..
 ********************************************************************************/
require_once 'modules/Home/UnifiedSearchAdvanced.php';
if (!empty($_REQUEST['usa_form'])) {
    $usa = new UnifiedSearchAdvanced();
    echo $usa->getDropDownDiv();
} else {
    global $mod_strings, $modListHeader, $app_strings, $beanList, $beanFiles;
    echo get_module_title("Search", $mod_strings['LBL_SEARCH_RESULTS'], true);
    $usa = new UnifiedSearchAdvanced();
    $usa->search();
}
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:31,代码来源:UnifiedSearch.php


示例15: uninstall

 function uninstall($base_dir)
 {
     if (defined('TEMPLATE_URL')) {
         SugarTemplateUtilities::disableCache();
     }
     global $app_strings;
     $total_steps = 5;
     //min steps with no tasks
     $current_step = 0;
     $this->base_dir = $base_dir;
     $tasks = array('pre_uninstall', 'uninstall_relationships', 'uninstall_copy', 'uninstall_dcactions', 'uninstall_dashlets', 'uninstall_connectors', 'uninstall_layoutfields', 'uninstall_extensions', 'uninstall_global_search', 'disable_manifest_logichooks', 'post_uninstall');
     $total_steps += count($tasks);
     //now the real number of steps
     if (file_exists($this->base_dir . '/manifest.php')) {
         if (!$this->silent) {
             $current_step++;
             display_progress_bar('install', $current_step, $total_steps);
             echo '<div id ="displayLoglink" ><a href="#" onclick="toggleDisplay(\'displayLog\')">' . $app_strings['LBL_DISPLAY_LOG'] . '</a> </div><div id="displayLog" style="display:none">';
         }
         global $moduleList;
         include $this->base_dir . '/manifest.php';
         $this->installdefs = $installdefs;
         $this->id_name = $this->installdefs['id'];
         $installed_modules = array();
         if (isset($this->installdefs['beans'])) {
             foreach ($this->installdefs['beans'] as $bean) {
                 $installed_modules[] = $bean['module'];
                 $this->uninstall_user_prefs($bean['module']);
             }
             $this->modulesInPackage = $installed_modules;
             $this->uninstall_beans($installed_modules);
             $this->uninstall_customizations($installed_modules);
             if (!$this->silent) {
                 $current_step++;
                 update_progress_bar('install', $total_steps, $total_steps);
             }
         }
         if (!$this->silent) {
             $current_step++;
             update_progress_bar('install', $current_step, $total_steps);
         }
         foreach ($tasks as $task) {
             $this->{$task}();
             if (!$this->silent) {
                 $current_step++;
                 update_progress_bar('install', $current_step, $total_steps);
             }
         }
         if (isset($installdefs['custom_fields']) && (isset($GLOBALS['mi_remove_tables']) && $GLOBALS['mi_remove_tables'])) {
             $this->log(translate('LBL_MI_UN_CUSTOMFIELD'));
             $this->uninstall_custom_fields($installdefs['custom_fields']);
         }
         if (!$this->silent) {
             $current_step++;
             update_progress_bar('install', $current_step, $total_steps);
             echo '</div>';
         }
         //since we are passing $silent = true to rebuildAll() in that method it will set $this->silent = true, so
         //we need to save the setting to set it back after rebuildAll() completes.
         $silentBak = $this->silent;
         $this->rebuild_all(true);
         $this->silent = $silentBak;
         //#27877, If the request from MB redeploy a custom module , we will not remove the ACL actions for this package.
         if (!isset($_REQUEST['action']) || $_REQUEST['action'] != 'DeployPackage') {
             $this->remove_acl_actions();
         }
         //end
         if (!$this->silent) {
             $current_step++;
             update_progress_bar('install', $current_step, $total_steps);
             echo '</div>';
         }
         UpdateSystemTabs('Restore', $installed_modules);
         //clear the unified_search_module.php file
         require_once 'modules/Home/UnifiedSearchAdvanced.php';
         UnifiedSearchAdvanced::unlinkUnifiedSearchModulesFile();
         $this->log('<br><b>' . translate('LBL_MI_COMPLETE') . '</b>');
         if (!$this->silent) {
             update_progress_bar('install', $total_steps, $total_steps);
         }
     } else {
         die("No manifest.php Defined In {$this->base_dir}/manifest.php");
     }
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:84,代码来源:ModuleInstaller.php


示例16: action_DeployPackage

 function action_DeployPackage()
 {
     global $current_user;
     if (defined('TEMPLATE_URL')) {
         sugar_cache_reset();
         SugarTemplateUtilities::disableCache();
     }
     //increment etag for menu so the new module shows up when the AJAX UI reloads
     $current_user->incrementETag("mainMenuETag");
     $mb = new ModuleBuilder();
     $load = $_REQUEST['package'];
     $message = $GLOBALS['mod_strings']['LBL_MODULE_DEPLOYED'];
     if (!empty($load)) {
         $zip = $mb->getPackage($load);
         require_once 'ModuleInstall/PackageManager/PackageManager.php';
         $pm = new PackageManager();
         $info = $mb->packages[$load]->build(false);
         $uploadDir = $pm->upload_dir . '/upgrades/module/';
         mkdir_recursive($uploadDir);
         rename($info['zip'], $uploadDir . $info['name'] . '.zip');
         copy($info['manifest'], $uploadDir . $info['name'] . '-manifest.php');
         $_REQUEST['install_file'] = $uploadDir . $info['name'] . '.zip';
         $GLOBALS['mi_remove_tables'] = false;
         $pm->performUninstall($load);
         //#23177 , js cache clear
         clearAllJsAndJsLangFilesWithoutOutput();
         //#30747, clear the cache in memory
         $cache_key = 'app_list_strings.' . $GLOBALS['current_language'];
         sugar_cache_clear($cache_key);
         sugar_cache_reset();
         //clear end
         $pm->performInstall($_REQUEST['install_file'], true);
         //clear the unified_search_module.php file
         require_once 'modules/Home/UnifiedSearchAdvanced.php';
         UnifiedSearchAdvanced::unlinkUnifiedSearchModulesFile();
         //bug 44269 - start
         //clear workflow admin modules cache
         if (isset($_SESSION['get_workflow_admin_modules_for_user'])) {
             unset($_SESSION['get_workflow_admin_modules_for_user']);
         }
         //clear "is_admin_for_module" cache
         $sessionVar = 'MLA_' . $current_user->user_name;
         foreach ($mb->packages as $package) {
             foreach ($package->modules as $module) {
                 $_SESSION[$sessionVar][$package->name . '_' . $module->name] = true;
             }
         }
         //recreate acl cache
         $actions = ACLAction::getUserActions($current_user->id, true);
         //bug 44269 - end
     }
     echo 'complete';
 }
开发者ID:butschster,项目名称:sugarcrm_dev,代码行数:53,代码来源:controller.php


示例17: action_saveglobalsearchsettings

 /**
  * action_saveglobalsearchsettings
  *
  * This method handles saving the selected modules to display in the Global Search Settings.
  * It instantiates an instance of UnifiedSearchAdvanced and then calls the saveGlobalSearchSettings
  * method.
  *
  */
 public function action_saveglobalsearchsettings()
 {
     global $current_user, $app_strings;
     if (!is_admin($current_user)) {
         sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']);
     }
     try {
         require_once 'modules/Home/UnifiedSearchAdvanced.php';
         $unifiedSearchAdvanced = new UnifiedSearchAdvanced();
         $unifiedSearchAdvanced->saveGlobalSearchSettings();
         $return = 'true';
         echo $return;
     } catch (Exception $ex) {
         echo "false";
     }
 }
开发者ID:NALSS,项目名称:SuiteCRM,代码行数:24,代码来源:controller.php


示例18: globalSearchSpot

 /**
  * This function is used to hand off the global search to the built-in SugarSearchEngine (aka SugarSpot)
  * @param $api ServiceBase The API class of the request
  * @param $args array The arguments array passed in from the API
  * @param $searchEngine SugarSearchEngine The SugarSpot search engine created using the Factory in the caller
  * @param $options array An array of options to pass through to the search engine, they get translated to the $searchOptions array so you can see exactly what gets passed through
  * @return array Two elements, 'records' the list of returned records formatted through FormatBean, and 'next_offset' which will indicate to the user if there are additional records to be returned.
  */
 public function globalSearchSpot(ServiceBase $api, array $args, $searchEngine, array $options)
 {
     require_once 'modules/Home/UnifiedSearchAdvanced.php';
     $searchOptions = array('modules' => $options['moduleList'], 'current_module' => $options['primaryModule'], 'return_beans' => true, 'my_items' => $options['my_items'], 'favorites' => $options['favorites'], 'orderBy' => $options['orderBy'], 'fields' => $options['fieldFilters'], 'selectFields' => $options['selectFields'], 'limitPerModule' => $options['limitPerModule'], 'allowEmptySearch' => true, 'distinct' => 'DISTINCT', 'return_beans' => true);
     if (isset($options['deleted'])) {
         $searchOptions['deleted'] = $options['deleted'];
     }
     $multiModule = false;
     if (empty($options['moduleList']) || count($options['moduleList']) == 0 || count($options['moduleList']) > 1) {
         $multiModule = true;
     }
     if (empty($options['moduleList'])) {
         require_once 'modules/ACL/ACLController.php';
         $usa = new UnifiedSearchAdvanced();
         $moduleList = $usa->getUnifiedSearchModules();
         // get the module names [array keys]
         $moduleList = array_keys($moduleList);
         // filter based on User Access if Blank
         $ACL = new ACLController();
         // moduleList is passed by reference
         $ACL->filterModuleList($moduleList);
         $searchOptions['modules'] = $options['moduleList'] = $moduleList;
     }
     if (!empty($options['searchFields'])) {
         $customWhere = array();
         foreach ($options['moduleList'] as $module) {
             $seed = BeanFactory::getBean($module);
             $fields = array_keys($seed->field_defs);
             $existingfields = array_intersect($fields, $options['searchFields']);
             if (!empty($existingfields)) {
                 $customTable = $seed->get_custom_table_name();
                 $table = $seed->table_name;
                 foreach ($existingfields as $field) {
                     if (!isset($seed->field_defs[$field]['unified_search']) || $seed->field_defs[$field]['unified_search'] !== true) {
                         continue;
                     }
                     $prefix = $table;
                     if (isset($GLOBALS['dictionary'][$seed->object_name]['custom_fields'][$field])) {
                         $prefix = $customTable;
                     }
                     if (!isset($seed->field_defs[$field]['source']) || $seed->field_defs[$field]['source'] != 'non-db') {
                         $customWhere[$module][] = "{$prefix}.{$field} LIKE '{$options['query']}%'";
                     }
                 }
                 if (isset($customWhere[$module])) {
                     $searchOptions['custom_where_module'][$module] = '(' . implode(' OR ', $customWhere[$module]) . ')';
                 }
             }
         }
     }
     $offset = $options['offset'];
     // One for luck.
     // Well, actually it's so that we know that there are additional results
     $limit = $options['limit'] + 1;
     if ($multiModule && $options['offset'] != 0) {
         // With more than one module, there is no way to do offsets for real, so we have to fake it.
         $limit = $limit + $offset;
         $offset = 0;
     }
     if (!$multiModule) {
         // It's not multi-module, the per-module limit should be the same as the master limit
         $searchOptions['limitPerModule'] = $limit;
     }
     if (isset($options['custom_select'])) {
         $searchOptions['custom_select'] = $options['custom_select'];
     }
     if (isset($options['custom_from'])) {
         $searchOptions['custom_from'] = $options['custom_from'];
     }
     if (isset($options['custom_where'])) {
         $searchOptions['custom_where'] = $options['custom_where'];
     }
     $results = $searchEngine->search($options['query'], $offset, $limit, $searchOptions);
     $returnedRecords = array();
     $api->action = 'list';
     foreach ($results as $module => $moduleResults) {
         if (!is_array($moduleResults['data'])) {
             continue;
         }
         $moduleArgs = $args;
         // Need to override the filter arg so that it looks like something formatBean expects
         if (!empty($options['fieldFilters'][$module])) {
             $moduleFields = $options['fieldFilters'][$module];
         } else {
             if (!empty($options['fieldFilters']['_default'])) {
                 $moduleFields = $options['fieldFilters']['_default'];
             } else {
                 $moduleFields = array();
             }
         }
         $moduleArgs['fields'] = implode(',', $moduleFields);
         foreach ($moduleResults['data'] as $record) {
//.........这里部分代码省略.........
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:101,代码来源:UnifiedSearchApi.php


示例19: clearSearchCache

 /**
  * Remove the cached unified_search_modules.php file
  */
 public function clearSearchCache()
 {
     global $mod_strings, $sugar_config;
     if ($this->show_output) {
         echo "<h3>{$mod_strings['LBL_QR_CLEARSEARCH']}</h3>";
     }
     // clear sugar_cache backend for SugarSearchEngine
     SugarSearchEngineMetadataHelper::clearCache();
     // Clear the cache file AFTER the cache clear, as it will be rebuilt by
     // clearCache otherwise
     UnifiedSearchAdvanced::unlinkUnifiedSearchModulesFile();
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:15,代码来源:QuickRepairAndRebuild.php


示例20: clearCache

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP UniqueIDGenerator类代码示例发布时间:2022-05-23
下一篇:
PHP UnifiedOrder_pub类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap