Commit a1343435ea1112ebef7e7a79845aa456e8e31552

Authored by nbm
1 parent 9389ff35

mplement changeToSimple and changeToComplex for fieldsets


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3859 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/documentFields.php
@@ -304,7 +304,7 @@ class KTDocumentFieldDispatcher extends KTStandardDispatcher { @@ -304,7 +304,7 @@ class KTDocumentFieldDispatcher extends KTStandardDispatcher {
304 } 304 }
305 // }}} 305 // }}}
306 306
307 - // {{{ 307 + // {{{ do_orderFields
308 function do_orderFields() { 308 function do_orderFields() {
309 $oFieldset =& KTFieldset::get($_REQUEST['fFieldsetId']); 309 $oFieldset =& KTFieldset::get($_REQUEST['fFieldsetId']);
310 $aFreeFieldIds = $_REQUEST['fFreeFieldIds']; 310 $aFreeFieldIds = $_REQUEST['fFreeFieldIds'];
@@ -327,7 +327,7 @@ class KTDocumentFieldDispatcher extends KTStandardDispatcher { @@ -327,7 +327,7 @@ class KTDocumentFieldDispatcher extends KTStandardDispatcher {
327 } 327 }
328 // }}} 328 // }}}
329 329
330 - // {{{ 330 + // {{{ do_setMasterField
331 function do_setMasterField() { 331 function do_setMasterField() {
332 $oFieldset =& $this->oValidator->validateFieldset($_REQUEST['fFieldsetId']); 332 $oFieldset =& $this->oValidator->validateFieldset($_REQUEST['fFieldsetId']);
333 $oField =& $this->oValidator->validateField($_REQUEST['fFieldId']); 333 $oField =& $this->oValidator->validateField($_REQUEST['fFieldId']);
@@ -367,6 +367,32 @@ class KTDocumentFieldDispatcher extends KTStandardDispatcher { @@ -367,6 +367,32 @@ class KTDocumentFieldDispatcher extends KTStandardDispatcher {
367 $this->successRedirectTo('manageConditional', 'Could not to complete', 'fFieldsetId=' . $oFieldset->getId()); 367 $this->successRedirectTo('manageConditional', 'Could not to complete', 'fFieldsetId=' . $oFieldset->getId());
368 } 368 }
369 // }}} 369 // }}}
  370 +
  371 + // {{{ do_changeToSimple
  372 + function do_changeToSimple() {
  373 + $oFieldset =& $this->oValidator->validateFieldset($_REQUEST['fFieldsetId']);
  374 + $oFieldset->setIsComplex(false);
  375 + $res = $oFieldset->update();
  376 + $this->oValidator->notError($res, array(
  377 + 'redirect_to' => array('manageConditional', 'fFieldsetId=' . $oFieldset->getId()),
  378 + 'message' => 'Error changing to simple',
  379 + ));
  380 + $this->successRedirectTo('manageConditional', 'Changed to simple', 'fFieldsetId=' . $oFieldset->getId());
  381 + }
  382 + // }}}
  383 +
  384 + // {{{ do_changeToComplex
  385 + function do_changeToComplex() {
  386 + $oFieldset =& $this->oValidator->validateFieldset($_REQUEST['fFieldsetId']);
  387 + $oFieldset->setIsComplex(true);
  388 + $res = $oFieldset->update();
  389 + $this->oValidator->notError($res, array(
  390 + 'redirect_to' => array('manageConditional', 'fFieldsetId=' . $oFieldset->getId()),
  391 + 'message' => 'Error changing to complex',
  392 + ));
  393 + $this->successRedirectTo('manageConditional', 'Changed to complex', 'fFieldsetId=' . $oFieldset->getId());
  394 + }
  395 + // }}}
370 } 396 }
371 397
372 $d =& new KTDocumentFieldDispatcher; 398 $d =& new KTDocumentFieldDispatcher;