php Ubirimi-Container-UbirimiContainer类(方法)实例源码

下面列出了php Ubirimi-Container-UbirimiContainer 类(方法)源码代码实例,从而了解它的用法。

作者:spiaseck    项目:ubirim   
public function deleteByIssueId($issueId)
 {
     $query = "delete from yongo_issue_watch where yongo_issue_id = ?";
     $stmt = UbirimiContainer::get()['db.connection']->prepare($query);
     $stmt->bind_param("i", $issueId);
     $stmt->execute();
 }

作者:spiaseck    项目:ubirim   
public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $loggedInUserId = $session->get('user/id');
     $menuSelectedCategory = 'issue';
     $clientSettings = $session->get('client/settings');
     $issues = $this->getRepository(Issue::class)->getByParameters(array('issue_id' => UbirimiContainer::get()['session']->get('bulk_change_issue_ids'), $loggedInUserId));
     if ($request->request->has('confirm')) {
         if (UbirimiContainer::get()['session']->get('bulk_change_operation_type') == 'delete') {
             $issueIds = UbirimiContainer::get()['session']->get('bulk_change_issue_ids');
             for ($i = 0; $i < count($issueIds); $i++) {
                 if (UbirimiContainer::get()['session']->get('bulk_change_send_operation_email')) {
                     $issue = $this->getRepository(Issue::class)->getByParameters(array('issue_id' => $issueIds[$i]), $loggedInUserId);
                     $issueEvent = new IssueEvent($issue, null, IssueEvent::STATUS_DELETE);
                     $this->getLogger()->addInfo('DELETE Yongo issue ' . $issue['project_code'] . '-' . $issue['nr'], $this->getLoggerContext());
                     UbirimiContainer::get()['dispatcher']->dispatch(YongoEvents::YONGO_ISSUE_EMAIL, $issueEvent);
                 }
                 $this->getRepository(Issue::class)->deleteById($issueIds[$i]);
                 $this->getRepository(IssueAttachment::class)->deleteByIssueId($issueIds[$i]);
                 // also delete the substaks
                 $childrenIssues = $this->getRepository(Issue::class)->getByParameters(array('parent_id' => $issueIds[$i]), $loggedInUserId);
                 while ($childrenIssues && ($childIssue = $childrenIssues->fetch_array(MYSQLI_ASSOC))) {
                     $this->getRepository(Issue::class)->deleteById($childIssue['id']);
                     $this->getRepository(IssueAttachment::class)->deleteByIssueId($childIssue['id']);
                 }
             }
         }
         return new RedirectResponse('/yongo/issue/search?' . UbirimiContainer::get()['session']->get('bulk_change_choose_issue_query_url'));
     }
     $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Bulk: Operation Confirmation';
     return $this->render(__DIR__ . '/../../../Resources/views/issue/bulk/OperationConfirmation.php', get_defined_vars());
 }

作者:spiaseck    项目:ubirim   
public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $entityId = $session->get('current_edit_entity_id');
     $attachments = $this->getRepository(EntityAttachment::class)->getByEntityId($entityId);
     $html = '';
     $index = 0;
     if ($attachments) {
         $entity = $this->getRepository(Entity::class)->getById($entityId);
         $html .= '<div style="width: 100%; height: 500px; overflow-y: scroll">';
         while ($attachment = $attachments->fetch_array(MYSQLI_ASSOC)) {
             // todo: check if the attachment is an image
             // get the last revision
             $attachmentRevisions = $this->getRepository(Entity::class)->getRevisionsByAttachmentId($attachment['id']);
             $lastRevisionNumber = $attachmentRevisions->num_rows;
             $html .= '<img data="/assets' . UbirimiContainer::get()['asset.documentador_entity_attachments'] . $entity['space_id'] . '/' . $entityId . '/' . $attachment['id'] . '/' . $lastRevisionNumber . '/' . $attachment['name'] . '" id="entity_existing_image_' . $attachment['id'] . '" style="float: left; padding-right: 10px; width: 240px" src="/assets' . UbirimiContainer::get()['asset.documentador_entity_attachments'] . $entity['space_id'] . '/' . $entityId . '/' . $attachment['id'] . '/' . $lastRevisionNumber . '/' . $attachment['name'] . '" />';
             $index++;
             if ($index > 4) {
                 $index = 0;
                 $html .= '<br />';
             }
         }
         $html .= '</div>';
     } else {
         $html .= '<div class="infoBox">There are no images for this page</div>';
     }
     return new \Symfony\Component\HttpFoundation\Response($html);
 }

