$otpf->Save(); Redirect::Page(URLBuilder::getURL(NULL, 'OverTimePolicyList.php')); break; } default: if (isset($id)) { BreadCrumb::setCrumb($title); $otplf = new OverTimePolicyListFactory(); $otplf->getByIdAndCompanyID($id, $current_company->getID()); foreach ($otplf as $otp_obj) { //Debug::Arr($station,'Department', __FILE__, __LINE__, __METHOD__,10); $data = array('id' => $otp_obj->getId(), 'name' => $otp_obj->getName(), 'type_id' => $otp_obj->getType(), 'trigger_time' => $otp_obj->getTriggerTime(), 'rate' => Misc::removeTrailingZeros($otp_obj->getRate()), 'wage_group_id' => $otp_obj->getWageGroup(), 'accrual_rate' => Misc::removeTrailingZeros($otp_obj->getAccrualRate()), 'accrual_policy_id' => $otp_obj->getAccrualPolicyID(), 'pay_stub_entry_account_id' => $otp_obj->getPayStubEntryAccountId(), 'created_date' => $otp_obj->getCreatedDate(), 'created_by' => $otp_obj->getCreatedBy(), 'updated_date' => $otp_obj->getUpdatedDate(), 'updated_by' => $otp_obj->getUpdatedBy(), 'deleted_date' => $otp_obj->getDeletedDate(), 'deleted_by' => $otp_obj->getDeletedBy()); } } elseif ($action != 'submit') { $data = array('trigger_time' => 0, 'rate' => '1.00', 'accrual_rate' => '1.00'); } $aplf = new AccrualPolicyListFactory(); $accrual_options = $aplf->getByCompanyIDArray($current_company->getId(), TRUE); $psealf = new PayStubEntryAccountListFactory(); $pay_stub_entry_options = $psealf->getByCompanyIdAndStatusIdAndTypeIdArray($current_company->getId(), 10, array(10, 20, 30, 50)); $wglf = new WageGroupListFactory(); $data['wage_group_options'] = $wglf->getArrayByListFactory($wglf->getByCompanyId($current_company->getId()), TRUE); //Select box options; $data['type_options'] = $otpf->getOptions('type'); $data['accrual_options'] = $accrual_options; $data['pay_stub_entry_options'] = $pay_stub_entry_options; $smarty->assign_by_ref('data', $data); break; } $smarty->assign_by_ref('otpf', $otpf); $smarty->display('policy/EditOverTimePolicy.tpl');
} else { $delete = FALSE; } $utlf = new UserTitleListFactory(); foreach ($ids as $id) { $utlf->GetByIdAndCompanyId($id, $current_company->getId()); foreach ($utlf as $title_obj) { $title_obj->setDeleted($delete); $title_obj->Save(); } } Redirect::Page(URLBuilder::getURL(NULL, 'WageGroupList.php')); break; default: $sort_array = NULL; if ($sort_column != '') { $sort_array = array(Misc::trimSortPrefix($sort_column) => $sort_order); } $wglf = new WageGroupListFactory(); $wglf->getByCompanyId($current_company->getId(), $current_user_prefs->getItemsPerPage(), $page, NULL, $sort_array); $pager = new Pager($wglf); foreach ($wglf as $group_obj) { $groups[] = array('id' => $group_obj->GetId(), 'name' => $group_obj->getName(), 'deleted' => $group_obj->getDeleted()); } $smarty->assign_by_ref('groups', $groups); $smarty->assign_by_ref('sort_column', $sort_column); $smarty->assign_by_ref('sort_order', $sort_order); $smarty->assign_by_ref('paging_data', $pager->getPageVariables()); break; } $smarty->display('company/WageGroupList.tpl');