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


PHP Util::getServerCurrentDateTime方法代码示例

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


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

示例1: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $workflowId = $request->get('id');
     $workflow = $this->getRepository(Workflow::class)->getMetaDataById($workflowId);
     if ($workflow['client_id'] != $session->get('client/id')) {
         return new RedirectResponse('/general-settings/bad-link-access-denied');
     }
     $emptyName = false;
     $duplicateName = false;
     if ($request->request->has('copy_workflow')) {
         $name = Util::cleanRegularInputField($request->request->get('name'));
         $description = Util::cleanRegularInputField($request->request->get('description'));
         if (empty($name)) {
             $emptyName = true;
         }
         $workflowAlreadyExisting = $this->getRepository(Workflow::class)->getByClientIdAndName($session->get('client/id'), $name);
         if ($workflowAlreadyExisting) {
             $duplicateName = true;
         }
         if (!$emptyName && !$workflowAlreadyExisting) {
             $currentDate = Util::getServerCurrentDateTime();
             $this->getRepository(Workflow::class)->copy($session->get('client/id'), $workflowId, $name, $description, $currentDate);
             $this->getLogger()->addInfo('Copy Yongo Workflow ' . $workflow['name'], $this->getLoggerContext());
             return new RedirectResponse('/yongo/administration/workflows');
         }
     }
     $menuSelectedCategory = 'issue';
     $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Copy Workflow';
     return $this->render(__DIR__ . '/../../../Resources/views/administration/workflow/Copy.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:31,代码来源:CopyController.php

示例2: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $clientId = $session->get('client/id');
     $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
     $name = Util::cleanRegularInputField($request->request->get('name'));
     $description = $request->request->get('description');
     $location = $request->request->get('location');
     $calendarId = $request->request->get('calendar');
     $start = $request->request->get('start');
     $end = $request->request->get('end');
     $color = '#' . $request->request->get('color');
     $repeatData = $request->request->get('repeat_data');
     if (!empty($name)) {
         $date = Util::getServerCurrentDateTime();
         ini_set('memory_limit', '1024M');
         $eventId = $this->getRepository(CalendarEvent::class)->add($calendarId, $session->get('user/id'), $name, $description, $location, $start, $end, $color, $date, $repeatData, $clientSettings);
         // add the default reminders
         $reminders = $this->getRepository(UbirimiCalendar::class)->getReminders($calendarId);
         while ($reminders && ($reminder = $reminders->fetch_array(MYSQLI_ASSOC))) {
             $this->getRepository(CalendarEvent::class)->addReminder($eventId, $reminder['cal_event_reminder_type_id'], $reminder['cal_event_reminder_period_id'], $reminder['value']);
         }
         $this->getLogger()->addInfo('ADD EVENTS event ' . $name, $this->getLoggerContext());
     }
     return new Response('');
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:26,代码来源:AddController.php

示例3: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $screenId = $request->get('id');
     $screenMetadata = $this->getRepository(Screen::class)->getMetaDataById($screenId);
     if ($screenMetadata['client_id'] != $session->get('client/id')) {
         return new RedirectResponse('/general-settings/bad-link-access-denied');
     }
     $position = $request->get('position');
     $fieldId = $request->get('field_id');
     if ($fieldId && $position) {
         $this->getRepository(Screen::class)->updatePositionForField($screenId, $fieldId, $position);
         return new RedirectResponse('/yongo/administration/screen/configure/' . $screenId);
     }
     $fields = $this->getRepository(Field::class)->getByClient($session->get('client/id'));
     if ($request->request->has('add_screen_field')) {
         $fieldId = Util::cleanRegularInputField($request->request->get('field'));
         if ($fieldId != -1) {
             $currentDate = Util::getServerCurrentDateTime();
             $lastOrder = $this->getRepository(Screen::class)->getLastOrderNumber($screenId);
             $this->getRepository(Screen::class)->addData($screenId, $fieldId, $lastOrder + 1, $currentDate);
             $this->getLogger()->addInfo('UPDATE Yongo Screen Data ' . $screenMetadata['name'], $this->getLoggerContext());
             return new RedirectResponse('/yongo/administration/screen/configure/' . $screenId);
         }
     }
     $screenData = $this->getRepository(Screen::class)->getDataById($screenId);
     $menuSelectedCategory = 'issue';
     $source = $request->get('source');
     $projectId = null;
     if ($source == 'project_screen' || $source == 'project_field') {
         $projectId = $request->get('project_id');
     }
     $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Update Screen';
     return $this->render(__DIR__ . '/../../../Resources/views/administration/screen/Configure.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:35,代码来源:ConfigureController.php

示例4: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $calendarId = $request->get('id');
     $calendar = $this->getRepository(UbirimiCalendar::class)->getById($calendarId);
     $defaultReminders = $this->getRepository(UbirimiCalendar::class)->getReminders($calendarId);
     if ($calendar['client_id'] != $session->get('client/id')) {
         return new RedirectResponse('/general-settings/bad-link-access-denied');
     }
     if ($request->request->has('edit_calendar_settings')) {
         $date = Util::getServerCurrentDateTime();
         $this->getRepository(UbirimiCalendar::class)->deleteReminders($calendarId);
         $this->getRepository(UbirimiCalendar::class)->deleteSharesByCalendarId($calendarId);
         // reminder information
         foreach ($request->request as $key => $value) {
             if (strpos($key, 'reminder_type_') !== false) {
                 $indexReminder = str_replace('reminder_type_', '', $key);
                 $reminderType = Util::cleanRegularInputField($request->request->get($key));
                 $reminderValue = $request->request->get('value_reminder_' . $indexReminder);
                 $reminderPeriod = $request->request->get('reminder_period_' . $indexReminder);
                 // add the reminder
                 if (is_numeric($reminderValue)) {
                     $this->getRepository(UbirimiCalendar::class)->addReminder($calendarId, $reminderType, $reminderPeriod, $reminderValue);
                 }
             }
         }
         $this->getLogger()->addInfo('UPDATE Calendar Default Reminders ' . $calendar['name'], $this->getLoggerContext());
         return new RedirectResponse('/calendar/calendars');
     }
     $menuSelectedCategory = 'calendar';
     $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_CALENDAR_NAME . ' / Calendar: ' . $calendar['name'] . ' / Settings';
     return $this->render(__DIR__ . '/../Resources/views/Settings.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:33,代码来源:SettingsController.php

示例5: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $emptyPriorityName = false;
     $priorityExists = false;
     if ($request->request->has('new_priority')) {
         $name = Util::cleanRegularInputField($request->request->get('name'));
         $description = Util::cleanRegularInputField($request->request->get('description'));
         $color = Util::cleanRegularInputField($request->request->get('color'));
         if (empty($name)) {
             $emptyPriorityName = true;
         }
         // check for duplication
         $priority = $this->getRepository(IssueSettings::class)->getByName($session->get('client/id'), 'priority', mb_strtolower($name));
         if ($priority) {
             $priorityExists = true;
         }
         if (!$priorityExists && !$emptyPriorityName) {
             $iconName = 'generic.png';
             $currentDate = Util::getServerCurrentDateTime();
             $this->getRepository(IssueSettings::class)->create('issue_priority', $session->get('client/id'), $name, $description, $iconName, $color, $currentDate);
             $this->getLogger()->addInfo('ADD Yongo Issue Priority ' . $name, $this->getLoggerContext());
             return new RedirectResponse('/yongo/administration/issue/priorities');
         }
     }
     $menuSelectedCategory = 'issue';
     $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Create Issue Priority';
     return $this->render(__DIR__ . '/../../../../Resources/views/administration/issue/priority/Add.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:29,代码来源:AddController.php

示例6: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $smtpServerId = $request->get('id');
     $smtpServer = $this->getRepository(SMTPServer::class)->getById($smtpServerId);
     $session->set('selected_product_id', -1);
     $menuSelectedCategory = 'general_mail';
     $emptyName = false;
     $emptyFromAddress = false;
     $emptyEmailPrefix = false;
     $emptyHostname = false;
     if ($request->request->has('edit_smtp')) {
         $name = Util::cleanRegularInputField($request->request->get('name'));
         $description = Util::cleanRegularInputField($request->request->get('description'));
         $fromAddress = Util::cleanRegularInputField($request->request->get('from_address'));
         $emailPrefix = Util::cleanRegularInputField($request->request->get('email_prefix'));
         $protocol = Util::cleanRegularInputField($request->request->get('protocol'));
         $hostname = Util::cleanRegularInputField($request->request->get('hostname'));
         $port = Util::cleanRegularInputField($request->request->get('port'));
         $timeout = Util::cleanRegularInputField($request->request->get('timeout'));
         $tls = $request->request->has('tls') ? 1 : 0;
         $username = Util::cleanRegularInputField($request->request->get('username'));
         $password = Util::cleanRegularInputField($request->request->get('password'));
         $date = Util::getServerCurrentDateTime();
         $this->getRepository(SMTPServer::class)->updateById($smtpServerId, $name, $description, $fromAddress, $emailPrefix, $protocol, $hostname, $port, $timeout, $tls, $username, $password, $date);
         $this->getLogger()->addInfo('UPDATE SMTP Server ' . $name, $this->getLoggerContext());
         $session->set('client/settings/smtp', $this->getRepository(SMTPServer::class)->getById($smtpServerId));
         return new RedirectResponse('/general-settings/smtp-settings');
     }
     $sectionPageTitle = $session->get('client/settings/title_name') . ' / GeneralSettings Settings / Update SMTP Server Settings';
     return $this->render(__DIR__ . '/../../Resources/views/smtp/Edit.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:32,代码来源:EditController.php

示例7: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $menuSelectedCategory = 'issue';
     $emptyName = false;
     $fields = $this->getRepository(Field::class)->getByClient($session->get('client/id'));
     if ($request->request->has('add_screen')) {
         $name = Util::cleanRegularInputField($request->request->get('name'));
         $description = Util::cleanRegularInputField($request->request->get('description'));
         $currentDate = Util::getServerCurrentDateTime();
         if (empty($name)) {
             $emptyName = true;
         }
         if (!$emptyName) {
             $screen = new Screen($session->get('client/id'), $name, $description);
             $screenId = $screen->save($currentDate);
             $order = 0;
             foreach ($request->request as $key => $value) {
                 if (substr($key, 0, 6) == 'field_') {
                     $order++;
                     $fieldId = str_replace('field_', '', $key);
                     $this->getRepository(Screen::class)->addData($screenId, $fieldId, $order, $currentDate);
                 }
             }
             $this->getLogger()->addInfo('ADD Yongo Screen ' . $name, $this->getLoggerContext());
             return new RedirectResponse('/yongo/administration/screens');
         }
     }
     $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Create Screen';
     return $this->render(__DIR__ . '/../../../Resources/views/administration/screen/Add.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:31,代码来源:AddController.php

示例8: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $fieldConfigurationId = $request->get('field_configuration_id');
     $fieldId = $request->get('id');
     $fieldConfiguration = $this->getRepository(FieldConfiguration::class)->getMetaDataById($fieldConfigurationId);
     $field = $this->getRepository(Field::class)->getById($fieldId);
     $screens = $this->getRepository(Screen::class)->getAll($session->get('client/id'));
     if ($request->request->has('edit_field_configuration_screen')) {
         $currentDate = Util::getServerCurrentDateTime();
         $this->getRepository(Screen::class)->deleteDataByFieldId($fieldId);
         foreach ($request->request as $key => $value) {
             if (substr($key, 0, 13) == 'field_screen_') {
                 $data = str_replace('field_screen_', '', $key);
                 $values = explode('_', $data);
                 $fieldSelectedId = $values[0];
                 $screenSelectedId = $values[1];
                 $this->getRepository(Screen::class)->addData($screenSelectedId, $fieldSelectedId, null, $currentDate);
             }
         }
         return new RedirectResponse('/yongo/administration/field-configuration/edit/' . $fieldConfigurationId);
     }
     $menuSelectedCategory = 'issue';
     $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Update Field Configuration Screen';
     return $this->render(__DIR__ . '/../../../../Resources/views/administration/field/configuration/EditScreen.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:26,代码来源:EditScreenController.php

示例9: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $projectId = $request->get('id');
     $emptyName = false;
     $queueExists = false;
     $queues = $this->getRepository(Queue::class)->getByProjectId($projectId);
     $selectedQueueId = -1;
     if ($queues) {
         $firstQueue = $queues->fetch_array(MYSQLI_ASSOC);
         $selectedQueueId = $firstQueue['id'];
     }
     if ($request->request->has('new_queue')) {
         $name = Util::cleanRegularInputField($request->request->get('name'));
         $description = Util::cleanRegularInputField($request->request->get('description'));
         $queueDefinition = Util::cleanRegularInputField($request->request->get('definition'));
         if (empty($name)) {
             $emptyName = true;
         }
         // check for duplication
         $queue = $this->getRepository(Queue::class)->getByName($projectId, mb_strtolower($name));
         if ($queue) {
             $queueExists = true;
         }
         if (!$queueExists && !$emptyName) {
             $currentDate = Util::getServerCurrentDateTime();
             $defaultColumns = 'code#summary#priority#status#created#updated#reporter#assignee';
             $queueId = $this->getRepository(Queue::class)->save($session->get('user/id'), $projectId, $name, $description, $queueDefinition, $defaultColumns, $currentDate);
             return new RedirectResponse('/helpdesk/queues/' . $projectId . '/' . $queueId);
         }
     }
     $menuSelectedCategory = 'issue';
     $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_HELP_DESK_NAME . ' / Create Queue';
     return $this->render(__DIR__ . '/../../Resources/views/queue/AddQueue.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:35,代码来源:AddController.php

示例10: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $emptyName = false;
     $duplicateOrganization = false;
     $organizationId = $request->get('id');
     $organization = $this->getRepository(Organization::class)->getById($organizationId);
     if ($request->request->has('edit_organization')) {
         $name = Util::cleanRegularInputField($request->request->get('name'));
         $description = Util::cleanRegularInputField($request->request->get('description'));
         if (empty($name)) {
             $emptyName = true;
         }
         $organizationDuplicate = $this->getRepository(Organization::class)->getByName($session->get('client/id'), mb_strtolower($name), $organizationId);
         if ($organizationDuplicate) {
             $duplicateOrganization = true;
         }
         if (!$emptyName && !$organizationDuplicate) {
             $currentDate = Util::getServerCurrentDateTime();
             $this->getRepository(Organization::class)->updateById($organizationId, $name, $description, $currentDate);
             $this->getLogger()->addInfo('UPDATE Organization ' . $name, $this->getLoggerContext());
             return new RedirectResponse('/helpdesk/administration/organizations');
         }
     }
     $menuSelectedCategory = 'helpdesk_organizations';
     $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_HELP_DESK_NAME . ' / Create Organization';
     return $this->render(__DIR__ . '/../../../Resources/views/administration/organization/EditOrganization.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:28,代码来源:EditController.php

示例11: 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

示例12: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $emptyValue = false;
     $duplicateValue = false;
     $customFieldId = $request->get('id');
     $field = $this->getRepository(Field::class)->getById($customFieldId);
     if ($request->request->has('new_custom_value')) {
         $value = Util::cleanRegularInputField($request->request->get('value'));
         if (empty($value)) {
             $emptyValue = true;
         }
         if (!$emptyValue) {
             $customValueExists = $this->getRepository(Field::class)->getDataByFieldIdAndValue($customFieldId, $value);
             if ($customValueExists) {
                 $duplicateValue = true;
             }
         }
         if (!$emptyValue && !$duplicateValue) {
             $currentDate = Util::getServerCurrentDateTime();
             $this->getRepository(Field::class)->addData($customFieldId, $value, $currentDate);
             $this->getLogger()->addInfo('ADD Field Custom Value ' . $value, $this->getLoggerContext());
             return new RedirectResponse('/yongo/administration/custom-fields/define/' . $customFieldId);
         }
     }
     $menuSelectedCategory = 'issue';
     $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Add Custom Field Value';
     return $this->render(__DIR__ . '/../../../../Resources/views/administration/field/custom/AddValue.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:29,代码来源:AddValueController.php

示例13: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $menuSelectedCategory = 'calendars';
     $emptyName = false;
     $duplicateName = false;
     if ($request->request->has('confirm_new_calendar')) {
         $name = Util::cleanRegularInputField($request->request->get('name'));
         $description = Util::cleanRegularInputField($request->request->get('description'));
         $color = Util::cleanRegularInputField($request->request->get('color'));
         if (empty($name)) {
             $emptyName = true;
         }
         $calendarSameName = $this->getRepository(UbirimiCalendar::class)->getByName($session->get('user/id'), $name);
         if ($calendarSameName) {
             $duplicateName = true;
         }
         if (!$emptyName && !$duplicateName) {
             $currentDate = Util::getServerCurrentDateTime();
             $calendarId = $this->getRepository(UbirimiCalendar::class)->save($session->get('user/id'), $name, $description, $color, $currentDate);
             // add default reminders
             $this->getRepository(UbirimiCalendar::class)->addReminder($calendarId, ReminderType::REMINDER_EMAIL, ReminderPeriod::PERIOD_MINUTE, 30);
             $this->getLogger()->addInfo('ADD EVENTS calendar ' . $name, $this->getLoggerContext());
             return new RedirectResponse('/calendar/calendars');
         }
     }
     $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_CALENDAR_NAME . ' / Create Calendar';
     return $this->render(__DIR__ . '/../Resources/views/Add.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:29,代码来源:AddController.php

示例14: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $Id = $request->get('id');
     $issueType = $this->getRepository(IssueType::class)->getById($Id);
     if ($issueType['client_id'] != $session->get('client/id')) {
         return new RedirectResponse('/general-settings/bad-link-access-denied');
     }
     $emptyName = false;
     $typeExists = false;
     if ($request->request->has('edit_type')) {
         $name = Util::cleanRegularInputField($request->request->get('name'));
         $description = Util::cleanRegularInputField($request->request->get('description'));
         if (empty($name)) {
             $emptyName = true;
         }
         // check for duplication
         $type = $this->getRepository(IssueSettings::class)->getByName($session->get('client/id'), 'type', mb_strtolower($name), $Id);
         if ($type) {
             $typeExists = true;
         }
         if (!$typeExists && !$emptyName) {
             $currentDate = Util::getServerCurrentDateTime();
             $this->getRepository(IssueType::class)->updateById($Id, $name, $description, $currentDate);
             $this->getLogger()->addInfo('UPDATE Yongo Issue Type ' . $name, $this->getLoggerContext());
             return new RedirectResponse('/yongo/administration/issue-sub-tasks');
         }
     }
     $menuSelectedCategory = 'issue';
     $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Update Issue Type';
     return $this->render(__DIR__ . '/../../../../Resources/views/administration/issue/type/Edit.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:32,代码来源:EditController.php

示例15: indexAction

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


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