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";
Document Field addition Unsuccessful!
Document Type already exists
Document Field added Successfully!