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


PHP Tools::isConnectedUser方法代码示例

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


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

示例1: display

 protected function display()
 {
     if (Tools::isConnectedUser()) {
         $session_user = UserCache::getInstance()->getUser($_SESSION['userid']);
         $blogManager = new BlogManager();
         $src_user_id = $session_user->getId();
         $severity = BlogPost::severity_normal;
         $category = 0;
         $summary = 'Welcome to the real world';
         $content = 'Hello world !<br>The quick brown fox jumps over the lazy dog<br>Casse toi pauv\' con !';
         $dest_team_id = 4;
         $dest_user_id = 0;
         $dest_project_id = 0;
         $date_expire = 0;
         $color = 0;
         $blogPost_id = BlogPost::create($src_user_id, $severity, $category, $summary, $content, $dest_user_id, $dest_project_id, $dest_team_id, $date_expire, $color);
         $postList = $blogManager->getPosts($session_user->getId());
         $blogPosts = $this->getBlogPosts($postList);
         $this->smartyHelper->assign('blogPosts', $blogPosts);
         $categories = $blogManager->getCategoryList();
         $this->smartyHelper->assign('categoryList', $categories);
         $severities = $blogManager->getSeverityList();
         $this->smartyHelper->assign('severityList', $severities);
     }
 }
开发者ID:fg-ok,项目名称:codev,代码行数:25,代码来源:blog.php

示例2: display

 protected function display()
 {
     if (Tools::isConnectedUser()) {
         $team = TeamCache::getInstance()->getTeam($this->teamid);
         $action = filter_input(INPUT_GET, 'action');
         // feed the PluginDataProvider
         $pluginDataProvider = PluginDataProvider::getInstance();
         $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_SESSION_USER_ID, $this->session_userid);
         $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_TEAM_ID, $this->teamid);
         $weekDates = Tools::week_dates(date('W'), date('Y'));
         $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_START_TIMESTAMP, $weekDates[1]);
         $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_END_TIMESTAMP, $weekDates[5]);
         $dashboardName = 'Admin' . $this->teamid;
         // save the DataProvider for Ajax calls
         $_SESSION[PluginDataProviderInterface::SESSION_ID . $dashboardName] = serialize($pluginDataProvider);
         // create the Dashboard
         $dashboard = new Dashboard($dashboardName);
         $dashboard->setDomain(IndicatorPluginInterface::DOMAIN_ADMIN);
         $dashboard->setCategories(array(IndicatorPluginInterface::CATEGORY_QUALITY, IndicatorPluginInterface::CATEGORY_ACTIVITY, IndicatorPluginInterface::CATEGORY_ROADMAP, IndicatorPluginInterface::CATEGORY_PLANNING, IndicatorPluginInterface::CATEGORY_RISK, IndicatorPluginInterface::CATEGORY_ADMIN));
         $dashboard->setTeamid($this->teamid);
         $dashboard->setUserid($this->session_userid);
         $data = $dashboard->getSmartyVariables($this->smartyHelper);
         foreach ($data as $smartyKey => $smartyVariable) {
             $this->smartyHelper->assign($smartyKey, $smartyVariable);
         }
     } else {
         $this->smartyHelper->assign('error', T_('Sorry, you need to be identified.'));
     }
 }
开发者ID:dfuzeau,项目名称:codev,代码行数:29,代码来源:admin_dashboard.php

示例3: execute

 public function execute()
 {
     if (Tools::isConnectedUser()) {
         $teamid = Tools::getSecureGETIntValue('teamid');
         $startTimestamp = Tools::getSecureGETStringValue('startT');
         $endTimestamp = Tools::getSecureGETStringValue('endT');
         $projectIds = Tools::getSecureGETIntValue('projects', 0);
         if (0 != $projectIds) {
             $projectIds = explode(':', $projectIds);
             if (self::$logger->isDebugEnabled()) {
                 self::$logger->debug("team <{$teamid}> projects = <{$projectIds}>");
             }
         } else {
             if (self::$logger->isDebugEnabled()) {
                 self::$logger->debug("team <{$teamid}> display all projects");
             }
             $projectIds = array();
         }
         /* INFO: the following 1 line are MANDATORY and fix the following error:
          * “The image <name> cannot be displayed because it contains errors”
          * Can't call ob_end_clean() if zlib.output_compression is ON
          */
         if (!ini_get('zlib.output_compression')) {
             ob_end_clean();
         }
         $graph = $this->getGanttGraph($teamid, $startTimestamp, $endTimestamp, $projectIds);
         // display graph
         $graph->Stroke();
         SqlWrapper::getInstance()->logStats();
     } else {
         Tools::sendForbiddenAccess();
     }
 }
