Example #1
0
 public function indexAction(Request $request, SessionInterface $session)
 {
     $entityId = $request->get('id');
     if (Util::checkUserIsLoggedIn()) {
         $session->set('selected_product_id', SystemProduct::SYS_PRODUCT_DOCUMENTADOR);
         $loggedInUserId = $session->get('user/id');
         $page = $this->getRepository(Entity::class)->getById($entityId, $loggedInUserId);
         if ($page) {
             $spaceId = $page['space_id'];
         }
         $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_DOCUMENTADOR_NAME . ' / ' . $page['name'] . ' / Attachments';
     } else {
         $httpHOST = Util::getHttpHost();
         $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
         $loggedInUserId = null;
         $settingsDocumentador = $this->getRepository(UbirimiClient::class)->getDocumentadorSettings($clientId);
         $documentatorUseAnonymous = $settingsDocumentador['anonymous_use_flag'];
         $page = $this->getRepository(Entity::class)->getById($entityId, $loggedInUserId);
         if ($page) {
             $spaceId = $page['space_id'];
             $spaceHasAnonymousAccess = $this->getRepository(Space::class)->hasAnonymousAccess($spaceId);
             if (!($documentatorUseAnonymous && $spaceHasAnonymousAccess)) {
                 Util::signOutAndRedirect();
                 die;
             }
         }
         $sectionPageTitle = SystemProduct::SYS_PRODUCT_DOCUMENTADOR_NAME . ' / ' . $page['name'] . ' / Attachments';
     }
     $menuSelectedCategory = 'documentator';
     if ($page) {
         $attachments = $this->getRepository(EntityAttachment::class)->getByEntityId($entityId);
     }
     return $this->render(__DIR__ . '/../../../Resources/views/page/attachment/View.php', get_defined_vars());
 }
 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());
 }
 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 {
         $loggedInUserId = null;
         $clientId = $this->getRepository(UbirimiClient::class)->getClientIdAnonymous();
         $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
     }
     $projectId = $request->get('id');
     $project = $this->getRepository(YongoProject::class)->getById($projectId);
     if ($project['client_id'] != $clientId) {
         return new RedirectResponse('/general-settings/bad-link-access-denied');
     }
     if ($request->request->has('show_report')) {
         $statisticType = Util::cleanRegularInputField($request->request->get('statistic_type'));
         $chartType = Util::cleanRegularInputField($request->request->get('chart_type'));
         return new RedirectResponse('/yongo/project/reports/' . $projectId . '/chart-report/' . $statisticType . '/' . $chartType);
     }
     $issueQueryParameters = array('project' => array($projectId), 'resolution' => array(-2));
     $issues = $this->getRepository(Issue::class)->getByParameters($issueQueryParameters, $loggedInUserId, null, $loggedInUserId);
     $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;
     $sectionPageTitle = $clientSettings['title_name'] . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / ' . $project['name'] . ' / Reports / Chart';
     $menuSelectedCategory = 'project';
     return $this->render(__DIR__ . '/../../../Resources/views/project/report/ViewChart.php', get_defined_vars());
 }