作者:spiaseck    项目:ubirim   
public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $loggedInUserId = $session->get('user/id');
     $issueId = $request->request->get('issue_id');
     $attachIdsToBeKept = $request->request->get('attach_ids');
     $comment = Util::cleanRegularInputField($request->request->get('comment'));
     if (!is_array($attachIdsToBeKept)) {
         $attachIdsToBeKept = array();
     }
     Util::manageModalAttachments($issueId, $session->get('user/id'), $attachIdsToBeKept);
     if (!empty($comment)) {
         $currentDate = Util::getServerCurrentDateTime();
         $this->getRepository(IssueComment::class)->add($issueId, $session->get('user/id'), $comment, $currentDate);
     }
     // send email notification
     $issueQueryParameters = array('issue_id' => $issueId);
     $issue = $this->getRepository(Issue::class)->getByParameters($issueQueryParameters, $loggedInUserId);
     $project = $this->getRepository(YongoProject::class)->getById($issue['issue_project_id']);
     $issueEventData = array('user_id' => $loggedInUserId, 'attachmentIds' => UbirimiContainer::get()['session']->get('added_attachments_in_screen'), 'comment' => $comment);
     $issueEvent = new IssueEvent($issue, $project, IssueEvent::STATUS_UPDATE, $issueEventData);
     UbirimiContainer::get()['dispatcher']->dispatch(YongoEvents::YONGO_ISSUE_ADD_ATTACHMENT, $issueEvent);
     UbirimiContainer::get()['session']->remove('added_attachments_in_screen');
     return new Response('');
 }

作者:spiaseck    项目:ubirim   
public function deleteById($reminderId)
 {
     $query = "delete from cal_event_reminder where id = ? limit 1";
     $stmt = UbirimiContainer::get()['db.connection']->prepare($query);
     $stmt->bind_param("i", $reminderId);
     $stmt->execute();
 }

作者:spiaseck    项目:ubirim   
public function getByIssueIdAndUserId($issueId = null, $userId = null, $order = null, $resultType = null)
 {
     $query = '(select \'history_event\' as source, ' . 'issue_history.date_created, ' . 'issue_history.field as field, ' . 'issue_history.old_value as old_value, ' . 'issue_history.new_value as new_value, ' . 'issue_history.old_value_id as old_value_id, ' . 'issue_history.new_value_id as new_value_id, ' . 'null as content, ' . 'general_user.id as user_id, general_user.first_name, general_user.last_name, ' . 'yongo_issue.nr as nr, ' . 'project.code as code, ' . 'yongo_issue.id as issue_id ' . 'from issue_history ' . 'left join general_user on general_user.id = issue_history.by_user_id ' . 'left join yongo_issue on yongo_issue.id = issue_history.issue_id ' . 'left join project on project.id = yongo_issue.project_id ' . 'where ';
     if ($issueId) {
         $query .= ' issue_history.issue_id = ' . $issueId . ' ';
     }
     if ($userId) {
         $query .= ' issue_history.by_user_id = ' . $userId . ' ';
     }
     if (!$order) {
         $order = 'desc';
     }
     $query .= 'order by date_created ' . $order . ', user_id) ';
     $query .= ' UNION (select ' . "'event_commented' as source, " . 'issue_comment.date_created as date_created, ' . 'null as field, ' . 'null as old_value, ' . 'null as new_value, ' . 'null as old_value_id, ' . 'null as new_value_id, ' . 'null as content, ' . 'general_user.id as user_id, general_user.first_name, general_user.last_name, ' . 'yongo_issue.nr as nr, ' . 'project.code as code, ' . 'yongo_issue.id as issue_id ' . 'from yongo_issue ' . 'left join issue_comment on yongo_issue.id = issue_comment.issue_id ' . 'left join general_user on general_user.id = issue_comment.user_id ' . 'left join project on project.id = yongo_issue.project_id ' . 'where yongo_issue.id = ' . $issueId . ' ' . 'and issue_comment.issue_id is not null ' . 'order by date_created ' . $order . ', user_id) ';
     $stmt = UbirimiContainer::get()['db.connection']->prepare($query);
     $stmt->execute();
     $result = $stmt->get_result();
     if ($result->num_rows) {
         if ($resultType == 'array') {
             $resultArray = array();
             while ($data = $result->fetch_array(MYSQLI_ASSOC)) {
                 $resultArray[] = $data;
             }
             return $resultArray;
         } else {
             return $result;
         }
     } else {
         return null;
     }
 }