开发者ID:fg-ok,项目名称:codev,代码行数:33,代码来源:gantt_graph.php

示例4: display

 protected function display()
 {
     if (Tools::isConnectedUser()) {
         // Admins only
         $session_user = UserCache::getInstance()->getUser($_SESSION['userid']);
         if ($session_user->isTeamMember(Config::getInstance()->getValue(Config::id_adminTeamId))) {
             if (NULL != Constants::$codevtt_logfile && file_exists(Constants::$codevtt_logfile)) {
                 $nbLinesToDisplay = 1500;
                 $lines = file(Constants::$codevtt_logfile);
                 if (count($lines) > $nbLinesToDisplay) {
                     $offset = count($lines) - $nbLinesToDisplay;
                 } else {
                     $offset = 0;
                 }
                 $logs = array();
                 for ($i = $offset; $i <= $offset + $nbLinesToDisplay, $i < count($lines); $i++) {
                     $logs[$i + 1] = htmlspecialchars($lines[$i], ENT_QUOTES, "UTF-8");
                     #echo "DEBUG $line_num - ".$logs[$line_num]."<br>";
                 }
                 $this->smartyHelper->assign('logs', $logs);
             } else {
                 $this->smartyHelper->assign('error', T_('Sorry, logfile not found:') . ' [' . Constants::$codevtt_logfile . ']');
             }
         } else {
             $this->smartyHelper->assign('error', T_('Sorry, you need to be in the admin-team to access this page.'));
         }
     } else {
         $this->smartyHelper->assign('error', T_('Sorry, you need to be in the admin-team to access this page.'));
     }
 }
开发者ID:fg-ok,项目名称:codev,代码行数:30,代码来源:logs.php

示例5: display

 protected function display()
 {
     if (Tools::isConnectedUser()) {
         $threshold = 0.5;
         // for Deviation filters
         // only teamMembers & observers can access this page
         if (0 == $this->teamid || $this->session_user->isTeamCustomer($this->teamid)) {
             $this->smartyHelper->assign('accessDenied', TRUE);
         } else {
             $withSupport = TRUE;
             $weekDates = Tools::week_dates(date('W'), date('Y'));
             // The first day of the current week
             $startDate = date("Y-m-d", $weekDates[1]);
             $startTimestamp = Tools::date2timestamp($startDate);
             #echo "DEBUG startTimestamp ".date("Y-m-d H:i:s", $startTimestamp)."<br/>";
             // The last day of the current week
             $endDate = date("Y-m-d", $weekDates[5]);
             $endTimestamp = Tools::date2timestamp($endDate);
             $endTimestamp += 24 * 60 * 60 - 1;
             // + 1 day -1 sec.
             #echo "DEBUG endTimestamp   ".date("Y-m-d H:i:s", $endTimestamp)."<br/>";
             #$managedTeamList = $this->session_user->getManagedTeamList();
             #$isManager = array_key_exists($this->teamid, $managedTeamList);
             $isManager = $this->session_user->isTeamManager($this->teamid);
             $isObserver = $this->session_user->isTeamObserver($this->teamid);
             $this->smartyHelper->assign('manager', $isManager || $isObserver);
             $this->smartyHelper->assign('threshold', $threshold);
             $this->smartyHelper->assign('currentDeviationStats', $this->getCurrentDeviationStats($this->teamid, $threshold));
             $this->smartyHelper->assign('issuesInDrift', $this->getIssuesInDrift($this->teamid, $withSupport));
         }
     }
 }
开发者ID:fg-ok,项目名称:codev,代码行数:32,代码来源:forecasting_report.php

示例6: display

 protected function display()
 {
     // Admins only
     if (Tools::isConnectedUser()) {
         $session_user = UserCache::getInstance()->getUser($_SESSION['userid']);
         if ($session_user->isTeamMember(Config::getInstance()->getValue(Config::id_adminTeamId))) {
             $this->smartyHelper->assign('defaultColor', Holidays::$defaultColor);
             if (isset($_POST['hol_color'])) {
                 $formatedDate = Tools::getSecurePOSTStringValue('date');
                 $timestamp = Tools::date2timestamp($formatedDate);
                 $hol_desc = Tools::getSecurePOSTStringValue('hol_desc');
                 $hol_color = Tools::getSecurePOSTStringValue('hol_color');
                 if (!Holidays::save($timestamp, $hol_desc, $hol_color)) {
                     $this->smartyHelper->assign('error', T_("Couldn't add the holiday"));
                 }
             } elseif (isset($_POST['hol_id'])) {
                 $hol_id = Tools::getSecurePOSTIntValue('hol_id');
                 if (!Holidays::delete($hol_id)) {
                     $this->smartyHelper->assign('error', T_("Couldn't remove the holiday"));
                 }
             }
             $this->smartyHelper->assign('holidays', Holidays::getHolidays());
         }
     }
 }
