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


PHP UserCache::getInstance方法代码示例

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


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

示例1: getIssueGeneralInfo

 /**
  * Get general info of an issue
  * @param Issue $issue The issue
  * @param bool $isManager if true: show MgrEffortEstim column
  * @param bool $displaySupport If true, display support
  * @return mixed[]
  */
 public static function getIssueGeneralInfo(Issue $issue, $isManager = false, $displaySupport = false)
 {
     $withSupport = true;
     // include support in elapsed & Drift
     $drift = $issue->getDrift($withSupport);
     $issueGeneralInfo = array("issueId" => $issue->getId(), "issueSummary" => htmlspecialchars(preg_replace('![\\t\\r\\n]+!', ' ', $issue->getSummary())), "issueType" => $issue->getType(), "issueDescription" => htmlspecialchars($issue->getDescription()), "projectName" => $issue->getProjectName(), "categoryName" => $issue->getCategoryName(), "issueExtRef" => $issue->getTcId(), 'mantisURL' => Tools::mantisIssueURL($issue->getId(), NULL, true), 'issueURL' => Tools::mantisIssueURL($issue->getId()), 'statusName' => $issue->getCurrentStatusName(), 'priorityName' => $issue->getPriorityName(), 'severityName' => $issue->getSeverityName(), 'handlerName' => UserCache::getInstance()->getUser($issue->getHandlerId())->getName(), "issueEffortTitle" => $issue->getEffortEstim() . ' + ' . $issue->getEffortAdd(), "issueEffort" => $issue->getEffortEstim() + $issue->getEffortAdd(), "issueReestimated" => $issue->getReestimated(), "issueBacklog" => $issue->getBacklog(), "issueDriftColor" => $issue->getDriftColor($drift), "issueDrift" => round($drift, 2), "progress" => round(100 * $issue->getProgress()), 'relationships' => self::getFormattedRelationshipsInfo($issue));
     if ($isManager) {
         $issueGeneralInfo['issueMgrEffortEstim'] = $issue->getMgrEffortEstim();
         $driftMgr = $issue->getDriftMgr($withSupport);
         $issueGeneralInfo['issueDriftMgrColor'] = $issue->getDriftColor($driftMgr);
         $issueGeneralInfo['issueDriftMgr'] = round($driftMgr, 2);
     }
     if ($withSupport) {
         $issueGeneralInfo['issueElapsed'] = $issue->getElapsed();
     } else {
         $issueGeneralInfo['issueElapsed'] = $issue->getElapsed() - $issue->getElapsed(Jobs::JOB_SUPPORT);
     }
     if ($displaySupport) {
         if ($isManager) {
             $driftMgr = $issue->getDriftMgr(!$withSupport);
             $issueGeneralInfo['issueDriftMgrSupportColor'] = $issue->getDriftColor($driftMgr);
             $issueGeneralInfo['issueDriftMgrSupport'] = round($driftMgr, 2);
         }
         $drift = $issue->getDrift(!$withSupport);
         $issueGeneralInfo['issueDriftSupportColor'] = $issue->getDriftColor($drift);
         $issueGeneralInfo['issueDriftSupport'] = round($drift, 2);
     }
     return $issueGeneralInfo;
 }
开发者ID:dfuzeau,项目名称:codev,代码行数:36,代码来源:issue_info_tools.php

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

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

示例4: login

