From b69ebd60fa1b51e27e96e97384f58f0685aebffb Mon Sep 17 00:00:00 2001 From: Michael Joseph Date: Wed, 9 Jul 2003 13:17:24 +0000 Subject: [PATCH] fixed #2673- if a new document field has a lookup, then redirect to add lookup page --- presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/addDocFieldSuccess.php | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/addDocFieldSuccess.php b/presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/addDocFieldSuccess.php index 75f0bae..13ed819 100644 --- a/presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/addDocFieldSuccess.php +++ b/presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/addDocFieldSuccess.php @@ -10,28 +10,35 @@ require_once("../../../../../config/dmsDefaults.php"); -global $default; - if(checkSession()) { + require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentField.inc"); + + $oDocField = DocumentField::get($fDocFieldID); + if ($oDocField) { + // if we're setting lookup to be true, then prompt for an initial lookup value?? + if ($oDocField->getHasLookup()) { + // and there are no metadata values for this lookup + // there shouldn't be since this has just been added- but lets be paranoid shall we? + if (DocumentField::getLookupCount($fDocFieldID) == 0) { + // then redirect to the edit metadata page + controllerRedirect("addMetaDataForField", "fDocFieldID=$fDocFieldID"); + } + } + } // include the page template (with navbar) require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); - + global $default; $Center .= renderHeading("Add Document Field"); $Center .= "\n"; $Center .= "\n"; - if ($fDocTypeID == -1) { + if ($fDocFieldID == -1) { $Center .= "\n"; $Center .= "\n"; $Center .= "\n"; - $Center .= "\n"; - $Center .= "\n"; - $Center .= "\n"; - } else { $Center .= "\n"; $Center .= "\n"; - } $Center .= "\n"; $Center .= "\n"; -- libgit2 0.21.4
Document Field addition Unsuccessful!
Document Type already exists
Document Field added Successfully!