开发者ID:fg-ok,项目名称:codev,代码行数:25,代码来源:edit_holidays.php

示例7: display

 protected function display()
 {
     if (Tools::isConnectedUser()) {
         // TODO SECURITY check array_key_exists($this->teamid, $this->teamList)
         // only teamMembers & observers can access this page
         if (0 == $this->teamid || $this->session_user->isTeamCustomer($this->teamid)) {
             $this->smartyHelper->assign('accessDenied', TRUE);
         } else {
             $year = Tools::getSecurePOSTIntValue('year', date('Y'));
             $weekid = Tools::getSecurePOSTIntValue('weekid', date('W'));
             $this->smartyHelper->assign('weeks', SmartyTools::getWeeks($weekid, $year));
             $this->smartyHelper->assign('years', SmartyTools::getYears($year, 1));
             $isDetailed = isset($_POST['cb_detailed']) ? TRUE : FALSE;
             $this->smartyHelper->assign('isChecked', $isDetailed);
             $weekDates = Tools::week_dates($weekid, $year);
             $startTimestamp = $weekDates[1];
             $endTimestamp = mktime(23, 59, 59, date("m", $weekDates[7]), date("d", $weekDates[7]), date("Y", $weekDates[7]));
             $timeTracking = new TimeTracking($startTimestamp, $endTimestamp, $this->teamid);
             $this->smartyHelper->assign('weekDetails', $this->getWeekDetails($timeTracking, $isDetailed, $weekDates, $this->session_user->getId()));
             // ConsistencyCheck
             $consistencyErrors = $this->getConsistencyErrors($timeTracking);
             if (count($consistencyErrors) > 0) {
                 $this->smartyHelper->assign('ccheckErrList', $consistencyErrors);
                 $this->smartyHelper->assign('ccheckButtonTitle', count($consistencyErrors) . ' ' . T_("Errors"));
                 $this->smartyHelper->assign('ccheckBoxTitle', count($consistencyErrors) . ' ' . T_("days are incomplete or undefined"));
             }
             // IssueNotes
             $timeTracks = $timeTracking->getTimeTracks();
             $issueNotes = array();
             foreach ($timeTracks as $tt) {
                 $bug_id = $tt->getIssueId();
                 if (!array_key_exists($bug_id, $issueNotes)) {
                     $issueNote = IssueNote::getTimesheetNote($bug_id);
                     if (!is_null($issueNote)) {
                         $issue = IssueCache::getInstance()->getIssue($bug_id);
                         $user = UserCache::getInstance()->getUser($issueNote->getReporterId());
                         $issueNoteText = trim(IssueNote::removeAllReadByTags($issueNote->getText()));
                         $isManager = $this->session_user->isTeamManager($this->teamid);
                         // only Managers can markAsRead
                         $isRead = TRUE;
                         if ($isManager) {
                             $isRead = 0 != $issueNote->isReadBy($this->session_userid);
                         }
                         // Delete allowed by owner & managers
                         if ($this->session_userid == $issueNote->getReporterId() || $isManager) {
                             $isDeleteGranted = TRUE;
                         } else {
                             $isDeleteGranted = FALSE;
                         }
                         $issueNoteInfo = array('taskDesc' => SmartyTools::getIssueDescription($bug_id, $issue->getTcId(), htmlspecialchars($issue->getSummary())), 'note' => nl2br(htmlspecialchars($issueNoteText)), 'reporter' => $user->getRealname(), 'date' => date('Y-m-d H:i', $issueNote->getLastModified()), 'readBy' => implode(',<br>', array_keys($issueNote->getReadByList(TRUE))), 'issueNoteId' => $issueNote->getId(), 'isRead' => $isRead, 'isDeleteGranted' => $isDeleteGranted);
                         $issueNotes[$bug_id] = $issueNoteInfo;
                     }
                 }
             }
             if (count($issueNotes) > 0) {
                 $this->smartyHelper->assign('issueNotes', $issueNotes);
             }
         }
     }
 }
