Commit 39791580b069c16887dfeb56c292465ce27cda94

Authored by Michael Joseph
1 parent 664de72b

(#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 47 return displayCategoryLink($aCategories[0]);
48 48 } else {
49 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 96 $sToRender .= "</tr>\n";
97 97 }
98 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 106 return $sToRender;
104 107 }
... ... @@ -161,7 +164,6 @@ function renderDocumentTypeResults($aResults) {
161 164 }
162 165 } else {
163 166 // else the first entry is the document type name, so display the documents in the document type
164   - // with full paths
165 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 169 return $sToRender;
... ...