function login($user, $password)
{
    $logger = Logger::getLogger('login');
    // WARN: if logger is LoggerAppenderEcho, then logs will break the login Ajax call !
    try {
        $appenders = $logger->getParent()->getAllAppenders();
        $isLog = true;
        foreach ($appenders as $appender) {
            if ('LoggerAppenderEcho' === get_class($appender)) {
                $isLog = false;
                break;
            }
        }
    } catch (Exception $e) {
        // logs should never break application
        $isLog = false;
    }
    $password = md5($password);
    $formattedUser = SqlWrapper::sql_real_escape_string($user);
    $formattedPass = SqlWrapper::sql_real_escape_string($password);
    $query = "SELECT id, username, realname FROM `mantis_user_table` WHERE username = '" . $formattedUser . "' AND password = '" . $formattedPass . "' AND enabled = 1;";
    $result = SqlWrapper::getInstance()->sql_query($query);
    if ($result && SqlWrapper::getInstance()->sql_num_rows($result) == 1 && ($row_login = SqlWrapper::getInstance()->sql_fetch_object($result))) {
        $_SESSION['userid'] = $row_login->id;
        $_SESSION['username'] = $row_login->username;
        $_SESSION['realname'] = $row_login->realname;
        try {
            $user = UserCache::getInstance()->getUser($row_login->id);
            $locale = $user->getDefaultLanguage();
            if (NULL != $locale) {
                $_SESSION['locale'] = $locale;
            }
            $teamid = $user->getDefaultTeam();
            if (0 != $teamid) {
                $_SESSION['teamid'] = $teamid;
            }
            $projid = $user->getDefaultProject();
            if (0 != $projid) {
                $_SESSION['projectid'] = $projid;
            }
        } catch (Exception $e) {
            if ($isLog && self::$logger->isDebugEnabled()) {
                $logger->debug("could not load preferences for user {$row_login->id}");
            }
        }
        if ($isLog) {
            $ua = Tools::getBrowser();
            $browserStr = $ua['name'] . ' ' . $ua['version'] . ' (' . $ua['platform'] . ')';
            $logger->info('user ' . $row_login->id . ' ' . $row_login->username . ' (' . $row_login->realname . '), Team ' . $user->getDefaultTeam() . ', ' . $browserStr);
        }
        return TRUE;
    } else {
        #$error = 'login failed !';
        return FALSE;
    }
}
开发者ID:fg-ok,项目名称:codev,代码行数:56,代码来源:login.php

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

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

示例7: getCommandIssues

 /**
  * @param Command $command
  * @return mixed[]
  */
 private static function getCommandIssues(Command $command)
 {
     $issueArray = array();
     $issues = $command->getIssueSelection()->getIssueList();
     foreach ($issues as $id => $issue) {
         $driftMgr = $issue->getDriftMgr();
         $driftMgrColor = $issue->getDriftColor($driftMgr);
         $drift = $issue->getDrift();
         $driftColor = $issue->getDriftColor($drift);
         $user = UserCache::getInstance()->getUser($issue->getHandlerId());
         $issueArray[$id] = array("mantisLink" => Tools::mantisIssueURL($issue->getId(), NULL, TRUE), "bugid" => Tools::issueInfoURL(sprintf("%07d\n", $issue->getId())), "extRef" => $issue->getTcId(), "project" => $issue->getProjectName(), "target" => $issue->getTargetVersion(), "status" => $issue->getCurrentStatusName(), "progress" => round(100 * $issue->getProgress()), "effortEstim" => $issue->getEffortEstim() + $issue->getEffortAdd(), "mgrEffortEstim" => $issue->getMgrEffortEstim(), "elapsed" => $issue->getElapsed(), "driftMgr" => $driftMgr, "driftMgrColor" => $driftMgrColor, "drift" => $drift, "driftColor" => $driftColor, "duration" => $issue->getDuration(), "summary" => $issue->getSummary(), "type" => $issue->getType(), "handlerName" => $user->getName());
     }
     return $issueArray;
 }
开发者ID:dfuzeau,项目名称:codev,代码行数:18,代码来源:command_tools.php

示例8: getUserData

 protected function getUserData()
 {
     $userId = $this->userId;
     $cache = UserCache::getInstance();
     $data = $cache->read($userId);
     if ((ENVIRONMENT & PRODUCTION) > 0 && !$data) {
         list($fp) = $cache->lock($userId);
         $data = $this->_getUserData($userId);
         $cache->write($fp, $data);
     }
     if (!$data) {
         $data = $this->_getUserData($userId);
     }
     return Sabel_ValueObject::fromArray(array("userId" => $userId, "friends" => Follower::getFriends($userId, FRIENDS_ICON_LIMIT + 1), "friendsCount" => $data["friends"], "followersCount" => $data["followers"], "statusesCount" => $data["statuses"], "latestComment" => $data["comment"]));
 }