开发者ID:fg-ok,项目名称:codev,代码行数:60,代码来源:team_activity_report.php

示例8: display

 protected function display()
 {
     if (Tools::isConnectedUser()) {
         // Admins only
         $session_user = UserCache::getInstance()->getUser($_SESSION['userid']);
         if ($session_user->isTeamMember(Config::getInstance()->getValue(Config::id_adminTeamId))) {
             $projectList = $this->getProjectList(false);
             if (isset($_POST['projectid']) && array_key_exists($_POST['projectid'], $projectList)) {
                 $projectid = Tools::getSecurePOSTIntValue('projectid');
                 $_SESSION['projectid'] = $projectid;
             } elseif (isset($_SESSION['projectid']) && array_key_exists($_SESSION['projectid'], $projectList)) {
                 $projectid = $_SESSION['projectid'];
             } else {
                 $projectIds = array_keys($projectList);
                 if (count($projectIds) > 0) {
                     $projectid = $projectIds[0];
                 } else {
                     $projectid = 0;
                 }
             }
             $this->smartyHelper->assign('projects', SmartyTools::getSmartyArray($projectList, $projectid));
             // display current workflow
             if (0 != $projectid) {
                 $clone_projectid = Tools::getSecurePOSTIntValue('clone_projectid', 0);
                 if ($clone_projectid == $projectid || !array_key_exists($clone_projectid, $projectList)) {
                     $clone_projectid = 0;
                 }
                 $action = Tools::getSecurePOSTStringValue('action', '');
                 if ("cloneToProject" == $action) {
                     #echo "Clone $projectid ---> $clone_projectid<br>";
                     $errMsg = Project::cloneAllProjectConfig($projectid, $clone_projectid);
                     $this->smartyHelper->assign('msg', 'Clone to project : ' . $errMsg);
                 } elseif ("cloneFromProject" == $action) {
                     #echo "Clone $clone_projectid ---> $projectid<br>";
                     $errMsg = Project::cloneAllProjectConfig($clone_projectid, $projectid);
                     $this->smartyHelper->assign('msg', 'Clone from project : ' . $errMsg);
                 }
                 unset($projectList[$projectid]);
                 $this->smartyHelper->assign('cloneProjects', SmartyTools::getSmartyArray($projectList, $clone_projectid));
                 $proj = ProjectCache::getInstance()->getProject($projectid);
                 $this->smartyHelper->assign('currentProjectId', $projectid);
                 $this->smartyHelper->assign('defaultProjectId', $clone_projectid);
                 $this->smartyHelper->assign('currentProjectName', $proj->getName());
                 $this->smartyHelper->assign('disabled', 0 == $clone_projectid);
                 $projectsInfo = array();
                 $projectsInfo[] = $this->getProjectInfo($proj, "tabsProject");
                 if (0 != $clone_projectid) {
                     $cproj = ProjectCache::getInstance()->getProject($clone_projectid);
                     $this->smartyHelper->assign('defaultProjectName', $cproj->getName());
                     $projectsInfo[] = $this->getProjectInfo($cproj, "tabsCloneProject");
                 }
                 $this->smartyHelper->assign('projectsInfo', $projectsInfo);
             }
         }
     }
 }
开发者ID:fg-ok,项目名称:codev,代码行数:56,代码来源:workflow.php

