}
     $udtf->setOverTimePolicyID($udt_data['over_time_policy_id']);
     $udtf->setPremiumPolicyID($udt_data['premium_policy_id']);
     $udtf->setAbsencePolicyID($udt_data['absence_policy_id']);
     $udtf->setMealPolicyID($udt_data['meal_policy_id']);
     $udtf->setTotalTime($udt_data['total_time']);
     $udtf->setPunchControlID((int) $udt_data['punch_control_id']);
     if (isset($udt_data['override']) and $udt_data['override'] == 1) {
         Debug::Text('Setting override to TRUE!', __FILE__, __LINE__, __METHOD__, 10);
         $udtf->setOverride(TRUE);
     } else {
         $udtf->setOverride(FALSE);
     }
     if ($udtf->isValid()) {
         $udtf->setEnableCalcSystemTotalTime(TRUE);
         $udtf->setEnableCalcWeeklySystemTotalTime(TRUE);
         $udtf->setEnableCalcException(TRUE);
         $udtf->Save();
         Redirect::Page(URLBuilder::getURL(array('refresh' => TRUE), '../CloseWindow.php'));
         break;
     }
 default:
     if ($id != '') {
         Debug::Text(' ID was passed: ' . $id, __FILE__, __LINE__, __METHOD__, 10);
         $udtlf = new UserDateTotalListFactory();
         $udtlf->getById($id);
         foreach ($udtlf as $udt_obj) {
             //Debug::Arr($station,'Department', __FILE__, __LINE__, __METHOD__,10);
             $udt_data = array('id' => $udt_obj->getId(), 'user_date_id' => $udt_obj->getUserDateId(), 'date_stamp' => $udt_obj->getUserDateObject()->getDateStamp(), 'user_id' => $udt_obj->getUserDateObject()->getUser(), 'user_full_name' => $udt_obj->getUserDateObject()->getUserObject()->getFullName(), 'status_id' => $udt_obj->getStatus(), 'type_id' => $udt_obj->getType(), 'total_time' => $udt_obj->getTotalTime(), 'branch_id' => $udt_obj->getBranch(), 'department_id' => $udt_obj->getDepartment(), 'job_id' => $udt_obj->getJob(), 'job_item_id' => $udt_obj->getJobItem(), 'quantity' => $udt_obj->getQuantity(), 'bad_quantity' => $udt_obj->getBadQuantity(), 'punch_control_id' => $udt_obj->getPunchControlID(), 'absence_policy_id' => $udt_obj->getAbsencePolicyID(), 'over_time_policy_id' => $udt_obj->getOverTimePolicyID(), 'premium_policy_id' => $udt_obj->getPremiumPolicyID(), 'meal_policy_id' => $udt_obj->getMealPolicyID(), 'override' => $udt_obj->getOverride(), 'created_date' => $udt_obj->getCreatedDate(), 'created_by' => $udt_obj->getCreatedBy(), 'updated_date' => $udt_obj->getUpdatedDate(), 'updated_by' => $udt_obj->getUpdatedBy(), 'deleted_date' => $udt_obj->getDeletedDate(), 'deleted_by' => $udt_obj->getDeletedBy(), 'override' => $udt_obj->getOverride());
         }
     } elseif ($action != 'submit') {