Ejemplo n.º 1
0
}
Debug::Arr($ids, 'Selected Objects', __FILE__, __LINE__, __METHOD__, 10);
$action = Misc::findSubmitButton();
switch ($action) {
    case 'add':
        Redirect::Page(URLBuilder::getURL(NULL, 'EditMealPolicy.php', FALSE));
        break;
    case 'delete' or 'undelete':
        if (strtolower($action) == 'delete') {
            $delete = TRUE;
        } else {
            $delete = FALSE;
        }
        $mplf = new MealPolicyListFactory();
        foreach ($ids as $id) {
            $mplf->getByIdAndCompanyId($id, $current_company->getId());
            foreach ($mplf as $mp_obj) {
                $mp_obj->setDeleted($delete);
                if ($mp_obj->isValid()) {
                    $mp_obj->Save();
                }
            }
        }
        Redirect::Page(URLBuilder::getURL(NULL, 'MealPolicyList.php'));
        break;
    default:
        $mplf = new MealPolicyListFactory();
        $mplf->getByCompanyId($current_company->getId());
        $pager = new Pager($mplf);
        $type_options = $mplf->getOptions('type');
        $show_no_policy_group_notice = FALSE;