开发者ID:hamaco,项目名称:phwittr-on-xoops,代码行数:15,代码来源:Submenu.php

示例9: logicsFollowRemove

 protected function logicsFollowRemove($userId, $targetId, $result)
 {
     if ($result->isFailure() || $result->removeType !== "follow") {
         return;
     }
     $cache = UserCache::getInstance();
     list($fp, $data) = $cache->lock($userId);
     if ($data) {
         $data["friends"]--;
         $cache->write($fp, $data);
     }
     list($fp, $data) = $cache->lock($targetId);
     if ($data) {
         $data["followers"]--;
         $cache->write($fp, $data);
     }
 }
开发者ID:hamaco,项目名称:phwittr-on-xoops,代码行数:17,代码来源:UserCache.php

示例10: checkAnalyzed

 /**
  * fiches analyzed dont BI non renseignes
  * fiches analyzed dont RAE non renseignes
  * @return ConsistencyError[]
  */
 public function checkAnalyzed()
 {
     // CoDev FDJ custom, defined in Mantis
     $status_analyzed = Config::getVariableKeyFromValue(Config::id_statusNames, 'analyzed');
     $status_accepted = Config::getVariableKeyFromValue(Config::id_statusNames, 'accepted');
     $status_deferred = Config::getVariableKeyFromValue(Config::id_statusNames, 'deferred');
     $FDJ_teamid = Config::getInstance()->getValue(Config::id_ClientTeamid);
     $cerrList = array();
     // select all issues which current status is 'analyzed'
     $query = "SELECT * " . "FROM `mantis_bug_table` " . "WHERE status in ({$status_analyzed}, {$status_accepted}, " . Constants::$status_open . ", {$status_deferred}) ";
     if (0 != count($this->projectList)) {
         $formatedProjects = implode(', ', array_keys($this->projectList));
         $query .= "AND project_id IN ({$formatedProjects}) ";
     }
     $query .= "ORDER BY last_updated DESC, bug_id DESC";
     $result = SqlWrapper::getInstance()->sql_query($query);
     if (!$result) {
         echo "<span style='color:red'>ERROR: Query FAILED</span>";
         exit;
     }
     while ($row = SqlWrapper::getInstance()->sql_fetch_object($result)) {
         $issue = IssueCache::getInstance()->getIssue($row->id, $row);
         if (NULL == $issue->getEffortEstim()) {
             $cerr = new ConsistencyError($row->id, $row->handler_id, $row->status, $row->last_updated, T_("BI not specified: BI = Time(Analysis + Dev + Tests)"));
             $cerr->severity = T_("Error");
             $cerrList[] = $cerr;
         }
         if (is_null($issue->getBacklog())) {
             $cerr = new ConsistencyError($row->bug_id, $row->handler_id, $row->status, $row->last_updated, T_("Backlog not specified: Backlog = Time(BI - Analysis)"));
             $cerr->severity = T_("Error");
             $cerrList[] = $cerr;
         }
         if ($status_analyzed == $row->status) {
             $user = UserCache::getInstance()->getUser($row->handler_id);
             if (!$user->isTeamMember($FDJ_teamid)) {
                 $cerr = new ConsistencyError($row->bug_id, $row->handler_id, $row->status, $row->last_updated, T_("Once analysed, a Task must be assigned to 'FDJ' for validation"));
                 $cerr->severity = T_("Error");
                 $cerrList[] = $cerr;
             }
         }
     }
     // check if fields correctly set
     return $cerrList;
 }
开发者ID:fg-ok,项目名称:codev,代码行数:49,代码来源:consistency_check_fdj.class.php

示例11: 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 (isset($_POST['projects']) && !empty($_POST['projects'])) {
                 $selectedProjects = $_POST['projects'];
                 $result = array();
                 foreach ($selectedProjects as $projectid) {
                     $project = ProjectCache::getInstance()->getProject($projectid);
                     $result[$projectid] = $project->getName();
                     Project::prepareProjectToCodev($projectid);
                 }
                 $this->smartyHelper->assign('result', $result);
             }
             $this->smartyHelper->assign('projects', $this->getProjectList());
         }
     }
 }