Example #4
0
 public function indexAction(Request $request, SessionInterface $session)
 {
     $Id = $request->get('id');
     $loggedInUserId = $session->get('user/id');
     $clientId = $session->get('client/id');
     if (Util::checkUserIsLoggedIn()) {
         $issue = $this->getRepository(Issue::class)->getById($Id, $loggedInUserId);
         $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / ' . $issue['project_code'] . '-' . $issue['nr'];
         $clientSettings = $session->get('client/settings');
     } else {
         $httpHOST = Util::getHttpHost();
         $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
         $loggedInUserId = null;
         $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
         $issue = $this->getRepository(Issue::class)->getById($Id, $loggedInUserId);
         $sectionPageTitle = $clientSettings['title_name'] . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / ' . $issue['project_code'] . '-' . $issue['nr'];
     }
     $issueProject = $this->getRepository(YongoProject::class)->getById($issue['issue_project_id']);
     if ($issueProject['client_id'] != $clientId) {
         return new RedirectResponse('/general-settings/bad-link-access-denied');
     }
     $issueId = $issue['id'];
     $components = $this->getRepository(IssueComponent::class)->getByIssueIdAndProjectId($issueId, $issue['issue_project_id']);
     $versionsAffected = $this->getRepository(IssueVersion::class)->getByIssueIdAndProjectId($issueId, $issue['issue_project_id'], Issue::ISSUE_AFFECTED_VERSION_FLAG);
     $versionsTargeted = $this->getRepository(IssueVersion::class)->getByIssueIdAndProjectId($issueId, $issue['issue_project_id'], Issue::ISSUE_FIX_VERSION_FLAG);
     $attachments = $this->getRepository(IssueAttachment::class)->getByIssueId($issueId);
     $countAttachments = 0;
     if ($attachments) {
         $countAttachments = $attachments->num_rows;
     }
     return $this->render(__DIR__ . '/../../Resources/views/issue/Print.php', get_defined_vars());
 }
 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 {
         $loggedInUserId = null;
         $clientId = $this->getRepository(UbirimiClient::class)->getClientIdAnonymous();
         $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
     }
     $projectId = $request->get('id');
     $project = $this->getRepository(YongoProject::class)->getById($projectId);
     if ($project['client_id'] != $clientId) {
         return new RedirectResponse('/general-settings/bad-link-access-denied');
     }
     $currentDate = Util::getServerCurrentDateTime();
     $dateFrom = date_create(Util::getServerCurrentDateTime());
     $dateTo = date_format(date_create(Util::getServerCurrentDateTime()), 'Y-m-d');
     date_sub($dateFrom, date_interval_create_from_date_string('1 months'));
     $dateFrom = date_format($dateFrom, 'Y-m-d');
     $issueQueryParameters = array('project' => array($projectId), 'resolution' => array(-2));
     $issues = $this->getRepository(Issue::class)->getByParameters($issueQueryParameters, $loggedInUserId, null, $loggedInUserId);
     $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;
     $sectionPageTitle = $clientSettings['title_name'] . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / ' . $project['name'] . ' / Reports';
     $menuSelectedCategory = 'project';
     return $this->render(__DIR__ . '/../../Resources/views/project/ViewReportsSummary.php', get_defined_vars());
 }
