Commit 4eedae775e384ce5218fd8640dfc67bdcd86f27b

Authored by rob
1 parent 05a741e7

Added functionality to allow for multiple urls for columns of type 3 (href)


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@833 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/visualpatterns/PatternTableSqlQuery.inc
@@ -36,7 +36,7 @@ class PatternTableSqlQuery { @@ -36,7 +36,7 @@ class PatternTableSqlQuery {
36 /** table width, either in pixels or as a percentage e.g. 600 or 100%*/ 36 /** table width, either in pixels or as a percentage e.g. 600 or 100%*/
37 var $sWidth; 37 var $sWidth;
38 /** link url used if a column type of 3 is specified */ 38 /** link url used if a column type of 3 is specified */
39 - var $sLinkURL; 39 + var $aLinkURLs;
40 /** database column values to append to link url if a column type of 3 is specified */ 40 /** database column values to append to link url if a column type of 3 is specified */
41 var $aDBQueryStringColumns; 41 var $aDBQueryStringColumns;
42 /** variables names to give $aDBQueryStringColumns on the query string */ 42 /** variables names to give $aDBQueryStringColumns on the query string */
@@ -52,14 +52,14 @@ class PatternTableSqlQuery { @@ -52,14 +52,14 @@ class PatternTableSqlQuery {
52 /** message that will be displayed if the table is empty*/ 52 /** message that will be displayed if the table is empty*/
53 var $sEmptyTableMessage; 53 var $sEmptyTableMessage;
54 54
55 - function PatternTableSqlQuery($sTmpQuery, $aTmpColumns, $aTmpColumnTypes, $aTmpColumnHeaderNames, $sTmpWidth, $sTmpLinkURL = null, $sTmpDBQueryStringColumns = null, $aNewQueryStringVariableNames = null) { 55 + function PatternTableSqlQuery($sTmpQuery, $aTmpColumns, $aTmpColumnTypes, $aTmpColumnHeaderNames, $sTmpWidth, $aTmpLinkURLs = null, $sTmpDBQueryStringColumns = null, $aNewQueryStringVariableNames = null) {
56 $this->sQuery = $sTmpQuery; 56 $this->sQuery = $sTmpQuery;
57 $this->aColumns = & $aTmpColumns; 57 $this->aColumns = & $aTmpColumns;
58 $this->aColumnTypes = $aTmpColumnTypes; 58 $this->aColumnTypes = $aTmpColumnTypes;
59 $this->aColumnHeaderNames = $aTmpColumnHeaderNames; 59 $this->aColumnHeaderNames = $aTmpColumnHeaderNames;
60 $this->sWidth = $sTmpWidth; 60 $this->sWidth = $sTmpWidth;
61 $this->bDisplayColumnHeadings = $bTmpDisplayColumnHeadings; 61 $this->bDisplayColumnHeadings = $bTmpDisplayColumnHeadings;
62 - $this->sLinkURL = $sTmpLinkURL; 62 + $this->aLinkURLs = $aTmpLinkURLs;
63 $this->aDBQueryStringColumns = $sTmpDBQueryStringColumns; 63 $this->aDBQueryStringColumns = $sTmpDBQueryStringColumns;
64 $this->aQueryStringVariableNames = $aNewQueryStringVariableNames; 64 $this->aQueryStringVariableNames = $aNewQueryStringVariableNames;
65 } 65 }
@@ -133,8 +133,8 @@ class PatternTableSqlQuery { @@ -133,8 +133,8 @@ class PatternTableSqlQuery {
133 } 133 }
134 break; 134 break;
135 case 3: 135 case 3:
136 - //hyperlink  
137 - $sToRender .= "<td><a href=\"" . $this->sLinkURL; 136 + //hyperlink
  137 + $sToRender .= "<td><a href=\"" . $this->aLinkURLs[$i];
138 for ($j = 0; $j < count($this->aDBQueryStringColumns); $j++) { 138 for ($j = 0; $j < count($this->aDBQueryStringColumns); $j++) {
139 if (strpos($sToRender, "?") === false) { 139 if (strpos($sToRender, "?") === false) {
140 $sToRender .= "?" . $this->aQueryStringVariableNames[$j] . "=" . $sql->f($this->aDBQueryStringColumns[$j]); 140 $sToRender .= "?" . $this->aQueryStringVariableNames[$j] . "=" . $sql->f($this->aDBQueryStringColumns[$j]);