Commit d1e7290ac4c7560a3f687a6f846725fdd7c8be98
1 parent
2615b02f
only display document types that arent mapped (fixes #2613)
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2288 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
17 additions
and
11 deletions
presentation/lookAndFeel/knowledgeTree/foldermanagement/addFolderDocTypeUI.inc
| 1 | <?php | 1 | <?php |
| 2 | /** | 2 | /** |
| 3 | -* Presentation information used by addFolderDocTypeBL.php | ||
| 4 | -* | ||
| 5 | -* @author Rob Cherry, Jam Warehouse South Africa (Pty) Ltd | ||
| 6 | -* @date 37 February 2003 | ||
| 7 | -* @package presentation.lookAndFeel.knowledgeTree.foldermanagement | ||
| 8 | -*/ | 3 | + * $Id$ |
| 4 | + * | ||
| 5 | + * Presentation information used by addFolderDocTypeBL.php | ||
| 6 | + * | ||
| 7 | + * Licensed under the GNU GPL. For full terms see the file DOCS/COPYING. | ||
| 8 | + * | ||
| 9 | + * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa | ||
| 10 | + * @package presentation.lookAndFeel.knowledgeTree.foldermanagement | ||
| 11 | + */ | ||
| 9 | 12 | ||
| 10 | function getPage($iFolderID, $iDocumentTypeID) { | 13 | function getPage($iFolderID, $iDocumentTypeID) { |
| 11 | global $default; | 14 | global $default; |
| @@ -14,14 +17,13 @@ function getPage($iFolderID, $iDocumentTypeID) { | @@ -14,14 +17,13 @@ function getPage($iFolderID, $iDocumentTypeID) { | ||
| 14 | $sToRender = renderHeading("Add Folder Document Type"); | 17 | $sToRender = renderHeading("Add Folder Document Type"); |
| 15 | $sToRender .= "<table border=\"0\">\n"; | 18 | $sToRender .= "<table border=\"0\">\n"; |
| 16 | $sToRender .= "<tr>\n"; | 19 | $sToRender .= "<tr>\n"; |
| 17 | - $sToRender .= "\t<td width=\"100%\">" . renderFolderPath($iFolderID, "$default->uiUrl/foldermanagement/addFolderBL.php") . "</td>\n"; | 20 | + $sToRender .= "\t<td width=\"100%\">" . renderFolderPath($iFolderID, "/control.php?action=browse ") . "</td>\n"; |
| 18 | $sToRender .= "</tr>\n"; | 21 | $sToRender .= "</tr>\n"; |
| 19 | $sToRender .= "</table>\n"; | 22 | $sToRender .= "</table>\n"; |
| 20 | - $sToRender .= "<br>"; | ||
| 21 | $sToRender .= "<table border=\"0\">\n"; | 23 | $sToRender .= "<table border=\"0\">\n"; |
| 22 | $sToRender .= "<tr>\n"; | 24 | $sToRender .= "<tr>\n"; |
| 23 | $sToRender .= "<td bgcolor=\"$sTDBGColour\">Document type</td>\n"; | 25 | $sToRender .= "<td bgcolor=\"$sTDBGColour\">Document type</td>\n"; |
| 24 | - $sToRender .= "<td>" . getDocumentTypeDropDown($iDocumentTypeID) . "</td>\n"; | 26 | + $sToRender .= "<td>" . getDocumentTypeDropDown($iDocumentTypeID, $iFolderID) . "</td>\n"; |
| 25 | $sToRender .= "</tr>\n"; | 27 | $sToRender .= "</tr>\n"; |
| 26 | $sToRender .= "</table>\n"; | 28 | $sToRender .= "</table>\n"; |
| 27 | $sToRender .= "<table>\n"; | 29 | $sToRender .= "<table>\n"; |
| @@ -33,9 +35,13 @@ function getPage($iFolderID, $iDocumentTypeID) { | @@ -33,9 +35,13 @@ function getPage($iFolderID, $iDocumentTypeID) { | ||
| 33 | return $sToRender; | 35 | return $sToRender; |
| 34 | } | 36 | } |
| 35 | 37 | ||
| 36 | -function getDocumentTypeDropDown($iDocumentTypeID) { | 38 | +function getDocumentTypeDropDown($iDocumentTypeID, $iFolderID) { |
| 37 | global $default; | 39 | global $default; |
| 38 | - $oPatternListBox = & new PatternListBox("$default->owl_document_types_table", "name", "id", "fDocumentTypeID"); | 40 | + // cunningly joined query courtesy of R. Cherry Esq. |
| 41 | + $oPatternListBox = & new PatternListBox("SELECT DTL.name AS display, DTL.id AS value " . | ||
| 42 | + "FROM $default->owl_document_types_table AS DTL " . | ||
| 43 | + "LEFT OUTER JOIN $default->owl_folder_doctypes_table AS FDL ON FDL.document_type_id = DTL.id AND FDL.folder_id = $iFolderID " . | ||
| 44 | + "WHERE folder_id IS NULL", "fDocumentTypeID"); | ||
| 39 | $oPatternListBox->setIncludeDefaultValue(false); | 45 | $oPatternListBox->setIncludeDefaultValue(false); |
| 40 | if (isset($iDocumentTypeID)) { | 46 | if (isset($iDocumentTypeID)) { |
| 41 | $oPatternListBox->setSelectedValue($iDocumentTypeID); | 47 | $oPatternListBox->setSelectedValue($iDocumentTypeID); |