Commit ef3b4551baea514a7d39589e3c023222d009c6e6

Authored by michael
1 parent 780b3800

(#2800) added empty table message


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2413 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/visualpatterns/PatternListFromQuery.inc
@@ -35,7 +35,9 @@ class PatternListFromQuery { @@ -35,7 +35,9 @@ class PatternListFromQuery {
35 var $iTableWidth = null; 35 var $iTableWidth = null;
36 /** Picture paths */ 36 /** Picture paths */
37 var $sChkPicPath = "widgets/checked.gif"; 37 var $sChkPicPath = "widgets/checked.gif";
38 - var $sUnChkPicPath = "widgets/unchecked.gif"; 38 + var $sUnChkPicPath = "widgets/unchecked.gif";
  39 + /** message that will be displayed if the table is empty*/
  40 + var $sEmptyTableMessage;
39 41
40 /** 42 /**
41 * Default constructor 43 * Default constructor
@@ -72,6 +74,10 @@ class PatternListFromQuery { @@ -72,6 +74,10 @@ class PatternListFromQuery {
72 $this->bIndividualTableForEachResult = $bNewValue; 74 $this->bIndividualTableForEachResult = $bNewValue;
73 } 75 }
74 76
  77 + function setEmptyTableMessage($sNewValue) {
  78 + $this->sEmptyTableMessage = $sNewValue;
  79 + }
  80 +
75 function & render() { 81 function & render() {
76 global $default; 82 global $default;
77 $sSectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"]))); 83 $sSectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"])));
@@ -87,8 +93,12 @@ class PatternListFromQuery { @@ -87,8 +93,12 @@ class PatternListFromQuery {
87 } 93 }
88 94
89 if ($sql->num_rows() == 0) { 95 if ($sql->num_rows() == 0) {
90 - $sToRender .= "<tr>\n";  
91 - $sToRender .= "<td colspan=" . count($this->aColumns) . ">No " . (isset($this->sTableHeading) ? "$this->sTableHeading" : "") . " data</td>\n"; 96 + $sToRender .= "<tr>\n";
  97 + if (isset($this->sEmptyTableMessage)) {
  98 + $sToRender .= "<td colspan=" . count($this->aColumns) . ">$this->sEmptyTableMessage</td>\n";
  99 + } else {
  100 + $sToRender .= "<td colspan=" . count($this->aColumns) . ">No " . (isset($this->sTableHeading) ? "$this->sTableHeading" : "") . " data</td>\n";
  101 + }
92 $sToRender .= "</tr>\n"; 102 $sToRender .= "</tr>\n";
93 } else { 103 } else {
94 $iColour = 0; 104 $iColour = 0;
presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc
@@ -46,7 +46,8 @@ function renderDocumentData($oDocument, $bEditable, $sStatusMessage = &quot;&quot;) { @@ -46,7 +46,8 @@ function renderDocumentData($oDocument, $bEditable, $sStatusMessage = &quot;&quot;) {
46 $aColumnTypes = array(1,1,1,1,1,1,1,1); 46 $aColumnTypes = array(1,1,1,1,1,1,1,1);
47 $oPatternListFromQuery = & new PatternListFromQuery($sQuery, $aColumns, $aColumnNames, $aColumnTypes); 47 $oPatternListFromQuery = & new PatternListFromQuery($sQuery, $aColumns, $aColumnNames, $aColumnTypes);
48 $oPatternListFromQuery->setTableHeading("Document Data"); 48 $oPatternListFromQuery->setTableHeading("Document Data");
49 - $oPatternListFromQuery->setTableWidth("400"); 49 + $oPatternListFromQuery->setEmptyTableMessage("No Document Data");
  50 + $oPatternListFromQuery->setTableWidth("400");
50 51
51 $sToRender .= "\t<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\">\n"; 52 $sToRender .= "\t<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\">\n";
52 if ($sStatusMessage) { 53 if ($sStatusMessage) {