示例9: display

 protected function display()
 {
     if (Tools::isConnectedUser()) {
         $session_user = UserCache::getInstance()->getUser($_SESSION['userid']);
         // Admins only
         if ($session_user->isTeamMember(Config::getInstance()->getValue(Config::id_adminTeamId))) {
             $this->smartyHelper->assign('access', true);
             $is_modified = Tools::getSecurePOSTStringValue('is_modified', 'false');
             // init
             // 'is_modified' is used because it's not possible to make a difference
             // between an unchecked checkBox and an unset checkbox variable
             if ("false" == $is_modified) {
                 $isBackup = true;
             } else {
                 $isBackup = $_POST['cb_backup'];
             }
             $filename = Tools::getSecurePOSTStringValue('backup_filename', "codevtt_backup_" . date("Ymd") . ".sql");
             $this->smartyHelper->assign('isBackup', $isBackup);
             $this->smartyHelper->assign('filename', $filename);
             if (isset($_POST['cb_backup'])) {
                 $result = true;
                 if ($isBackup) {
                     $result = SqlWrapper::getInstance()->sql_dump($filename) && $this->saveConfigFiles();
                     $this->smartyHelper->assign('backupResult', $result);
                 }
                 $this->smartyHelper->assign('stepOneResult', $result);
                 if ($result) {
                     $prjList = $this->displayProjectsToRemove();
                     $this->smartyHelper->assign('projects', $prjList);
                 }
                 $this->smartyHelper->assign('stepTwoResult', $result);
                 if ($result) {
                     $result = $this->removeCustomFields();
                 }
                 $this->smartyHelper->assign('stepThreeResult', $result);
                 if ($result) {
                     $result = Tools::execSQLscript2("uninstall.sql");
                 }
                 $this->smartyHelper->assign('stepFourResult', $result);
                 if ($result) {
                     $result = $this->deleteConfigFiles();
                 }
                 $this->smartyHelper->assign('stepFiveResult', $result);
                 if ($result) {
                     $result = $this->removeCustomMenuItem('CodevTT');
                 }
                 $this->smartyHelper->assign('stepSixResult', $result);
             } else {
                 Config::setQuiet(true);
                 $this->smartyHelper->assign('codevReportsDir', Constants::$codevOutputDir . DIRECTORY_SEPARATOR . 'reports');
                 Config::setQuiet(false);
                 $this->smartyHelper->assign('is_modified', $is_modified);
             }
         }
     }
 }
开发者ID:fg-ok,项目名称:codev,代码行数:56,代码来源:uninstall.php

示例10: display

 protected function display()
 {
     $this->smartyHelper->assign('activeGlobalMenuItem', 'Admin');
     if (Tools::isConnectedUser()) {
         if (!$this->session_user->isTeamMember(Config::getInstance()->getValue(Config::id_adminTeamId))) {
             $this->smartyHelper->assign('accessDenied', TRUE);
         } else {
             $action = filter_input(INPUT_POST, 'action');
             if (empty($action)) {
                 $action = 'display';
             }
             $pm = PluginManager::getInstance();
             // === ACTIONS =====================================================
             if ('enablePlugin' == $action) {
                 $pluginName = Tools::getSecurePOSTStringValue('pluginName');
                 $pm->enablePlugin($pluginName);
             } else {
                 if ('disablePlugin' == $action) {
                     $pluginName = Tools::getSecurePOSTStringValue('pluginName');
                     $pm->disablePlugin($pluginName);
                 } else {
                     if ('discoverNewPlugins' == $action) {
                         try {
                             Tools::createClassMap();
                             $pm->discoverNewPlugins();
                             //$this->smartyHelper->assign('infoMsg', T_('Found xx new plugins !'));
                         } catch (Exception $e) {
                             $this->smartyHelper->assign('errorMsg', T_('Could not create classmap: ') . $e->getMessage());
                         }
                     }
                 }
             }
             // === DISPLAY =====================================================
             // set values to display plugin table
             $plugins = $pm->getPlugins();
             $formattedPlugins = array();
             foreach ($plugins as $plugin) {
                 $className = $plugin['className'];
                 $formated_domains = array();
                 foreach ($plugin['domains'] as $domName) {
                     array_push($formated_domains, T_($domName));
                 }
                 //sort($formated_domains);
                 $formated_categories = array();
                 foreach ($plugin['categories'] as $catName) {
                     array_push($formated_categories, T_($catName));
                 }
                 //sort($formated_categories);
                 $formattedPlugins[$className] = array('name' => $plugin['displayedName'], 'status' => $plugin['status'], 'statusName' => pluginManager::getStatusName($plugin['status']), 'domains' => implode(',<br>', $formated_domains), 'categories' => implode(',<br>', $formated_categories), 'version' => $plugin['version'], 'description' => $plugin['description']);
             }
             $this->smartyHelper->assign('availablePlugins', $formattedPlugins);
         }
     }
 }
开发者ID:fg-ok,项目名称:codev,代码行数:54,代码来源:plugin_manager.php

