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


PHP Container\UbirimiContainer类代码示例

本文整理汇总了PHP中Ubirimi\Container\UbirimiContainer的典型用法代码示例。如果您正苦于以下问题:PHP UbirimiContainer类的具体用法?PHP UbirimiContainer怎么用?PHP UbirimiContainer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: deleteByIssueId

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

示例2: indexAction

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

示例3: indexAction

 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);
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:28,代码来源:GetEntityImagesController.php

示例4: indexAction

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

示例5: deleteById

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

示例6: getByIssueIdAndUserId

 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;
     }
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:31,代码来源:IssueHistory.php

示例7: indexAction

 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);
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:34,代码来源:LogController.php

示例8: deleteById

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

示例9: indexAction

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

示例10: getByIssueIdAndProjectId

 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;
     }
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:25,代码来源:IssueComponent.php

示例11: hasEvent

 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']);
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:7,代码来源:WorkflowService.php

示例12: indexAction

 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');
     }
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:27,代码来源:SaveIssueTransitionNoScreenController.php

示例13: indexAction

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

示例14: addConditionString

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

示例15: indexAction

 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('/');
         }
     }
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:29,代码来源:PasswordRecoverDoController.php


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