PHP 클래스 Kimai_Export_ExcelExporter

저자: Florian Lentsch ([email protected])
상속: extends PHPExcel
파일 보기 프로젝트 열기: kimai/kimai 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$columns_dict array dictionary value: column name as in extensions/ki_export/templates/scripts/main.php key: true if active, else false
$customTimeformat string strftime format string for fields of type time
$exportData_arr array the data rows to be exported
$kga array Kimai Global Array

보호된 프로퍼티들

프로퍼티 타입 설명
$COLUMN_CONFIG array Column configuration: columns_dict> => [ 'fieldName' => exportData_arr - defaults to the same field name as in $this->columns> 'type' => 'langLabel' => kga['lang'] - defaults to the same as the field name in $this->columns> 'sum' => boolean - if true, sums will be generated for this field ]
$activeColumns_arr array contains names (as in $this->columns_dict) of active columns
$anySumsWereAdded boolean true, if there are any active columns with sums, else false
$dateFormat string excel format string for fields of type date
$sheet PHPExcel_Worksheet the first (and only) worksheet
$timeFormat string excel format string for fields of type time

공개 메소드들

메소드 설명
render ( array $kga, array $exportData_arr, array $columns_dict, string $customTimeformat ) generates an .xlsx file containing time sheets to be exported the file will be sent to the browser for download/viewing

보호된 메소드들

메소드 설명
addCellBorders ( ) add cell borders
doLayouting ( ) do layouting (cell borders, font styles, background colors, cell sizing, page setup)
excelAddr ( integer $x, integer $y ) : string get excel field address by supplying coordinates (e.g. '1/1' becomes 'B2')
excelColumnAddr ( integer $n ) : string get excel column letter by index (e.g. '2' becomes 'C') using this over PHPExcels built-in methods, because they are partly 1-based instead of 0-based
excelRange ( $x1, $y1, $x2, $y2 ) : string get excel field range by supplying coordinates
formatDataRowsByType ( ) cell formatting (number/text/date .
formatHeaders ( ) format the headers (additional cell borders, background color, alignment)
formatSums ( ) format the sums row if there are any sums (borders and background color)
initialize ( ) initial PHPExcel settings; build $this->activeColumns_arr
renderExcel ( ) renders the excel and sends it to the browser
writeDataRows ( ) write the data rows for all active columns
writeHeaders ( ) write the headers for all active columns
writeSums ( ) write sums for active columns only if configured in self::$COLUMN_CONFIG

메소드 상세

addCellBorders() 보호된 메소드

add cell borders
protected addCellBorders ( )

doLayouting() 보호된 메소드

do layouting (cell borders, font styles, background colors, cell sizing, page setup)
protected doLayouting ( )

excelAddr() 보호된 정적인 메소드

get excel field address by supplying coordinates (e.g. '1/1' becomes 'B2')
protected static excelAddr ( integer $x, integer $y ) : string
$x integer horizontal coordinate
$y integer vertical coordinate
리턴 string excel field address

excelColumnAddr() 보호된 정적인 메소드

get excel column letter by index (e.g. '2' becomes 'C') using this over PHPExcels built-in methods, because they are partly 1-based instead of 0-based
protected static excelColumnAddr ( integer $n ) : string
$n integer column index
리턴 string excel column letter

excelRange() 보호된 정적인 메소드

get excel field range by supplying coordinates
protected static excelRange ( $x1, $y1, $x2, $y2 ) : string
리턴 string excel field range

formatDataRowsByType() 보호된 메소드

..) as configured in self::$COLUMN_CONFIG
protected formatDataRowsByType ( )

formatHeaders() 보호된 메소드

format the headers (additional cell borders, background color, alignment)
protected formatHeaders ( )

formatSums() 보호된 메소드

format the sums row if there are any sums (borders and background color)
protected formatSums ( )

initialize() 보호된 메소드

initial PHPExcel settings; build $this->activeColumns_arr
protected initialize ( )

render() 공개 메소드

generates an .xlsx file containing time sheets to be exported the file will be sent to the browser for download/viewing
public render ( array $kga, array $exportData_arr, array $columns_dict, string $customTimeformat )
$kga array Kimai Global Array
$exportData_arr array the data rows to be exported
$columns_dict array dictionary of columns: column name => active (true/false)
$customTimeformat string strftime format string for fields of type time (for dates $this->kga['conf']['date_format_1'] will be used)

renderExcel() 보호된 메소드

renders the excel and sends it to the browser
protected renderExcel ( )

writeDataRows() 보호된 메소드

write the data rows for all active columns
protected writeDataRows ( )

writeHeaders() 보호된 메소드

write the headers for all active columns
protected writeHeaders ( )

writeSums() 보호된 메소드

write sums for active columns only if configured in self::$COLUMN_CONFIG
protected writeSums ( )

프로퍼티 상세

$COLUMN_CONFIG 보호되어 있는 정적으로 프로퍼티

Column configuration: columns_dict> => [ 'fieldName' => exportData_arr - defaults to the same field name as in $this->columns> 'type' => 'langLabel' => kga['lang'] - defaults to the same as the field name in $this->columns> 'sum' => boolean - if true, sums will be generated for this field ]
protected static array $COLUMN_CONFIG
리턴 array

$activeColumns_arr 보호되어 있는 프로퍼티

contains names (as in $this->columns_dict) of active columns
protected array $activeColumns_arr
리턴 array

$anySumsWereAdded 보호되어 있는 프로퍼티

true, if there are any active columns with sums, else false
protected bool $anySumsWereAdded
리턴 boolean

$columns_dict 공개적으로 프로퍼티

dictionary value: column name as in extensions/ki_export/templates/scripts/main.php key: true if active, else false
public array $columns_dict
리턴 array

$customTimeformat 공개적으로 프로퍼티

strftime format string for fields of type time
public string $customTimeformat
리턴 string

$dateFormat 보호되어 있는 프로퍼티

excel format string for fields of type date
protected string $dateFormat
리턴 string

$exportData_arr 공개적으로 프로퍼티

the data rows to be exported
public array $exportData_arr
리턴 array

$kga 공개적으로 프로퍼티

Kimai Global Array
public array $kga
리턴 array

$sheet 보호되어 있는 프로퍼티

the first (and only) worksheet
protected PHPExcel_Worksheet $sheet
리턴 PHPExcel_Worksheet

$timeFormat 보호되어 있는 프로퍼티

excel format string for fields of type time
protected string $timeFormat
리턴 string