Example #1
0
 function do_addfieldsets()
 {
     $oDocumentType =& DocumentType::get($_REQUEST['fDocumentTypeId']);
     $aFieldsetId = $_REQUEST['fieldsetid'];
     if (!count($aFieldsetId)) {
         $this->errorRedirectTo('edit', _kt('You must select at least one fieldset'), 'fDocumentTypeId=' . $oDocumentType->getId());
         exit(0);
     }
     $res = KTMetadataUtil::addSetsToDocumentType($oDocumentType, $aFieldsetId);
     if (PEAR::isError($res)) {
         var_dump($res);
         $this->errorRedirectTo('edit', _kt('Changes not saved'), 'fDocumentTypeId=' . $oDocumentType->getId());
         exit(0);
     }
     $this->successRedirectTo('edit', _kt('Fieldsets associated.'), 'fDocumentTypeId=' . $oDocumentType->getId());
     exit(0);
 }