本文整理汇总了PHP中Ubirimi\Util::checkUserIsLoggedInAndRedirect方法的典型用法代码示例。如果您正苦于以下问题:PHP Util::checkUserIsLoggedInAndRedirect方法的具体用法?PHP Util::checkUserIsLoggedInAndRedirect怎么用?PHP Util::checkUserIsLoggedInAndRedirect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ubirimi\Util
的用法示例。
在下文中一共展示了Util::checkUserIsLoggedInAndRedirect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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('');
}
示例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());
}
示例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('');
}
示例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]]');
}
}
}
}
}
示例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());
}
示例6: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$menuSelectedCategory = 'user';
$sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Roles';
return $this->render(__DIR__ . '/../../../Resources/views/administration/role/List.php', get_defined_vars());
}
示例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());
}
示例8: 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());
}
示例9: 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());
}
示例10: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$emptyName = false;
$duplicateName = false;
$name = Util::cleanRegularInputField($request->request->get('name'));
$description = Util::cleanRegularInputField($request->request->get('description'));
if (empty($name)) {
$emptyName = true;
}
$notebookSameName = $this->getRepository(Notebook::class)->getByName($session->get('user/id'), $name);
if ($notebookSameName) {
$duplicateName = true;
}
if (!$emptyName && !$duplicateName) {
$currentDate = Util::getServerCurrentDateTime();
$defaultFlag = 0;
// get the default notebook
$defaultNotebook = $this->getRepository(Notebook::class)->getDefaultByUserId($session->get('user/id'));
if (!$defaultNotebook) {
$defaultFlag = 1;
}
$notebookId = $this->getRepository(Notebook::class)->save($session->get('user/id'), $name, $description, $defaultFlag, $currentDate);
$this->getLogger()->addInfo('ADD QUICK NOTES notebook ' . $name, $this->getLoggerContext());
}
return new Response('');
}
示例11: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$columnId = $request->request->get('id');
$this->getRepository(Board::class)->deleteColumn($columnId);
return new Response('');
}
示例12: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$clientSettings = $session->get('client/settings');
$slaId = $request->get('id');
$dateFrom = $request->get('date_from');
$dateTo = $request->get('date_to');
$issues = $this->getRepository(Sla::class)->getIssues($slaId, $dateFrom, $dateTo);
$dates = array();
$succeeded = array();
$breached = array();
$dateTemporary = new \DateTime($dateFrom, new \DateTimeZone($clientSettings['timezone']));
while (date_format($dateTemporary, 'Y-m-d') <= $dateTo) {
$dates[] = date_format($dateTemporary, 'Y-m-d');
$succeeded[end($dates)] = 0;
$breached[end($dates)] = 0;
date_add($dateTemporary, date_interval_create_from_date_string('1 days'));
}
while ($issues && ($issue = $issues->fetch_array(MYSQLI_ASSOC))) {
if ($issue['sla_value'] >= 0) {
$succeeded[substr($issue['stopped_date'], 0, 10)]++;
} else {
$breached[substr($issue['stopped_date'], 0, 10)]++;
}
}
$data = array('dates' => $dates, 'succeeded' => $succeeded, 'breached' => $breached);
return new JsonResponse($data);
}
示例13: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$emptyName = false;
$workflowExists = false;
$workflowIssueTypeSchemes = $this->getRepository(IssueTypeScheme::class)->getByClientId($session->get('client/id'), 'workflow');
if ($request->request->has('new_workflow')) {
$name = Util::cleanRegularInputField($request->request->get('name'));
$description = Util::cleanRegularInputField($request->request->get('description'));
if (empty($name)) {
$emptyName = true;
}
$duplicateWorkflow = $this->getRepository(Workflow::class)->getByClientIdAndName($session->get('client/id'), mb_strtolower($name));
if ($duplicateWorkflow) {
$workflowExists = true;
}
if (!$emptyName && !$workflowExists) {
$workflowIssueTypeSchemeId = $request->request->get('workflow_issue_type_scheme');
$currentDate = $date = Util::getServerCurrentDateTime();
$workflowId = $this->getRepository(Workflow::class)->createNewMetaData($session->get('client/id'), $workflowIssueTypeSchemeId, $name, $description, $currentDate);
$this->getRepository(Workflow::class)->createInitialData($session->get('client/id'), $workflowId);
$this->getLogger()->addInfo('ADD Yongo Workflow ' . $name, $this->getLoggerContext());
return new RedirectResponse('/yongo/administration/workflows');
}
}
$menuSelectedCategory = 'issue';
$sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Create Workflow';
return $this->render(__DIR__ . '/../../../Resources/views/administration/workflow/Add.php', get_defined_vars());
}
示例14: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$emptyName = false;
$duplicateName = false;
if ($request->request->has('add_project_category')) {
$name = Util::cleanRegularInputField($request->request->get('name'));
$description = Util::cleanRegularInputField($request->request->get('description'));
if (empty($name)) {
$emptyName = true;
} else {
$data = $this->getRepository(ProjectCategory::class)->getByName($name, null, $session->get('client/id'));
if ($data) {
$duplicateName = true;
}
}
if (!$emptyName && !$duplicateName) {
$projectCategory = new ProjectCategory($session->get('client/id'), $name, $description);
$currentDate = Util::getServerCurrentDateTime();
$projectCategory->save($currentDate);
$this->getLogger()->addInfo('ADD Yongo Project Category ' . $name, $this->getLoggerContext());
return new RedirectResponse('/yongo/administration/project/categories');
}
}
$menuSelectedCategory = 'project';
$sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Create Project Category';
return $this->render(__DIR__ . '/../../../../Resources/views/administration/project/category/Add.php', get_defined_vars());
}
示例15: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$issueTypes = FieldType::getAll($session->get('client/id'));
$projects = $this->getRepository(YongoProject::class)->getByClientId($session->get('client/id'));
$fieldTypeCode = $request->get('type');
$emptyName = false;
$duplicateName = false;
if ($request->request->has('finish_custom_field')) {
$name = Util::cleanRegularInputField($request->request->get('name'));
$description = Util::cleanRegularInputField($request->request->get('description'));
$issueType = $request->request->get('issue_type');
$project = $request->request->get('project');
$fieldType = $this->getRepository(FieldType::class)->getByCode($fieldTypeCode);
$fieldTypeId = $fieldType['id'];
if (empty($name)) {
$emptyName = true;
} else {
// check for duplicate name
$duplicateField = $this->getRepository(CustomField::class)->getByNameAndType($session->get('client/id'), $name, $fieldTypeId);
if ($duplicateField) {
$duplicateName = true;
}
}
if (!$emptyName && !$duplicateName) {
$date = Util::getServerCurrentDateTime();
$fieldId = CustomField::create($session->get('client/id'), $fieldTypeCode, $name, $description, $issueType, $project, $date);
$this->getLogger()->addInfo('ADD Yongo Custom Field ' . $name, $this->getLoggerContext());
return new RedirectResponse('/yongo/administration/custom-field/edit-field-screen/' . $fieldId);
}
}
$menuSelectedCategory = 'issue';
$sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Create Custom Field Data';
return $this->render(__DIR__ . '/../../../Resources/views/administration/field/AddData.php', get_defined_vars());
}