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


PHP Filter::getFiltersInfo方法代码示例

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


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

示例1: getListing

 /**
  * Method used to get an array of the full list of the custom
  * filters associated with the current user and the current 
  * 'active' project.
  *
  * @access  public
  * @param   boolean $build_url If a URL for this filter should be constructed.
  * @return  array The full list of custom filters
  */
 function getListing($build_url = false)
 {
     $stmt = "SELECT\n                    *\n                 FROM\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "custom_filter\n                 WHERE\n                    cst_prj_id=" . Auth::getCurrentProject() . " AND\n                    (\n                        cst_usr_id=" . Auth::getUserID() . " OR\n                        cst_is_global=1\n                    )\n                 ORDER BY\n                    cst_title";
     $res = $GLOBALS["db_api"]->dbh->getAll($stmt, DB_FETCHMODE_ASSOC);
     if (PEAR::isError($res)) {
         Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
         return "";
     } else {
         if (count($res) > 0 && $build_url == true) {
             $filter_info = Filter::getFiltersInfo();
             for ($i = 0; $i < count($res); $i++) {
                 $res[$i]['url'] = '';
                 foreach ($filter_info as $field => $filter) {
                     if (@$filter['is_date'] == true) {
                         $res[$i]['url'] .= $filter['param'] . '[filter_type]=' . $res[$i]['cst_' . $field . '_filter_type'] . '&';
                         if ($res[$i]['cst_' . $field . '_filter_type'] == 'in_past' || $res[$i]['cst_' . $field . '_filter_type'] == 'not_in_past') {
                             $res[$i]['url'] .= $filter['param'] . '[time_period]=' . $res[$i]['cst_' . $field . '_time_period'] . '&';
                         } else {
                             $start_date = $res[$i]['cst_' . $field];
                             if (!empty($start_date)) {
                                 $start_date_parts = explode("-", $start_date);
                                 $res[$i]['url'] .= $filter['param'] . '[Year]=' . $start_date_parts[0] . '&';
                                 $res[$i]['url'] .= $filter['param'] . '[Month]=' . $start_date_parts[1] . '&';
                                 $res[$i]['url'] .= $filter['param'] . '[Day]=' . $start_date_parts[2] . '&';
                             }
                             $end_date = $res[$i]['cst_' . $field . '_end'];
                             if (!empty($end_date)) {
                                 $end_date_parts = explode("-", $end_date);
                                 $res[$i]['url'] .= $filter['param'] . '_end[Year]=' . $end_date_parts[0] . '&';
                                 $res[$i]['url'] .= $filter['param'] . '_end[Month]=' . $end_date_parts[1] . '&';
                                 $res[$i]['url'] .= $filter['param'] . '_end[Day]=' . $end_date_parts[2] . '&';
                             }
                         }
                     } else {
                         if (@$filter['is_custom'] != 1) {
                             $res[$i]['url'] .= $filter['param'] . '=' . urlencode($res[$i]['cst_' . $field]) . '&';
                         }
                     }
                 }
                 $res[$i]['url'] .= 'custom_field=' . urlencode($res[$i]['cst_custom_field']);
             }
         }
         return $res;
     }
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:54,代码来源:class.filter.php

示例2: getSortingInfo

 /**
  * Method used to get the current sorting options used in the grid layout
  * of the issue listing page.
  *
  * @param   array $options The current search parameters
  * @return  array The sorting options
  */
 public static function getSortingInfo($options)
 {
     $custom_fields = Custom_Field::getFieldsToBeListed(Auth::getCurrentProject());
     // default order for last action date, priority should be descending
     // for textual fields, like summary, ascending is reasonable
     $fields = array('pri_rank' => 'desc', 'sev_rank' => 'asc', 'iss_id' => 'desc', 'iss_customer_id' => 'desc', 'prc_title' => 'asc', 'sta_rank' => 'asc', 'iss_created_date' => 'desc', 'iss_summary' => 'asc', 'last_action_date' => 'desc', 'usr_full_name' => 'asc', 'iss_expected_resolution_date' => 'desc', 'pre_title' => 'asc', 'assigned' => 'asc', 'grp_name' => 'asc');
     foreach ($custom_fields as $fld_id => $fld_name) {
         $fields['custom_field_' . $fld_id] = 'desc';
     }
     $sortfields = array_combine(array_keys($fields), array_keys($fields));
     $sortfields['pre_title'] = 'pre_scheduled_date';
     $sortfields['assigned'] = 'isu_usr_id';
     $items = array('links' => array(), 'images' => array());
     $current_sort_by = $options['sort_by'];
     $current_sort_order = $options['sort_order'];
     foreach ($sortfields as $field => $sortfield) {
         $sort_order = $fields[$field];
         if ($current_sort_by == $sortfield) {
             $items['images'][$field] = 'images/' . strtolower($current_sort_order) . '.gif';
             if (strtolower($current_sort_order) == 'asc') {
                 $sort_order = 'desc';
             } else {
                 $sort_order = 'asc';
             }
         }
         $options['sort_by'] = $sortfield;
         $options['sort_order'] = $sort_order;
         $items['links'][$field] = $_SERVER['PHP_SELF'] . '?' . Filter::buildUrl(Filter::getFiltersInfo(), $options, false, true);
     }
     return $items;
 }
开发者ID:korusdipl,项目名称:eventum,代码行数:38,代码来源:class.search.php

示例3: join

            continue;
        }
        $field = Custom_Field::getDetails($fld_id);
        if ($field['fld_type'] == 'combo' || $field['fld_type'] == 'multiple') {
            $custom_fields_display[$fld_id] = join(', ', Custom_Field::getOptions($fld_id, $search_value));
        }
    }
}
$list = Issue::getListing($prj_id, $options, $pagerRow, $rows);
$tpl->assign("list", $list["list"]);
$tpl->assign("list_info", $list["info"]);
$tpl->assign("csv_data", base64_encode(@$list["csv"]));
$tpl->assign("columns", Display_Column::getColumnsToDisplay($prj_id, 'list_issues'));
$tpl->assign("priorities", Priority::getAssocList($prj_id));
$tpl->assign("status", Status::getAssocStatusList($prj_id));
$tpl->assign("open_status", Status::getAssocStatusList($prj_id, true));
$tpl->assign("users", $users);
$tpl->assign("assign_options", $assign_options);
$tpl->assign("custom", Filter::getAssocList($prj_id));
$tpl->assign("csts", Filter::getListing(true));
$tpl->assign("filter_info", Filter::getFiltersInfo());
$tpl->assign("categories", Category::getAssocList($prj_id));
$tpl->assign("releases", Release::getAssocList($prj_id, true));
$tpl->assign("available_releases", Release::getAssocList($prj_id));
$tpl->assign("groups", $groups);
$tpl->assign("custom_fields_display", $custom_fields_display);
$tpl->assign("reporters", Project::getReporters($prj_id));
$prefs = Prefs::get($usr_id);
$tpl->assign("refresh_rate", $prefs['list_refresh_rate'] * 60);
$tpl->assign("refresh_page", "list.php");
$tpl->displayTemplate();
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:list.php


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