コード例 #1
0
Debug::Arr($ids, 'Selected Objects', __FILE__, __LINE__, __METHOD__, 10);
$action = Misc::findSubmitButton();
switch ($action) {
    case 'add':
        Redirect::Page(URLBuilder::getURL(NULL, 'EditHierarchyControl.php', FALSE));
        break;
    case 'delete' or 'undelete':
        if (strtolower($action) == 'delete') {
            $delete = TRUE;
        } else {
            $delete = FALSE;
        }
        $hclf = new HierarchyControlListFactory();
        foreach ($ids as $id) {
            //$dsclf->GetByIdAndUserId($id, $current_user->getId() );
            $hclf->GetById($id);
            foreach ($hclf as $hierarchy_control) {
                $hierarchy_control->setDeleted($delete);
                $hierarchy_control->Save();
            }
        }
        Redirect::Page(URLBuilder::getURL(NULL, 'HierarchyControlList.php'));
        break;
    default:
        $hclf = new HierarchyControlListFactory();
        $hclf->GetByCompanyId($current_company->getId(), $current_user_prefs->getItemsPerPage(), $page, NULL, $sort_array);
        $pager = new Pager($hclf);
        $hotf = new HierarchyObjectTypeFactory();
        $object_type_options = $hotf->getOptions('object_type');
        foreach ($hclf as $hierarchy_control) {
            $object_type_ids = $hierarchy_control->getObjectType();