Example #6
0
 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());
 }
 public function indexAction(Request $request, SessionInterface $session)
 {
     $loggedInUserId = null;
     if (Util::checkUserIsLoggedIn()) {
         $loggedInUserId = $session->get('user/id');
         $session->set('selected_product_id', SystemProduct::SYS_PRODUCT_DOCUMENTADOR);
         $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_DOCUMENTADOR_NAME . ' / Dashboard';
     } else {
         $httpHOST = Util::getHttpHost();
         $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
         $sectionPageTitle = SystemProduct::SYS_PRODUCT_DOCUMENTADOR_NAME . ' / Dashboard';
     }
     $type = $request->get('type');
     $menuSelectedCategory = 'documentator';
     if ($type == 'spaces') {
         if (Util::checkUserIsLoggedIn()) {
             $spaces = $this->getRepository(Space::class)->getByClientId($session->get('client/id'), 1);
         } else {
             $spaces = $this->getRepository(Space::class)->getByClientIdAndAnonymous($session->get('client/id'));
         }
     } else {
         if ($type == 'pages') {
             $pages = $this->getRepository(Entity::class)->getFavouritePagesByClientIdAndUserId($session->get('client/id'), $loggedInUserId);
         }
     }
     return $this->render(__DIR__ . '/../Resources/views/Dashboard.php', get_defined_vars());
 }
 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
         $clientId = $session->get('client/id');
         $loggedInUserId = $session->get('user/id');
     } else {
         $clientId = $this->getRepository(UbirimiClient::class)->getClientIdAnonymous();
         $loggedInUserId = null;
     }
     $projectId = $request->request->get('id');
     $selectedProjectId = $projectId;
     if ($projectId == -1) {
         $projects = array();
         $projectsForBrowsing = $this->getRepository(UbirimiClient::class)->getProjectsByPermission($clientId, $loggedInUserId, Permission::PERM_BROWSE_PROJECTS, 'array');
         for ($i = 0; $i < count($projectsForBrowsing); $i++) {
             $projects[] = $projectsForBrowsing[$i]['id'];
         }
     } else {
         $projects = array((int) $projectId);
     }
     $issueQueryParameters = array('issues_per_page' => 20, 'resolution' => array(-2), 'sort' => 'code', 'sort_order' => 'desc', 'project' => $projects);
     if ($loggedInUserId) {
         $issueQueryParameters['not_assignee'] = $loggedInUserId;
     }
     $issuesUnresolvedOthers = $this->getRepository(Issue::class)->getByParameters($issueQueryParameters, $loggedInUserId, null, $loggedInUserId);
     $renderParameters = array('issues' => $issuesUnresolvedOthers, 'render_checkbox' => false, 'show_header' => true);
     $renderColumns = array('code', 'summary', 'priority', 'assignee');
     $projects = $this->getRepository(UbirimiClient::class)->getProjectsByPermission($clientId, $loggedInUserId, Permission::PERM_BROWSE_PROJECTS, 'array');
     $projectIdsNames = array();
     for ($i = 0; $i < count($projects); $i++) {
         $projectIdsNames[] = array($projects[$i]['id'], $projects[$i]['name']);
     }
     $clientSettings = $session->get('client/settings');
     return $this->render(__DIR__ . '/../../Resources/views/charts/ViewUnresolvedOthers.php', get_defined_vars());
 }
 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());
 }
 public function indexAction(Request $request, SessionInterface $session)
 {
     $projectId = $request->get('id');
     if (Util::checkUserIsLoggedIn()) {
         $loggedInUserId = $session->get('user/id');
         $clientId = $session->get('client/id');
         $project = $this->getRepository(YongoProject::class)->getById($projectId);
         $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / ' . $project['name'];
     } else {
         $httpHOST = Util::getHttpHost();
         $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
         $loggedInUserId = null;
         $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
         $project = $this->getRepository(YongoProject::class)->getById($projectId);
         $sectionPageTitle = $clientSettings['title_name'] . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / ' . $project['name'];
     }
     $hasBrowsingPermission = $this->getRepository(YongoProject::class)->userHasPermission(array($projectId), Permission::PERM_BROWSE_PROJECTS, $loggedInUserId);
     if ($project['client_id'] != $clientId || !$hasBrowsingPermission) {
         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;
     $menuProjectCategory = 'summary';
     return $this->render(__DIR__ . '/../../Resources/views/project/ViewSummary.php', get_defined_vars());
 }
 public function indexAction(Request $request, SessionInterface $session)
 {
     $clientId = $session->get('client/id');
     $helpdeskFlag = 0;
     $loggedInUser = Util::checkUserIsLoggedIn();
     if ($loggedInUser) {
         if ($session->get('selected_product_id') == SystemProduct::SYS_PRODUCT_HELP_DESK) {
             $helpdeskFlag = 1;
         }
     }
     $projectId = $request->request->get('id');
     $date = date("Y-m-d", strtotime("-1 month"));
     $date = date('Y-m-d', strtotime("+1 day", strtotime($date)));
     $dateWithoutYear = date("d M", strtotime("-1 month"));
     $currentDate = date("Y-m-d");
     $result = array();
     while (strtotime($date) <= strtotime($currentDate)) {
         $countAllIssues = $this->getRepository(YongoProject::class)->getTotalIssuesPreviousDate($clientId, $projectId, $date, $helpdeskFlag);
         $resolvedCount = $this->getRepository(YongoProject::class)->getTotalIssuesResolvedOnDate($clientId, $projectId, $date, $helpdeskFlag);
         $result[] = array($dateWithoutYear, $countAllIssues, $resolvedCount);
         $dateWithoutYear = date('d M', strtotime("+1 day", strtotime($date)));
         $date = date('Y-m-d', strtotime("+1 day", strtotime($date)));
     }
     return new JsonResponse($result);
 }
 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());
 }
Example #13
0
 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
         $session->set('selected_product_id', SystemProduct::SYS_PRODUCT_DOCUMENTADOR);
         $clientSettings = $session->get('client/settings');
     } else {
         $httpHOST = Util::getHttpHost();
         $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
         $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
         $loggedInUserId = null;
     }
     $spaceId = $request->get('space_id');
     $space = $this->getRepository(Space::class)->getById($spaceId);
     $menuSelectedCategory = 'documentator';
     $space = $this->getRepository(Space::class)->getById($spaceId);
     if ($space['client_id'] != $session->get('client/id')) {
         return new RedirectResponse('/general-settings/bad-link-access-denied');
     }
     $spaceHasAnonymousAccess = $this->getRepository(Space::class)->hasAnonymousAccess($spaceId);
     $pages = $this->getRepository(Entity::class)->getAllBySpaceId($spaceId, 0);
     $homePage = $this->getRepository(Entity::class)->getById($space['home_entity_id']);
     if ($homePage['in_trash_flag']) {
         $homePage = null;
     }
     $treeStructure = $this->getRepository(Space::class)->generateTreeStructure($pages, $space['home_entity_id']);
     $pages->data_seek(0);
     return $this->render(__DIR__ . '/../Resources/views/ListPages.php', get_defined_vars());
 }