示例11: display

 protected function display()
 {
     if (Tools::isConnectedUser()) {
         if (0 != $this->teamid) {
             $team = TeamCache::getInstance()->getTeam($this->teamid);
             $action = filter_input(INPUT_GET, 'action');
             if ('setDateRange' === $action) {
                 $startdate = filter_input(INPUT_GET, 'startdate');
                 $startTimestamp = Tools::date2timestamp($startdate);
                 $enddate = filter_input(INPUT_GET, 'enddate');
                 $endTimestamp = Tools::date2timestamp($enddate);
                 $endTimestamp += 24 * 60 * 60 - 1;
                 // + 1 day -1 sec.
             } else {
                 //$startTimestamp = $team->getDate(); // creationDate
                 //$endTimestamp = time();
                 $startTimestamp = strtotime("first day of this month");
                 $endTimestamp = strtotime("last day of this month");
             }
             $this->smartyHelper->assign('startDate', date("Y-m-d", $startTimestamp));
             $this->smartyHelper->assign('endDate', date("Y-m-d", $endTimestamp));
             // create issueSelection with issues from team projects
             $teamIssues = $team->getTeamIssueList(true, true);
             // with disabledProjects ?
             $teamIssueSelection = new IssueSelection('Team' . $this->teamid . 'ISel');
             $teamIssueSelection->addIssueList($teamIssues);
             // feed the PluginDataProvider
             $pluginDataProvider = PluginDataProvider::getInstance();
             $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_ISSUE_SELECTION, $teamIssueSelection);
             $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_TEAM_ID, $this->teamid);
             $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_START_TIMESTAMP, $startTimestamp);
             $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_END_TIMESTAMP, $endTimestamp);
             $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_SESSION_USER_ID, $this->session_userid);
             $dashboardName = 'Team' . $this->teamid;
             // save the DataProvider for Ajax calls
             $_SESSION[PluginDataProviderInterface::SESSION_ID . $dashboardName] = serialize($pluginDataProvider);
             // create the Dashboard
             $dashboard = new Dashboard($dashboardName);
             $dashboard->setDomain(IndicatorPluginInterface::DOMAIN_TEAM);
             $dashboard->setCategories(array(IndicatorPluginInterface::CATEGORY_QUALITY, IndicatorPluginInterface::CATEGORY_ACTIVITY, IndicatorPluginInterface::CATEGORY_ROADMAP, IndicatorPluginInterface::CATEGORY_PLANNING, IndicatorPluginInterface::CATEGORY_RISK, IndicatorPluginInterface::CATEGORY_TEAM));
             $dashboard->setTeamid($this->teamid);
             $dashboard->setUserid($this->session_userid);
             $data = $dashboard->getSmartyVariables($this->smartyHelper);
             foreach ($data as $smartyKey => $smartyVariable) {
                 $this->smartyHelper->assign($smartyKey, $smartyVariable);
             }
         } else {
             $this->smartyHelper->assign('error', T_('Please select a team to access this page.'));
         }
     } else {
         $this->smartyHelper->assign('error', T_('Sorry, you need to be identified.'));
     }
 }
开发者ID:siebrand,项目名称:codev,代码行数:53,代码来源:team_dashboard.php

示例12: display

 protected function display()
 {
     if (Tools::isConnectedUser()) {
         // only teamMembers & observers can access this page
         if (0 == $this->teamid || $this->session_user->isTeamCustomer($this->teamid)) {
             $this->smartyHelper->assign('accessDenied', TRUE);
             return;
         }
         $year = Tools::getSecurePOSTIntValue('year', date('Y'));
         $displayed_teamid = 0;
         if (isset($_POST['displayed_teamid'])) {
             $displayed_teamid = Tools::getSecurePOSTIntValue('displayed_teamid', 0);
         } else {
             $displayed_teamid = $this->teamid;
         }
         // --- Filters
         $filtersStr = Tools::getSecurePOSTStringValue('checkedFilters', '');
         if (!empty($filtersStr)) {
             $filters = Tools::doubleExplode(':', ',', $filtersStr);
         } else {
             $filters = array('isExternalTasks' => 1, 'isSidetasksInactivity' => 1);
         }
         $filterInfo = array();
         $filterInfo[] = array('filterId' => 'isExternalTasks', 'filterName' => T_('External Tasks'), 'isChecked' => $filters['isExternalTasks']);
         $filterInfo[] = array('filterId' => 'isSidetasksInactivity', 'filterName' => T_('Sidetasks Inactivity'), 'isChecked' => $filters['isSidetasksInactivity']);
         $this->smartyHelper->assign('filterInfo', $filterInfo);
         $this->smartyHelper->assign('checkedFilters', $filtersStr);
         // ---
         $teams = SmartyTools::getSmartyArray($this->teamList, $displayed_teamid);
         #$teams = SmartyTools::getSmartyArray(Team::getTeams(),$displayed_teamid);
         $this->smartyHelper->assign('availableTeams', $teams);
         $this->smartyHelper->assign('years', SmartyTools::getYears($year, 2));
         if ($displayed_teamid == 0 && count($teams) > 0) {
             $teamids = array_keys($teams);
             $displayed_teamid = $teamids[0];
         }
         $team = TeamCache::getInstance()->getTeam($displayed_teamid);
         $users = $team->getUsers();
         $months = array();
         for ($i = 1; $i <= 12; $i++) {
             $monthTimestamp = mktime(0, 0, 0, $i, 1, $year);
             $nbDaysInMonth = date("t", $monthTimestamp);
             $endMonthTimestamp = strtotime("last day of this month", $monthTimestamp);
             $months[$i] = array("name" => Tools::formatDate("%B %Y", $monthTimestamp), "idcaption" => Tools::formatDate("%B", $monthTimestamp), "days" => $this->getDays($nbDaysInMonth, $i, $year), "users" => $this->getDaysUsers($i, $year, $displayed_teamid, $users, $nbDaysInMonth, $filters), "workdays" => Holidays::getInstance()->getWorkdays($monthTimestamp, $endMonthTimestamp), "filename_csv" => date("Ym", $monthTimestamp) . '_' . str_replace(' ', '_', $team->getName()) . '_holidays.csv');
         }
         $this->smartyHelper->assign('months', $months);
     }
 }
