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


PHP Util::getAsArray方法代码示例

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


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

示例1: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $menuSelectedCategory = 'home';
     $session->set('selected_product_id', SystemProduct::SYS_PRODUCT_HELP_DESK);
     $projectsForBrowsing = $this->getRepository(UbirimiClient::class)->getProjects($session->get('client/id'), null, null, true);
     if ($projectsForBrowsing) {
         $projectIdsAndNames = Util::getAsArray($projectsForBrowsing, array('id', 'name'));
         $projectsForBrowsing->data_seek(0);
         $projectIds = Util::getAsArray($projectsForBrowsing, array('id'));
     }
     return $this->render(__DIR__ . '/../../Resources/views/customer_portal/Dashboard.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:13,代码来源:DashboardController.php

示例2: 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());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:89,代码来源:SearchController.php

示例3: getSearchParameters

 public function getSearchParameters($projectsForBrowsing, $clientId, $helpDeskFlag = 0)
 {
     $projectsForBrowsing->data_seek(0);
     $projectIds = Util::getAsArray($projectsForBrowsing, array('id'));
     $allClientIssueTypes = UbirimiContainer::get()['repository']->get(IssueType::class)->getByProjects($projectIds);
     $criteria = array();
     $issueTypeArray = array();
     while ($allClientIssueTypes && ($issueType = $allClientIssueTypes->fetch_array(MYSQLI_ASSOC))) {
         $found = false;
         for ($i = 0; $i < count($issueTypeArray); $i++) {
             if ($issueTypeArray[$i]['name'] == $issueType['name']) {
                 $issueTypeArray[$i]['id'] .= '#' . $issueType['id'];
                 $found = true;
                 break;
             }
         }
         if (!$found) {
             $issueTypeArray[] = $issueType;
         }
     }
     $criteria['all_client_issue_type'] = $issueTypeArray;
     $allClientIssueStatuses = UbirimiContainer::get()['repository']->get(IssueSettings::class)->getAllIssueSettings('status', $clientId);
     $issueStatusArray = array();
     while ($issueStatus = $allClientIssueStatuses->fetch_array(MYSQLI_ASSOC)) {
         $found = false;
         for ($i = 0; $i < count($issueStatusArray); $i++) {
             if ($issueStatusArray[$i]['name'] == $issueStatus['name']) {
                 $issueStatusArray[$i]['id'] .= '#' . $issueStatus['id'];
                 $found = true;
                 break;
             }
         }
         if (!$found) {
             $issueStatusArray[] = $issueStatus;
         }
     }
     $criteria['all_client_issue_status'] = $issueStatusArray;
     $allClientIssuePriorities = UbirimiContainer::get()['repository']->get(IssueSettings::class)->getAllIssueSettings('priority', $clientId);
     $issuePriorityArray = array();
     while ($issuePriority = $allClientIssuePriorities->fetch_array(MYSQLI_ASSOC)) {
         $found = false;
         for ($i = 0; $i < count($issuePriorityArray); $i++) {
             if ($issuePriorityArray[$i]['name'] == $issuePriority['name']) {
                 $issuePriorityArray[$i]['id'] .= '#' . $issuePriority['id'];
                 $found = true;
                 break;
             }
         }
         if (!$found) {
             $issuePriorityArray[] = $issuePriority;
         }
     }
     $criteria['all_client_issue_priority'] = $issuePriorityArray;
     $allClientIssueResolutions = UbirimiContainer::get()['repository']->get(IssueSettings::class)->getAllIssueSettings('resolution', $clientId);
     $issueResolutionArray = array();
     while ($issueResolution = $allClientIssueResolutions->fetch_array(MYSQLI_ASSOC)) {
         $found = false;
         for ($i = 0; $i < count($issueResolutionArray); $i++) {
             if ($issueResolutionArray[$i]['name'] == $issueResolution['name']) {
                 $issueResolutionArray[$i]['id'] .= '#' . $issueResolution['id'];
                 $found = true;
                 break;
             }
         }
         if (!$found) {
             $issueResolutionArray[] = $issueResolution;
         }
     }
     $criteria['all_client_issue_resolution'] = $issueResolutionArray;
     $clientUsersArray = array();
     if ($helpDeskFlag) {
         $allClientUsers = UbirimiContainer::get()['repository']->get(UbirimiUser::class)->getByClientId($clientId);
         while ($allClientUsers && ($clientUser = $allClientUsers->fetch_array(MYSQLI_ASSOC))) {
             $found = false;
             for ($i = 0; $i < count($clientUsersArray); $i++) {
                 if ($clientUsersArray[$i]['first_name'] == $clientUser['first_name'] && $clientUsersArray[$i]['last_name'] == $clientUser['last_name']) {
                     $clientUsersArray[$i]['id'] .= '#' . $clientUser['id'];
                     $found = true;
                     break;
                 }
             }
             if (!$found) {
                 $clientUsersArray[] = $clientUser;
             }
         }
         $criteria['all_client_user_assignee'] = $clientUsersArray;
         $allClientUsers = UbirimiContainer::get()['repository']->get(UbirimiUser::class)->getByClientId($clientId, 1);
         $clientUsersArray = array();
         while ($allClientUsers && ($clientUser = $allClientUsers->fetch_array(MYSQLI_ASSOC))) {
             $found = false;
             for ($i = 0; $i < count($clientUsersArray); $i++) {
                 if ($clientUsersArray[$i]['first_name'] == $clientUser['first_name'] && $clientUsersArray[$i]['last_name'] == $clientUser['last_name']) {
                     $clientUsersArray[$i]['id'] .= '#' . $clientUser['id'];
                     $found = true;
                     break;
                 }
             }
             if (!$found) {
                 $clientUsersArray[] = $clientUser;
             }
//.........这里部分代码省略.........
开发者ID:spiasecki,项目名称:ubirimi,代码行数:101,代码来源:Issue.php

示例4: 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());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:65,代码来源:ListIssueController.php

示例5: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     $clientId = $session->get('client/id');
     $loggedInUserId = $session->get('user/id');
     Util::checkUserIsLoggedInAndRedirect();
     $projectIdArray = $request->request->get('project_id_arr');
     if (count($projectIdArray) == 1 && $projectIdArray[0] == -1) {
         $projectsForBrowsing = $this->getRepository(UbirimiClient::class)->getProjectsByPermission($clientId, $loggedInUserId, Permission::PERM_BROWSE_PROJECTS);
         $projectIdArray = Util::getAsArray($projectsForBrowsing, array('id'));
     }
     $allIssueTypes = $this->getRepository(YongoProject::class)->getAllIssueTypesForProjects($projectIdArray);
     $issueTypeArray = array();
     while ($issueType = $allIssueTypes->fetch_array(MYSQLI_ASSOC)) {
         $found = false;
         for ($i = 0; $i < count($issueTypeArray); $i++) {
             if ($issueTypeArray[$i]['name'] == $issueType['name']) {
                 if (!in_array($issueType['id'], explode("#", $issueTypeArray[$i]['id']))) {
                     $issueTypeArray[$i]['id'] .= '#' . $issueType['id'];
                 }
                 $found = true;
                 break;
             }
         }
         if (!$found) {
             $issueTypeArray[] = $issueType;
         }
     }
     $allIssueStatuses = $this->getRepository(UbirimiClient::class)->getAllIssueSettings('status', $clientId);
     $issueStatusArray = array();
     while ($issueStatus = $allIssueStatuses->fetch_array(MYSQLI_ASSOC)) {
         $found = false;
         for ($i = 0; $i < count($issueStatusArray); $i++) {
             if ($issueStatusArray[$i]['name'] == $issueStatus['name']) {
                 if (!in_array($issueStatus['id'], explode("#", $issueStatusArray[$i]['id']))) {
                     $issueStatusArray[$i]['id'] .= '#' . $issueStatus['id'];
                 }
                 $found = true;
                 break;
             }
         }
         if (!$found) {
             $issueStatusArray[] = $issueStatus;
         }
     }
     $allIssuePriorities = $this->getRepository(UbirimiClient::class)->getAllIssueSettings('priority', $clientId);
     $issuePriorityArray = array();
     while ($issuePriority = $allIssuePriorities->fetch_array(MYSQLI_ASSOC)) {
         $found = false;
         for ($i = 0; $i < count($issuePriorityArray); $i++) {
             if ($issuePriorityArray[$i]['name'] == $issuePriority['name']) {
                 if (!in_array($issuePriority['id'], explode("#", $issuePriorityArray[$i]['id']))) {
                     $issuePriorityArray[$i]['id'] .= '#' . $issuePriority['id'];
                 }
                 $found = true;
                 break;
             }
         }
         if (!$found) {
             $issuePriorityArray[] = $issuePriority;
         }
     }
     $allIssueResolutions = $this->getRepository(UbirimiClient::class)->getAllIssueSettings('resolution', $clientId);
     $issueResolutionArray = array();
     while ($issueResolution = $allIssueResolutions->fetch_array(MYSQLI_ASSOC)) {
         $found = false;
         for ($i = 0; $i < count($issueResolutionArray); $i++) {
             if ($issueResolutionArray[$i]['name'] == $issueResolution['name']) {
                 if (!in_array($issueResolution['id'], explode("#", $issueResolutionArray[$i]['id']))) {
                     $issueResolutionArray[$i]['id'] .= '#' . $issueResolution['id'];
                 }
                 $found = true;
                 break;
             }
         }
         if (!$found) {
             $issueResolutionArray[] = $issueResolution;
         }
     }
     $assignableUsers = $this->getRepository(YongoProject::class)->getUsersWithPermission($projectIdArray, Permission::PERM_ASSIGNABLE_USER);
     $allowUnassignedIssuesFlag = $this->getRepository(UbirimiClient::class)->getYongoSetting($clientId, 'allow_unassigned_issues_flag');
     $issueUsersAssignableArray = array();
     if ($allowUnassignedIssuesFlag) {
         $issueUsersAssignableArray[0]['user_id'] = -1;
         $issueUsersAssignableArray[0]['first_name'] = 'No one';
         $issueUsersAssignableArray[0]['last_name'] = '';
     }
     while ($assignableUsers && ($issueUser = $assignableUsers->fetch_array(MYSQLI_ASSOC))) {
         $found = false;
         for ($i = 0; $i < count($issueUsersAssignableArray); $i++) {
             if ($issueUsersAssignableArray[$i]['first_name'] == $issueUser['first_name'] && $issueUsersAssignableArray[$i]['last_name'] == $issueUser['last_name']) {
                 $issueUsersAssignableArray[$i]['user_id'] .= '#' . $issueUser['user_id'];
                 $found = true;
                 break;
             }
         }
         if (!$found) {
             $issueUsersAssignableArray[] = $issueUser;
         }
     }
     // components are releases
//.........这里部分代码省略.........
开发者ID:spiasecki,项目名称:ubirimi,代码行数:101,代码来源:ProjectsDataController.php


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