Example #14
0
 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
         $selectedProjectId = $session->get('selected_project_id');
     } else {
         $httpHOST = Util::getHttpHost();
         $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
         $loggedInUserId = null;
         $selectedProjectId = null;
     }
     if ($session->get('selected_product_id') == SystemProduct::SYS_PRODUCT_YONGO) {
         $urlPrefix = '/yongo/project/';
         $projectsMenu = $this->getRepository(UbirimiClient::class)->getProjectsByPermission($session->get('client/id'), $session->get('user/id'), Permission::PERM_BROWSE_PROJECTS, 'array');
     } else {
         $urlPrefix = '/helpdesk/customer-portal/project/';
         $projectsMenu = $this->getRepository(UbirimiClient::class)->getProjects($session->get('client/id'), 'array', null, 1);
     }
     $selectedProjectMenu = null;
     if ($selectedProjectId) {
         $selectedProjectMenu = $this->getRepository(YongoProject::class)->getById($selectedProjectId);
     }
     $hasGlobalAdministrationPermission = $this->getRepository(UbirimiUser::class)->hasGlobalPermission($session->get('client/id'), $session->get('user/id'), GlobalPermission::GLOBAL_PERMISSION_YONGO_ADMINISTRATORS);
     $hasGlobalSystemAdministrationPermission = $this->getRepository(UbirimiUser::class)->hasGlobalPermission($session->get('client/id'), $session->get('user/id'), GlobalPermission::GLOBAL_PERMISSION_YONGO_SYSTEM_ADMINISTRATORS);
     return $this->render(__DIR__ . '/../../Resources/views/menu/Projects.php', get_defined_vars());
 }
 public function indexAction(Request $request, SessionInterface $session)
 {
     $clientId = $session->get('client/id');
     $loggedInUserId = $session->get('user/id');
     $issuesPerPage = $session->get('user/issues_per_page');
     $searchParameters = array();
     $parseURLData = null;
     $getFilter = $request->get('filter');
     $getPage = $request->get('page');
     $getSortColumn = $request->get('sort') ? $request->get('sort') : 'created';
     $getSortOrder = $request->get('order') ? $request->get('order') : 'desc';
     $getSearchQuery = $request->get('search_query');
     $getSummaryFlag = $request->get('summary_flag');
     $getDescriptionFlag = $request->get('description_flag');
     $getCommentsFlag = $request->get('comments_flag');
     $getProjectIds = $request->get('project') ? explode('|', $request->get('project')) : null;
     if ($getProjectIds) {
         $projectsData = $this->getRepository(YongoProject::class)->getByIds($getProjectIds);
         if (!$projectsData) {
             return new RedirectResponse('/general-settings/bad-link-access-denied');
         }
         while ($projectsData && ($data = $projectsData->fetch_array(MYSQLI_ASSOC))) {
             if (Util::checkUserIsLoggedIn()) {
                 if ($data['client_id'] != $clientId) {
                     return new RedirectResponse('/general-settings/bad-link-access-denied');
                 }
             } else {
                 $hasBrowsingPermission = $this->getRepository(YongoProject::class)->userHasPermission(array($data['id']), Permission::PERM_BROWSE_PROJECTS);
                 if (!$hasBrowsingPermission) {
                     return new RedirectResponse('/general-settings/bad-link-access-denied');
                 }
             }
         }
     }
     $getAssigneeIds = $request->get('assignee') ? explode('|', $request->get('assignee')) : null;
     $getReportedIds = $request->get('reporter') ? explode('|', $request->get('reporter')) : null;
     $getIssueTypeIds = $request->get('type') ? explode('|', $request->get('type')) : null;
     $getIssueStatusIds = $request->get('status') ? explode('|', $request->get('status')) : null;
     $getIssuePriorityIds = $request->get('priority') ? explode('|', $request->get('priority')) : null;
     $getProjectComponentIds = $request->get('component') ? explode('|', $request->get('component')) : null;
     $getProjectVersionIds = $request->get('version') ? explode('|', $request->get('version')) : null;
     $getIssueResolutionIds = $request->get('resolution') ? explode('|', $request->get('resolution')) : 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);
     $parseURLData = parse_url($_SERVER['REQUEST_URI']);
     if (!$parseURLData['query']) {
         return new RedirectResponse('/general-settings/bad-link-access-denied');
     }
     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');
     $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Print List';
     $menuSelectedCategory = null;
     return $this->render(__DIR__ . '/../../Resources/views/issue/search/SearchListPrintable.php', get_defined_vars());
 }
 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
         Util::checkUserIsLoggedInAndRedirect();
         $spaces = $this->getRepository(Space::class)->getByClientId($session->get('client/id'));
     } else {
         $httpHOST = Util::getHttpHost();
         $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
         $spaces = $this->getRepository(Space::class)->getByClientIdAndAnonymous($clientId);
     }
     return $this->render(__DIR__ . '/../../Resources/views/menu/Documentador.php', get_defined_vars());
 }