开发者ID:fg-ok,项目名称:codev,代码行数:48,代码来源:holidays_report.php

示例13: display

 protected function display()
 {
     if (Tools::isConnectedUser()) {
         $isel = $this->getResolvedIssues($this->teamid, $this->session_userid);
         #$isel = $this->getResolvedIssues($this->teamid, $this->session_userid, array(18));
         #$isel = $this->getResolvedIssues($this->teamid, 17, array(18));
         #$isel = new IssueSelection('testSel');
         #$isel->addIssue(565);
         #$isel->addIssue(567);
         #$isel->addIssue(377);
         $indic = new BacklogVariationIndicator();
         $indic->execute($isel);
         $data = $indic->getSmartyObject();
         foreach ($data as $smartyKey => $smartyVariable) {
             $this->smartyHelper->assign($smartyKey, $smartyVariable);
         }
     }
 }
开发者ID:fg-ok,项目名称:codev,代码行数:18,代码来源:bvi.php

示例14: display

 protected function display()
 {
     if (Tools::isConnectedUser()) {
         // only teamMembers & observers can access this page
         if (0 == $this->teamid || $this->session_user->isTeamCustomer($this->teamid)) {
             $this->smartyHelper->assign('accessDenied', TRUE);
         } else {
             $weekid = isset($_POST['weekid']) ? $_POST['weekid'] : date('W');
             $year = isset($_POST['year']) ? $_POST['year'] : date('Y');
             $this->smartyHelper->assign('weeks', SmartyTools::getWeeks($weekid, $year));
             $this->smartyHelper->assign('years', SmartyTools::getYears($year, 2));
             if ('computeCsvWeekly' == $_POST['action']) {
                 $formatedteamName = TeamCache::getInstance()->getTeam($this->teamid)->getName();
                 $weekDates = Tools::week_dates($weekid, $year);
                 $startTimestamp = $weekDates[1];
                 $endTimestamp = mktime(23, 59, 59, date("m", $weekDates[5]), date("d", $weekDates[5]), date("Y", $weekDates[5]));
                 $reports = "";
                 $managedIssuesfile = Constants::$codevOutputDir . DIRECTORY_SEPARATOR . 'reports' . DIRECTORY_SEPARATOR . $formatedteamName . "_Mantis_" . Tools::formatDate("%Y%m%d", time()) . ".csv";
                 $managedIssuesfile = ExportCsvTools::exportManagedIssuesToCSV($this->teamid, $startTimestamp, $endTimestamp, $managedIssuesfile);
                 $reports[] = array('file' => basename($managedIssuesfile), 'title' => T_('Export Managed Issues'), 'subtitle' => T_('Issues form Team projects, including issues assigned to other teams'));
                 $timeTracking = new TimeTracking($startTimestamp, $endTimestamp, $this->teamid);
                 $weekActivityReportfile = Constants::$codevOutputDir . DIRECTORY_SEPARATOR . 'reports' . DIRECTORY_SEPARATOR . $formatedteamName . "_CRA_" . Tools::formatDate("%Y_W%W", $startTimestamp) . ".csv";
                 $weekActivityReportfile = $this->exportWeekActivityReportToCSV($this->teamid, $weekDates, $timeTracking, $weekActivityReportfile);
                 $reports[] = array('file' => basename($weekActivityReportfile), 'title' => T_('Export Week') . ' ' . $weekid . ' ' . T_('Member Activity'));
                 $projectActivityFile = Constants::$codevOutputDir . DIRECTORY_SEPARATOR . 'reports' . DIRECTORY_SEPARATOR . $formatedteamName . "_projects_" . Tools::formatDate("%Y_W%W", $startTimestamp) . ".csv";
                 $projectActivityFile = $this->exportProjectActivityToCSV($timeTracking, $projectActivityFile);
                 $reports[] = array('file' => basename($projectActivityFile), 'title' => T_('Export Week') . ' ' . $weekid . ' ' . T_('Projects Activity'));
                 $this->smartyHelper->assign('reports', $reports);
                 $monthsReport = "";
                 // reduce scope to enhance speed
                 $monthsLineReport = "";
                 $startMonth = 1;
                 for ($i = $startMonth; $i <= 12; $i++) {
                     $myFile = ExportCsvTools::exportHolidaystoCSV($i, $year, $this->teamid, $formatedteamName, Constants::$codevOutputDir . DIRECTORY_SEPARATOR . 'reports');
                     $monthsLineReport[] = array('file' => basename($myFile));
                 }
                 $monthsReport['title'] = T_('Export Holidays') . ' ' . $year;
                 $monthsReport['line'] = $monthsLineReport;
                 $this->smartyHelper->assign('monthsReport', $monthsReport);
                 $this->smartyHelper->assign('reportsDir', Constants::$codevOutputDir . DIRECTORY_SEPARATOR . 'reports');
             }
         }
     }
 }
