While trying to add a new time clock, I receive the following error...
Incorrect Input!
1. Incorrect work code field lengths, they must all add up to 9.
The Work Code Field Lengths: Branch and Department have the value of 1. I tried various values with no success.
Also occurs when trying to edit an existing time clock.
System: Ubuntu 8.04 LTS
Version: 2.2.12
Incorrect work code field lengths
This is a bug that will be fixed in the next version of TimeTrex.
In the mean time, give this a try:
Edit: classes/modules/core/StationFactory.class.php then around line 1050 add the following line just below: "function setWorkCodeDefinition"
So it should look like this:
In the mean time, give this a try:
Edit: classes/modules/core/StationFactory.class.php then around line 1050 add the following line just below: "function setWorkCodeDefinition"
Code: Select all
$arr = Misc::preSetArrayValues( $arr, array('branch', 'department','job', 'job_item'), 0);
Code: Select all
function setWorkCodeDefinition($arr) {
$arr = Misc::preSetArrayValues( $arr, array('branch', 'department', 'job', 'job_item'), 0);
if ( is_array( $arr )
AND ($arr['branch']+$arr['department']+$arr['job']+$arr['job_item']) == 9 ) {
$this->data['work_code_definition'] = serialize( $arr );
return TRUE;
} else {
$this->Validator->isTRUE( 'work_code_definition',
FALSE,
TTi18n::gettext('Incorrect work code field lengths, they must all add up to 9') );
}
return FALSE;
}