当前位置: 首页>>代码示例>>PHP>>正文


PHP SearchForm::displayAdvanced方法代码示例

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


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

示例1: displayAdvanced

 function displayAdvanced($header = true, $return = false, $listViewDefs = '', $lv = '')
 {
     global $app_strings;
     $SAVED_SEARCHES_OPTIONS = '';
     $savedSearch = BeanFactory::getBean('SavedSearch');
     $SAVED_SEARCHES_OPTIONS = $savedSearch->getSelect($this->module);
     $str = "";
     if (!empty($SAVED_SEARCHES_OPTIONS) && $this->showSavedSearchOptions) {
         $str .= "   <span class='white-space'>\n                        &nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<b>{$app_strings['LBL_SAVED_SEARCH_SHORTCUT']}</b>&nbsp;\n                        {$SAVED_SEARCHES_OPTIONS}\n                        <span id='go_btn_span' style='display:none'><input tabindex='2' title='go_select' id='go_select'  onclick='SUGAR.searchForm.clear_form(this.form); return false;' class='button' type='button' name='go_select' value=' {$app_strings['LBL_GO_BUTTON_LABEL']} '/></span>\n                    </span>";
     }
     $str .= "\n                <script>\n                    function toggleInlineSearch(){\n                        if (document.getElementById('inlineSavedSearch').style.display == 'none'){\n                            document.getElementById('showSSDIV').value = 'yes'\n                            document.getElementById('inlineSavedSearch').style.display = '';\n\n                            document.getElementById('up_down_img').src='" . SugarThemeRegistry::current()->getImageURL('basic_search.gif') . "';\n                            document.getElementById('up_down_img').setAttribute('alt','" . translate('LBL_ALT_HIDE_OPTIONS') . "');\n\n                        }else{\n\n                            document.getElementById('up_down_img').src='" . SugarThemeRegistry::current()->getImageURL('advanced_search.gif') . "';\n                            document.getElementById('up_down_img').setAttribute('alt','" . translate('LBL_ALT_SHOW_OPTIONS') . "');\n                            document.getElementById('showSSDIV').value = 'no';\n                            document.getElementById('inlineSavedSearch').style.display = 'none';\n                        }\n                    }\n\n\n                </script>\n            ";
     $this->xtpl->assign('ADVANCED_BUTTONS', $str);
     $this->xtpl->assign('LBL_DELETE_CONFIRM', translate('LBL_DELETE_CONFIRM', 'SavedSearch'));
     return parent::displayAdvanced($header, $return, $listViewDefs, $lv);
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:15,代码来源:SearchFormReports.php

示例2: switch

    $params['overrideOrder'] = true;
    if (!empty($_REQUEST['sortOrder'])) {
        $params['sortOrder'] = $_REQUEST['sortOrder'];
    }
}
$lv->displayColumns = $displayColumns;
if (!empty($_REQUEST['search_form_only']) && $_REQUEST['search_form_only']) {
    // handle ajax requests for search forms only
    switch ($_REQUEST['search_form_view']) {
        case 'basic_search':
            $searchForm->setup();
            $searchForm->displayBasic(false);
            break;
        case 'advanced_search':
            $searchForm->setup();
            $searchForm->displayAdvanced(false);
            break;
        case 'saved_views':
            echo $searchForm->displaySavedViews($listViewDefs, $lv, false);
            break;
    }
    return;
}
// use the stored query if there is one
if (!isset($where)) {
    $where = "";
}
require_once 'modules/MySettings/StoreQuery.php';
$storeQuery = new StoreQuery();
if (!isset($_REQUEST['query'])) {
    $storeQuery->loadQuery($currentModule);
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:31,代码来源:ListView.php

示例3: display


//.........这里部分代码省略.........
         }
     }
     $lv->displayColumns = $displayColumns;
     $this->seed = $seed;
     $this->module = $module;
     $searchForm = null;
     $storeQuery = new StoreQuery();
     if (!isset($_REQUEST['query'])) {
         $storeQuery->loadQuery($this->module);
         $storeQuery->populateRequest();
     } else {
         $storeQuery->saveFromRequest($this->module);
     }
     //search
     $view = 'basic_search';
     if (!empty($_REQUEST['search_form_view'])) {
         $view = $_REQUEST['search_form_view'];
     }
     $headers = true;
     if (!empty($_REQUEST['search_form_only']) && $_REQUEST['search_form_only']) {
         $headers = false;
     } elseif (!isset($_REQUEST['search_form']) || $_REQUEST['search_form'] != 'false') {
         if (isset($_REQUEST['searchFormTab']) && $_REQUEST['searchFormTab'] == 'advanced_search') {
             $view = 'advanced_search';
         } else {
             $view = 'basic_search';
         }
     }
     $use_old_search = true;
     if (file_exists('modules/' . $this->module . '/SearchForm.html')) {
         require_once 'include/SearchForm/SearchForm.php';
         $searchForm = new SearchForm($this->module, $this->seed);
     } else {
         $use_old_search = false;
         require_once 'include/SearchForm/SearchForm2.php';
         if (file_exists('custom/modules/' . $this->module . '/metadata/searchdefs.php')) {
             require_once 'custom/modules/' . $this->module . '/metadata/searchdefs.php';
         } elseif (!empty($metafiles[$this->module]['searchdefs'])) {
             require_once $metafiles[$this->module]['searchdefs'];
         } elseif (file_exists('modules/' . $this->module . '/metadata/searchdefs.php')) {
             require_once 'modules/' . $this->module . '/metadata/searchdefs.php';
         }
         if (!empty($metafiles[$this->module]['searchfields'])) {
             require_once $metafiles[$this->module]['searchfields'];
         } elseif (file_exists('modules/' . $this->module . '/metadata/SearchFields.php')) {
             require_once 'modules/' . $this->module . '/metadata/SearchFields.php';
         }
         $searchForm = new SearchForm($this->seed, $this->module, $this->action);
         $searchForm->setup($searchdefs, $searchFields, 'include/SearchForm/tpls/SearchFormGeneric.tpl', $view, $listViewDefs);
         $searchForm->lv = $lv;
     }
     if (isset($this->options['show_title']) && $this->options['show_title']) {
         $moduleName = isset($this->seed->module_dir) ? $this->seed->module_dir : $GLOBALS['mod_strings']['LBL_MODULE_NAME'];
         echo getClassicModuleTitle($moduleName, array($GLOBALS['mod_strings']['LBL_MODULE_TITLE']), FALSE);
     }
     $where = '';
     if (isset($_REQUEST['query'])) {
         // we have a query
         if (!empty($_SERVER['HTTP_REFERER']) && preg_match('/action=EditView/', $_SERVER['HTTP_REFERER'])) {
             // from EditView cancel
             $searchForm->populateFromArray($storeQuery->query);
         } else {
             $searchForm->populateFromRequest();
         }
         $where_clauses = $searchForm->generateSearchWhere(true, $this->seed->module_dir);
         if (count($where_clauses) > 0) {
             $where = '(' . implode(' ) AND ( ', $where_clauses) . ')';
         }
         $GLOBALS['log']->info("List View Where Clause: {$where}");
     }
     if ($use_old_search) {
         switch ($view) {
             case 'basic_search':
                 $searchForm->setup();
                 $searchForm->displayBasic($headers);
                 break;
             case 'advanced_search':
                 $searchForm->setup();
                 $searchForm->displayAdvanced($headers);
                 break;
             case 'saved_views':
                 echo $searchForm->displaySavedViews($listViewDefs, $lv, $headers);
                 break;
         }
     } else {
         echo $searchForm->display($headers);
     }
     if (!$headers) {
         return;
     }
     if (empty($_REQUEST['search_form_only']) || $_REQUEST['search_form_only'] == false) {
         if (!is_admin($current_user)) {
             $lv->setup($seed, 'include/ListView/ListViewNoMassUpdate.tpl', $where, $params);
         } else {
             $lv->setup($seed, 'include/ListView/ListViewGeneric.tpl', $where, $params);
         }
         $savedSearchName = empty($_REQUEST['saved_search_select_name']) ? '' : ' - ' . $_REQUEST['saved_search_select_name'];
         echo $lv->display();
     }
 }