Example #17
0
 public function indexAction(Request $request, SessionInterface $session)
 {
     $entityId = $request->get('id');
     if (Util::checkUserIsLoggedIn()) {
         $session->set('selected_product_id', SystemProduct::SYS_PRODUCT_DOCUMENTADOR);
         $page = $this->getRepository(Entity::class)->getById($entityId, $session->get('user/id'));
         if ($page) {
             $spaceId = $page['space_id'];
         }
         $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_DOCUMENTADOR_NAME . ' / ' . $page['name'];
     } else {
         $httpHOST = Util::getHttpHost();
         $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
         $loggedInUserId = null;
         $settingsDocumentador = $this->getRepository(UbirimiClient::class)->getDocumentadorSettings($clientId);
         $documentatorUseAnonymous = $settingsDocumentador['anonymous_use_flag'];
         $page = $this->getRepository(Entity::class)->getById($entityId, $loggedInUserId);
         if ($page) {
             $spaceId = $page['space_id'];
             $spaceHasAnonymousAccess = $this->getRepository(Space::class)->hasAnonymousAccess($spaceId);
             if (!($documentatorUseAnonymous && $spaceHasAnonymousAccess)) {
                 Util::signOutAndRedirect();
                 die;
             }
         }
         $sectionPageTitle = SystemProduct::SYS_PRODUCT_DOCUMENTADOR_NAME . ' / ' . $page['name'];
     }
     $menuSelectedCategory = 'documentator';
     if ($page) {
         $parentEntityId = $page['parent_entity_id'];
         $parentPage = null;
         if ($parentEntityId) {
             $parentPage = $this->getRepository(Entity::class)->getById($parentEntityId);
         }
         $revisionId = $request->attributes->has('rev_id') ? str_replace('/', '', $request->get('rev_id')) : null;
         if ($revisionId) {
             $revision = $this->getRepository(Entity::class)->getRevisionsByPageIdAndRevisionId($entityId, $revisionId);
         }
         $space = $this->getRepository(Space::class)->getById($spaceId);
         if ($space['client_id'] != $session->get('client/id')) {
             return new RedirectResponse('/general-settings/bad-link-access-denied');
         }
         $pagesInSpace = $this->getRepository(Entity::class)->getAllBySpaceId($spaceId);
         $treeStructure = $this->getRepository(Space::class)->generateTreeStructure($pagesInSpace, $entityId);
         $comments = $this->getRepository(EntityComment::class)->getComments($entityId, 'array');
         $lastRevision = $this->getRepository(Entity::class)->getLastRevisionByPageId($entityId);
         $childPages = $this->getRepository(Entity::class)->getChildren($entityId);
         $pageFiles = $this->getRepository(Entity::class)->getFilesByEntityId($entityId);
         $attachments = $this->getRepository(EntityAttachment::class)->getByEntityId($entityId);
     }
     return $this->render(__DIR__ . '/../../Resources/views/page/View.php', get_defined_vars());
 }
Example #18
0
 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
         $selectedProjectId = $session->get('selected_project_id');
     } else {
         $httpHOST = Util::getHttpHost();
         $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
         $loggedInUserId = null;
         $selectedProjectId = null;
     }
     $clientAdministratorFlag = $session->get('user/client_administrator_flag');
     return $this->render(__DIR__ . '/../../Resources/views/menu/HelpDesk.php', get_defined_vars());
 }
Example #19
0
 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
         $clientSettings = $session->get('client/settings');
     } else {
         $clientId = $this->getRepository(UbirimiClient::class)->getClientIdAnonymous();
         $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
         $loggedInUserId = null;
     }
     $session->set('selected_product_id', -2);
     $menuSelectedCategory = 'ubirimi_about';
     $sectionPageTitle = $clientSettings['title_name'] . ' / About Ubirimi';
     return $this->render(__DIR__ . '/../Resources/views/About.php', get_defined_vars());
 }
 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
         $clientSettings = $session->get('client/settings');
         $filters = $this->getRepository(IssueFilter::class)->getAllByUser($session->get('user/id'));
     } else {
         $clientId = $this->getRepository(UbirimiClient::class)->getClientIdAnonymous();
         $loggedInUserId = null;
         $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
         $filters = $this->getRepository(IssueFilter::class)->getAllByClientId($clientId);
     }
     $loggedInUserId = $session->get('user/id');
     $menuSelectedCategory = 'filters';
     $sectionPageTitle = $clientSettings['title_name'] . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Filters';
     return $this->render(__DIR__ . '/../Resources/views/filter/List.php', get_defined_vars());
 }
