Commit d384cec7548ecb75c1be87a7f4b547fefc4f857b
1 parent
3f39957a
if a field has been edited to have a lookup, redirect to the add metadata page
(process fixes ##2673) git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2326 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
19 additions
and
14 deletions
presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/editDocFieldBL.php
| ... | ... | @@ -15,13 +15,11 @@ if (checkSession()) { |
| 15 | 15 | require_once("editDocFieldUI.inc"); |
| 16 | 16 | require_once("$default->fileSystemRoot/lib/security/permission.inc"); |
| 17 | 17 | require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentField.inc"); |
| 18 | - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | |
| 19 | 18 | require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); |
| 20 | 19 | require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); |
| 21 | 20 | require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc"); |
| 22 | 21 | require_once("$default->fileSystemRoot/presentation/Html.inc"); |
| 23 | 22 | |
| 24 | - | |
| 25 | 23 | $oPatternCustom = & new PatternCustom(); |
| 26 | 24 | |
| 27 | 25 | if (isset($fForStore)) { |
| ... | ... | @@ -42,29 +40,36 @@ if (checkSession()) { |
| 42 | 40 | $oDocField->setHasLookup(false); |
| 43 | 41 | } |
| 44 | 42 | if ($oDocField->update()) { |
| 45 | - // if successfull print out success message | |
| 46 | - $oPatternCustom->setHtml(getEditPageSuccess()); | |
| 47 | - | |
| 43 | + | |
| 44 | + // if we're setting lookup to be true, then prompt for an initial lookup value?? | |
| 45 | + if (isset($fDocFieldHasLookup)) { | |
| 46 | + // and there are no metadata values for this lookup | |
| 47 | + if (DocumentField::getLookupCount($fDocFieldID) == 0) { | |
| 48 | + // then redirect to the edit metadata page | |
| 49 | + controllerRedirect("addMetaDataForField", "fDocFieldID=$fDocFieldID"); | |
| 50 | + } | |
| 51 | + } | |
| 52 | + // otherwise, print out success message | |
| 53 | + $oPatternCustom->setHtml(getEditPageSuccess()); | |
| 48 | 54 | } else { |
| 49 | - // if fail print out fail message | |
| 50 | - $oPatternCustom->setHtml(getEditPageFail()); | |
| 55 | + // if fail print out fail message | |
| 56 | + $oPatternCustom->setHtml(getEditPageFail()); | |
| 51 | 57 | } |
| 52 | 58 | } else if (isset($fDocFieldID)){ |
| 53 | - | |
| 54 | 59 | // post back on DocField select from manual edit page |
| 55 | 60 | $oPatternCustom->setHtml(getEditPage($fDocFieldID)); |
| 56 | - $main->setFormAction($_SERVER["PHP_SELF"] . "?fForStore=1"); | |
| 57 | - | |
| 58 | - | |
| 61 | + $sFormAction = $_SERVER["PHP_SELF"] . "?fForStore=1"; | |
| 59 | 62 | } else { |
| 60 | 63 | // if nothing happens...just reload edit page |
| 61 | 64 | $oPatternCustom->setHtml(getEditPage(null)); |
| 62 | - $main->setFormAction($_SERVER["PHP_SELF"]); | |
| 63 | - | |
| 65 | + $sFormAction = $_SERVER["PHP_SELF"]; | |
| 64 | 66 | } |
| 67 | + | |
| 65 | 68 | //render the page |
| 69 | + require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | |
| 70 | + $main->setFormAction($sFormAction); | |
| 66 | 71 | $main->setCentralPayload($oPatternCustom); |
| 67 | 72 | $main->setHasRequiredFields(true); |
| 68 | 73 | $main->render(); |
| 69 | 74 | } |
| 70 | 75 | -?> |
| 76 | +?> | |
| 71 | 77 | \ No newline at end of file | ... | ... |