作者:spiaseck    项目:ubirim   
public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $loggedInUserId = $session->get('user/id');
     $issueId = $request->request->get('id');
     $timeSpentPost = trim(str_replace(" ", '', $request->request->get('time_spent')));
     $dateStartedString = $request->request->get('date_started');
     $remainingTime = $request->request->get('remaining');
     $comment = $request->request->get('comment');
     $dateStarted = \DateTime::createFromFormat('d-m-Y H:i', $dateStartedString);
     $dateStartedString = date_format($dateStarted, 'Y-m-d H:i');
     if (is_numeric($timeSpentPost)) {
         $timeSpentPost = $timeSpentPost . $session->get('yongo/settings/time_tracking_default_unit');
     }
     if ($timeSpentPost) {
         $currentDate = Util::getServerCurrentDateTime();
         $issueQueryParameters = array('issue_id' => $issueId);
         $issue = $this->getRepository(Issue::class)->getByParameters($issueQueryParameters, $loggedInUserId);
         $this->getRepository(WorkLog::class)->addLog($issueId, $loggedInUserId, $timeSpentPost, $dateStartedString, $comment, $currentDate);
         $remainingTime = $this->getRepository(WorkLog::class)->adjustRemainingEstimate($issue, $timeSpentPost, $remainingTime, $session->get('yongo/settings/time_tracking_hours_per_day'), $session->get('yongo/settings/time_tracking_days_per_week'), $loggedInUserId);
         $fieldChanges = array(array('time_spent', null, $timeSpentPost), array('remaining_estimate', $issue['remaining_estimate'], $remainingTime));
         $this->getRepository(Issue::class)->updateHistory($issue['id'], $loggedInUserId, $fieldChanges, $currentDate);
         // update the date_updated field
         $this->getRepository(Issue::class)->updateById($issueId, array('date_updated' => $currentDate), $currentDate);
         $project = $this->getRepository(YongoProject::class)->getById($issue['issue_project_id']);
         $issueEventData = array('user_id' => $loggedInUserId, 'comment' => $comment, 'date_started' => $dateStartedString, 'time_spent' => $timeSpentPost);
         $issueEvent = new IssueEvent($issue, $project, IssueEvent::STATUS_UPDATE, $issueEventData);
         UbirimiContainer::get()['dispatcher']->dispatch(YongoEvents::YONGO_ISSUE_WORK_LOGGED, $issueEvent);
     }
     if (null == $remainingTime || '' == $remainingTime) {
         $remainingTime = -1;
     }
     return new Response($remainingTime);
 }