开发者ID:sysraj86,项目名称:carnivalcrm,代码行数:101,代码来源:view.list.php

示例4: switch

    if (!empty($_REQUEST['sortOrder'])) {
        $params['sortOrder'] = $_REQUEST['sortOrder'];
    }
}
$lv->displayColumns = $displayColumns;
$lv->delete = false;
if (!empty($_REQUEST['search_form_only']) && $_REQUEST['search_form_only']) {
    // handle ajax requests for search forms only
    switch ($_REQUEST['search_form_view']) {
        case 'basic_search':
            $searchForm->setup();
            $searchForm->displayBasic(false);
            break;
        case 'advanced_search':
            $searchForm->setup();
            $searchForm->displayAdvanced(false, false, $listViewDefs, $lv);
            break;
        case 'saved_views':
            echo $searchForm->displaySavedViews($listViewDefs, $lv, false);
            break;
    }
    return;
}
// use the stored query if there is one
if (!isset($where)) {
    $where = "";
}
if (isset($_REQUEST['query'])) {
    // we have a query
    // first save columns
    $current_user->setPreference('ListViewDisplayColumns', $displayColumns, 0, 'Users');
开发者ID:klr2003,项目名称:sourceread,代码行数:31,代码来源:ListView.php

示例5: display


//.........这里部分代码省略.........
         $storeQuery->saveFromRequest($this->module);
     }
     //search
     $view = 'basic_search';
     if (!empty($_REQUEST['search_form_view'])) {
         $view = $_REQUEST['search_form_view'];
     }
     $headers = true;
     if (!empty($_REQUEST['search_form_only']) && $_REQUEST['search_form_only']) {
         $headers = false;
     } elseif (!isset($_REQUEST['search_form']) || $_REQUEST['search_form'] != 'false') {
         if (isset($_REQUEST['searchFormTab']) && $_REQUEST['searchFormTab'] == 'advanced_search') {
             $view = 'advanced_search';
         } else {
             $view = 'basic_search';
         }
     }
     $use_old_search = true;
     if (SugarAutoLoader::existing('modules/' . $this->module . '/SearchForm.html')) {
         require_once 'include/SearchForm/SearchForm.php';
         $searchForm = new SearchForm($this->module, $this->seed);
     } else {
         $use_old_search = false;
         require_once 'include/SearchForm/SearchForm2.php';
         $defs = SugarAutoLoader::loadWithMetafiles($this->module, 'searchdefs');
         if (!empty($defs)) {
             require $defs;
         }
         $searchFields = SugarAutoLoader::loadSearchFields($this->module);
         $searchForm = new SearchForm($this->seed, $this->module, $this->action);
         $searchForm->setup($searchdefs, $searchFields, 'SearchFormGeneric.tpl', $view, $listViewDefs);
         $searchForm->lv = $lv;
     }
     if (isset($this->options['show_title']) && $this->options['show_title']) {
         $moduleName = isset($this->seed->module_dir) ? $this->seed->module_dir : $GLOBALS['mod_strings']['LBL_MODULE_NAME'];
         echo getClassicModuleTitle($moduleName, array($GLOBALS['mod_strings']['LBL_MODULE_TITLE']), FALSE);
     }
     $where = '';
     if (isset($_REQUEST['query'])) {
         // we have a query
         if (!empty($_SERVER['HTTP_REFERER']) && preg_match('/action=EditView/', $_SERVER['HTTP_REFERER'])) {
             // from EditView cancel
             $searchForm->populateFromArray($storeQuery->query);
         } else {
             $searchForm->populateFromRequest();
         }
         $where_clauses = $searchForm->generateSearchWhere(true, $this->seed->module_dir);
         if (count($where_clauses) > 0) {
             $where = '(' . implode(' ) AND ( ', $where_clauses) . ')';
         }
         $GLOBALS['log']->info("List View Where Clause: {$where}");
     }
     if ($use_old_search) {
         switch ($view) {
             case 'basic_search':
                 $searchForm->setup();
                 $searchForm->displayBasic($headers);
                 break;
             case 'advanced_search':
                 $searchForm->setup();
                 $searchForm->displayAdvanced($headers);
                 break;
             case 'saved_views':
                 echo $searchForm->displaySavedViews($listViewDefs, $lv, $headers);
                 break;
         }
     } else {
         echo $searchForm->display($headers);
     }
     if (!$headers) {
         return;
     }
     /*
      * Bug 50575 - related search columns not inluded in query in a proper way
      */
     $lv->searchColumns = $searchForm->searchColumns;
     if (isset($GLOBALS['mod_strings']['LBL_MODULE_NAME_SINGULAR'])) {
         $seed->module_title = $GLOBALS['mod_strings']['LBL_MODULE_NAME_SINGULAR'];
     }
     if (isset($GLOBALS['mod_strings']['LBL_LIST_PARENT_NAME'])) {
         $seed->parent_title = $GLOBALS['mod_strings']['LBL_LIST_PARENT_NAME'];
         $seed->parent_module_dir = 'Project';
     }
     $project = BeanFactory::getBean('Project');
     $project_query = new SugarQuery();
     $project_query->from($project);
     $project_list = $project->fetchFromQuery($project_query);
     if (count($project_list)) {
         $seed->show_link = true;
     }
     if (empty($_REQUEST['search_form_only']) || $_REQUEST['search_form_only'] == false) {
         //Bug 58841 - mass update form was not displayed for non-admin users that should have access
         if (ACLController::checkAccess($module, 'massupdate') || ACLController::checkAccess($module, 'export')) {
             $lv->setup($seed, 'include/ListView/ListViewGeneric.tpl', $where, $params);
         } else {
             $lv->setup($seed, 'include/ListView/ListViewNoMassUpdate.tpl', $where, $params);
         }
         echo $lv->display();
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:101,代码来源:view.list.php


注:本文中的SearchForm::displayAdvanced方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。