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


PHP Ubirimi\Util类代码示例

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


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

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

示例2: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $groupId = $request->get('id');
     $group = $this->getRepository(UbirimiGroup::class)->getMetadataById($groupId);
     return $this->render(__DIR__ . '/../../../Resources/views/administration/group/DeleteConfirm.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:7,代码来源:DeleteConfirmController.php

示例3: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $calendarId = $request->request->get('id');
     $this->getRepository(SlaCalendar::class)->deleteById($calendarId);
     return new Response('');
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:7,代码来源:DeleteController.php

示例4: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $transitionId = $request->request->get('transition_id');
     $type = $request->request->get('type');
     $conditionData = $this->getRepository(WorkflowCondition::class)->getByTransitionId($transitionId);
     if (!$conditionData) {
         $this->getRepository(Workflow::class)->addCondition($transitionId, '');
     }
     if ($type == 'open_bracket') {
         $this->getRepository(WorkflowCondition::class)->addConditionString($transitionId, '(');
     } else {
         if ($type == 'closed_bracket') {
             $this->getRepository(WorkflowCondition::class)->addConditionString($transitionId, ')');
         } else {
             if ($type == 'operator_and') {
                 $this->getRepository(WorkflowCondition::class)->addConditionString($transitionId, '[[AND]]');
             } else {
                 if ($type == 'operator_or') {
                     $this->getRepository(WorkflowCondition::class)->addConditionString($transitionId, '[[OR]]');
                 }
             }
         }
     }
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:25,代码来源:AddStringController.php

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

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

示例7: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $menuSelectedCategory = 'system';
     $emptyName = false;
     $eventId = $request->get('id');
     $event = $this->getRepository(IssueEvent::class)->getById($eventId);
     if ($event['client_id'] != $session->get('client/id')) {
         return new RedirectResponse('/general-settings/bad-link-access-denied');
     }
     if ($request->request->has('edit_event')) {
         $name = Util::cleanRegularInputField($request->request->get('name'));
         $description = Util::cleanRegularInputField($request->request->get('description'));
         if (empty($name)) {
             $emptyName = true;
         }
         if (!$emptyName) {
             $currentDate = Util::getServerCurrentDateTime();
             $this->getRepository(IssueEvent::class)->updateById($eventId, $name, $description, $currentDate);
             $this->getLogger()->addInfo('UPDATE Yongo Event ' . $name, $this->getLoggerContext());
             return new RedirectResponse('/yongo/administration/events');
         }
     }
     $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Update Event';
     return $this->render(__DIR__ . '/../../../Resources/views/administration/event/edit.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:26,代码来源:EditController.php

示例8: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
         $clientId = $session->get('client/id');
         $loggedInUserId = $session->get('user/id');
         $clientSettings = $session->get('client/settings');
     } else {
         $clientId = $this->getRepository(UbirimiClient::class)->getClientIdAnonymous();
         $loggedInUserId = null;
         $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
     }
     $projectId = $request->get('id');
     $month = $request->get('month');
     $year = $request->get('year');
     $project = $this->getRepository(YongoProject::class)->getById($projectId);
     if ($project['client_id'] != $clientId) {
         return new RedirectResponse('/general-settings/bad-link-access-denied');
     }
     $session->set('selected_project_id', $projectId);
     $menuSelectedCategory = 'project';
     $hasGlobalAdministrationPermission = $this->getRepository(UbirimiUser::class)->hasGlobalPermission($clientId, $loggedInUserId, GlobalPermission::GLOBAL_PERMISSION_YONGO_ADMINISTRATORS);
     $hasGlobalSystemAdministrationPermission = $this->getRepository(UbirimiUser::class)->hasGlobalPermission($clientId, $loggedInUserId, GlobalPermission::GLOBAL_PERMISSION_YONGO_SYSTEM_ADMINISTRATORS);
     $hasAdministerProjectsPermission = $this->getRepository(UbirimiClient::class)->getProjectsByPermission($clientId, $loggedInUserId, Permission::PERM_ADMINISTER_PROJECTS);
     $hasAdministerProject = $hasGlobalSystemAdministrationPermission || $hasGlobalAdministrationPermission || $hasAdministerProjectsPermission;
     $previousMonthName = date("F", mktime(0, 0, 0, $month - 1));
     $currentMonthName = date("F", mktime(0, 0, 0, $month));
     $nextMonthName = date("F", mktime(0, 0, 0, $month + 1));
     $sectionPageTitle = $clientSettings['title_name'] . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / ' . $project['name'] . ' / Calendar (due date)';
     return $this->render(__DIR__ . '/../../Resources/views/project/ViewCalendar.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:30,代码来源:ViewCalendarController.php

示例9: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
         $clientId = $session->get('client/id');
         $issuesPerPage = $session->get('user/issues_per_page');
         $clientSettings = $session->get('client/settings');
     } else {
         $clientId = $this->getRepository(UbirimiClient::class)->getClientIdAnonymous();
         $issuesPerPage = 25;
         $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
     }
     $sectionPageTitle = $clientSettings['title_name'] . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / 2 Dimensional Filter Statistics';
     $client = $this->getRepository(UbirimiClient::class)->getById($clientId);
     $allProjects = $this->getRepository(UbirimiClient::class)->getProjects($clientId);
     $menuSelectedCategory = 'home';
     $section = '2-dimensional-filter-statistics';
     $projects = $this->getRepository(UbirimiClient::class)->getProjectsByPermission($clientId, $session->get('user/id'), Permission::PERM_BROWSE_PROJECTS, 'array');
     $projectIdsArray = array();
     $projectIdsNames = array();
     for ($i = 0; $i < count($projects); $i++) {
         $projectIdsArray[] = $projects[$i]['id'];
         $projectIdsNames[] = array($projects[$i]['id'], $projects[$i]['name']);
     }
     $hasGlobalAdministrationPermission = $this->getRepository(UbirimiUser::class)->hasGlobalPermission($clientId, $session->get('user/id'), GlobalPermission::GLOBAL_PERMISSION_YONGO_ADMINISTRATORS);
     $hasGlobalSystemAdministrationPermission = $this->getRepository(UbirimiUser::class)->hasGlobalPermission($clientId, $session->get('user/id'), GlobalPermission::GLOBAL_PERMISSION_YONGO_SYSTEM_ADMINISTRATORS);
     $twoDimensionalData = null;
     if (count($projectIdsArray)) {
         $twoDimensionalData = $this->getRepository(Issue::class)->get2DimensionalFilter(-1, 'array');
     }
     $issueStatuses = $this->getRepository(IssueSettings::class)->getAllIssueSettings('status', $clientId, 'array');
     $usersAsAssignee = $this->getRepository(UbirimiUser::class)->getByClientId($clientId);
     return $this->render(__DIR__ . '/../Resources/views/TwoDimensionalFilterStatistics.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:33,代码来源:TwoDimensionalFilterStatisticsController.php

示例10: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $settings = $this->getRepository(UbirimiUser::class)->getYongoSettings($session->get('user/id'));
     $countries = Util::getCountries();
     return $this->render(__DIR__ . '/../../Resources/views/user/UpdatePreferencesConfirm.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:7,代码来源:UpdatePreferencesConfirmController.php

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

示例12: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
         $loggedInUserId = $session->get('user/id');
         $clientId = $session->get('client/id');
         $clientSettings = $session->get('client/settings');
     } else {
         $clientId = $this->getRepository(UbirimiClient::class)->getClientIdAnonymous();
         $loggedInUserId = null;
         $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
     }
     $versionId = $request->get('id');
     $version = $this->getRepository(YongoProject::class)->getVersionById($versionId);
     $projectId = $version['project_id'];
     $project = $this->getRepository(YongoProject::class)->getById($projectId);
     if ($project['client_id'] != $clientId) {
         return new RedirectResponse('/general-settings/bad-link-access-denied');
     }
     $menuSelectedCategory = 'project';
     $sectionPageTitle = $clientSettings['title_name'] . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Version: ' . $version['name'] . ' / Summary';
     $issuesResult = $this->getRepository(Issue::class)->getByParameters(array('project' => $projectId, 'resolution' => array(-2), 'page' => 1, 'version' => array($versionId), 'issues_per_page' => 10), $loggedInUserId);
     $issues = $issuesResult[0];
     $issuesResultUpdatedRecently = $this->getRepository(Issue::class)->getByParameters(array('project' => $projectId, 'resolution' => array(-2), 'page' => 1, 'issues_per_page' => 10, 'sort' => 'updated', 'version' => array($versionId), 'sort_order' => 'desc'), $loggedInUserId);
     $issuesUpdatedRecently = $issuesResultUpdatedRecently[0];
     return $this->render(__DIR__ . '/../../Resources/views/project/ViewVersionSummary.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:26,代码来源:ViewVersionSummaryController.php

示例13: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $clientYongoSettings = $this->getRepository(UbirimiClient::class)->getYongoSettings($session->get('client/id'));
     $menuSelectedCategory = 'system';
     return $this->render(__DIR__ . '/../../../Resources/views/administration/general_configuration/View.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:7,代码来源:ViewController.php

示例14: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $emptyName = false;
     $allIssueTypes = $this->getRepository(IssueType::class)->getAll($session->get('client/id'));
     if ($request->request->has('new_issue_type_screen_scheme')) {
         $name = Util::cleanRegularInputField($request->request->get('name'));
         $description = Util::cleanRegularInputField($request->request->get('description'));
         if (empty($name)) {
             $emptyName = true;
         }
         if (!$emptyName) {
             $issueTypeScreenScheme = new IssueTypeScreenScheme($session->get('client/id'), $name, $description);
             $currentDate = Util::getServerCurrentDateTime();
             $issueTypeScreenSchemeId = $issueTypeScreenScheme->save($currentDate);
             $issueTypes = $this->getRepository(IssueType::class)->getAll($session->get('client/id'));
             while ($issueType = $issueTypes->fetch_array(MYSQLI_ASSOC)) {
                 $this->getRepository(IssueTypeScreenScheme::class)->addData($issueTypeScreenSchemeId, $issueType['id'], $currentDate);
             }
             $this->getLogger()->addInfo('ADD Yongo Issue Type Screen Scheme ' . $name, $this->getLoggerContext());
             return new RedirectResponse('/yongo/administration/screens/issue-types');
         }
     }
     $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Create Issue Type Screen Scheme';
     return $this->render(__DIR__ . '/../../../../Resources/views/administration/screen/issue_type_scheme/Add.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:26,代码来源:AddController.php

示例15: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
         $clientSettings = $session->get('client/settings');
         $session->set('selected_product_id', SystemProduct::SYS_PRODUCT_DOCUMENTADOR);
         $clientId = $session->get('client/id');
     } else {
         $httpHOST = Util::getHttpHost();
         $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
         $clientSettings = $this->getRepository(UbirimiClient::class)->getById($clientId);
         $loggedInUserId = null;
         $settingsDocumentador = $this->getRepository(UbirimiClient::class)->getDocumentadorSettings($clientId);
         $documentatorUseAnonymous = $settingsDocumentador['anonymous_use_flag'];
         $documentatorAnonymousViewUserProfiles = $settingsDocumentador['anonymous_view_user_profile_flag'];
         if (!($documentatorUseAnonymous && $documentatorAnonymousViewUserProfiles)) {
             Util::signOutAndRedirect();
             die;
         }
     }
     $userId = $request->get('id');
     $user = $this->getRepository(UbirimiUser::class)->getById($userId);
     if ($user['client_id'] != $clientId) {
         return new RedirectResponse('/general-settings/bad-link-access-denied');
     }
     $menuSelectedCategory = 'documentator';
     $activities = $this->getRepository(UbirimiUser::class)->getDocumentadorActivityStream($userId);
     $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_DOCUMENTADOR_NAME . ' / ' . $user['first_name'] . ' ' . $user['last_name'] . ' / Activity';
     return $this->render(__DIR__ . '/../../Resources/views/user/Activity.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:29,代码来源:ActivityController.php


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