作者:spiaseck    项目:ubirim   
public function deleteById($smtpServerId)
 {
     $query = 'delete from client_smtp_settings where id = ? limit 1';
     $stmt = UbirimiContainer::get()['db.connection']->prepare($query);
     $stmt->bind_param("i", $smtpServerId);
     $stmt->execute();
 }

作者:spiaseck    项目:ubirim   
public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $menuSelectedCategory = 'svn';
     $userId = $request->query->get('id', $request->request->get('id'));
     $repoId = $request->query->get('repo_id', $request->request->get('repo_id'));
     $user = $this->getRepository(UbirimiUser::class)->getById($userId);
     $svnRepo = $this->getRepository(SvnRepository::class)->getById($repoId);
     $errors = array('empty_password' => false, 'password_mismatch' => false);
     if ($request->request->has('password') || $request->request->has('password_again')) {
         $password = Util::cleanRegularInputField($request->request->get('password'));
         $passwordAgain = Util::cleanRegularInputField($request->request->get('password_again'));
         if (empty($password)) {
             $errors['empty_password'] = true;
         }
         if ($password != $passwordAgain) {
             $errors['password_mismatch'] = true;
         }
         if (Util::hasNoErrors($errors)) {
             $this->getRepository(SvnRepository::class)->updateUserPassword($session->get('selected_svn_repo_id'), $userId, $password);
             $this->getRepository(SvnRepository::class)->updateHtpasswd($session->get('selected_svn_repo_id'), $session->get('client/company_domain'));
             $this->getRepository(SvnRepository::class)->updateAuthz();
             $svnEvent = new SvnHostingEvent($svnRepo['name'], $user, array('password' => $password));
             $this->getLogger()->addInfo(sprintf('SVN Change Password for [%s]', $svnRepo['name']), $this->getLoggerContext());
             UbirimiContainer::get()['dispatcher']->dispatch(SvnHostingEvents::PASSWORD_UPDATE, $svnEvent);
             return new Response('1');
         }
     }
     $menuSelectedCategory = 'svn';
     return $this->render(__DIR__ . '/../Resources/views/ChangePassword.php', get_defined_vars());
 }

作者:spiaseck    项目:ubirim   
public function getByIssueIdAndProjectId($issueId, $projectId, $resultType = null, $resultColumn = null)
 {
     $query = 'SELECT issue_component.id, project_component.name, project_component_id, parent_id ' . 'FROM issue_component ' . 'LEFT JOIN project_component on issue_component.project_component_id = project_component.id ' . 'WHERE issue_id = ? and project_component.project_id = ? ' . 'order by id asc';
     $stmt = UbirimiContainer::get()['db.connection']->prepare($query);
     $stmt->bind_param("ii", $issueId, $projectId);
     $stmt->execute();
     $result = $stmt->get_result();
     if ($result->num_rows) {
         if ($resultType == 'array') {
             $resultArray = array();
             while ($component = $result->fetch_array(MYSQLI_ASSOC)) {
                 if ($resultColumn) {
                     $resultArray[] = $component[$resultColumn];
                 } else {
                     $resultArray[] = $component;
                 }
             }
             return $resultArray;
         } else {
             return $result;
         }
     } else {
         return null;
     }
 }

作者:spiaseck    项目:ubirim   
public function hasEvent($clientId, $projectId, $issueTypeId)
 {
     $workflowUsed = UbirimiContainer::get()['repository']->get(YongoProject::class)->getWorkflowUsedForType($projectId, $issueTypeId);
     $creationData = UbirimiContainer::get()['repository']->get(Workflow::class)->getDataForCreation($workflowUsed['id']);
     $eventData = UbirimiContainer::get()['repository']->get(IssueEvent::class)->getByClientIdAndCode($clientId, IssueEvent::EVENT_ISSUE_CREATED_CODE);
     return UbirimiContainer::get()['repository']->get(WorkflowFunction::class)->hasEvent($creationData['id'], 'event=' . $eventData['id']);
 }

