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


PHP Dashboard::setCategories方法代码示例

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


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

示例1: dashboardSettings

 /**
  *
  * @param SmartyHelper $smartyHelper
  * @param Command $prj
  * @param int $userid
  */
 public static function dashboardSettings(SmartyHelper $smartyHelper, Project $prj, $userid, $teamid)
 {
     $pluginDataProvider = PluginDataProvider::getInstance();
     $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_ISSUE_SELECTION, $prj->getIssueSelection());
     $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_TEAM_ID, $teamid);
     $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_SESSION_USER_ID, $userid);
     $team = TeamCache::getInstance()->getTeam($teamid);
     $startT = $team->getDate();
     $now = time();
     $endT = mktime(23, 59, 59, date('m', $now), date('d', $now), date('Y', $now));
     if ($startT > $endT) {
         $startT = strtotime('today midnight');
     }
     //echo "start $startT end $endT<br>";
     // Calculate a nice day interval
     $nbWeeks = ($endT - $startT) / 60 / 60 / 24;
     $interval = ceil($nbWeeks / 20);
     $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_START_TIMESTAMP, $startT);
     $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_END_TIMESTAMP, $endT);
     $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_INTERVAL, $interval);
     // save the DataProvider for Ajax calls
     $_SESSION[PluginDataProviderInterface::SESSION_ID] = serialize($pluginDataProvider);
     // create the Dashboard
     $dashboard = new Dashboard('Project' . $prj->getId());
     $dashboard->setDomain(IndicatorPluginInterface::DOMAIN_PROJECT);
     $dashboard->setCategories(array(IndicatorPluginInterface::CATEGORY_QUALITY, IndicatorPluginInterface::CATEGORY_ACTIVITY, IndicatorPluginInterface::CATEGORY_ROADMAP, IndicatorPluginInterface::CATEGORY_PLANNING, IndicatorPluginInterface::CATEGORY_RISK));
     $dashboard->setTeamid($teamid);
     $dashboard->setUserid($userid);
     $data = $dashboard->getSmartyVariables($smartyHelper);
     foreach ($data as $smartyKey => $smartyVariable) {
         $smartyHelper->assign($smartyKey, $smartyVariable);
     }
 }
开发者ID:fg-ok,项目名称:codev,代码行数:39,代码来源:project_info_tools.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: 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

示例4: display

 protected function display()
 {
     if (Tools::isConnectedUser()) {
         // Admins only
         $userid = $_SESSION['userid'];
         //$session_user = UserCache::getInstance()->getUser($userid);
         $teamid = 9;
         // ASF_OVA_Internet
         $cmdid = 16;
         // ASF Commande Internet
         $cmd = CommandCache::getInstance()->getCommand($cmdid);
         $startTimestamp = Tools::date2timestamp('2013-11-22');
         $endTimestamp = Tools::date2timestamp('2014-06-22');
         // ------ START TESTS
         //if (FALSE == Tools::createClassMap()) { echo "ERROR createClassMap";}
         //$pm = PluginManager::getInstance();
         //$pm->discoverNewPlugins();
         // ------ END TESTS
         // feed the PluginDataProvider
         $pluginDataProvider = PluginDataProvider::getInstance();
         $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_ISSUE_SELECTION, $cmd->getIssueSelection());
         $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_TEAM_ID, $teamid);
         $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_START_TIMESTAMP, $startTimestamp);
         $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_END_TIMESTAMP, $endTimestamp);
         $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_PROVISION_DAYS, $cmd->getProvisionDays());
         $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_SESSION_USER_ID, $userid);
         // save the DataProvider for Ajax calls
         $_SESSION[PluginDataProviderInterface::SESSION_ID] = serialize($pluginDataProvider);
         // create the Dashboard
         $dashboard = new Dashboard('myDashboardId');
         $dashboard->setDomain(IndicatorPluginInterface::DOMAIN_COMMAND);
         $dashboard->setCategories(array(IndicatorPluginInterface::CATEGORY_QUALITY, IndicatorPluginInterface::CATEGORY_ACTIVITY, IndicatorPluginInterface::CATEGORY_ROADMAP, IndicatorPluginInterface::CATEGORY_PLANNING, IndicatorPluginInterface::CATEGORY_RISK, IndicatorPluginInterface::CATEGORY_TEAM));
         $dashboard->setTeamid($teamid);
         $dashboard->setUserid($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 in the admin-team to access this page.'));
     }
 }
开发者ID:fg-ok,项目名称:codev,代码行数:42,代码来源:plugin.php