Example #21
0
 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
     } else {
         $httpHOST = Util::getHttpHost();
         $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
         $loggedInUserId = null;
     }
     $projectsMenu = $this->getRepository(UbirimiClient::class)->getProjectsByPermission($session->get('client/id'), $session->get('user/id'), Permission::PERM_BROWSE_PROJECTS, 'array');
     $projectsForBrowsing = array();
     for ($i = 0; $i < count($projectsMenu); $i++) {
         $projectsForBrowsing[$i] = $projectsMenu[$i]['id'];
     }
     $customFilters = $this->getRepository(IssueFilter::class)->getAllByUser($session->get('user/id'));
     return $this->render(__DIR__ . '/../../Resources/views/menu/Filters.php', get_defined_vars());
 }
Example #22
0
 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
     } else {
         $httpHOST = Util::getHttpHost();
         $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
         $loggedInUserId = null;
     }
     $issueId = $request->request->get('issue_id');
     $projectId = $request->request->get('project_id');
     $workLogs = $this->getRepository(WorkLog::class)->getByIssueId($issueId);
     $hasEditOwnWorklogsPermission = $this->getRepository(YongoProject::class)->userHasPermission($projectId, Permission::PERM_EDIT_OWN_WORKLOGS, $session->get('user/id'));
     $hasEditAllWorklogsPermission = $this->getRepository(YongoProject::class)->userHasPermission($projectId, Permission::PERM_EDIT_ALL_WORKLOGS, $session->get('user/id'));
     $hasDeleteOwnWorklogsPermission = $this->getRepository(YongoProject::class)->userHasPermission($projectId, Permission::PERM_DELETE_OWN_WORKLOGS, $session->get('user/id'));
     $hasDeleteAllWorklogsPermission = $this->getRepository(YongoProject::class)->userHasPermission($projectId, Permission::PERM_DELETE_ALL_WORKLOGS, $session->get('user/id'));
     return $this->render(__DIR__ . '/../../../Resources/views/issue/log_work/View.php', get_defined_vars());
 }
Example #23
0
 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);
     }
     $projects = $this->getRepository(UbirimiClient::class)->getProjectsByPermission($clientId, $loggedInUserId, Permission::PERM_BROWSE_PROJECTS, 'array');
     $menuSelectedCategory = 'project';
     $sectionPageTitle = $clientSettings['title_name'] . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Projects';
     $projectCategories = $this->getRepository(ProjectCategory::class)->getAll($clientId);
     $includeCheckbox = false;
     return $this->render(__DIR__ . '/../../Resources/views/project/List.php', get_defined_vars());
 }
 public function indexAction(Request $request, SessionInterface $session)
 {
     $projectId = $request->request->get('id');
     $loggedInUserId = $session->get('user/id');
     $clientId = $session->get('client/id');
     $client = $this->getRepository(UbirimiClient::class)->getById($clientId);
     $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
     if (Util::checkUserIsLoggedIn()) {
         $hasBrowsingPermission = $this->getRepository(YongoProject::class)->userHasPermission(array($projectId), Permission::PERM_BROWSE_PROJECTS, $loggedInUserId);
     } else {
         $loggedInUserId = null;
         $httpHOST = Util::getHttpHost();
         $hasBrowsingPermission = $this->getRepository(YongoProject::class)->userHasPermission(array($projectId), Permission::PERM_BROWSE_PROJECTS);
     }
     if ($hasBrowsingPermission) {
         $helpDeskFlag = 0;
         if ($session->get('selected_product_id') == SystemProduct::SYS_PRODUCT_HELP_DESK) {
             $helpDeskFlag = 1;
         }
         $endDate = Util::getServerCurrentDateTime();
         $startDate = date_sub(new \DateTime($endDate, new \DateTimeZone($clientSettings['timezone'])), date_interval_create_from_date_string('2 days'));
         $historyList = null;
         do {
             $historyList = Util::getProjectHistory(array($projectId), $helpDeskFlag, null, date_format($startDate, 'Y-m-d'), $endDate);
             if (null == $historyList && date_format($startDate, 'Y-m-d H:i:s') == $client['date_created']) {
                 break;
             }
             $startDate = date_sub($startDate, date_interval_create_from_date_string('2 days'));
             $startDate->setTime(0, 0, 0);
             if (date_format($startDate, 'Y-m-d') < $client['date_created']) {
                 $startDate = new \DateTime($client['date_created'], new \DateTimeZone($clientSettings['timezone']));
                 break;
             }
         } while ($historyList == null);
         $historyData = array();
         $userData = array();
         while ($historyList && ($history = $historyList->fetch_array(MYSQLI_ASSOC))) {
             $historyData[substr($history['date_created'], 0, 10)][$history['user_id']][$history['date_created']][] = $history;
             $userData[$history['user_id']] = array('picture' => $history['avatar_picture'], 'first_name' => $history['first_name'], 'last_name' => $history['last_name']);
         }
     }
     $index = 0;
     return $this->render(__DIR__ . '/../../Resources/views/project/ViewActivityStream.php', get_defined_vars());
 }
