Commit 94983b17ae51f2621b4e54ea377e73e68e004fd4
1 parent
c84ecaa4
Fixed missing document id error
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@745 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
5 additions
and
4 deletions
presentation/lookAndFeel/knowledgeTree/documentmanagement/addDocumentUI.inc
| @@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
| 10 | 10 | ||
| 11 | function getDocumentListForFolder($fFolderID) { | 11 | function getDocumentListForFolder($fFolderID) { |
| 12 | global $default; | 12 | global $default; |
| 13 | - $sQuery = "SELECT D.id, D.folder_id, D.name, COALESCE(MT.icon_path, '$default->owl_graphics_url/star.gif') AS image_url " . | 13 | + $sQuery = "SELECT D.id AS id, D.folder_id AS folder_id, D.name, COALESCE(MT.icon_path, '$default->owl_graphics_url/star.gif') AS image_url " . |
| 14 | "FROM $default->owl_documents_table AS D LEFT OUTER JOIN $default->owl_mime_table AS MT ON D.mime_id = MT.id " . | 14 | "FROM $default->owl_documents_table AS D LEFT OUTER JOIN $default->owl_mime_table AS MT ON D.mime_id = MT.id " . |
| 15 | "WHERE folder_id = $fFolderID " . | 15 | "WHERE folder_id = $fFolderID " . |
| 16 | "ORDER BY name ASC"; | 16 | "ORDER BY name ASC"; |
| @@ -18,8 +18,9 @@ function getDocumentListForFolder($fFolderID) { | @@ -18,8 +18,9 @@ function getDocumentListForFolder($fFolderID) { | ||
| 18 | $aColumns = array("name"); | 18 | $aColumns = array("name"); |
| 19 | $aColumnTypes = array(3); | 19 | $aColumnTypes = array(3); |
| 20 | $aColumnHeaderNames = ("Name"); | 20 | $aColumnHeaderNames = ("Name"); |
| 21 | - | ||
| 22 | - $oPatternTableSqlQuery = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnHeaderNames, "100%", "$default->owl_root_url/control.php?action=viewDocument&fDocumentID=", "id"); | 21 | + $aDBColumns = array("id"); |
| 22 | + $aQueryStringVariableNames = array("fDocumentID"); | ||
| 23 | + $oPatternTableSqlQuery = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnHeaderNames, "100%", "$default->owl_root_url/control.php?action=viewDocument", $aDBColumns, $aQueryStringVariableNames); | ||
| 23 | $oPatternTableSqlQuery->setEmptyTableMessage("This folder contains no documents"); | 24 | $oPatternTableSqlQuery->setEmptyTableMessage("This folder contains no documents"); |
| 24 | $oPatternTableSqlQuery->setUseImageURLFromQuery(true); | 25 | $oPatternTableSqlQuery->setUseImageURLFromQuery(true); |
| 25 | return $oPatternTableSqlQuery->render(); | 26 | return $oPatternTableSqlQuery->render(); |
| @@ -64,7 +65,7 @@ function getBrowseAddPage($fFolderID) { | @@ -64,7 +65,7 @@ function getBrowseAddPage($fFolderID) { | ||
| 64 | $sToRender .= "<td colspan=\"2\"><b>Document to add:<b></td>\n"; | 65 | $sToRender .= "<td colspan=\"2\"><b>Document to add:<b></td>\n"; |
| 65 | $sToRender .= "</tr>\n"; | 66 | $sToRender .= "</tr>\n"; |
| 66 | $sToRender .= "<td><input type=\"file\" name=\"fFile\"></td>\n"; | 67 | $sToRender .= "<td><input type=\"file\" name=\"fFile\"></td>\n"; |
| 67 | - $sToRender .= "<td><input type=\"submit\" value=\"Add\"></td>\n"; | 68 | + $sToRender .= "<td><input type=\"image\" value=\"Add\"></td>\n"; |
| 68 | $sToRender .= "</tr>\n"; | 69 | $sToRender .= "</tr>\n"; |
| 69 | $sToRender .= "</table>\n"; | 70 | $sToRender .= "</table>\n"; |
| 70 | 71 |