Commit b4810bf75430dd76c09fd21a08b5760c5ce74e60

Authored by michael
1 parent 7a5ce664

(#2725) added check and error message if there is no Category document field


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2335 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/documentmanagement/browseUI.inc
@@ -47,7 +47,7 @@ function displayCategoryPathLink($aCategories) { @@ -47,7 +47,7 @@ function displayCategoryPathLink($aCategories) {
47 return displayCategoryLink($aCategories[0]); 47 return displayCategoryLink($aCategories[0]);
48 } else { 48 } else {
49 // else the first entry is the category name, so build a little path 49 // else the first entry is the category name, so build a little path
50 - return displayCategoryLink("Categories") . " > " . displayCategoryLink($aCategories[0]); 50 + return displayCategoryLink("Categories") . ($aCategories[0] ? " > " . displayCategoryLink($aCategories[0]) : "");
51 } 51 }
52 } 52 }
53 53
@@ -96,9 +96,12 @@ function renderCategoryResults($aResults) { @@ -96,9 +96,12 @@ function renderCategoryResults($aResults) {
96 $sToRender .= "</tr>\n"; 96 $sToRender .= "</tr>\n";
97 } 97 }
98 } else { 98 } else {
99 - // else the first entry is the category name, so display the documents in the category  
100 - // with full paths  
101 - $sToRender .= renderDocumentList($aResults, "This category contains no documents", "You don't have access to the documents in this category"); 99 + if (count($aResults["categories"]) > 0) {
  100 + // else the first entry is the category name, so display the documents in the category
  101 + $sToRender .= renderDocumentList($aResults, "This category contains no documents", "You don't have access to the documents in this category");
  102 + } else {
  103 + $sToRender .= "<tr><td colspan=\"5\"><font color=\"red\">There is no Category Document Field- contact a System Administrator.</font></td></tr>";
  104 + }
102 } 105 }
103 return $sToRender; 106 return $sToRender;
104 } 107 }
@@ -161,7 +164,6 @@ function renderDocumentTypeResults($aResults) { @@ -161,7 +164,6 @@ function renderDocumentTypeResults($aResults) {
161 } 164 }
162 } else { 165 } else {
163 // else the first entry is the document type name, so display the documents in the document type 166 // else the first entry is the document type name, so display the documents in the document type
164 - // with full paths  
165 $sToRender .= renderDocumentList($aResults, "This document type contains no documents", "You don't have access to the documents in this document type"); 167 $sToRender .= renderDocumentList($aResults, "This document type contains no documents", "You don't have access to the documents in this document type");
166 } 168 }
167 return $sToRender; 169 return $sToRender;