本文整理汇总了PHP中TTDate::getReportDates方法的典型用法代码示例。如果您正苦于以下问题:PHP TTDate::getReportDates方法的具体用法?PHP TTDate::getReportDates怎么用?PHP TTDate::getReportDates使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TTDate
的用法示例。
在下文中一共展示了TTDate::getReportDates方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _preProcess
function _preProcess()
{
$this->getProgressBarObject()->start($this->getAMFMessageID(), count($this->tmp_data['pay_stub_entry']), NULL, TTi18n::getText('Pre-Processing Data...'));
//Merge time data with user data
$key = 0;
if (isset($this->tmp_data['pay_stub_entry'])) {
foreach ($this->tmp_data['pay_stub_entry'] as $user_id => $row) {
if (isset($this->tmp_data['user'][$user_id])) {
$date_columns = TTDate::getReportDates(NULL, $row['date_stamp'], FALSE, $this->getUserObject(), array('pay_period_start_date' => $row['pay_period_start_date'], 'pay_period_end_date' => $row['pay_period_end_date'], 'pay_period_transaction_date' => $row['pay_period_transaction_date']));
$processed_data = array('user_id' => $user_id);
$this->data[] = array_merge($this->tmp_data['user'][$user_id], $row, $date_columns, $processed_data);
$this->getProgressBarObject()->set($this->getAMFMessageID(), $key);
$key++;
}
}
unset($this->tmp_data, $row, $date_columns, $processed_data, $level_1, $level_2, $level_3);
}
//Debug::Arr($this->data, 'preProcess Data: ', __FILE__, __LINE__, __METHOD__,10);
$this->form_data = $this->data;
//Copy data to Form Data so group/sort doesn't affect it.
return TRUE;
}
示例2: _preProcess
function _preProcess()
{
$this->getProgressBarObject()->start($this->getAMFMessageID(), count($this->tmp_data['user']), NULL, TTi18n::getText('Pre-Processing Data...'));
$key = 0;
if (isset($this->tmp_data['user'])) {
foreach ($this->tmp_data['user'] as $user_id => $row) {
if (isset($row['hire_date'])) {
$hire_date_columns = TTDate::getReportDates('hire', TTDate::parseDateTime($row['hire_date']), FALSE, $this->getUserObject());
} else {
$hire_date_columns = array();
}
if (isset($row['termination_date'])) {
$termination_date_columns = TTDate::getReportDates('termination', TTDate::parseDateTime($row['termination_date']), FALSE, $this->getUserObject());
} else {
$termination_date_columns = array();
}
if (isset($row['birth_date'])) {
$birth_date_columns = TTDate::getReportDates('birth', TTDate::parseDateTime($row['birth_date']), FALSE, $this->getUserObject());
} else {
$birth_date_columns = array();
}
if (isset($row['created_date'])) {
$created_date_columns = TTDate::getReportDates('created', TTDate::parseDateTime($row['created_date']), FALSE, $this->getUserObject());
} else {
$created_date_columns = array();
}
if (isset($row['updated_date'])) {
$updated_date_columns = TTDate::getReportDates('updated', TTDate::parseDateTime($row['updated_date']), FALSE, $this->getUserObject());
} else {
$updated_date_columns = array();
}
$processed_data = array();
if (isset($this->tmp_data['user_preference'][$user_id])) {
$processed_data = array_merge($processed_data, $this->tmp_data['user_preference'][$user_id]);
}
if (isset($this->tmp_data['user_bank'][$user_id])) {
$processed_data = array_merge($processed_data, $this->tmp_data['user_bank'][$user_id]);
}
if (isset($this->tmp_data['user_wage'][$user_id])) {
$processed_data = array_merge($processed_data, $this->tmp_data['user_wage'][$user_id]);
}
$this->data[] = array_merge($row, $hire_date_columns, $termination_date_columns, $birth_date_columns, $created_date_columns, $updated_date_columns, $processed_data);
$this->getProgressBarObject()->set($this->getAMFMessageID(), $key);
$key++;
}
unset($this->tmp_data, $row, $date_columns, $user_id, $hire_date_columns, $termination_date_columns, $birth_date_columns, $processed_data);
}
//Debug::Arr($this->data, 'preProcess Data: ', __FILE__, __LINE__, __METHOD__,10);
return TRUE;
}
示例3: _preProcess
function _preProcess()
{
$this->getProgressBarObject()->start($this->getAMFMessageID(), count($this->tmp_data['roe']), NULL, TTi18n::getText('Pre-Processing Data...'));
//Merge time data with user data
$key = 0;
if (isset($this->tmp_data['roe'])) {
foreach ($this->tmp_data['roe'] as $user_id => $row) {
$process_data = array();
if (isset($row['first_date'])) {
$first_date_columns = TTDate::getReportDates('first', TTDate::parseDateTime($row['first_date']), FALSE, $this->getUserObject());
} else {
$first_date_columns = array();
}
if (isset($row['last_date'])) {
$last_date_columns = TTDate::getReportDates('last', TTDate::parseDateTime($row['last_date']), FALSE, $this->getUserObject());
} else {
$last_date_columns = array();
}
if (isset($row['pay_period_end_date'])) {
$pay_period_end_date_columns = TTDate::getReportDates('pay_period_end', TTDate::parseDateTime($row['pay_period_end_date']), FALSE, $this->getUserObject());
} else {
$pay_period_end_date_columns = array();
}
if (isset($row['recall_date'])) {
$recall_date_columns = TTDate::getReportDates('recall', TTDate::parseDateTime($row['recall_date']), FALSE, $this->getUserObject());
} else {
$recall_date_columns = array();
}
if (isset($this->tmp_data['user'][$user_id])) {
if (is_array($this->tmp_data['user'][$user_id])) {
$process_data = array_merge($process_data, $this->tmp_data['user'][$user_id]);
}
if (is_array($row)) {
$process_data = array_merge($process_data, $row);
}
$this->data[] = array_merge($process_data, $first_date_columns, $last_date_columns, $pay_period_end_date_columns, $recall_date_columns);
$this->getProgressBarObject()->set($this->getAMFMessageID(), $key);
$key++;
}
}
unset($this->tmp_data, $row, $first_date_columns, $last_date_columns, $pay_period_end_date_columns, $recall_date_columns, $process_data);
}
//Debug::Arr($this->data, 'preProcess Data: ', __FILE__, __LINE__, __METHOD__,10);
$this->form_data = $this->data;
//Copy data to Form Data so group/sort doesn't affect it.
return TRUE;
}
示例4: _preProcess
function _preProcess()
{
$this->getProgressBarObject()->start($this->getAMFMessageID(), count($this->tmp_data['exception']), NULL, TTi18n::getText('Pre-Processing Data...'));
if (isset($this->tmp_data['user'])) {
$key = 0;
if (isset($this->tmp_data['exception'])) {
foreach ($this->tmp_data['exception'] as $user_id => $level_1) {
foreach ($level_1 as $id => $level_2) {
$date_columns = TTDate::getReportDates(NULL, TTDate::parseDateTime($level_2['date_stamp']), FALSE, $this->getUserObject(), array('pay_period_start_date' => strtotime($level_2['pay_period_start_date']), 'pay_period_end_date' => strtotime($level_2['pay_period_end_date']), 'pay_period_transaction_date' => strtotime($level_2['pay_period_transaction_date'])));
if (isset($this->tmp_data['user'][$user_id])) {
$this->data[] = array_merge($level_2, $this->tmp_data['user'][$user_id], $date_columns);
}
$this->getProgressBarObject()->set($this->getAMFMessageID(), $key);
$key++;
}
}
}
unset($this->tmp_data, $level_1);
}
//Debug::Arr($this->data, 'preProcess Data: ', __FILE__, __LINE__, __METHOD__,10);
return TRUE;
}
示例5: _preProcess
function _preProcess()
{
$this->getProgressBarObject()->start($this->getAMFMessageID(), count($this->tmp_data['user_date_total']), NULL, TTi18n::getText('Pre-Processing Data...'));
//Merge time data with user data
$key = 0;
if (isset($this->tmp_data['user_date_total'])) {
foreach ($this->tmp_data['user_date_total'] as $user_id => $level_1) {
if (isset($this->tmp_data['user'][$user_id])) {
foreach ($level_1 as $date_stamp => $level_2) {
foreach ($level_2 as $branch => $level_3) {
foreach ($level_3 as $department => $row) {
$date_columns = TTDate::getReportDates(NULL, $date_stamp, FALSE, $this->getUserObject(), array('pay_period_start_date' => $row['pay_period_start_date'], 'pay_period_end_date' => $row['pay_period_end_date'], 'pay_period_transaction_date' => $row['pay_period_transaction_date']));
$processed_data = array();
if (isset($this->tmp_data['verified_timesheet'][$user_id][$row['pay_period_id']])) {
$processed_data['verified_time_sheet'] = $this->tmp_data['verified_timesheet'][$user_id][$row['pay_period_id']]['status'];
$processed_data['verified_time_sheet_date'] = $this->tmp_data['verified_timesheet'][$user_id][$row['pay_period_id']]['created_date'];
} else {
$processed_data['verified_time_sheet'] = TTi18n::getText('No');
$processed_data['verified_time_sheet_date'] = FALSE;
}
if (!isset($row['worked_time'])) {
$row['worked_time'] = 0;
}
if (isset($this->tmp_data['schedule'][$user_id][$date_stamp]['schedule_working'])) {
$processed_data['schedule_working'] = $this->tmp_data['schedule'][$user_id][$date_stamp]['schedule_working'];
$processed_data['schedule_working_diff'] = $row['worked_time'] - $this->tmp_data['schedule'][$user_id][$date_stamp]['schedule_working'];
unset($this->tmp_data['schedule'][$user_id][$date_stamp]['schedule_working']);
} else {
$processed_data['schedule_working'] = 0;
$processed_data['schedule_working_diff'] = $row['worked_time'];
}
if (isset($this->tmp_data['schedule'][$user_id][$date_stamp]['schedule_absent'])) {
$processed_data['schedule_absent'] = $this->tmp_data['schedule'][$user_id][$date_stamp]['schedule_absent'];
unset($this->tmp_data['schedule'][$user_id][$date_stamp]['schedule_absent']);
} else {
$processed_data['schedule_absent'] = 0;
}
if (isset($this->tmp_data['user'][$user_id]['default_branch_id']) and isset($this->tmp_data['default_branch'][$this->tmp_data['user'][$user_id]['default_branch_id']])) {
$tmp_default_branch = $this->tmp_data['default_branch'][$this->tmp_data['user'][$user_id]['default_branch_id']];
} else {
$tmp_default_branch = array();
}
if (isset($this->tmp_data['user'][$user_id]['default_department_id']) and isset($this->tmp_data['default_department'][$this->tmp_data['user'][$user_id]['default_department_id']])) {
$tmp_default_department = $this->tmp_data['default_department'][$this->tmp_data['user'][$user_id]['default_department_id']];
} else {
$tmp_default_department = array();
}
if (isset($this->tmp_data['branch'][$row['branch_id']])) {
$tmp_branch = $this->tmp_data['branch'][$row['branch_id']];
} else {
$tmp_branch = array();
}
if (isset($this->tmp_data['department'][$row['department_id']])) {
$tmp_department = $this->tmp_data['department'][$row['department_id']];
} else {
$tmp_department = array();
}
$this->data[] = array_merge($this->tmp_data['user'][$user_id], $tmp_default_branch, $tmp_default_department, $tmp_branch, $tmp_department, $row, $date_columns, $processed_data);
$this->getProgressBarObject()->set($this->getAMFMessageID(), $key);
$key++;
}
}
}
}
}
unset($this->tmp_data, $row, $date_columns, $processed_data, $level_1, $level_2, $level_3);
}
//Debug::Arr($this->data, 'preProcess Data: ', __FILE__, __LINE__, __METHOD__,10);
return TRUE;
}
示例6: _preProcess
function _preProcess()
{
$this->getProgressBarObject()->start($this->getAMFMessageID(), count($this->tmp_data['pay_stub_entry']), NULL, TTi18n::getText('Pre-Processing Data...'));
//Merge time data with user data
$key = 0;
if (isset($this->tmp_data['pay_stub_entry'])) {
foreach ($this->tmp_data['pay_stub_entry'] as $user_id => $level_1) {
if (isset($this->tmp_data['user'][$user_id])) {
foreach ($level_1 as $date_stamp => $row) {
$date_columns = TTDate::getReportDates('transaction', $date_stamp, FALSE, $this->getUserObject(), array('pay_period_start_date' => $row['pay_period_start_date'], 'pay_period_end_date' => $row['pay_period_end_date'], 'pay_period_transaction_date' => $row['pay_period_transaction_date']));
$processed_data = array();
//Need to make sure PSEA IDs are strings not numeric otherwise array_merge will re-key them.
$this->data[] = array_merge($this->tmp_data['user'][$user_id], $row, $date_columns, $processed_data);
$this->getProgressBarObject()->set($this->getAMFMessageID(), $key);
$key++;
}
}
}
unset($this->tmp_data, $row, $date_columns, $processed_data, $level_1);
}
//Debug::Arr($this->data, 'preProcess Data: ', __FILE__, __LINE__, __METHOD__,10);
return TRUE;
}
示例7: columnFormatter
function columnFormatter($type, $column, $value, $format = NULL)
{
if (is_array($value) and isset($value['display'])) {
//Found sorting array, use display column.
return $value['display'];
} else {
$retval = $value;
if ($format == 'csv' or $format == 'raw') {
//Force specific field formats for exporting to CSV format.
switch ($type) {
case 'report_date':
$column = strpos($column, 'custom_column') === FALSE ? $column : $column . '-' . 'date_stamp';
$retval = TTDate::getReportDates($column, $value, TRUE, $this->getUserObject());
break;
case 'currency':
case 'percent':
case 'numeric':
//Don't format above types.
break;
case 'time_unit':
$retval = TTDate::getHours($value);
//Force to hours always.
break;
case 'date_stamp':
$retval = TTDate::getDate('DATE', $value);
break;
case 'time':
$retval = TTDate::getDate('TIME', $value);
break;
case 'time_stamp':
$retval = TTDate::getDate('DATE+TIME', $value);
break;
case 'boolean':
if ($value == TRUE) {
$retval = TTi18n::getText('Yes');
} else {
$retval = TTi18n::getText('No');
}
default:
break;
}
} elseif ($format == 'xml') {
//Use standard XML formats whenever possible.
switch ($type) {
case 'report_date':
$column = strpos($column, 'custom_column') === FALSE ? $column : $column . '-' . 'date_stamp';
$retval = TTDate::getReportDates($column, $value, TRUE, $this->getUserObject());
break;
case 'currency':
case 'percent':
case 'numeric':
//Don't format above types.
break;
case 'time_unit':
$retval = TTDate::getHours($value);
//Force to hours always.
break;
case 'date_stamp':
$retval = date('Y-m-d', $value);
////type="xs:date"
break;
case 'time':
$retval = date('H:i:s', $value);
//type="xs:time"
break;
case 'time_stamp':
$retval = date('c', $value);
//type="xs:dateTime"
break;
case 'boolean':
if ($value == TRUE) {
$retval = TTi18n::getText('Yes');
} else {
$retval = TTi18n::getText('No');
}
default:
break;
}
} else {
switch ($type) {
case 'report_date':
$column = strpos($column, 'custom_column') === FALSE ? $column : $column . '-' . 'date_stamp';
$retval = TTDate::getReportDates($column, $value, TRUE, $this->getUserObject());
break;
case 'currency':
if (is_object($this->getCurrencyObject())) {
//Set MIN decimals to 2 and max to the currency rounding.
$retval = $this->getCurrencyObject()->getSymbol() . TTi18n::formatNumber($value, TRUE, 2, $this->getCurrencyObject()->getRoundDecimalPlaces());
} else {
$retval = TTi18n::formatCurrency($value);
}
break;
case 'percent':
$retval = TTi18n::formatNumber($value, TRUE) . '%';
break;
case 'numeric':
$retval = TTi18n::formatNumber($value, TRUE);
break;
case 'time_unit':
$retval = TTDate::getTimeUnit($value);
//.........这里部分代码省略.........
示例8: _preProcess
function _preProcess()
{
$this->getProgressBarObject()->start($this->getAMFMessageID(), count($this->tmp_data['pay_stub_entry']), NULL, TTi18n::getText('Pre-Processing Data...'));
$blf = TTnew('BranchListFactory');
$branch_options = $blf->getByCompanyIdArray($this->getUserObject()->getCompany());
//Get Branch ID to Branch Code mapping
$branch_code_map = array(0 => 0);
$blf->getByCompanyId($this->getUserObject()->getCompany());
if ($blf->getRecordCount() > 0) {
foreach ($blf as $b_obj) {
$branch_code_map[$b_obj->getId()] = $b_obj;
}
}
$dlf = TTnew('DepartmentListFactory');
$department_options = $dlf->getByCompanyIdArray($this->getUserObject()->getCompany());
//Get Department ID to Branch Code mapping
$department_code_map = array(0 => 0);
$dlf->getByCompanyId($this->getUserObject()->getCompany());
if ($dlf->getRecordCount() > 0) {
foreach ($dlf as $d_obj) {
$department_code_map[$d_obj->getId()] = $d_obj;
}
}
$utlf = TTnew('UserTitleListFactory');
$title_options = $utlf->getByCompanyIdArray($this->getUserObject()->getCompany());
if (getTTProductEdition() >= TT_PRODUCT_CORPORATE) {
$jlf = TTnew('JobListFactory');
$job_options = $jlf->getByCompanyIdArray($this->getUserObject()->getCompany());
//Get Job ID to Job Code mapping
$job_code_map = array(0 => 0);
$jlf->getByCompanyId($this->getUserObject()->getCompany());
if ($jlf->getRecordCount() > 0) {
foreach ($jlf as $j_obj) {
$job_code_map[$j_obj->getId()] = $j_obj;
}
}
$jilf = TTnew('JobItemListFactory');
$job_item_options = $jlf->getByCompanyIdArray($this->getUserObject()->getCompany());
//Get Job ID to Job Code mapping
$job_item_code_map = array(0 => 0);
$jilf->getByCompanyId($this->getUserObject()->getCompany());
if ($jilf->getRecordCount() > 0) {
foreach ($jilf as $ji_obj) {
$job_item_code_map[$ji_obj->getId()] = $ji_obj;
}
}
} else {
$job_code_map = array();
$job_item_code_map = array();
}
//Merge time data with user data
$key = 0;
if (isset($this->tmp_data['pay_stub_entry'])) {
foreach ($this->tmp_data['pay_stub_entry'] as $user_id => $level_1) {
if (isset($this->tmp_data['user'][$user_id])) {
//foreach( $level_1 as $date_stamp => $row ) {
foreach ($level_1 as $date_stamp => $row) {
$replace_arr = array(is_object($branch_code_map[(int) $this->tmp_data['user'][$user_id]['default_branch_id']]) ? $branch_code_map[(int) $this->tmp_data['user'][$user_id]['default_branch_id']]->getManualID() : NULL, is_object($branch_code_map[(int) $this->tmp_data['user'][$user_id]['default_branch_id']]) ? $branch_code_map[(int) $this->tmp_data['user'][$user_id]['default_branch_id']]->getOtherID1() : NULL, is_object($branch_code_map[(int) $this->tmp_data['user'][$user_id]['default_branch_id']]) ? $branch_code_map[(int) $this->tmp_data['user'][$user_id]['default_branch_id']]->getOtherID2() : NULL, is_object($branch_code_map[(int) $this->tmp_data['user'][$user_id]['default_branch_id']]) ? $branch_code_map[(int) $this->tmp_data['user'][$user_id]['default_branch_id']]->getOtherID3() : NULL, is_object($branch_code_map[(int) $this->tmp_data['user'][$user_id]['default_branch_id']]) ? $branch_code_map[(int) $this->tmp_data['user'][$user_id]['default_branch_id']]->getOtherID4() : NULL, is_object($branch_code_map[(int) $this->tmp_data['user'][$user_id]['default_branch_id']]) ? $branch_code_map[(int) $this->tmp_data['user'][$user_id]['default_branch_id']]->getOtherID5() : NULL, is_object($department_code_map[(int) $this->tmp_data['user'][$user_id]['default_department_id']]) ? $department_code_map[(int) $this->tmp_data['user'][$user_id]['default_department_id']]->getManualID() : NULL, is_object($department_code_map[(int) $this->tmp_data['user'][$user_id]['default_department_id']]) ? $department_code_map[(int) $this->tmp_data['user'][$user_id]['default_department_id']]->getOtherID1() : NULL, is_object($department_code_map[(int) $this->tmp_data['user'][$user_id]['default_department_id']]) ? $department_code_map[(int) $this->tmp_data['user'][$user_id]['default_department_id']]->getOtherID2() : NULL, is_object($department_code_map[(int) $this->tmp_data['user'][$user_id]['default_department_id']]) ? $department_code_map[(int) $this->tmp_data['user'][$user_id]['default_department_id']]->getOtherID3() : NULL, is_object($department_code_map[(int) $this->tmp_data['user'][$user_id]['default_department_id']]) ? $department_code_map[(int) $this->tmp_data['user'][$user_id]['default_department_id']]->getOtherID4() : NULL, is_object($department_code_map[(int) $this->tmp_data['user'][$user_id]['default_department_id']]) ? $department_code_map[(int) $this->tmp_data['user'][$user_id]['default_department_id']]->getOtherID5() : NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, isset($this->tmp_data['user'][$user_id]['employee_number']) ? $this->tmp_data['user'][$user_id]['employee_number'] : NULL, isset($this->tmp_data['user'][$user_id]['other_id1']) ? $this->tmp_data['user'][$user_id]['other_id1'] : NULL, isset($this->tmp_data['user'][$user_id]['other_id2']) ? $this->tmp_data['user'][$user_id]['other_id2'] : NULL, isset($this->tmp_data['user'][$user_id]['other_id3']) ? $this->tmp_data['user'][$user_id]['other_id3'] : NULL, isset($this->tmp_data['user'][$user_id]['other_id4']) ? $this->tmp_data['user'][$user_id]['other_id4'] : NULL, isset($this->tmp_data['user'][$user_id]['other_id5']) ? $this->tmp_data['user'][$user_id]['other_id5'] : NULL);
$date_columns = TTDate::getReportDates('transaction', $date_stamp, FALSE, $this->getUserObject(), array('pay_period_start_date' => $row['pay_period_start_date'], 'pay_period_end_date' => $row['pay_period_end_date'], 'pay_period_transaction_date' => $row['pay_period_transaction_date']));
$processed_data = array();
if (isset($row['psen_ids']) and is_array($row['psen_ids'])) {
$psen_ids = $row['psen_ids'];
unset($row['psen_ids']);
foreach ($psen_ids as $psen_data) {
if ($this->enable_time_based_distribution == TRUE) {
$expanded_gl_rows = $this->expandGLAccountRows($psen_data, $this->tmp_data['pay_period_distribution'][$user_id][$row['pay_period_id']], $branch_code_map, $department_code_map, $job_code_map, $job_item_code_map, $replace_arr);
foreach ($expanded_gl_rows as $gl_row) {
$this->data[] = array_merge($this->tmp_data['user'][$user_id], $row, $date_columns, $processed_data, $gl_row);
}
unset($expanded_gl_rows, $psen_data);
} else {
$psen_data['account'] = $this->replaceGLAccountVariables($psen_data['account'], $replace_arr);
//Need to make sure PSEA IDs are strings not numeric otherwise array_merge will re-key them.
$this->data[] = array_merge($this->tmp_data['user'][$user_id], $row, $date_columns, $processed_data, $psen_data);
}
}
unset($psen_ids, $psen_id, $psen_amount);
}
$this->getProgressBarObject()->set($this->getAMFMessageID(), $key);
$key++;
}
}
}
unset($this->tmp_data, $row, $date_columns, $processed_data, $level_1);
}
$this->form_data = $this->data;
//Used for exporting.
//Debug::Arr($this->data, 'preProcess Data: ', __FILE__, __LINE__, __METHOD__,10);
return TRUE;
}
示例9: _preProcess
function _preProcess($format)
{
$this->getProgressBarObject()->start($this->getAMFMessageID(), count($this->tmp_data['user_date_total']), NULL, TTi18n::getText('Pre-Processing Data...'));
//Merge time data with user data
$key = 0;
if (isset($this->tmp_data['user_date_total'])) {
foreach ($this->tmp_data['user_date_total'] as $user_id => $level_1) {
if (isset($this->tmp_data['user'][$user_id])) {
foreach ($level_1 as $date_stamp => $level_2) {
foreach ($level_2 as $branch => $level_3) {
foreach ($level_3 as $department => $row) {
$date_columns = TTDate::getReportDates(NULL, $date_stamp, FALSE, $this->getUserObject(), array('pay_period_start_date' => $row['pay_period_start_date'], 'pay_period_end_date' => $row['pay_period_end_date'], 'pay_period_transaction_date' => $row['pay_period_transaction_date']));
$processed_data = array();
if (isset($this->tmp_data['verified_timesheet'][$user_id][$row['pay_period_id']])) {
$processed_data['verified_time_sheet_user_verified'] = $this->tmp_data['verified_timesheet'][$user_id][$row['pay_period_id']]['user_verified'];
$processed_data['verified_time_sheet_user_verified_date'] = $this->tmp_data['verified_timesheet'][$user_id][$row['pay_period_id']]['user_verified_date'];
$processed_data['verified_time_sheet_status_id'] = $this->tmp_data['verified_timesheet'][$user_id][$row['pay_period_id']]['status_id'];
$processed_data['verified_time_sheet'] = $this->tmp_data['verified_timesheet'][$user_id][$row['pay_period_id']]['status'];
$processed_data['verified_time_sheet_date'] = $this->tmp_data['verified_timesheet'][$user_id][$row['pay_period_id']]['updated_date'];
} else {
$processed_data['verified_time_sheet_status_id'] = $processed_data['verified_time_sheet_user_verified'] = $processed_data['verified_time_sheet_user_verified_date'] = FALSE;
$processed_data['verified_time_sheet'] = TTi18n::getText('No');
$processed_data['verified_time_sheet_date'] = FALSE;
}
if (isset($this->tmp_data['pay_period'][$row['pay_period_id']])) {
$processed_data['start_week_day'] = $this->tmp_data['pay_period'][$row['pay_period_id']]['start_week_day'];
}
if (!isset($row['worked_time'])) {
$row['worked_time'] = 0;
}
if (isset($this->tmp_data['schedule'][$user_id][$date_stamp]['schedule_working'])) {
$processed_data['schedule_working'] = $this->tmp_data['schedule'][$user_id][$date_stamp]['schedule_working'];
$processed_data['schedule_working_diff'] = $row['worked_time'] - $this->tmp_data['schedule'][$user_id][$date_stamp]['schedule_working'];
//We can only include scheduled_time once per user/date combination. Otherwise its duplicates the amounts and makes it incorrect.
//So once its used unset it so it can't be used again.
unset($this->tmp_data['schedule'][$user_id][$date_stamp]['schedule_working']);
} else {
$processed_data['schedule_working'] = 0;
$processed_data['schedule_working_diff'] = $row['worked_time'];
}
if (isset($this->tmp_data['schedule'][$user_id][$date_stamp]['schedule_absent'])) {
$processed_data['schedule_absent'] = $this->tmp_data['schedule'][$user_id][$date_stamp]['schedule_absent'];
unset($this->tmp_data['schedule'][$user_id][$date_stamp]['schedule_absent']);
} else {
$processed_data['schedule_absent'] = 0;
}
if (strpos($format, 'pdf_') === FALSE) {
$this->data[] = array_merge($this->tmp_data['user'][$user_id], $row, $date_columns, $processed_data);
} else {
$this->form_data['user_date_total'][$user_id]['data'][$date_stamp] = array_merge($this->form_data['user_date_total'][$user_id]['data'][$date_stamp], $date_columns, $processed_data);
//$this->form_data[$user_id]['data'][] = array_merge( $row, $date_columns, $processed_data );
}
}
}
}
}
$this->getProgressBarObject()->set($this->getAMFMessageID(), $key);
$key++;
}
unset($this->tmp_data, $row, $date_columns, $processed_data, $level_1, $level_2, $level_3);
}
//Debug::Arr($this->data, 'preProcess Data: ', __FILE__, __LINE__, __METHOD__,10);
//Debug::Arr($this->form_data, 'Form Data: ', __FILE__, __LINE__, __METHOD__,10);
return TRUE;
}
示例10: _preProcess
function _preProcess()
{
$this->getProgressBarObject()->start($this->getAMFMessageID(), count($this->tmp_data['qualification']), NULL, TTi18n::getText('Pre-Processing Data...'));
if (isset($this->tmp_data['qualification'])) {
$key = 0;
foreach ($this->tmp_data['qualification'] as $qualification_id => $row) {
if (isset($this->tmp_data['user'])) {
foreach ($this->tmp_data['user'] as $user_id => $user) {
if (isset($user['user.hire_date'])) {
$hire_date_columns = TTDate::getReportDates('user.hire', TTDate::parseDateTime($user['user.hire_date']), FALSE, $this->getUserObject());
} else {
$hire_date_columns = array();
}
if (isset($user['user.termination_date'])) {
$termination_date_columns = TTDate::getReportDates('user.termination', TTDate::parseDateTime($user['user.termination_date']), FALSE, $this->getUserObject());
} else {
$termination_date_columns = array();
}
if (isset($user['user.birth_date'])) {
$birth_date_columns = TTDate::getReportDates('user.birth', TTDate::parseDateTime($user['user.birth_date']), FALSE, $this->getUserObject());
} else {
$birth_date_columns = array();
}
$processed_data = array();
if (isset($this->tmp_data['user_preference'][$user_id])) {
$processed_data = array_merge($processed_data, (array) $this->tmp_data['user_preference'][$user_id]);
}
if (isset($this->tmp_data['user_wage'][$user_id])) {
$processed_data = array_merge($processed_data, (array) $this->tmp_data['user_wage'][$user_id]);
}
if (isset($this->tmp_data['user_skill'][$qualification_id][$user_id])) {
foreach ($this->tmp_data['user_skill'][$qualification_id][$user_id] as $user_skill) {
if (isset($user_skill['user_skill.first_used_date'])) {
$user_skill['user_skill.first_used_date'] = array('sort' => TTDate::parseDateTime($user_skill['user_skill.first_used_date']), 'display' => $user_skill['user_skill.first_used_date']);
}
if (isset($user_skill['user_skill.last_used_date'])) {
$user_skill['user_skill.last_used_date'] = array('sort' => TTDate::parseDateTime($user_skill['user_skill.last_used_date']), 'display' => $user_skill['user_skill.last_used_date']);
}
$this->data[] = array_merge((array) $row, (array) $user, $hire_date_columns, $termination_date_columns, $birth_date_columns, $processed_data, (array) $user_skill);
}
}
if (isset($this->tmp_data['user_education'][$qualification_id][$user_id])) {
foreach ($this->tmp_data['user_education'][$qualification_id][$user_id] as $user_education) {
if (isset($user_education['user_education.start_date'])) {
$user_education['user_education.start_date'] = array('sort' => TTDate::parseDateTime($user_education['user_education.start_date']), 'display' => $user_education['user_education.start_date']);
}
if (isset($user_education['user_education.end_date'])) {
$user_education['user_education.end_date'] = array('sort' => TTDate::parseDateTime($user_education['user_education.end_date']), 'display' => $user_education['user_education.end_date']);
}
if (isset($user_education['user_education.graduate_date'])) {
$user_education['user_education.graduate_date'] = array('sort' => TTDate::parseDateTime($user_education['user_education.graduate_date']), 'display' => $user_education['user_education.graduate_date']);
}
$this->data[] = array_merge((array) $row, (array) $user, $hire_date_columns, $termination_date_columns, $birth_date_columns, $processed_data, (array) $user_education);
}
}
if (isset($this->tmp_data['user_license'][$qualification_id][$user_id])) {
foreach ($this->tmp_data['user_license'][$qualification_id][$user_id] as $user_license) {
if (isset($user_license['user_license.license_issued_date'])) {
$user_license['user_license.license_issued_date'] = array('sort' => TTDate::parseDateTime($user_license['user_license.license_issued_date']), 'display' => $user_license['user_license.license_issued_date']);
}
if (isset($user_license['user_license.license_expiry_date'])) {
$user_license['user_license.license_expiry_date'] = array('sort' => TTDate::parseDateTime($user_license['user_license.license_expiry_date']), 'display' => $user_license['user_license.license_expiry_date']);
}
$this->data[] = array_merge((array) $row, (array) $user, $hire_date_columns, $termination_date_columns, $birth_date_columns, $processed_data, (array) $user_license);
}
}
if (isset($this->tmp_data['user_language'][$qualification_id][$user_id])) {
foreach ($this->tmp_data['user_language'][$qualification_id][$user_id] as $user_language) {
$this->data[] = array_merge((array) $row, (array) $user, $hire_date_columns, $termination_date_columns, $birth_date_columns, $processed_data, (array) $user_language);
}
}
if (isset($this->tmp_data['user_membership'][$qualification_id][$user_id])) {
foreach ($this->tmp_data['user_membership'][$qualification_id][$user_id] as $user_membership) {
if (isset($user_membership['user_membership.start_date'])) {
$user_membership['user_membership.start_date'] = array('sort' => TTDate::parseDateTime($user_membership['user_membership.start_date']), 'display' => $user_membership['user_membership.start_date']);
}
if (isset($user_membership['user_membership.renewal_date'])) {
$user_membership['user_membership.renewal_date'] = array('sort' => TTDate::parseDateTime($user_membership['user_membership.renewal_date']), 'display' => $user_membership['user_membership.renewal_date']);
}
$this->data[] = array_merge((array) $row, (array) $user, $hire_date_columns, $termination_date_columns, $birth_date_columns, $processed_data, (array) $user_membership);
}
}
}
}
$this->getProgressBarObject()->set($this->getAMFMessageID(), $key);
$key++;
}
unset($this->tmp_data, $row, $date_columns, $hire_date_columns, $termination_date_columns, $birth_date_columns, $processed_data);
}
//Debug::Arr($this->data, 'preProcess Data: ', __FILE__, __LINE__, __METHOD__,10);
return TRUE;
}
示例11: _preProcess
function _preProcess()
{
$this->getProgressBarObject()->start($this->getAMFMessageID(), count($this->tmp_data['punch']), NULL, TTi18n::getText('Pre-Processing Data...'));
//Merge time data with user data
$key = 0;
if (isset($this->tmp_data['punch'])) {
foreach ($this->tmp_data['punch'] as $user_id => $level_1) {
if (isset($this->tmp_data['user'][$user_id])) {
foreach ($level_1 as $punch_control_id => $row) {
$date_columns = TTDate::getReportDates(NULL, $row['date_stamp'], FALSE, $this->getUserObject(), array('pay_period_start_date' => $row['pay_period_start_date'], 'pay_period_end_date' => $row['pay_period_end_date'], 'pay_period_transaction_date' => $row['pay_period_transaction_date']));
//$date_columns1 = TTDate::getReportDates( 'in_time_stamp', $row['in_time_stamp'], FALSE, $this->getUserObject() );
//$date_columns2 = TTDate::getReportDates( 'out_time_stamp', $row['out_time_stamp'], FALSE, $this->getUserObject() );
$processed_data = array();
if (isset($this->tmp_data['verified_timesheet'][$user_id][$row['pay_period_id']])) {
$processed_data['verified_time_sheet'] = $this->tmp_data['verified_timesheet'][$user_id][$row['pay_period_id']]['status'];
$processed_data['verified_time_sheet_date'] = $this->tmp_data['verified_timesheet'][$user_id][$row['pay_period_id']]['created_date'];
} else {
$processed_data['verified_time_sheet'] = TTi18n::getText('No');
$processed_data['verified_time_sheet_date'] = FALSE;
}
if (isset($this->tmp_data['verified_timesheet'][$user_id][$row['pay_period_id']]) and isset($row['in_updated_date']) and isset($row['out_updated_date']) and ($processed_data['verified_time_sheet_date'] < $row['in_updated_date'] or $processed_data['verified_time_sheet_date'] < $row['out_updated_date'])) {
$processed_data['verified_time_sheet_tainted'] = TRUE;
} else {
$processed_data['verified_time_sheet_tainted'] = FALSE;
}
$this->data[] = array_merge($this->tmp_data['user'][$user_id], $row, $date_columns, $processed_data);
$this->getProgressBarObject()->set($this->getAMFMessageID(), $key);
$key++;
}
}
}
unset($this->tmp_data, $row, $date_columns, $processed_data, $level_1);
}
//Debug::Arr($this->data, 'preProcess Data: ', __FILE__, __LINE__, __METHOD__,10);
return TRUE;
}
示例12: _preProcess
function _preProcess()
{
$this->getProgressBarObject()->start($this->getAMFMessageID(), count($this->tmp_data['user_review_control']), NULL, TTi18n::getText('Pre-Processing Data...'));
$key = 0;
if (isset($this->tmp_data['user_review_control'])) {
foreach ($this->tmp_data['user_review_control'] as $user_review_control_id => $level_1) {
foreach ($level_1 as $user_id => $user_review_control) {
$processed_data = array();
if (isset($user_review_control['user_review_control.start_date'])) {
$start_date_columns = TTDate::getReportDates('user_review_control.start', TTDate::parseDateTime($user_review_control['user_review_control.start_date']), FALSE, $this->getUserObject());
} else {
$start_date_columns = array();
}
if (isset($user_review_control['user_review_control.end_date'])) {
$end_date_columns = TTDate::getReportDates('user_review_control.end', TTDate::parseDateTime($user_review_control['user_review_control.end_date']), FALSE, $this->getUserObject());
} else {
$end_date_columns = array();
}
if (isset($user_review_control['user_review_control.due_date'])) {
$due_date_columns = TTDate::getReportDates('user_review_control.due', TTDate::parseDateTime($user_review_control['user_review_control.due_date']), FALSE, $this->getUserObject());
} else {
$due_date_columns = array();
}
if (isset($this->tmp_data['user'][$user_id]) and is_array($this->tmp_data['user'][$user_id])) {
$processed_data = array_merge($processed_data, $this->tmp_data['user'][$user_id]);
}
if (isset($this->tmp_data['user_review'][$user_review_control_id])) {
foreach ($this->tmp_data['user_review'][$user_review_control_id] as $kpi_id => $kpi) {
if (is_array($kpi)) {
$processed_data = array_merge($processed_data, $kpi);
}
if (is_array($user_review_control)) {
$processed_data = array_merge($processed_data, $user_review_control);
}
if (isset($this->tmp_data['kpi'][$kpi_id]) and is_array($this->tmp_data['kpi'][$kpi_id])) {
$processed_data = array_merge($processed_data, $this->tmp_data['kpi'][$kpi_id]);
}
$this->data[] = array_merge($start_date_columns, $end_date_columns, $due_date_columns, $processed_data);
}
}
}
$this->getProgressBarObject()->set($this->getAMFMessageID(), $key);
$key++;
}
unset($this->tmp_data, $kpi, $user_review_control, $start_date_columns, $end_date_columns, $due_date_columns, $processed_data);
}
Debug::Arr($this->data, 'preProcess Data: ', __FILE__, __LINE__, __METHOD__, 10);
return TRUE;
}
示例13: _preProcess
function _preProcess()
{
$this->getProgressBarObject()->start($this->getAMFMessageID(), count($this->tmp_data['accrual']), NULL, TTi18n::getText('Pre-Processing Data...'));
if (isset($this->tmp_data['user'])) {
$key = 0;
if (isset($this->tmp_data['accrual'])) {
foreach ($this->tmp_data['accrual'] as $user_id => $level_2) {
if (isset($this->tmp_data['user'][$user_id])) {
foreach ($level_2 as $accrual_policy_id => $rows) {
foreach ($rows as $row) {
if (isset($row['date_stamp'])) {
$date_columns = TTDate::getReportDates(NULL, TTDate::strtotime($row['date_stamp']), FALSE, $this->getUserObject());
} else {
$date_columns = array();
}
$this->data[] = array_merge($this->tmp_data['user'][$user_id], $row, $this->tmp_data['accrual'][$user_id][$accrual_policy_id], $date_columns);
}
}
}
$this->getProgressBarObject()->set($this->getAMFMessageID(), $key);
$key++;
}
}
unset($this->tmp_data, $row, $processed_data);
}
//Debug::Arr($this->data, 'preProcess Data: ', __FILE__, __LINE__, __METHOD__,10);
return TRUE;
}