diff --git a/lib/documentmanagement/DocumentField.inc b/lib/documentmanagement/DocumentField.inc
index 12e5426..bf6c496 100644
--- a/lib/documentmanagement/DocumentField.inc
+++ b/lib/documentmanagement/DocumentField.inc
@@ -280,6 +280,26 @@ class DocumentField {
$_SESSION["errorMessage"] = $lang_err_database;
return false;
}
+
+ /* Static function. Given a documenttype...will find all fields belongin to it
+ *
+ * @return DocumentFieldLink populated DocumentFieldLink object on success, false otherwise and set $_SESSION["errorMessage"]
+ */
+ function isFieldLinkedToType() {
+ global $default, $lang_err_database;
+ $sql = $default->db;
+ $query = "SELECT * FROM " . $default->owl_document_type_fields_table . " Where field_id = $this->iId";
+ $sql->query($query);
+ $rows = $sql->num_rows($sql);
+
+ if ($rows > 0){
+ return true;
+ }else{
+ return false;
+ }
+ $_SESSION["errorMessage"] = $lang_err_database;
+ return false;
+ }
}
/**
diff --git a/presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/editDocFieldBL.php b/presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/editDocFieldBL.php
index 27638f6..81542ab 100644
--- a/presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/editDocFieldBL.php
+++ b/presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/editDocFieldBL.php
@@ -50,6 +50,8 @@ if (checkSession()) {
$oPatternCustom->setHtml(getEditPageFail());
}
} else if (isset($fDocFieldID)){
+
+
// post back on DocField select from manual edit page
$oPatternCustom->setHtml(getEditPage($fDocFieldID));
$main->setFormAction($_SERVER["PHP_SELF"] . "?fForStore=1");
diff --git a/presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/editDocFieldUI.inc b/presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/editDocFieldUI.inc
index 4738eca..a05d5ee 100644
--- a/presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/editDocFieldUI.inc
+++ b/presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/editDocFieldUI.inc
@@ -17,8 +17,10 @@ function getEditPage($iDocFieldID) {
$oDocField = null;
if (isset($iDocFieldID)) {
$oDocField = DocumentField::get($iDocFieldID);
+ $checkBox = $oDocField->isFieldLinkedToType();
}
+
$sToRender .= "
\n";
@@ -40,10 +42,16 @@ function getEditPage($iDocFieldID) {
$sToRender .= "