Example #25
0
 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
         $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_DOCUMENTADOR_NAME . ' / Search';
     } else {
         $httpHOST = Util::getHttpHost();
         $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
         $loggedInUserId = null;
         $sectionPageTitle = SystemProduct::SYS_PRODUCT_DOCUMENTADOR_NAME . ' / Search';
     }
     if ($request->request->has('search')) {
         $searchQuery = $request->request->get('keyword');
         return new RedirectResponse('/documentador/search?search_query=' . $searchQuery);
     }
     $searchQuery = $request->get('search_query');
     $menuSelectedCategory = 'documentator';
     $pages = $this->getRepository(Space::class)->searchForPages($session->get('client/id'), $searchQuery);
     return $this->render(__DIR__ . '/../Resources/views/Search.php', get_defined_vars());
 }
 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
         $clientId = $session->get('client/id');
         $clientSettings = $session->get('client/settings');
     } else {
         $clientId = $this->getRepository(UbirimiClient::class)->getClientIdAnonymous();
         $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
     }
     $client = $this->getRepository(UbirimiClient::class)->getById($clientId);
     $date = $request->request->get('date');
     $project = $request->request->get('project');
     if ($project == 'all') {
         $projectsMenu = $this->getRepository(UbirimiClient::class)->getProjectsByPermission($session->get('client/id'), $session->get('user/id'), Permission::PERM_BROWSE_PROJECTS, 'array');
         $projectIds = Util::array_column($projectsMenu, 'id');
     } else {
         $projectIds = array($project);
     }
     $historyList = null;
     $endDate = $date;
     $startDate = date_sub(new \DateTime($date, new \DateTimeZone($clientSettings['timezone'])), date_interval_create_from_date_string('2 days'));
     do {
         $historyList = Util::getProjectHistory($projectIds, 0, null, date_format($startDate, 'Y-m-d'), $endDate);
         if (null == $historyList && date_format($startDate, 'Y-m-d H:i:s') == $client['date_created']) {
             break;
         }
         $startDate = date_sub($startDate, date_interval_create_from_date_string('2 days'));
         $startDate->setTime(0, 0, 0);
         if (date_format($startDate, 'Y-m-d') < $client['date_created']) {
             $startDate = new \DateTime($client['date_created'], new \DateTimeZone($clientSettings['timezone']));
             break;
         }
     } while ($historyList == null);
     $historyData = array();
     $userData = array();
     while ($historyList && ($history = $historyList->fetch_array(MYSQLI_ASSOC))) {
         $historyData[substr($history['date_created'], 0, 10)][$history['user_id']][$history['date_created']][] = $history;
         $userData[$history['user_id']] = array('picture' => $history['avatar_picture'], 'first_name' => $history['first_name'], 'last_name' => $history['last_name']);
     }
     $index = 0;
     return $this->render(__DIR__ . '/../Resources/views/project/_activityStream.php', get_defined_vars());
 }
