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


PHP Report::getWorkloadByTimePeriod方法代码示例

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


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

示例1: WorkloadTimePeriodGraph

 /**
  * Generates the workload by time period graph.
  *
  * @param string $type
  */
 public function WorkloadTimePeriodGraph($type)
 {
     $usr_id = Auth::getUserID();
     // get timezone of current user
     $user_prefs = Prefs::get($usr_id);
     if ($type == 'email') {
         $data = Report::getEmailWorkloadByTimePeriod($user_prefs['timezone'], true);
         $graph_title = ev_gettext('Email by Time Period');
         $event_type = ev_gettext('emails');
     } else {
         $data = Report::getWorkloadByTimePeriod($user_prefs['timezone'], true);
         $graph_title = ev_gettext('Workload by Time Period');
         $event_type = ev_gettext('actions');
     }
     // TRANSLATORS: %s = Timezone name
     $xtitle = ev_gettext('Hours (%s)', Date_Helper::getTimezoneShortNameByUser($usr_id));
     // rebuild data for phplot format
     $plotData = array();
     $legends = array();
     $i = 1;
     foreach ($data as $performer => $values) {
         foreach ($values as $hour => $value) {
             $plotData[(int) $hour][0] = $hour;
             $plotData[(int) $hour][$i] = $value;
         }
         $legends[$i] = ucfirst($performer) . ' ' . $event_type;
         $i++;
     }
     $plot = $this->create(900, 350);
     $plot->SetImageBorderType('plain');
     $plot->SetPlotType('bars');
     $plot->SetDataType('text-data');
     $plot->SetDataValues($plotData);
     $plot->SetTitle($graph_title);
     $plot->SetLegend($legends);
     $plot->SetYTitle($event_type);
     $plot->SetXTitle($xtitle);
     $plot->SetXTickLabelPos('none');
     $plot->SetXTickPos('none');
     $plot->SetYDataLabelPos('plotin');
     $plot->SetYLabelType('printf', '%.0f%%');
     $plot->group_frac_width = 1;
     $plot->DrawGraph();
 }
开发者ID:korusdipl,项目名称:eventum,代码行数:49,代码来源:PlotHelper.php

示例2: dirname

// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        |
// | GNU General Public License for more details.                         |
// |                                                                      |
// | You should have received a copy of the GNU General Public License    |
// | along with this program; if not, write to:                           |
// |                                                                      |
// | Free Software Foundation, Inc.                                       |
// | 51 Franklin Street, Suite 330                                          |
// | Boston, MA 02110-1301, USA.                                          |
// +----------------------------------------------------------------------+
// | Authors: Bryan Alsdorf <bryan@mysql.com>                             |
// +----------------------------------------------------------------------+
require_once dirname(__FILE__) . '/../../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('reports/workload_time_period.tpl.html');
Auth::checkAuthentication(APP_COOKIE);
$usr_id = Auth::getUserID();
if (!Access::canAccessReports(Auth::getUserID())) {
    echo 'Invalid role';
    exit;
}
$prj_id = Auth::getCurrentProject();
// get timezone of current user
$user_prefs = Prefs::get($usr_id);
if (@$_GET['type'] == 'email') {
    $data = Report::getEmailWorkloadByTimePeriod(@$user_prefs['timezone']);
} else {
    $data = Report::getWorkloadByTimePeriod(@$user_prefs['timezone']);
}
$tpl->assign(array('data' => $data, 'type' => @$_GET['type'], 'user_tz' => Date_Helper::getTimezoneShortNameByUser($usr_id)));
$tpl->displayTemplate();
开发者ID:korusdipl,项目名称:eventum,代码行数:31,代码来源:workload_time_period.php

示例3: array

$usr_id = Auth::getUserID();
if (Auth::getCurrentRole() <= User::getRoleID("Customer")) {
    echo "Invalid role";
    exit;
}
/**
 * Generates the workload by time period graph.
 */
// get timezone of current user
$user_prefs = Prefs::get($usr_id);
if (@$HTTP_GET_VARS["type"] == "email") {
    $data = Report::getEmailWorkloadByTimePeriod(@$user_prefs["timezone"], true);
    $graph_title = "Email by Time Period";
    $event_type = "emails";
} else {
    $data = Report::getWorkloadByTimePeriod(@$user_prefs["timezone"], true);
    $graph_title = "Workload by Time Period";
    $event_type = "actions";
}
$plots = array();
foreach ($data as $performer => $values) {
    ksort($values);
    ksort($data[$performer]);
    // Create a bar pot
    $bplot = new BarPlot(array_values($values));
    if ($performer == "customer") {
        $color = "#99ccff";
    } else {
        $color = "#ffcc00";
    }
    $bplot->SetFillColor($color);
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:workload_time_period_graph.php


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