예제 #1
0
            $hplf->getByIdAndCompanyId($id, $current_company->getId());
            foreach ($hplf as $hp_obj) {
                $hp_obj->setDeleted($delete);
                if ($hp_obj->isValid()) {
                    $hp_obj->Save();
                }
            }
        }
        Redirect::Page(URLBuilder::getURL(NULL, 'HolidayPolicyList.php'));
        break;
    default:
        BreadCrumb::setCrumb($title);
        $hplf = new HolidayPolicyListFactory();
        $hplf->getByCompanyId($current_company->getId());
        $pager = new Pager($hplf);
        $type_options = $hplf->getOptions('type');
        $show_no_policy_group_notice = FALSE;
        foreach ($hplf as $hp_obj) {
            if ((int) $hp_obj->getColumn('assigned_policy_groups') == 0) {
                $show_no_policy_group_notice = TRUE;
            }
            $policies[] = array('id' => $hp_obj->getId(), 'name' => $hp_obj->getName(), 'type_id' => $hp_obj->getType(), 'type' => $type_options[$hp_obj->getType()], 'assigned_policy_groups' => (int) $hp_obj->getColumn('assigned_policy_groups'), 'deleted' => $hp_obj->getDeleted());
        }
        $smarty->assign_by_ref('policies', $policies);
        $smarty->assign_by_ref('show_no_policy_group_notice', $show_no_policy_group_notice);
        $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('policy/HolidayPolicyList.tpl');