Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

hook in design response as default search on idea list page

  • Loading branch information...
commit 7817978d39f8d1e8ddf9ed9f4c708360002d1868 1 parent 7ae8036
@rmarianski authored
Showing with 12 additions and 1 deletion.
  1. +12 −1 application/controllers/reports.php
View
13 application/controllers/reports.php
@@ -53,10 +53,15 @@ public function index($cluster_id = 0)
$category_ids_in = NULL;
$category_ids = array();
$category_ids_string = array();
+ $design_response_category = ((int)Kohana::config('pps.design_response_category_id'));
if (isset($_GET['c']) AND !empty($_GET['c']) AND $_GET['c']!=0)
{
$category_ids_string = is_array($_GET['c']) ? $_GET['c'] : array($_GET['c']);
}
+ else {
+ // default to design response search
+ $category_ids_string = array('' . $design_response_category);
+ }
if (!empty($category_ids_string))
{
foreach ($category_ids_string as $category_id) {
@@ -296,7 +301,13 @@ public function index($cluster_id = 0)
if ($visible_category->parent_id === $scale_category->id) {
$scale_categories[] = $visible_category;
} elseif ($visible_category->parent_id === $context_category->id) {
- $context_categories[] = $visible_category;
+ // design response category should be first in context list
+ // also assuming that the design response is under the context category
+ if ($visible_category->id === $design_response_category) {
+ array_unshift($context_categories, $visible_category);
+ } else {
+ array_push($context_categories, $visible_category);
+ }
}
}
$this->template->content->scale_categories = $scale_categories;
Please sign in to comment.
Something went wrong with that request. Please try again.