Commit 373ea67da695c05111d84c070f3afdbfff8e58af

Authored by rob
1 parent 1cef7bed

added dependant documents


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2010 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/dashboardBL.php
@@ -50,8 +50,11 @@ if (checkSession()) { @@ -50,8 +50,11 @@ if (checkSession()) {
50 // retrieve pending web documents 50 // retrieve pending web documents
51 $aPendingWebDocuments = $oDashboard->getPendingWebDocuments(); 51 $aPendingWebDocuments = $oDashboard->getPendingWebDocuments();
52 52
  53 + //retrive dependant documents
  54 + $aDependantDocuments = $oDashboard->getDependantDocuments();
  55 +
53 // generate the html 56 // generate the html
54 - $oContent->setHtml(renderPage($aPendingDocumentList, $aCheckedOutDocumentList, $aSubscriptionAlertList, $aQuickLinks, $aPendingWebDocuments)); 57 + $oContent->setHtml(renderPage($aPendingDocumentList, $aCheckedOutDocumentList, $aSubscriptionAlertList, $aQuickLinks, $aPendingWebDocuments, $aDependantDocuments));
55 58
56 // display 59 // display
57 $main->setCentralPayload($oContent); 60 $main->setCentralPayload($oContent);
presentation/lookAndFeel/knowledgeTree/dashboardUI.inc
@@ -103,6 +103,45 @@ function renderCheckedOutDocuments($aCheckedOutDocumentList) { @@ -103,6 +103,45 @@ function renderCheckedOutDocuments($aCheckedOutDocumentList) {
103 return $sToRender; 103 return $sToRender;
104 } 104 }
105 105
  106 +function renderDependantDocuments($aDependantDocumentList) {
  107 + global $default;
  108 + if (count($aCheckedOutDocumentList) > 0) {
  109 + $sBgColor = "#9D9D7F";
  110 + } else {
  111 + $sBgColor = "#CECEBF";
  112 + }
  113 + $sToRender = "\t\t\t<tr align=\"left\" bgcolor=\"$sBgColor\">\n";
  114 + $sToRender .= "\t\t\t\t<th class=\"sectionHeading\" colspan=\"2\"><font color=\"ffffff\">Dependant Documents</font></th>\n";
  115 + $sToRender .= "\t\t\t</tr>\n";
  116 +
  117 + if (count($aDependantDocumentList) > 0) {
  118 + $sToRender .= "\t\t\t<tr>\n";
  119 + $sToRender .= "\t\t\t\t<th align=\"left\" width=\"33%\" class=\"sectionColumns\">";
  120 + $sToRender .= "Title";
  121 + $sToRender .= "</th>\n";
  122 + $sToRender .= "\t\t\t\t<th align=\"left\" width=\"66%\" class=\"sectionColumns\">";
  123 + $sToRender .= "Template document";
  124 + $sToRender .= "\t\t\t\t</th>\n";
  125 + $sToRender .= "\t\t\t</tr>\n";
  126 + }
  127 +
  128 + for ($i = 0; $i < count($aDependantDocumentList); $i++) {
  129 + $oDependantDocument = $aDependantDocumentList[$i];
  130 + $oTemplateDocument = Document::get($oDependantDocument->getTemplateDocumentID());
  131 +
  132 + $sToRender .= "\t\t\t<tr>\n";
  133 + $sToRender .= "\t\t\t\t<td>" . $oDependantDocument->getDocumentTitle() . "</td>";
  134 + if (!($oTemplateDocument === false)) {
  135 + $sToRender .= "<td>" . generateControllerLink("viewDocument", "fDocumentID=" . $oTemplateDocument->getID(), "<img src=\"$default->graphicsUrl/widgets/dstatus.gif\" border=\"0\"/>&nbsp;" . $oTemplateDocument->getName()) . "</td>\n";
  136 + } else {
  137 + $sToRender .= "<td>No template specified</td>\n";
  138 + }
  139 + $sToRender .= "\t\t\t</tr>\n";
  140 + }
  141 + return $sToRender;
  142 +
  143 +}
  144 +
106 /** 145 /**
107 * Displays the subscription alerts 146 * Displays the subscription alerts
108 * 147 *
@@ -179,7 +218,7 @@ function renderDashboardNews() { @@ -179,7 +218,7 @@ function renderDashboardNews() {
179 * @param array checked out documents for this user 218 * @param array checked out documents for this user
180 * @param array subscription alerts for this user 219 * @param array subscription alerts for this user
181 */ 220 */
182 -function renderPage($aPendingDocumentList, $aCheckedOutDocumentList, $aSubscriptionAlertList, $aQuickLinks, $aWebDocuments) { 221 +function renderPage($aPendingDocumentList, $aCheckedOutDocumentList, $aSubscriptionAlertList, $aQuickLinks, $aWebDocuments, $aDependantDocuments) {
183 global $default; 222 global $default;
184 223
185 $sToRender = "<table border=\"0\" width=\"600\" >\n"; 224 $sToRender = "<table border=\"0\" width=\"600\" >\n";
@@ -205,6 +244,7 @@ function renderPage($aPendingDocumentList, $aCheckedOutDocumentList, $aSubscript @@ -205,6 +244,7 @@ function renderPage($aPendingDocumentList, $aCheckedOutDocumentList, $aSubscript
205 $sToRender .= renderPendingCollaborationDocuments($aPendingDocumentList); 244 $sToRender .= renderPendingCollaborationDocuments($aPendingDocumentList);
206 $sToRender .= renderCheckedOutDocuments($aCheckedOutDocumentList) . "\n"; 245 $sToRender .= renderCheckedOutDocuments($aCheckedOutDocumentList) . "\n";
207 $sToRender .= renderSubscriptionAlerts($aSubscriptionAlertList) . "\n"; 246 $sToRender .= renderSubscriptionAlerts($aSubscriptionAlertList) . "\n";
  247 + $sToRender .= renderDependantDocuments($aDependantDocuments) . "\n";
208 $sToRender .= "\t\t\t</table>\n"; 248 $sToRender .= "\t\t\t</table>\n";
209 $sToRender .= "\t\t</td>\n"; 249 $sToRender .= "\t\t</td>\n";
210 250
@@ -214,6 +254,7 @@ function renderPage($aPendingDocumentList, $aCheckedOutDocumentList, $aSubscript @@ -214,6 +254,7 @@ function renderPage($aPendingDocumentList, $aCheckedOutDocumentList, $aSubscript
214 $sToRender .= renderQuickLinks($aQuickLinks); 254 $sToRender .= renderQuickLinks($aQuickLinks);
215 $sToRender .= "\t\t\t</table>\n"; 255 $sToRender .= "\t\t\t</table>\n";
216 256
  257 +
217 $sToRender .= "\t\t</td>\n"; 258 $sToRender .= "\t\t</td>\n";
218 $sToRender .= "\t</tr>\n"; 259 $sToRender .= "\t</tr>\n";
219 $sToRender .= "</table>\n"; 260 $sToRender .= "</table>\n";