コード例 #1
0
            $pplf->getByIdAndCompanyId($id, $current_company->getId());
            foreach ($pplf as $pp_obj) {
                $pp_obj->setDeleted($delete);
                if ($pp_obj->isValid()) {
                    $pp_obj->Save();
                }
            }
        }
        Redirect::Page(URLBuilder::getURL(NULL, 'PremiumPolicyList.php'));
        break;
    default:
        BreadCrumb::setCrumb($title);
        $pplf = new PremiumPolicyListFactory();
        $pplf->getByCompanyId($current_company->getId());
        $pager = new Pager($pplf);
        $type_options = $pplf->getOptions('type');
        $show_no_policy_group_notice = FALSE;
        foreach ($pplf as $pp_obj) {
            if ((int) $pp_obj->getColumn('assigned_policy_groups') == 0) {
                $show_no_policy_group_notice = TRUE;
            }
            $policies[] = array('id' => $pp_obj->getId(), 'name' => $pp_obj->getName(), 'type_id' => $pp_obj->getType(), 'type' => $type_options[$pp_obj->getType()], 'assigned_policy_groups' => (int) $pp_obj->getColumn('assigned_policy_groups'), 'deleted' => $pp_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/PremiumPolicyList.tpl');