开发者ID:fg-ok,项目名称:codev,代码行数:20,代码来源:prepare_project.php

示例12: getBlogPosts

 /**
  * @param BlogPost[] $postList
  * @return mixed[]
  */
 private function getBlogPosts(array $postList)
 {
     $blogPosts = array();
     foreach ($postList as $id => $bpost) {
         $srcUser = UserCache::getInstance()->getUser($bpost->src_user_id);
         $item = array();
         // TODO
         $item['category'] = Config::getVariableValueFromKey(Config::id_blogCategories, $bpost->category);
         $item['severity'] = BlogPost::getSeverityName($bpost->severity);
         $item['summary'] = $bpost->summary;
         $item['content'] = $bpost->content;
         $item['date_submitted'] = date('Y-m-d G:i', $bpost->date_submitted);
         $item['from'] = $srcUser->getRealname();
         // find receiver
         if (0 != $bpost->dest_user_id) {
             $destUser = UserCache::getInstance()->getUser($bpost->dest_user_id);
             $item['to'] = $destUser->getRealname();
         } else {
             if (0 != $bpost->dest_team_id) {
                 $team = TeamCache::getInstance()->getTeam($bpost->dest_team_id);
                 $item['to'] = $team->getName();
             } else {
                 if (0 != $bpost->dest_project_id) {
                     $destProj = ProjectCache::getInstance()->getProject($bpost->dest_project_id);
                     $item['to'] = $destProj->getName();
                 } else {
                     $item['to'] = '?';
                 }
             }
         }
         $item['activity'] = 'activities...';
         $item['buttons'] = "<input type='button' value='" . T_('Ack') . "' onclick='javascript: ackPost(" . $bpost->id . ")' />";
         $item['buttons'] .= "<input type='button' value='" . T_('Hide') . "' onclick='javascript: hidePost(" . $bpost->id . ")' />";
         // TODO only if i'm the owner
         $item['buttons'] .= "<input type='button' value='" . T_('Delete') . "' onclick='javascript: deletePost(" . $bpost->id . ")' />";
         $item['isHidden'] = '0';
         $blogPosts[$id] = $item;
     }
     return $blogPosts;
 }
开发者ID:fg-ok,项目名称:codev,代码行数:44,代码来源:blog.php

示例13: getTeamConsistencyErrors

 /**
  * Get consistency errors
  * @param int $teamid
  * @return mixed[]
  */
 private function getTeamConsistencyErrors($teamid)
 {
     if (self::$logger->isDebugEnabled()) {
         self::$logger->debug("getTeamConsistencyErrors teamid={$teamid}");
     }
     // get team projects
     $issueList = TeamCache::getInstance()->getTeam($teamid)->getTeamIssueList(true, false);
     if (self::$logger->isDebugEnabled()) {
         self::$logger->debug("getTeamConsistencyErrors nbIssues=" . count($issueList));
     }
     #$ccheck = new ConsistencyCheck2($issueList);
     $ccheck = new ConsistencyCheck2($issueList, $teamid);
     $cerrList = $ccheck->check();
     $cerrs = NULL;
     if (count($cerrList) > 0) {
         $i = 0;
         foreach ($cerrList as $cerr) {
             $i += 1;
             if (NULL != $cerr->userId) {
                 $user = UserCache::getInstance()->getUser($cerr->userId);
             } else {
                 $user = NULL;
             }
             if (Issue::exists($cerr->bugId)) {
                 $issue = IssueCache::getInstance()->getIssue($cerr->bugId);
                 $summary = $issue->getSummary();
                 $projName = $issue->getProjectName();
                 $refExt = $issue->getTcId();
             } else {
                 $summary = '';
                 $projName = '';
             }
             $cerrs[$i] = array('userName' => isset($user) ? $user->getName() : '', 'issueURL' => NULL == $cerr->bugId ? '' : Tools::issueInfoURL($cerr->bugId, $summary), 'mantisURL' => NULL == $cerr->bugId ? '' : Tools::mantisIssueURL($cerr->bugId, $summary, true), 'extRef' => NULL == $refExt ? '' : $refExt, 'date' => NULL == $cerr->timestamp ? '' : date("Y-m-d", $cerr->timestamp), 'status' => NULL == $cerr->status ? '' : Constants::$statusNames[$cerr->status], 'severity' => $cerr->getLiteralSeverity(), 'project' => $projName, 'desc' => $cerr->desc, 'summary' => $summary);
         }
     }
     return $cerrs;
 }
