/** * Method used to get a specific parameter in the issue listing cookie. * * @param string $name The name of the parameter * @param bool $request_only If only $_GET and $_POST should be checked * @param array $valid_values * @return mixed The value of the specified parameter * @return string */ public static function getParam($name, $request_only = false, $valid_values = null) { $value = null; if (isset($_GET[$name])) { $value = $_GET[$name]; } elseif (isset($_POST[$name])) { $value = $_POST[$name]; } elseif ($request_only) { return ''; } if (isset($value)) { if ($valid_values && !in_array($value, $valid_values)) { return ''; } return $value; } $profile = Search_Profile::getProfile(Auth::getUserID(), Auth::getCurrentProject(), 'issue'); if (isset($profile[$name])) { return $profile[$name]; } else { return ''; } }
/** * Method used to get a specific parameter in the email listing * cookie. * * @param string $name The name of the parameter * @return mixed The value of the specified parameter */ public static function getParam($name) { if (isset($_GET[$name])) { return $_GET[$name]; } elseif (isset($_POST[$name])) { return $_POST[$name]; } elseif (($profile = Search_Profile::getProfile(Auth::getUserID(), Auth::getCurrentProject(), 'email')) && isset($profile[$name])) { return $profile[$name]; } else { return ''; } }
if ($role_id == User::getRoleID('customer')) { $crm = CRM::getInstance($prj_id); // need the activity dashboard here $contact_id = User::getCustomerContactID($usr_id); $customer_id = Auth::getCurrentCustomerID(); $tpl->assign(array('contact' => $crm->getContact($contact_id), 'customer' => $crm->getCustomer($customer_id))); } else { if (Auth::getCurrentRole() <= User::getRoleID('Reporter') && Project::getSegregateReporters($prj_id)) { $tpl->assign('hide_stats', true); } else { $tpl->assign('hide_stats', false); $tpl->assign('status', Stats::getStatus()); $tpl->assign('releases', Stats::getRelease($hide_closed)); $tpl->assign('categories', Stats::getCategory($hide_closed)); $tpl->assign('priorities', Stats::getPriority($hide_closed)); $tpl->assign('users', Stats::getUser($hide_closed)); $tpl->assign('emails', Stats::getEmailStatus($hide_closed)); $tpl->assign('pie_chart', Stats::getPieChart($hide_closed)); } } if (@$_REQUEST['hide_closed'] == '') { $Stats_Search_Profile = Search_Profile::getProfile($usr_id, $prj_id, 'stats'); if (!empty($Stats_Search_Profile)) { $tpl->assign('hide_closed', $Stats_Search_Profile['hide_closed']); } } else { $tpl->assign('hide_closed', @$_REQUEST['hide_closed']); Search_Profile::save($usr_id, $prj_id, 'stats', array('hide_closed' => @$_REQUEST['hide_closed'])); } $tpl->assign('news', News::getListByProject($prj_id)); $tpl->displayTemplate();
/** * Method used to get a specific parameter in the email listing * cookie. * * @access public * @param string $name The name of the parameter * @return mixed The value of the specified parameter */ function getParam($name) { global $HTTP_POST_VARS, $HTTP_GET_VARS; $profile = Search_Profile::getProfile(Auth::getUserID(), Auth::getCurrentProject(), 'email'); if (isset($HTTP_GET_VARS[$name])) { return $HTTP_GET_VARS[$name]; } elseif (isset($HTTP_POST_VARS[$name])) { return $HTTP_POST_VARS[$name]; } elseif (isset($profile[$name])) { return $profile[$name]; } else { return ""; } }
$options_override = array('customer_id' => Misc::escapeString($_REQUEST['customer_id']), 'rows' => $rows); if (Search::getParam('hide_closed', true) === '') { $options_override['hide_closed'] = 1; } $_REQUEST['nosave'] = 1; } elseif ($_REQUEST['view'] == 'customer_all' && isset($_REQUEST['customer_id'])) { $options_override = array('customer_id' => Misc::escapeString($_REQUEST['customer_id']), 'rows' => $rows); if (Search::getParam('hide_closed', true) === '') { $options_override['hide_closed'] = 0; } $_REQUEST['nosave'] = 1; $profile = Search_Profile::getProfile($usr_id, $prj_id, 'issue'); Search_Profile::remove($usr_id, $prj_id, 'issue'); Auth::redirect('list.php?customer_id=' . Misc::escapeString($_REQUEST['customer_id']) . "&hide_closed=1&rows={$rows}&sort_by=" . $profile['sort_by'] . '&sort_order=' . $profile['sort_order'] . '&nosave=1'); } elseif ($_REQUEST['view'] == 'reporter' && isset($_REQUEST['reporter_id'])) { $profile = Search_Profile::getProfile($usr_id, $prj_id, 'issue'); Auth::redirect('list.php?reporter=' . Misc::escapeInteger($_REQUEST['reporter_id']) . "&hide_closed=1&rows={$rows}&sort_by=" . $profile['sort_by'] . '&sort_order=' . $profile['sort_order'] . '&nosave=1'); } elseif ($_REQUEST['view'] == 'clear') { Search_Profile::remove($usr_id, $prj_id, 'issue'); Auth::redirect('list.php'); } elseif ($_REQUEST['view'] == 'clearandfilter') { Search_Profile::remove($usr_id, $prj_id, 'issue'); Auth::redirect('list.php?' . str_replace('view=clearandfilter&', '', $_SERVER['QUERY_STRING'])); } } if (!empty($_REQUEST['nosave'])) { $options = Search::saveSearchParams(false); } else { $options = Search::saveSearchParams(); } $options += $options_override;