本文整理汇总了PHP中Ubirimi\Util::searchQueryNotEmpty方法的典型用法代码示例。如果您正苦于以下问题:PHP Util::searchQueryNotEmpty方法的具体用法?PHP Util::searchQueryNotEmpty怎么用?PHP Util::searchQueryNotEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ubirimi\Util
的用法示例。
在下文中一共展示了Util::searchQueryNotEmpty方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$loggedInUserId = $session->get('user/id');
$issuesPerPage = $session->get('user/issues_per_page');
$searchParameters = array();
$parseURLData = null;
$getFilter = isset($_GET['filter']) ? $_GET['filter'] : null;
$getPage = isset($_GET['page']) ? $_GET['page'] : 1;
$getSortColumn = isset($_GET['sort']) ? $_GET['sort'] : 'created';
$getSortOrder = isset($_GET['order']) ? $_GET['order'] : 'desc';
$getSearchQuery = isset($_GET['search_query']) ? $_GET['search_query'] : null;
$getSummaryFlag = isset($_GET['summary_flag']) ? $_GET['summary_flag'] : null;
$getDescriptionFlag = isset($_GET['description_flag']) ? $_GET['description_flag'] : null;
$getCommentsFlag = isset($_GET['comments_flag']) ? $_GET['comments_flag'] : null;
$getProjectIds = isset($_GET['project']) ? explode('|', $_GET['project']) : null;
$getAssigneeIds = isset($_GET['assignee']) ? explode('|', $_GET['assignee']) : null;
$getReportedIds = isset($_GET['reporter']) ? explode('|', $_GET['reporter']) : null;
$getIssueTypeIds = isset($_GET['type']) ? explode('|', $_GET['type']) : null;
$getIssueStatusIds = isset($_GET['status']) ? explode('|', $_GET['status']) : null;
$getIssuePriorityIds = isset($_GET['priority']) ? explode('|', $_GET['priority']) : null;
$getProjectComponentIds = isset($_GET['component']) ? explode('|', $_GET['component']) : null;
$getProjectVersionIds = isset($_GET['version']) ? explode('|', $_GET['version']) : null;
$getIssueResolutionIds = isset($_GET['resolution']) ? explode('|', $_GET['resolution']) : null;
// date filters
$getDateDueAfter = isset($_GET['date_due_after']) ? $_GET['date_due_after'] : null;
$getDateDueBefore = isset($_GET['date_due_before']) ? $_GET['date_due_before'] : null;
$getDateCreatedAfter = isset($_GET['date_created_after']) ? $_GET['date_created_after'] : null;
$getDateCreatedBefore = isset($_GET['date_created_before']) ? $_GET['date_created_before'] : null;
$getSearchParameters = array('search_query' => $getSearchQuery, 'summary_flag' => $getSummaryFlag, 'description_flag' => $getDescriptionFlag, 'comments_flag' => $getCommentsFlag, 'project' => $getProjectIds, 'assignee' => $getAssigneeIds, 'reporter' => $getReportedIds, 'filter' => $getFilter, 'type' => $getIssueTypeIds, 'status' => $getIssueStatusIds, 'priority' => $getIssuePriorityIds, 'component' => $getProjectComponentIds, 'version' => $getProjectVersionIds, 'resolution' => $getIssueResolutionIds, 'sort' => $getSortColumn, 'sort_order' => $getSortOrder, 'render_checkbox' => true, 'checkbox_in_header' => true, 'date_due_after' => $getDateDueAfter, 'date_due_before' => $getDateDueBefore, 'date_created_after' => $getDateCreatedAfter, 'date_created_before' => $getDateCreatedBefore);
$parseURLData = parse_url($_SERVER['REQUEST_URI']);
if (isset($parseURLData['query'])) {
UbirimiContainer::get()['session']->set('bulk_change_choose_issue_query_url', $parseURLData['query']);
if (Util::searchQueryNotEmpty($getSearchParameters)) {
$issues = $this->getRepository(Issue::class)->getByParameters($getSearchParameters, $loggedInUserId, null, $loggedInUserId);
$issuesCount = $issues->num_rows;
$getSearchParameters['link_to_page'] = '/yongo/issue/printable-list';
}
}
$columns = array('code', 'summary', 'priority', 'status', 'created', 'updated', 'reporter', 'assignee');
$menuSelectedCategory = 'issue';
$errorNoIssuesSelected = false;
if ($request->request->has('next_step_2')) {
$issueIdsArray = array();
foreach ($_POST as $key => $value) {
if (substr($key, 0, 15) == "issue_checkbox_") {
$issueIdsArray[] = (int) str_replace("issue_checkbox_", "", $key);
}
}
if (count($issueIdsArray)) {
UbirimiContainer::get()['session']->set('bulk_change_issue_ids', $issueIdsArray);
return new RedirectResponse('/yongo/issue/bulk-operation');
} else {
$errorNoIssuesSelected = true;
}
}
$sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Bulk: Choose Issues';
return $this->render(__DIR__ . '/../../../Resources/views/issue/bulk/ChooseIssue.php', get_defined_vars());
}
示例2: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
$clientId = $session->get('client/id');
$loggedInUserId = $session->get('user/id');
$issuesPerPage = $session->get('user/issues_per_page');
$searchParameters = array();
$parseURLData = null;
$getFilter = $request->get('filter');
$getPage = $request->get('page');
$getSortColumn = $request->get('sort') ? $request->get('sort') : 'created';
$getSortOrder = $request->get('order') ? $request->get('order') : 'desc';
$getSearchQuery = $request->get('search_query');
$getSummaryFlag = $request->get('summary_flag');
$getDescriptionFlag = $request->get('description_flag');
$getCommentsFlag = $request->get('comments_flag');
$getProjectIds = $request->get('project') ? explode('|', $request->get('project')) : null;
if ($getProjectIds) {
$projectsData = $this->getRepository(YongoProject::class)->getByIds($getProjectIds);
if (!$projectsData) {
return new RedirectResponse('/general-settings/bad-link-access-denied');
}
while ($projectsData && ($data = $projectsData->fetch_array(MYSQLI_ASSOC))) {
if (Util::checkUserIsLoggedIn()) {
if ($data['client_id'] != $clientId) {
return new RedirectResponse('/general-settings/bad-link-access-denied');
}
} else {
$hasBrowsingPermission = $this->getRepository(YongoProject::class)->userHasPermission(array($data['id']), Permission::PERM_BROWSE_PROJECTS);
if (!$hasBrowsingPermission) {
return new RedirectResponse('/general-settings/bad-link-access-denied');
}
}
}
}
$getAssigneeIds = $request->get('assignee') ? explode('|', $request->get('assignee')) : null;
$getReportedIds = $request->get('reporter') ? explode('|', $request->get('reporter')) : null;
$getIssueTypeIds = $request->get('type') ? explode('|', $request->get('type')) : null;
$getIssueStatusIds = $request->get('status') ? explode('|', $request->get('status')) : null;
$getIssuePriorityIds = $request->get('priority') ? explode('|', $request->get('priority')) : null;
$getProjectComponentIds = $request->get('component') ? explode('|', $request->get('component')) : null;
$getProjectVersionIds = $request->get('version') ? explode('|', $request->get('version')) : null;
$getIssueResolutionIds = $request->get('resolution') ? explode('|', $request->get('resolution')) : null;
$getSearchParameters = array('search_query' => $getSearchQuery, 'summary_flag' => $getSummaryFlag, 'description_flag' => $getDescriptionFlag, 'comments_flag' => $getCommentsFlag, 'project' => $getProjectIds, 'assignee' => $getAssigneeIds, 'reporter' => $getReportedIds, 'filter' => $getFilter, 'type' => $getIssueTypeIds, 'status' => $getIssueStatusIds, 'priority' => $getIssuePriorityIds, 'component' => $getProjectComponentIds, 'version' => $getProjectVersionIds, 'resolution' => $getIssueResolutionIds, 'sort' => $getSortColumn, 'sort_order' => $getSortOrder);
$parseURLData = parse_url($_SERVER['REQUEST_URI']);
if (!$parseURLData['query']) {
return new RedirectResponse('/general-settings/bad-link-access-denied');
}
if (Util::searchQueryNotEmpty($getSearchParameters)) {
$issues = $this->getRepository(Issue::class)->getByParameters($getSearchParameters, $loggedInUserId, null, $loggedInUserId);
$issuesCount = $issues->num_rows;
$getSearchParameters['link_to_page'] = '/yongo/issue/printable-list';
}
$columns = array('code', 'summary', 'priority', 'status', 'created', 'updated', 'reporter', 'assignee');
$sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Print List';
$menuSelectedCategory = null;
return $this->render(__DIR__ . '/../../Resources/views/issue/search/SearchListPrintable.php', get_defined_vars());
}
示例3: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
$issuesPerPage = $session->get('user/issues_per_page');
$loggedInUserId = $session->get('user/id');
$searchParameters = array();
$parseURLData = null;
$getFilter = $request->get('filter');
$getPage = $request->get('page');
$getSortColumn = $request->get('sort') ? $request->get('sort') : 'created';
$getSortOrder = $request->get('order') ? $request->get('order') : 'desc';
$getSearchQuery = $request->get('search_query');
$getSummaryFlag = $request->get('summary_flag');
$getDescriptionFlag = $request->get('description_flag');
$getCommentsFlag = $request->get('comments_flag');
$getProjectIds = $request->get('project') ? explode('|', $request->get('project')) : null;
$getAssigneeIds = $request->get('assignee') ? explode('|', $request->get('assignee')) : null;
$getReportedIds = $request->get('reporter') ? explode('|', $request->get('reporter')) : null;
$getIssueTypeIds = $request->get('type') ? explode('|', $request->get('type')) : null;
$getIssueStatusIds = $request->get('status') ? explode('|', $request->get('status')) : null;
$getIssuePriorityIds = $request->get('priority') ? explode('|', $request->get('priority')) : null;
$getProjectComponentIds = $request->get('component') ? explode('|', $request->get('component')) : null;
$getProjectVersionIds = $request->get('version') ? explode('|', $request->get('version')) : null;
$getIssueResolutionIds = $request->get('resolution') ? explode('|', $request->get('resolution')) : null;
$getSearchParameters = array('search_query' => $getSearchQuery, 'summary_flag' => $getSummaryFlag, 'description_flag' => $getDescriptionFlag, 'comments_flag' => $getCommentsFlag, 'project' => $getProjectIds, 'assignee' => $getAssigneeIds, 'reporter' => $getReportedIds, 'filter' => $getFilter, 'type' => $getIssueTypeIds, 'status' => $getIssueStatusIds, 'priority' => $getIssuePriorityIds, 'component' => $getProjectComponentIds, 'version' => $getProjectVersionIds, 'resolution' => $getIssueResolutionIds, 'sort' => $getSortColumn, 'sort_order' => $getSortOrder);
$parseURLData = parse_url($_SERVER['REQUEST_URI']);
if (isset($parseURLData['query'])) {
if (Util::searchQueryNotEmpty($getSearchParameters)) {
$issues = $this->getRepository(Issue::class)->getByParameters($getSearchParameters, $loggedInUserId);
$issuesCount = $issues->num_rows;
$getSearchParameters['link_to_page'] = '/yongo/issue/printable-list';
}
}
$columns = array('code', 'summary', 'priority', 'status', 'created', 'updated', 'reporter', 'assignee');
$sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Print List Full Content';
$menuSelectedCategory = null;
return $this->render(__DIR__ . '/../../Resources/views/issue/search/SearchListPrintableContent.php', get_defined_vars());
}
示例4: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
if (Util::checkUserIsLoggedIn()) {
$issuesPerPage = $session->get('user/issues_per_page');
$clientSettings = $session->get('client/settings');
} else {
$issuesPerPage = 25;
$httpHOST = Util::getHttpHost();
$clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
$loggedInUserId = null;
$clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
}
$clientId = $session->get('client/id');
$loggedInUserId = $session->get('user/id');
$sectionPageTitle = $clientSettings['title_name'] . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Search';
$session->set('selected_product_id', SystemProduct::SYS_PRODUCT_YONGO);
$selectedProductId = $session->get('selected_product_id');
$cliMode = false;
$projectsForBrowsing = $this->getRepository(UbirimiClient::class)->getProjectsByPermission($clientId, $loggedInUserId, Permission::PERM_BROWSE_PROJECTS);
$searchParameters = array();
$parseURLData = null;
$projectIds = null;
if ($projectsForBrowsing) {
$projectIdsAndNames = Util::getAsArray($projectsForBrowsing, array('id', 'name'));
$projectsForBrowsing->data_seek(0);
$projectIds = Util::getAsArray($projectsForBrowsing, array('id'));
$searchCriteria = $this->getRepository(Issue::class)->getSearchParameters($projectsForBrowsing, $clientId);
$issuesResult = null;
$SLAs = UbirimiContainer::get()['repository']->get(Sla::class)->getByProjectIds($projectIds);
}
if ($request->request->has('search')) {
$searchParameters = $this->getRepository(Issue::class)->prepareDataForSearchFromPostGet($projectIds, $_POST, $_GET);
$redirectLink = str_replace("%7C", "|", http_build_query($searchParameters));
return new RedirectResponse('/yongo/issue/search?' . $redirectLink);
} else {
$getFilter = $request->get('filter');
$currentSearchPage = $request->get('page');
$currentSearchPage = isset($currentSearchPage) ? $currentSearchPage : 1;
$getSearchParameters = $this->getRepository(Issue::class)->prepareDataForSearchFromURL($_GET, $issuesPerPage);
// check to see if the project Ids are all belonging to the client
$getProjectIds = isset($_GET['project']) ? explode('|', $_GET['project']) : null;
if ($getProjectIds && !(count($getProjectIds) == 1 && $getProjectIds[0] == -1)) {
if (!$this->getRepository(YongoProject::class)->checkProjectsBelongToClient($clientId, $getProjectIds)) {
return new RedirectResponse('/general-settings/bad-link-access-denied');
}
}
$parseURLData = parse_url($_SERVER['REQUEST_URI']);
if (isset($parseURLData['query']) && $projectsForBrowsing) {
if (Util::searchQueryNotEmpty($getSearchParameters)) {
$issuesResult = $this->getRepository(Issue::class)->getByParameters($getSearchParameters, $loggedInUserId, null, $loggedInUserId);
$issues = $issuesResult[0];
$issuesCount = $issuesResult[1];
$countPages = ceil($issuesCount / $issuesPerPage);
$getSearchParameters['count_pages'] = $countPages;
$getSearchParameters['link_to_page'] = '/yongo/issue/search';
}
}
}
$columns = array('code', 'summary', 'priority', 'status', 'created', 'updated', 'reporter', 'assignee', 'settings_menu');
if (Util::checkUserIsLoggedIn()) {
$columns = explode('#', $session->get('user/issues_display_columns'));
$columns[] = 'settings_menu';
$columns[] = '';
}
$hasGlobalBulkPermission = $this->getRepository(UbirimiUser::class)->hasGlobalPermission($clientId, $loggedInUserId, GlobalPermission::GLOBAL_PERMISSION_YONGO_BULK_CHANGE);
$customFilters = $this->getRepository(IssueFilter::class)->getAllByUser($loggedInUserId);
if ($getFilter) {
$menuSelectedCategory = 'filters';
} else {
$menuSelectedCategory = 'issue';
}
$extraParameters = array();
if ($getFilter) {
$extraParameters[] = 'filter=' . $getFilter;
}
$extraParametersURL = '';
if (count($extraParameters)) {
$extraParametersURL = implode('&', $extraParameters);
}
$urlIssuePrefix = '/yongo/issue/';
$parseData = parse_url($_SERVER['REQUEST_URI']);
$query = isset($parseData['query']) ? $parseData['query'] : '';
if (isset($query) && $query != '') {
$session->set('last_search_parameters', $parseData['query']);
} else {
$session->remove('last_search_parameters');
}
return $this->render(__DIR__ . '/../../Resources/views/issue/search/Search.php', get_defined_vars());
}
示例5: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$menuSelectedCategory = 'home';
$clientId = $session->get('client/id');
$projectsForBrowsing = $this->getRepository(UbirimiClient::class)->getProjects($clientId, null, null, true);
$clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
$session->set('selected_product_id', SystemProduct::SYS_PRODUCT_HELP_DESK);
$selectedProductId = $session->get('selected_product_id');
$cliMode = false;
if ($projectsForBrowsing) {
$projectIdsAndNames = Util::getAsArray($projectsForBrowsing, array('id', 'name'));
$projectsForBrowsing->data_seek(0);
$projectIds = Util::getAsArray($projectsForBrowsing, array('id'));
$searchCriteria = $this->getRepository(Issue::class)->getSearchParameters($projectsForBrowsing, $session->get('client/id'), 1);
$issuesResult = null;
}
if ($request->request->has('search')) {
$searchParameters = $this->getRepository(Issue::class)->prepareDataForSearchFromPostGet($projectIds, $request->request->all(), $request->query->all());
$redirectLink = str_replace("%7C", "|", http_build_query($searchParameters));
return new RedirectResponse('/helpdesk/customer-portal/tickets?' . $redirectLink);
} else {
$getSearchParameters = $this->getRepository(Issue::class)->prepareDataForSearchFromURL($request->query->all(), 30);
$getSearchParameters['helpdesk_flag'] = 1;
// check to see if the project Ids are all belonging to the client
$getProjectIds = $request->request->has('project') ? explode('|', $request->query->get('project')) : null;
if ($getProjectIds) {
for ($pos = 0; $pos < count($getProjectIds); $pos++) {
$projectFilter = $this->getRepository(YongoProject::class)->getById($getProjectIds[$pos]);
if ($projectFilter['client_id'] != $session->get('client/id')) {
return new RedirectResponse('/general-settings/bad-link-access-denied');
}
}
}
$parseURLData = parse_url($_SERVER['REQUEST_URI']);
$projectsForBrowsing = array(229);
if (isset($parseURLData['query']) && $projectsForBrowsing) {
if (Util::searchQueryNotEmpty($getSearchParameters)) {
$issuesResult = $this->getRepository(Issue::class)->getByParameters($getSearchParameters, $session->get('user/id'));
$issues = $issuesResult[0];
$issuesCount = $issuesResult[1];
$issuesPerPage = $session->get('user/issues_per_page');
$currentSearchPage = isset($_GET['page']) ? $_GET['page'] : 1;
$countPages = ceil($issuesCount / 30);
$getSearchParameters['count_pages'] = $countPages;
$getSearchParameters['link_to_page'] = '/helpdesk/customer-portal/tickets';
}
}
}
$SLAs = $this->getRepository(Sla::class)->getByProjectIds(array(229));
$columns = array('code', 'summary', 'priority', 'status', 'created', 'updated', 'reporter', 'assignee', 'settings_menu');
if (Util::checkUserIsLoggedIn()) {
$columns = explode('#', $session->get('user/issues_display_columns'));
$columns[] = 'settings_menu';
$columns[] = '';
}
$parseData = parse_url($_SERVER['REQUEST_URI']);
$query = isset($parseData['query']) ? $parseData['query'] : '';
if (isset($query)) {
$session->set('last_search_parameters', $parseData['query']);
} else {
$session->remove('last_search_parameters');
}
return $this->render(__DIR__ . '/../../Resources/views/customer_portal/ListIssue.php', get_defined_vars());
}