i want to change last 2 :
$header6->populateFromArray(array(
'name' => 'Sub Unit',
'width' => '15%',
'isSortable' => true,
'sortField' => 'SubDivision',
'elementType' => 'label',
'textAlignmentStyle' => 'left',
'elementProperty' => array('getter' => 'getSubDivision')
));
$header7->populateFromArray(array(
'name' => 'Supervisor',
'width' => '25%',
'isSortable' => true,
'sortField' => 'supervisor',
'elementType' => 'label',
'textAlignmentStyle' => 'left',
'elementProperty' => array('getter' => 'getSupervisorNames')
to getStartDate and getEndDate contract .. I tried in every way but with error .. what i need to edit to get the result ?
with 'elementProperty' => array('getter' => 'getStartDate ') not working ..
Thanks
How i can edit in fields on employee list [SOLVED]
Re: How i can edit in fields on employee list [SOLVED]
Hi
You may need to modify symfony/lib/model/doctrine/orangehrmPimPlugin/Employee.class.php and add whatever your method to get dates.
If you want to call deep attribute of an entity call like this (this is only example)
if you are getting array of elements you may need to prepare as string,
find the example at symfony/lib/model/doctrine/orangehrmPimPlugin/Employee.class.php method getSupervisorNames
You may need to modify symfony/lib/model/doctrine/orangehrmPimPlugin/Employee.class.php and add whatever your method to get dates.
If you want to call deep attribute of an entity call like this (this is only example)
Code: Select all
with 'elementProperty' => array('getter' => array('getContract', 'getStartDate '))
find the example at symfony/lib/model/doctrine/orangehrmPimPlugin/Employee.class.php method getSupervisorNames
Re: How i can edit in fields on employee list [SOLVED]
i solved with this code:
public function getLastContractStartDate() {
if($this->getEmpNumber() != "") {
$contracts = $this->getEmployeeService()->getEmployee($this->getEmpNumber())->getContracts();
return str_replace('00:00:00','',$contracts[count($contracts) -1]->getStartDate());
}
return '';
}
public function getLastContractEndDate() {
if($this->getEmpNumber() != "") {
$contracts = $this->getEmployeeService()->getEmployee($this->getEmpNumber())->getContracts();
return str_replace('00:00:00','',$contracts[count($contracts) -1]->getEndDate());
}
return '';
}
}
but now i want to change date : yyyy-mm-dd to dd-mm-yyyy .. with default settings not work..
public function getLastContractStartDate() {
if($this->getEmpNumber() != "") {
$contracts = $this->getEmployeeService()->getEmployee($this->getEmpNumber())->getContracts();
return str_replace('00:00:00','',$contracts[count($contracts) -1]->getStartDate());
}
return '';
}
public function getLastContractEndDate() {
if($this->getEmpNumber() != "") {
$contracts = $this->getEmployeeService()->getEmployee($this->getEmpNumber())->getContracts();
return str_replace('00:00:00','',$contracts[count($contracts) -1]->getEndDate());
}
return '';
}
}
but now i want to change date : yyyy-mm-dd to dd-mm-yyyy .. with default settings not work..