开发者ID:fg-ok,项目名称:codev,代码行数:44,代码来源:export_csv_weekly.php

示例15: display

 protected function display()
 {
     if (Tools::isConnectedUser()) {
         // only teamMembers & observers can access this page
         if (0 == $this->teamid || $this->session_user->isTeamCustomer($this->teamid)) {
             $this->smartyHelper->assign('accessDenied', TRUE);
         } else {
             // if 'support' is set in the URL, display graphs for 'with/without Support'
             $displayNoSupport = isset($_GET['support']) ? TRUE : FALSE;
             $this->smartyHelper->assign('displayNoSupport', $displayNoSupport);
             $team = TeamCache::getInstance()->getTeam($this->teamid);
             $min_year = date("Y", $team->getDate());
             $year = isset($_POST['year']) && $_POST['year'] > $min_year ? $_POST['year'] : $min_year;
             $this->smartyHelper->assign('years', SmartyTools::getYearsToNow($min_year, $year));
             //plugins
             $this->smartyHelper->assign('statusHistoryIndicatorFile', StatusHistoryIndicator::getSmartyFilename());
             $this->smartyHelper->assign('effortEstimReliabilityIndicatorFile', EffortEstimReliabilityIndicator::getSmartyFilename());
             if ('computeTeamHistory' == $_POST['action']) {
                 $month = $year == $min_year ? date("m", $team->getDate()) : 1;
                 $day = $year == $min_year ? date("d", $team->getDate()) : 1;
                 if (count($team->getProjects(FALSE)) > 0) {
                     $timeTrackingTable = $this->createTimeTrackingList($day, $month, $year, $this->teamid);
                     $this->generateSubmittedResolvedGraph($timeTrackingTable, FALSE);
                     $this->generateSubmittedResolvedGraph($timeTrackingTable, TRUE);
                     // ExtRefOnly
                     $this->generateTimeDriftGraph($timeTrackingTable);
                     $this->generateResolvedDriftGraph($timeTrackingTable, $displayNoSupport, FALSE);
                     $this->generateResolvedDriftGraph($timeTrackingTable, $displayNoSupport, TRUE);
                     // ExtRefOnly
                     $this->generateEfficiencyGraph($timeTrackingTable);
                     $this->generateReopenedRateGraph($timeTrackingTable);
                     $this->generateDevelopersWorkloadGraph($timeTrackingTable);
                     // --- BEGIN FDJ SPECIFIC ---
                     $this->generateEffortEstimReliabilityGraph($this->teamid, $timeTrackingTable);
                     // --- END FDJ SPECIFIC ---
                     #$this->generateStatusHistoryGraph($teamid);
                 } else {
                     $this->smartyHelper->assign('error', T_('No projects in this team'));
                 }
             }
         }
     }
 }
开发者ID:fg-ok,项目名称:codev,代码行数:43,代码来源:statistics.php


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