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


PHP Report::getObjectName方法代码示例

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


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

示例1: array

	// CUSTOM REPORTS
	$reports = array_var($customReports, $type_id, array());
	
?>
<div class="report_header"><?php echo lang('custom reports') ?></div>
<?php 
	if(count($reports) > 0){
		$alt = true;
?>
	<ul>
	<?php foreach($reports as $report){
			$alt = !$alt; 
	?>
		<li style="padding-top:4px">
		<div style="max-width:700px;<?php echo $alt ? 'background-color:#ECEFF7;' : '';?>">
			<a style="font-weight:bold;margin-right:15px" class="internalLink" href="<?php echo get_url('reporting','view_custom_report', array('id' => $report->getId()))?>"><?php echo $report->getObjectName() ?></a>
			<div style="float:right;padding-left:15px;">
			<?php if ($report->canEdit(logged_user())) { ?>
				<a style="margin-right:5px" class="internalLink coViewAction ico-edit" href="<?php echo get_url('reporting','edit_custom_report', array('id' => $report->getId()))?>"><?php echo lang('edit') ?></a>
			<?php } ?>
			<?php if ($report->canDelete(logged_user())) { ?>
				<a style="margin-right:5px" class="internalLink coViewAction ico-delete" href="javascript:og.deleteReport(<?php echo $report->getId() ?>)"><?php echo lang('delete') ?></a>
			<?php } ?>
			</div>
			<div style="float:right;max-width:700px;" id="report-<?php echo $report->getId();?>">
				<span class="breadcrumb"></span>
				<script>
					<?php $crumbOptions = json_encode($report->getMembersToDisplayPath());
					$crumbJs = " og.getCrumbHtml($crumbOptions) ";?>
					var crumbHtml = <?php echo $crumbJs;?>;
					$("#report-<?php echo $report->getId()?> .breadcrumb").html(crumbHtml);
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:31,代码来源:index.php

示例2: lang

<div class="report_header"><?php 
    echo lang('custom reports');
    ?>
</div>
<?php 
    if (count($reports) > 0) {
        ?>
	<ul>
	<?php 
        foreach ($reports as $report) {
            ?>
		<li style="padding-top:4px"><div><a style="font-weight:bold;margin-right:15px" class="internalLink" href="<?php 
            echo get_url('reporting', 'view_custom_report', array('id' => $report->getId()));
            ?>
"><?php 
            echo $report->getObjectName();
            ?>
</a>
			<?php 
            if ($report->canEdit(logged_user())) {
                ?>
				<a style="margin-right:5px" class="internalLink coViewAction ico-edit" href="<?php 
                echo get_url('reporting', 'edit_custom_report', array('id' => $report->getId()));
                ?>
"><?php 
                echo lang('edit');
                ?>
</a>
			<?php 
            }
            ?>
开发者ID:rorteg,项目名称:fengoffice,代码行数:31,代码来源:index.php

示例3: generatePDFReport

 function generatePDFReport(Report $report, $results)
 {
     $results['columns'][] = lang("status");
     $types = self::get_report_column_types($report->getId());
     $ot = ObjectTypes::findById($report->getReportObjectTypeId());
     eval('$managerInstance = ' . $ot->getHandlerClass() . "::instance();");
     $externalCols = $managerInstance->getExternalColumns();
     $filename = str_replace(' ', '_', $report->getObjectName()) . date('_YmdHis');
     $pageLayout = $_POST['pdfPageLayout'];
     $fontSize = $_POST['pdfFontSize'];
     include_once LIBRARY_PATH . '/pdf/fpdf.php';
     $pdf = new FPDF($pageLayout);
     $pdf->setTitle($report->getObjectName());
     $pdf->AddPage();
     $pdf->SetFont('Arial', '', $fontSize);
     $pdf->Cell(80);
     $report_title = iconv(mb_internal_encoding(), "ISO-8859-1", html_entity_decode($report->getObjectName(), ENT_COMPAT));
     $pdf->Cell(30, 10, $report_title);
     $pdf->Ln(20);
     $colSizes = array();
     $maxValue = array();
     $fixed_col_sizes = array();
     foreach ($results['rows'] as $row) {
         $i = 0;
         array_shift($row);
         foreach ($row as $k => $value) {
             if (!isset($maxValue[$i])) {
                 $maxValue[$i] = '';
             }
             if (strlen(strip_tags($value)) > strlen($maxValue[$i])) {
                 $maxValue[$i] = strip_tags($value);
             }
             $i++;
         }
     }
     $k = 0;
     foreach ($maxValue as $str) {
         $col_title_len = $pdf->GetStringWidth($results['columns'][$k]);
         $colMaxTextSize = max($pdf->GetStringWidth($str), $col_title_len);
         $db_col = $results['columns'][$k];
         $colType = array_var($types, array_var($results['db_columns'], $db_col, ''), '');
         if ($colType == DATA_TYPE_DATETIME && !($report->getObjectTypeName() == 'event' && $results['db_columns'][$db_col] == 'start')) {
             $colMaxTextSize = $colMaxTextSize / 2;
             if ($colMaxTextSize < $col_title_len) {
                 $colMaxTextSize = $col_title_len;
             }
         }
         $fixed_col_sizes[$k] = $colMaxTextSize;
         $k++;
     }
     $fixed_col_sizes = self::fix_column_widths($pageLayout == 'P' ? 172 : 260, $fixed_col_sizes);
     $max_char_len = array();
     $i = 0;
     foreach ($results['columns'] as $col) {
         $colMaxTextSize = $fixed_col_sizes[$i];
         $colFontSize = $colMaxTextSize + 5;
         $colSizes[$i] = $colFontSize;
         $col_name = iconv(mb_internal_encoding(), "ISO-8859-1", html_entity_decode($col, ENT_COMPAT));
         $pdf->Cell($colFontSize, 7, $col_name);
         $max_char_len[$i] = self::get_max_length_from_pdfsize($pdf, $colFontSize);
         $i++;
     }
     $lastColX = $pdf->GetX();
     $pdf->Ln();
     $pdf->Line($pdf->GetX(), $pdf->GetY(), $lastColX, $pdf->GetY());
     foreach ($results['rows'] as $row) {
         $i = 0;
         $more_lines = array();
         $col_offsets = array();
         foreach ($row as $k => $value) {
             if ($k == 'object_type_id') {
                 continue;
             }
             $db_col = isset($results['db_columns'][$results['columns'][$i]]) ? $results['db_columns'][$results['columns'][$i]] : '';
             $cell = format_value_to_print($db_col, html_to_text($value), $k == 'link' ? '' : array_var($types, $k), array_var($row, 'object_type_id'), '', is_numeric(array_var($results['db_columns'], $k)) ? "Y-m-d" : user_config_option('date_format'));
             $cell = iconv(mb_internal_encoding(), "ISO-8859-1", html_entity_decode($cell, ENT_COMPAT));
             $splitted = self::split_column_value($cell, $max_char_len[$i]);
             $cell = $splitted[0];
             if (count($splitted) > 1) {
                 array_shift($splitted);
                 $ml = 0;
                 foreach ($splitted as $sp_val) {
                     if (!isset($more_lines[$ml]) || !is_array($more_lines[$ml])) {
                         $more_lines[$ml] = array();
                     }
                     $more_lines[$ml][$i] = $sp_val;
                     $ml++;
                 }
                 $col_offsets[$i] = $pdf->x;
             }
             $pdf->Cell($colSizes[$i], 7, $cell);
             $i++;
         }
         foreach ($more_lines as $ml_values) {
             $pdf->Ln();
             foreach ($ml_values as $col_idx => $col_val) {
                 $pdf->SetX($col_offsets[$col_idx]);
                 $pdf->Cell($colSizes[$col_idx], 7, $col_val);
             }
         }
//.........这里部分代码省略.........
开发者ID:rorteg,项目名称:fengoffice,代码行数:101,代码来源:ReportingController.class.php


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