Example #27
0
 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 . ' / Dashboard';
     $userAssignedId = $session->get('user/id');
     $allProjects = $this->getRepository(UbirimiClient::class)->getProjects($clientId);
     $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']);
     }
     $issueQueryParameters = array('issues_per_page' => $issuesPerPage, 'assignee' => $userAssignedId, 'resolution' => array(-2), 'sort' => 'code', 'sort_order' => 'desc');
     if (count($projectIdsArray)) {
         $issueQueryParameters['project'] = $projectIdsArray;
     } else {
         $issueQueryParameters['project'] = array(-1);
     }
     $issues = $this->getRepository(Issue::class)->getByParameters($issueQueryParameters, $session->get('user/id'), null, $session->get('user/id'));
     $issueQueryParameters = array('issues_per_page' => $issuesPerPage, 'resolution' => array(-2), 'sort' => 'code', 'sort_order' => 'desc', 'date_created_after' => date('Y-m-d H:i:s', strtotime("-90 days")));
     if (count($projectIdsArray)) {
         $issueQueryParameters['project'] = $projectIdsArray;
     }
     if ($session->get('user/id')) {
         $issueQueryParameters['not_assignee'] = $userAssignedId;
     }
     $issuesUnresolvedOthers = $this->getRepository(Issue::class)->getByParameters($issueQueryParameters, $session->get('user/id'), null, $session->get('user/id'));
     $menuSelectedCategory = 'home';
     $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);
     $session->set('selected_product_id', SystemProduct::SYS_PRODUCT_YONGO);
     return $this->render(__DIR__ . '/../Resources/views/Index.php', get_defined_vars());
 }
 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
         $clientId = $session->get('client/id');
         $loggedInUserId = $session->get('user/id');
     } else {
         $clientId = $this->getRepository(UbirimiClient::class)->getClientIdAnonymous();
         $loggedInUserId = null;
     }
     $projects = $this->getRepository(UbirimiClient::class)->getProjectsByPermission($clientId, $loggedInUserId, Permission::PERM_BROWSE_PROJECTS, 'array');
     $projectId = $request->request->get('id');
     $projectIdsNames = array();
     for ($i = 0; $i < count($projects); $i++) {
         $projectIdsNames[] = array($projects[$i]['id'], $projects[$i]['name']);
     }
     $usersAsAssignee = $this->getRepository(UbirimiUser::class)->getByClientId($clientId);
     $issueStatuses = $this->getRepository(IssueSettings::class)->getAllIssueSettings('status', $clientId, 'array');
     $twoDimensionalData = $this->getRepository(Issue::class)->get2DimensionalFilter($projectId, 'array');
     return $this->render(__DIR__ . '/../../Resources/views/charts/ViewTwoDimensionalFilter.php', get_defined_vars());
 }
Example #29
0
 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
     } else {
         $httpHOST = Util::getHttpHost();
         $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
         $loggedInUserId = null;
     }
     $projectsMenu = $this->getRepository(UbirimiClient::class)->getProjectsByPermission($session->get('client/id'), $session->get('user/id'), Permission::PERM_BROWSE_PROJECTS, 'array');
     $projectsForBrowsing = array();
     for ($i = 0; $i < count($projectsMenu); $i++) {
         $projectsForBrowsing[$i] = $projectsMenu[$i]['id'];
     }
     $hasCreateIssuePermission = false;
     if (count($projectsForBrowsing)) {
         $hasCreateIssuePermission = $this->getRepository(YongoProject::class)->userHasPermission($projectsForBrowsing, Permission::PERM_CREATE_ISSUE, $session->get('user/id'));
     }
     $recentIssues = $session->get('yongo/recent_issues');
     return $this->render(__DIR__ . '/../../Resources/views/menu/Issues.php', get_defined_vars());
 }
 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 {
         $loggedInUserId = null;
         $clientId = $this->getRepository(UbirimiClient::class)->getClientIdAnonymous();
         $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
     }
     $projectId = $request->get('id');
     $project = $this->getRepository(YongoProject::class)->getById($projectId);
     if ($project['client_id'] != $clientId) {
         return new RedirectResponse('/general-settings/bad-link-access-denied');
     }
     $statisticType = Util::cleanRegularInputField($request->get('statistic_type'));
     $chartType = Util::cleanRegularInputField($request->get('chart_type'));
     $issueQueryParameters = array('project' => array($projectId));
     $issues = $this->getRepository(Issue::class)->getByParameters($issueQueryParameters, $loggedInUserId, null, $loggedInUserId);
     if ($statisticType == 'assignee') {
         $issuesAssignee = array();
         if ($issues) {
             $totalIssues = $issues->num_rows;
             while ($issues && ($issue = $issues->fetch_array(MYSQLI_ASSOC))) {
                 if (!array_key_exists($issue['assignee'], $issuesAssignee)) {
                     $issuesAssignee[$issue['assignee']] = array('assignee_name' => $issue['ua_first_name'] . ' ' . $issue['ua_last_name'], 'issues_count' => 0);
                 }
                 $issuesAssignee[$issue['assignee']]['issues_count']++;
             }
         }
     }
     $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;
     $sectionPageTitle = $clientSettings['title_name'] . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / ' . $project['name'] . ' / Reports / Chart';
     $menuProjectCategory = 'reports';
     $menuSelectedCategory = 'project';
     return $this->render(__DIR__ . '/../../../Resources/views/project/report/ViewChartStatisticType.php', get_defined_vars());
 }