Ejemplo n.º 1
0
    $permission->Redirect(FALSE);
    //Redirect
}
$smarty->assign('title', TTi18n::gettext($title = 'Edit Absence Policy'));
// See index.php
/*
 * Get FORM variables
 */
extract(FormVariables::GetVariables(array('action', 'id', 'data')));
$apf = new AbsencePolicyFactory();
$action = Misc::findSubmitButton();
$action = strtolower($action);
switch ($action) {
    case 'submit':
        Debug::Text('Submit!', __FILE__, __LINE__, __METHOD__, 10);
        $apf->setId($data['id']);
        $apf->setCompany($current_company->getId());
        $apf->setName($data['name']);
        $apf->setType($data['type_id']);
        $apf->setRate($data['rate']);
        $apf->setWageGroup($data['wage_group_id']);
        $apf->setAccrualRate($data['accrual_rate']);
        $apf->setAccrualPolicyID($data['accrual_policy_id']);
        $apf->setPayStubEntryAccountID($data['pay_stub_entry_account_id']);
        if ($apf->isValid()) {
            $apf->Save();
            Redirect::Page(URLBuilder::getURL(NULL, 'AbsencePolicyList.php'));
            break;
        }
    default:
        if (isset($id)) {