开发者ID:fg-ok,项目名称:codev,代码行数:42,代码来源:check.php

示例14: display

 protected function display()
 {
     if (Tools::isConnectedUser()) {
         $session_user = UserCache::getInstance()->getUser($_SESSION['userid']);
         $mTeamList = $session_user->getDevTeamList();
         $lTeamList = $session_user->getLeadedTeamList();
         $oTeamList = $session_user->getObservedTeamList();
         $managedTeamList = $session_user->getManagedTeamList();
         $teamList = $mTeamList + $lTeamList + $oTeamList + $managedTeamList;
         $defaultTeam = isset($_SESSION['teamid']) ? $_SESSION['teamid'] : 0;
         $teamid = Tools::getSecureGETIntValue('teamid', $defaultTeam);
         $_SESSION['teamid'] = $teamid;
         $this->smartyHelper->assign('teams', SmartyTools::getSmartyArray($teamList, $teamid));
         // if current team is not in allowed list, do not display
         if (array_key_exists($teamid, $teamList)) {
             $team = TeamCache::getInstance()->getTeam($teamid);
             $start_year = date("Y", $team->getDate());
             $start_month = date("m", $team->getDate());
             $start_day = date("d", $team->getDate());
             $statusNames = Config::getInstance()->getValue("statusNames");
             ksort($statusNames);
             $this->smartyHelper->assign('statusNames', $statusNames);
             $periodStatsReport = new PeriodStatsReport($start_year, $start_month, $start_day, $teamid);
             $periodStatsList = $periodStatsReport->computeReport();
             $periods = array();
             foreach ($periodStatsList as $date => $ps) {
                 $status = array();
                 foreach ($statusNames as $s => $sname) {
                     $status[$s] = $ps->getStatusCount($s);
                 }
                 $periods[Tools::formatDate("%B %Y", $date)] = $status;
             }
             $this->smartyHelper->assign('periods', $periods);
         }
     }
 }
开发者ID:fg-ok,项目名称:codev,代码行数:36,代码来源:mantis_reports.php

示例15: updateTeamSelector

 protected function updateTeamSelector()
 {
     if (Tools::isConnectedUser()) {
         // use the teamid set in the form, if not defined (first page call) use session teamid
         if (isset($_GET['teamid'])) {
             $this->teamid = Tools::getSecureGETIntValue('teamid');
             $_SESSION['teamid'] = $this->teamid;
         } else {
             $this->teamid = isset($_SESSION['teamid']) ? $_SESSION['teamid'] : 0;
         }
         $this->smartyHelper->assign('teamid', $this->teamid);
         $this->session_userid = $_SESSION['userid'];
         $this->session_user = UserCache::getInstance()->getUser($_SESSION['userid']);
         $this->teamList = $this->session_user->getTeamList();
         if (count($this->teamList) > 0) {
             $this->smartyHelper->assign('teams', SmartyTools::getSmartyArray($this->teamList, $_SESSION['teamid']));
         }
         $this->session_user->setDefaultTeam($this->teamid);
         // used to disable some menu items
         if ($this->session_user->isTeamMember(Config::getInstance()->getValue(Config::id_adminTeamId))) {
             $this->smartyHelper->assign('isAdmin', true);
         }
     }
 }
开发者ID:fg-ok,项目名称:codev,代码行数:24,代码来源:controller.class.php


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