作者:spiaseck    项目:ubirim   
public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $clientId = UbirimiContainer::get()['session']->get('client/id');
     $loggedInUserId = UbirimiContainer::get()['session']->get('user/id');
     $workflowStepIdFrom = $request->request->get('step_id_from');
     $workflowStepIdTo = $request->request->get('step_id_to');
     $workflowId = $request->request->get('workflow_id');
     $issueId = $request->request->get('issue_id');
     $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
     $workflowData = $this->getRepository(Workflow::class)->getDataByStepIdFromAndStepIdTo($workflowId, $workflowStepIdFrom, $workflowStepIdTo);
     $issue = $this->getRepository(Issue::class)->getByParameters(array('issue_id' => $issueId), $loggedInUserId);
     $canBeExecuted = $this->getRepository(Workflow::class)->checkConditionsByTransitionId($workflowData['id'], $loggedInUserId, $issue);
     if ($canBeExecuted) {
         $smtpSettings = $session->get('client/settings/smtp');
         if ($smtpSettings) {
             Email::$smtpSettings = $smtpSettings;
         }
         $date = Util::getServerCurrentDateTime();
         $this->getRepository(WorkflowFunction::class)->triggerPostFunctions($clientId, $issue, $workflowData, array(), $loggedInUserId, $date);
         // update the date_updated field
         $this->getRepository(Issue::class)->updateById($issueId, array('date_updated' => $date), $date);
         return new Response('success');
     } else {
         return new Response('can_not_be_executed');
     }
 }

作者:spiaseck    项目:ubirim   
public function indexAction(Request $request, SessionInterface $session)
 {
     $timeTrackingDefaultUnit = $this->getRepository(UbirimiClient::class)->getYongoSetting($request->get('api_client_id'), 'time_tracking_default_unit');
     $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($request->get('api_client_id'));
     $issue = UbirimiContainer::get()['issue']->save(array('id' => $request->get('projectId')), array('resolution' => $request->get('resolution'), 'priority' => $request->get('priority'), 'type' => $request->get('type'), 'assignee' => $request->get('assignee'), 'summary' => $request->get('summary'), 'description' => $request->get('description'), 'environment' => $request->get('environment'), 'reporter' => $request->get('api_user_id'), 'due_date' => $request->get('due_date')), null, $timeTrackingDefaultUnit, $request->get('projectId'), array(), array(), $clientSettings, $request->get('api_user_id'), $request->get('api_client_id'));
     return new JsonResponse($issue);
 }

作者:spiaseck    项目:ubirim   
public function addConditionString($transitionId, $stringText)
 {
     $q = 'update workflow_condition_data set definition_data = CONCAT(definition_data, ?) where workflow_data_id = ? limit 1';
     $stmt = UbirimiContainer::get()['db.connection']->prepare($q);
     $stmt->bind_param("si", $stringText, $transitionId);
     $stmt->execute();
 }

作者:spiaseck    项目:ubirim   
public function indexAction(Request $request, SessionInterface $session)
 {
     if ($request->request->has('retrieve')) {
         $errorNotInClientDomain = false;
         $emailAddressNotExists = false;
         $httpHOST = Util::getHttpHost();
         $address = Util::cleanRegularInputField($request->request->get('address'));
         $exists = Util::checkEmailAddressExistence($address);
         if ($exists) {
             $baseURL = Util::getHttpHost();
             $userData = $this->getRepository(UbirimiUser::class)->getByEmailAddressAndBaseURL($address, $baseURL);
             if ($userData) {
                 $password = Util::updatePasswordForUserId($userData['id']);
                 $event = new UbirimiEvent(array('email' => $address, 'password' => $password));
                 UbirimiContainer::get()['dispatcher']->dispatch(UbirimiEvents::PASSWORD_RECOVER, $event);
                 return new RedirectResponse('/recover-password/response');
             } else {
                 $errorNotInClientDomain = true;
             }
         } else {
             $emailAddressNotExists = true;
         }
         return $this->render(__DIR__ . '/../Resources/views/_passwordRecoverForm.php', get_defined_vars());
     } else {
         if ($request->request->has('go_back')) {
             return new RedirectResponse('/');
         }
     }
 }