示例5: dashboardSettings

 /**
  *
  * @param SmartyHelper $smartyHelper
  * @param Command $cmd
  * @param int $userid
  */
 public static function dashboardSettings(SmartyHelper $smartyHelper, Command $cmd, $userid)
 {
     $pluginDataProvider = PluginDataProvider::getInstance();
     $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_ISSUE_SELECTION, $cmd->getIssueSelection());
     $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_TEAM_ID, $cmd->getTeamid());
     $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_PROVISION_DAYS, $cmd->getProvisionDays());
     $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_SESSION_USER_ID, $userid);
     $params = self::computeTimestampsAndInterval($cmd);
     $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_START_TIMESTAMP, $params['startTimestamp']);
     $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_END_TIMESTAMP, $params['endTimestamp']);
     $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_INTERVAL, $params['interval']);
     $dashboardName = 'Command' . $cmd->getId();
     // save the DataProvider for Ajax calls
     $_SESSION[PluginDataProviderInterface::SESSION_ID . $dashboardName] = serialize($pluginDataProvider);
     // create the Dashboard
     $dashboard = new Dashboard($dashboardName);
     $dashboard->setDomain(IndicatorPluginInterface::DOMAIN_COMMAND);
     $dashboard->setCategories(array(IndicatorPluginInterface::CATEGORY_QUALITY, IndicatorPluginInterface::CATEGORY_ACTIVITY, IndicatorPluginInterface::CATEGORY_ROADMAP, IndicatorPluginInterface::CATEGORY_PLANNING, IndicatorPluginInterface::CATEGORY_RISK));
     $dashboard->setTeamid($cmd->getTeamid());
     $dashboard->setUserid($userid);
     $data = $dashboard->getSmartyVariables($smartyHelper);
     foreach ($data as $smartyKey => $smartyVariable) {
         $smartyHelper->assign($smartyKey, $smartyVariable);
     }
 }
开发者ID:dfuzeau,项目名称:codev,代码行数:31,代码来源:command_tools.php

示例6: dashboardSettings

 /**
  *
  * @param SmartyHelper $smartyHelper
  * @param Issue $issue
  * @param int $userid
  * @param int $teamid
  */
 public static function dashboardSettings(SmartyHelper $smartyHelper, Issue $issue, $userid, $teamid)
 {
     $isel = new IssueSelection();
     $isel->addIssue($issue->getId());
     $pluginDataProvider = PluginDataProvider::getInstance();
     $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_ISSUE_SELECTION, $isel);
     $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_TEAM_ID, $teamid);
     $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_SESSION_USER_ID, $userid);
     // start date is min(1st_timetrack, issue_creation_date)
     $startT = $issue->getDateSubmission();
     $firstTT = $issue->getFirstTimetrack();
     if (NULL != $firstTT) {
         $startT = min(array($issue->getDateSubmission(), $firstTT->getDate()));
     }
     // end date is last_timetrack or now if none
     $eTs = NULL == $firstTT ? time() : $issue->getLatestTimetrack()->getDate();
     $endT = mktime(23, 59, 59, date('m', $eTs), date('d', $eTs), date('Y', $eTs));
     //echo "start $startT end $endT<br>";
     // Calculate a nice day interval
     $nbWeeks = ($endT - $startT) / 60 / 60 / 24;
     $interval = ceil($nbWeeks / 20);
     $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_START_TIMESTAMP, $startT);
     $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_END_TIMESTAMP, $endT);
     $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_INTERVAL, $interval);
     $dashboardName = 'Tasks_prj' . $issue->getProjectId();
     // save the DataProvider for Ajax calls
     $_SESSION[PluginDataProviderInterface::SESSION_ID . $dashboardName] = serialize($pluginDataProvider);
     // create the Dashboard
     $dashboard = new Dashboard($dashboardName);
     // settings are common all tasks of a project
     $dashboard->setDomain(IndicatorPluginInterface::DOMAIN_TASK);
     $dashboard->setCategories(array(IndicatorPluginInterface::CATEGORY_QUALITY, IndicatorPluginInterface::CATEGORY_ACTIVITY, IndicatorPluginInterface::CATEGORY_ROADMAP, IndicatorPluginInterface::CATEGORY_PLANNING, IndicatorPluginInterface::CATEGORY_RISK));
     $dashboard->setTeamid($teamid);
     $dashboard->setUserid($userid);
     $data = $dashboard->getSmartyVariables($smartyHelper);
     foreach ($data as $smartyKey => $smartyVariable) {
         $smartyHelper->assign($smartyKey, $smartyVariable);
     }
 }
开发者ID:dfuzeau,项目名称:codev,代码行数:46,代码来源:issue_info_tools.php


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