作者:spiaseck    项目:ubirim   
public function importUsers($repositoryName, $user)
 {
     if ($this->session->get('client/settings/smtp')) {
         Email::$smtpSettings = $this->session->get('client/settings/smtp');
         UbirimiContainer::get()['repository']->get(Email::class)->sendNewUserRepositoryNotificationEmail($this->session->get('client/id'), $user['first_name'], $user['last_name'], $user['username'], null, $user['email'], $repositoryName);
     }
 }

作者:spiaseck    项目:ubirim   
public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $loggedInUserId = $session->get('user/id');
     $workLogId = $request->request->get('id');
     $issueId = $request->request->get('issue_id');
     $remainingTime = $request->request->get('remaining');
     $workLog = $this->getRepository(WorkLog::class)->getById($workLogId);
     $timeSpent = $workLog['time_spent'];
     $this->getRepository(WorkLog::class)->deleteById($workLogId);
     $issueQueryParameters = array('issue_id' => $issueId);
     $issue = $this->getRepository(Issue::class)->getByParameters($issueQueryParameters, $session->get('user/id'));
     $previousEstimate = $issue['remaining_estimate'];
     if ($remainingTime == 'automatic') {
         $remainingTime = '+' . $timeSpent;
     }
     $remainingTime = $this->getRepository(WorkLog::class)->adjustRemainingEstimate($issue, $timeSpent, $remainingTime, $session->get('yongo/settings/time_tracking_hours_per_day'), $session->get('yongo/settings/time_tracking_days_per_week'), $session->get('user/id'));
     $currentDate = Util::getServerCurrentDateTime();
     $fieldChanges = array(array('time_spent', $workLog['time_spent'], 0), array('remaining_estimate', $previousEstimate, $remainingTime), array('worklog_time_spent', $workLog['time_spent'], null));
     $this->getRepository(Issue::class)->updateHistory($issue['id'], $session->get('user/id'), $fieldChanges, $currentDate);
     // update the date_updated field
     $this->getRepository(Issue::class)->updateById($issueId, array('date_updated' => $currentDate), $currentDate);
     // send the email notification
     $project = $this->getRepository(YongoProject::class)->getById($issue['issue_project_id']);
     $issueEventData = array('user_id' => $loggedInUserId, 'remaining_estimate' => $remainingTime, 'time_spent' => $workLog['time_spent']);
     $issueEvent = new IssueEvent($issue, $project, IssueEvent::STATUS_UPDATE, $issueEventData);
     UbirimiContainer::get()['dispatcher']->dispatch(YongoEvents::YONGO_ISSUE_WORK_LOG_DELETED, $issueEvent);
     return new Response($remainingTime);
 }

作者:spiaseck    项目:ubirim   
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());
 }

作者:spiaseck    项目:ubirim   
public function create($organizationId, $userId)
 {
     $query = "INSERT INTO help_customer(help_organization_id, user_id) VALUES (?, ?)";
     $stmt = UbirimiContainer::get()['db.connection']->prepare($query);
     $stmt->bind_param("ii", $organizationId, $userId);
     $stmt->execute();
     return UbirimiContainer::get()['db.connection']->insert_id;
 }

作者:spiaseck    项目:ubirim   
public function deleteByProjectId($projectId)
 {
     $components = UbirimiContainer::get()['repository']->get(YongoProject::class)->getComponents($projectId);
     while ($components && ($component = $components->fetch_array(MYSQLI_ASSOC))) {
         $componentId = $component['id'];
         ProjectComponent::deleteById($componentId);
     }
 }


问题


面经


文章

微信
公众号

扫码关注公众号