Commit 8833aaa221eff1e2d15001a4f4519f7d180c2c79
1 parent
e10ffa6a
latest layout changes
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2155 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
2 changed files
with
140 additions
and
119 deletions
tests/documentmanagement/viewBL.php
| @@ -238,7 +238,7 @@ if (checkSession()) { | @@ -238,7 +238,7 @@ if (checkSession()) { | ||
| 238 | $main->setErrorMessage("This document has been archived."); | 238 | $main->setErrorMessage("This document has been archived."); |
| 239 | } | 239 | } |
| 240 | $main->setCentralPayload($oPatternCustom); | 240 | $main->setCentralPayload($oPatternCustom); |
| 241 | - //$main->setOnLoadJavaScript("switchDiv('documentData')"); | 241 | + $main->setOnLoadJavaScript("switchDiv('documentData')"); |
| 242 | $main->setFormAction("$default->rootUrl/control.php?action=modifyDocument&fDocumentID=" . $oDocument->getID()); | 242 | $main->setFormAction("$default->rootUrl/control.php?action=modifyDocument&fDocumentID=" . $oDocument->getID()); |
| 243 | $main->render(); | 243 | $main->render(); |
| 244 | } else { | 244 | } else { |
tests/documentmanagement/viewUI.inc
| @@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
| 11 | * | 11 | * |
| 12 | * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa | 12 | * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa |
| 13 | * @date 21 January 2003 | 13 | * @date 21 January 2003 |
| 14 | - * @package presentation.lookAndFeel.knowledgeTree.documentManager | 14 | + * @package presentation.lookAndFeel.knowledgeTree.documentmanagement |
| 15 | */ | 15 | */ |
| 16 | 16 | ||
| 17 | function renderDocumentPath($oDocument) { | 17 | function renderDocumentPath($oDocument) { |
| @@ -20,10 +20,10 @@ function renderDocumentPath($oDocument) { | @@ -20,10 +20,10 @@ function renderDocumentPath($oDocument) { | ||
| 20 | $sTDBGColour = $default->siteMap->getSectionColour($sSectionName, "td"); | 20 | $sTDBGColour = $default->siteMap->getSectionColour($sSectionName, "td"); |
| 21 | $sDocumentPath = displayFolderPathLink(Folder::getFolderPathAsArray($oDocument->getFolderID()), Folder::getFolderPathNamesAsArray($oDocument->getFolderID()), "$default->rootUrl/control.php?action=browse") . " > "; | 21 | $sDocumentPath = displayFolderPathLink(Folder::getFolderPathAsArray($oDocument->getFolderID()), Folder::getFolderPathNamesAsArray($oDocument->getFolderID()), "$default->rootUrl/control.php?action=browse") . " > "; |
| 22 | $sDocumentPath .= "<a href=\"$default->rootUrl/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewBL.php?fDocumentID=" . $oDocument->getID() . "&fForInlineView=1\">" . $oDocument->getName() . "</a>"; | 22 | $sDocumentPath .= "<a href=\"$default->rootUrl/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewBL.php?fDocumentID=" . $oDocument->getID() . "&fForInlineView=1\">" . $oDocument->getName() . "</a>"; |
| 23 | - return "<table border=0 cellpadding=\"5\" width = 100%><tr><td bgcolor=\"$sTDBGColour\">$sDocumentPath</td></tr></table>\n"; | 23 | + return "<table border=0 cellpadding=\"5\" width=\"610\"><tr bgcolor=\"$sTDBGColour\"><td width=\"89%\">$sDocumentPath</td><td width=\"15%\">Actions</td></tr></table>\n"; |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | -function renderDocumentData($oDocument, $bEditable) { | 26 | +function renderDocumentData($oDocument, $sDivName, $bEditable) { |
| 27 | global $default; | 27 | global $default; |
| 28 | $sQuery = "SELECT D.name, D.modified, DTT.datetime AS created, U.name AS initiator, CONCAT(CONCAT(D.major_version, '.'), D.minor_version) AS version, WDSL.name AS status, DTL.name AS document_type, D.is_checked_out, COALESCE(U2.name, '') AS c_user " . | 28 | $sQuery = "SELECT D.name, D.modified, DTT.datetime AS created, U.name AS initiator, CONCAT(CONCAT(D.major_version, '.'), D.minor_version) AS version, WDSL.name AS status, DTL.name AS document_type, D.is_checked_out, COALESCE(U2.name, '') AS c_user " . |
| 29 | "FROM $default->owl_documents_table AS D INNER JOIN $default->owl_web_documents_table AS WD ON WD.document_id = D.ID " . | 29 | "FROM $default->owl_documents_table AS D INNER JOIN $default->owl_web_documents_table AS WD ON WD.document_id = D.ID " . |
| @@ -41,73 +41,24 @@ function renderDocumentData($oDocument, $bEditable) { | @@ -41,73 +41,24 @@ function renderDocumentData($oDocument, $bEditable) { | ||
| 41 | $aColumnTypes = array(1,1,1,1,1,1,1,1); | 41 | $aColumnTypes = array(1,1,1,1,1,1,1,1); |
| 42 | $oPatternListFromQuery = & new PatternListFromQuery($sQuery, $aColumns, $aColumnNames, $aColumnTypes); | 42 | $oPatternListFromQuery = & new PatternListFromQuery($sQuery, $aColumns, $aColumnNames, $aColumnTypes); |
| 43 | $oPatternListFromQuery->setTableHeading("Document Data"); | 43 | $oPatternListFromQuery->setTableHeading("Document Data"); |
| 44 | - $oPatternListFromQuery->setTableWidth("100%"); | ||
| 45 | - | ||
| 46 | - $sToRender = "<div id=\"documentData\" style=\"position:absolute;visibility:hidden;top:265px;left:130px;\">"; | 44 | + $oPatternListFromQuery->setTableWidth("530"); |
| 45 | + | ||
| 47 | $sToRender .= "\t<table border=\"0\" width=\"100%\">\n"; | 46 | $sToRender .= "\t<table border=\"0\" width=\"100%\">\n"; |
| 48 | $sToRender .= "\t<tr>\n"; | 47 | $sToRender .= "\t<tr>\n"; |
| 49 | $sToRender .= "\t\t<td>" . $oPatternListFromQuery->render() . "</td>\n"; | 48 | $sToRender .= "\t\t<td>" . $oPatternListFromQuery->render() . "</td>\n"; |
| 50 | $sToRender .= "\t</tr>\n"; | 49 | $sToRender .= "\t</tr>\n"; |
| 51 | if ($bEditable) { | 50 | if ($bEditable) { |
| 52 | $sToRender .= "\t<tr>\n"; | 51 | $sToRender .= "\t<tr>\n"; |
| 53 | - $sToRender .= "<td colspan=\"2\"><a href=\"$default->rootUrl/control.php?action=modifyDocument&fDocumentID=$iDocumentID\"><image src=\"$default->graphicsUrl/widgets/edit.gif\" border=\"0\"></a></td>\n"; | 52 | + $sToRender .= "<td colspan=\"2\"><a href=\"$default->rootUrl/control.php?action=modifyDocument&fDocumentID=" . $oDocument->getID() . "\"><image src=\"$default->graphicsUrl/widgets/edit.gif\" border=\"0\"></a></td>\n"; |
| 54 | $sToRender .= "\t</tr>\n"; | 53 | $sToRender .= "\t</tr>\n"; |
| 55 | } | 54 | } |
| 56 | $sToRender .= "\t</table>\n"; | 55 | $sToRender .= "\t</table>\n"; |
| 57 | - $sToRender .= "</div>"; | ||
| 58 | - return $sToRender; | ||
| 59 | -} | ||
| 60 | - | ||
| 61 | -function renderEditableLinkedDocuments($oDocument) { | ||
| 62 | - global $default; | ||
| 63 | - | ||
| 64 | - $sQuery = "SELECT D.id AS child_document_id, D.name, DL.id as document_link_id, DL.parent_document_id AS parent_document_id, 'Unlink' AS unlink " . | ||
| 65 | - "FROM documents AS D INNER JOIN document_link AS DL ON D.id = DL.child_document_id " . | ||
| 66 | - "WHERE DL.parent_document_id = " . $oDocument->getID(); | ||
| 67 | - | ||
| 68 | - $aColumns = array("name", "unlink"); | ||
| 69 | - $aColumnHeaders = array("Document"); | ||
| 70 | - $aColumnTypes = array(3,3); | ||
| 71 | - $aDBColumnArray = array("parent_document_id", "child_document_id","document_link_id"); | ||
| 72 | - $aQueryStringVariableNames = array("fParentDocumentID","fChildDocumentID", "fDocumentLinkID"); | ||
| 73 | - $aLinkURLs = array(0=>"$default->rootUrl/control.php?action=viewDocument", 1=>"$default->rootUrl/control.php?action=removeDocumentLink"); | ||
| 74 | - | ||
| 75 | - $oPatternTableSqlQuery = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnHeaders, "100%", $aLinkURLs,$aDBColumnArray,$aQueryStringVariableNames); | ||
| 76 | - $oPatternTableSqlQuery->setTableHeading("Linked documents"); | ||
| 77 | - $oPatternTableSqlQuery->setDisplayColumnHeadings(true); | ||
| 78 | - | ||
| 79 | - $sToRender .= "<div id=\"linkedDocuments\" style=\"position:absolute;visibility:hidden;top:265px;left:130px;\">"; | ||
| 80 | - $sToRender .= "\t<table border=\"0\" width=\"100%\">\n"; | ||
| 81 | - $sToRender .= "\t<tr>\n"; | ||
| 82 | - $sToRender .= "\t\t<td>" . $oPatternTableSqlQuery->render() . "</td>\n"; | ||
| 83 | - $sToRender .= "\t</tr>"; | ||
| 84 | - $sToRender .= "\t<tr>\n"; | ||
| 85 | - $sToRender .= "<td><a href=\"$default->rootUrl/control.php?action=addDocumentLink&fDocumentID=" . $oDocument->getID() ."\"><img src=\"$default->graphicsUrl/widgets/add.gif\" border=\"0\"/></a></td>\n"; | ||
| 86 | - $sToRender .= "\t</tr>"; | ||
| 87 | - $sToRender .= "\t</table>\n"; | ||
| 88 | - $sToRender .= "</div>"; | ||
| 89 | - return $sToRender; | ||
| 90 | -} | ||
| 91 | 56 | ||
| 92 | -function renderNonEditableLinkedDocuments($oDocument) { | ||
| 93 | - global $default; | ||
| 94 | - | ||
| 95 | - $sQuery = "SELECT D.id, D.name, 'Delete' AS del " . | ||
| 96 | - "FROM documents AS D INNER JOIN document_link AS DL ON D.id = DL.child_document_id " . | ||
| 97 | - "WHERE DL.parent_document_id = " . $oDocument->getID(); | ||
| 98 | - | ||
| 99 | - $aColumns = array("name","del"); | ||
| 100 | - $aColumnNames = array("Document"); | ||
| 101 | - $aColumnTypes = array(1,3); | ||
| 102 | - | ||
| 103 | - $oPatternListFromQuery = & new PatternListFromQuery($sQuery, $aColumns, $aColumnNames, $aColumnTypes); | ||
| 104 | - $oPatternListFromQuery->setTableHeading("Linked documents"); | ||
| 105 | - $oPatternListFromQuery->setTableWidth("100%"); | ||
| 106 | - return $oPatternListFromQuery->render(); | 57 | + return renderDiv($sDivName, $sToRender); |
| 107 | } | 58 | } |
| 108 | 59 | ||
| 109 | 60 | ||
| 110 | -function renderGenericMetaData($oDocument) { | 61 | +function renderGenericMetaData($oDocument, $sDivName) { |
| 111 | global $default; | 62 | global $default; |
| 112 | $sQuery = "SELECT DF.name AS name, DFL.value as value " . | 63 | $sQuery = "SELECT DF.name AS name, DFL.value as value " . |
| 113 | "FROM $default->owl_documents_table AS D INNER JOIN $default->owl_document_fields_table AS DFL ON D.id = DFL.document_id " . | 64 | "FROM $default->owl_documents_table AS D INNER JOIN $default->owl_document_fields_table AS DFL ON D.id = DFL.document_id " . |
| @@ -117,23 +68,22 @@ function renderGenericMetaData($oDocument) { | @@ -117,23 +68,22 @@ function renderGenericMetaData($oDocument) { | ||
| 117 | $aColumns = array("name", "value"); | 68 | $aColumns = array("name", "value"); |
| 118 | $aColumnHeaders = array("Tag", "Value"); | 69 | $aColumnHeaders = array("Tag", "Value"); |
| 119 | $aColumnTypes = array(1,1); | 70 | $aColumnTypes = array(1,1); |
| 120 | - $oPatternTableSqlQuery = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnHeaders, "100%"); | 71 | + $oPatternTableSqlQuery = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnHeaders, "540"); |
| 121 | $oPatternTableSqlQuery->setTableHeading("Generic Meta Data"); | 72 | $oPatternTableSqlQuery->setTableHeading("Generic Meta Data"); |
| 122 | 73 | ||
| 123 | - $sToRender .= "<div id=\"genericMetaData\" style=\"position:absolute;visibility:hidden;top:265px;left:130px;\">"; | ||
| 124 | $sToRender .= "\t<table border=\"0\" width=\"100%\">\n"; | 74 | $sToRender .= "\t<table border=\"0\" width=\"100%\">\n"; |
| 125 | $sToRender .= "\t<tr>\n"; | 75 | $sToRender .= "\t<tr>\n"; |
| 126 | $sToRender .= "\t<td>" . $oPatternTableSqlQuery->render() . "</td>\n"; | 76 | $sToRender .= "\t<td>" . $oPatternTableSqlQuery->render() . "</td>\n"; |
| 127 | $sToRender .= "\t</tr>\n"; | 77 | $sToRender .= "\t</tr>\n"; |
| 128 | $sToRender .= "\t<tr>\n"; | 78 | $sToRender .= "\t<tr>\n"; |
| 129 | - $sToRender .= "<td><a href=\"$default->rootUrl/control.php?action=modifyDocumentGenericMetaData&fDocumentID=$iDocumentID\"><image src=\"$default->graphicsUrl/widgets/edit.gif\" border=\"0\"></a></td>\n"; | 79 | + $sToRender .= "<td><a href=\"$default->rootUrl/control.php?action=modifyDocumentGenericMetaData&fDocumentID=" . $oDocument->getID() . "\"><image src=\"$default->graphicsUrl/widgets/edit.gif\" border=\"0\"></a></td>\n"; |
| 130 | $sToRender .= "\t</tr>\n"; | 80 | $sToRender .= "\t</tr>\n"; |
| 131 | $sToRender .= "\t</table>\n"; | 81 | $sToRender .= "\t</table>\n"; |
| 132 | - $sToRender .= "</div>"; | ||
| 133 | - return $sToRender; | 82 | + |
| 83 | + return renderDiv($sDivName, $sToRender); | ||
| 134 | } | 84 | } |
| 135 | 85 | ||
| 136 | -function renderTypeSpecificMetaData($oDocument) { | 86 | +function renderTypeSpecificMetaData($oDocument, $sDivName) { |
| 137 | global $default; | 87 | global $default; |
| 138 | 88 | ||
| 139 | $sQuery = "SELECT DF.name AS name, DFL.value AS value " . | 89 | $sQuery = "SELECT DF.name AS name, DFL.value AS value " . |
| @@ -146,24 +96,55 @@ function renderTypeSpecificMetaData($oDocument) { | @@ -146,24 +96,55 @@ function renderTypeSpecificMetaData($oDocument) { | ||
| 146 | $aColumns = array("name", "value"); | 96 | $aColumns = array("name", "value"); |
| 147 | $aColumnHeaders = array("Tag", "Value"); | 97 | $aColumnHeaders = array("Tag", "Value"); |
| 148 | $aColumnTypes = array(1,1); | 98 | $aColumnTypes = array(1,1); |
| 149 | - $oPatternTableSqlQuery = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnHeaders, "100%"); | 99 | + $oPatternTableSqlQuery = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnHeaders, "540"); |
| 150 | $oPatternTableSqlQuery->setTableHeading("Type Specific Meta Data"); | 100 | $oPatternTableSqlQuery->setTableHeading("Type Specific Meta Data"); |
| 151 | $oPatternTableSqlQuery->setEmptyTableMessage("No Type Specific Meta Data"); | 101 | $oPatternTableSqlQuery->setEmptyTableMessage("No Type Specific Meta Data"); |
| 152 | 102 | ||
| 153 | - $sToRender .= "<div id=\"typeSpecificMetaData\" style=\"position:absolute;visibility:hidden;top:265px;left:130px;\">"; | ||
| 154 | $sToRender .= "\t<table border=\"0\" width=\"100%\">\n"; | 103 | $sToRender .= "\t<table border=\"0\" width=\"100%\">\n"; |
| 155 | $sToRender .= "\t<tr>\n"; | 104 | $sToRender .= "\t<tr>\n"; |
| 156 | $sToRender .= "\t\t<td>" . $oPatternTableSqlQuery->render() . "</td>\n"; | 105 | $sToRender .= "\t\t<td>" . $oPatternTableSqlQuery->render() . "</td>\n"; |
| 157 | $sToRender .= "\t</tr>\n"; | 106 | $sToRender .= "\t</tr>\n"; |
| 158 | $sToRender .= "\t<tr>\n"; | 107 | $sToRender .= "\t<tr>\n"; |
| 159 | - $sToRender .= "<td><a href=\"$default->rootUrl/control.php?action=modifyDocumentTypeMetaData&fDocumentID=$iDocumentID\"><image src=\"$default->graphicsUrl/widgets/edit.gif\" border=\"0\"></a></td>\n"; | 108 | + $sToRender .= "<td><a href=\"$default->rootUrl/control.php?action=modifyDocumentTypeMetaData&fDocumentID=" . $oDocument->getID() . "\"><image src=\"$default->graphicsUrl/widgets/edit.gif\" border=\"0\"></a></td>\n"; |
| 160 | $sToRender .= "\t</tr>\n"; | 109 | $sToRender .= "\t</tr>\n"; |
| 161 | $sToRender .= "\t</table>\n"; | 110 | $sToRender .= "\t</table>\n"; |
| 162 | - $sToRender .= "</div>"; | ||
| 163 | - return $sToRender; | 111 | + return renderDiv($sDivName, $sToRender); |
| 112 | +} | ||
| 113 | + | ||
| 114 | +function renderDocumentArchiveSettings($oDocument, $sDivName) { | ||
| 115 | + global $default; | ||
| 116 | + $sQuery = "SELECT d.id, atl.name, 'Edit' AS edit FROM $default->owl_document_archiving_table AS da " . | ||
| 117 | + "INNER JOIN $default->owl_archiving_type_lookup_table AS atl ON da.archiving_type_id=atl.id " . | ||
| 118 | + "INNER JOIN $default->owl_documents_table AS d ON da.document_id=d.id " . | ||
| 119 | + "WHERE d.id = " . $oDocument->getID(); | ||
| 120 | + | ||
| 121 | + $aColumns = array("name", "edit"); | ||
| 122 | + $aColumnHeaders = array("Archiving Type"); | ||
| 123 | + $aColumnTypes = array(1,3); | ||
| 124 | + $aDBColumnArray = array("id"); | ||
| 125 | + $aQueryStringVariableNames = array("fDocumentID"); | ||
| 126 | + $aLinkURLs = array(1=>"$default->rootUrl/control.php?action=modifyDocumentArchiveSettings"); | ||
| 127 | + $oPatternTableSqlQuery = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnHeaders, "540", $aLinkURLs ,$aDBColumnArray,$aQueryStringVariableNames); | ||
| 128 | + $oPatternTableSqlQuery->setTableHeading("Archiving Settings"); | ||
| 129 | + $oPatternTableSqlQuery->setEmptyTableMessage("No archiving settings"); | ||
| 130 | + $oPatternTableSqlQuery->setDisplayColumnHeadings(true); | ||
| 131 | + | ||
| 132 | + | ||
| 133 | + $sToRender .= "\t<table border=\"0\" width=\"100%\">\n"; | ||
| 134 | + $sToRender .= "\t<tr>\n"; | ||
| 135 | + $sToRender .= "\t\t<td>" . $oPatternTableSqlQuery->render() . "</td>\n"; | ||
| 136 | + $sToRender .= "\t</tr>"; | ||
| 137 | + $sToRender .= "\t<tr> \n"; | ||
| 138 | + // if there are no archiving settings then allow their addition | ||
| 139 | + $oDocumentArchiving = DocumentArchiving::getFromDocumentID($oDocument->getID()); | ||
| 140 | + $sToRender .= "\t\t<td>" . ($oDocumentArchiving ? "" : generateControllerLink("addDocumentArchiveSettings", "fDocumentID=" . $oDocument->getID(), "<img src=\"$default->graphicsUrl/widgets/add.gif\" border=\"0\"/>")) . "</td>\n"; | ||
| 141 | + $sToRender .= "\t</tr>"; | ||
| 142 | + $sToRender .= "\t</table>\n"; | ||
| 143 | + | ||
| 144 | + return renderDiv($sDivName, $sToRender); | ||
| 164 | } | 145 | } |
| 165 | 146 | ||
| 166 | -function renderEditableDocumentRouting($oDocument) { | 147 | +function renderEditableDocumentRouting($oDocument, $sDivName) { |
| 167 | global $default; | 148 | global $default; |
| 168 | $sQuery = "SELECT D.id as document_id, GFAL.id as id, R.name AS role_name, COALESCE(U.Name, 'Not assigned') AS name, GFAL.precedence AS precedence, COALESCE(FURL.active,0) AS active, COALESCE(FURL.done, 0) AS done, 'Edit' as edit " . | 149 | $sQuery = "SELECT D.id as document_id, GFAL.id as id, R.name AS role_name, COALESCE(U.Name, 'Not assigned') AS name, GFAL.precedence AS precedence, COALESCE(FURL.active,0) AS active, COALESCE(FURL.done, 0) AS done, 'Edit' as edit " . |
| 169 | "FROM documents AS D INNER JOIN $default->owl_groups_folders_approval_table AS GFAL ON D.folder_id = GFAL.folder_id " . | 150 | "FROM documents AS D INNER JOIN $default->owl_groups_folders_approval_table AS GFAL ON D.folder_id = GFAL.folder_id " . |
| @@ -179,11 +160,10 @@ function renderEditableDocumentRouting($oDocument) { | @@ -179,11 +160,10 @@ function renderEditableDocumentRouting($oDocument) { | ||
| 179 | $aQueryStringVariableNames = array("fFolderCollaborationID", "fDocumentID","fIsActive","fIsDone"); | 160 | $aQueryStringVariableNames = array("fFolderCollaborationID", "fDocumentID","fIsActive","fIsDone"); |
| 180 | $aLinkURLs = array(5=>"$default->rootUrl/control.php?action=modifyDocumentRouting"); | 161 | $aLinkURLs = array(5=>"$default->rootUrl/control.php?action=modifyDocumentRouting"); |
| 181 | 162 | ||
| 182 | - $oPatternTableSqlQuery = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnHeaders, "100%", $aLinkURLs,$aDBColumnArray,$aQueryStringVariableNames); | 163 | + $oPatternTableSqlQuery = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnHeaders, "540", $aLinkURLs,$aDBColumnArray,$aQueryStringVariableNames); |
| 183 | $oPatternTableSqlQuery->setTableHeading("Document Routing"); | 164 | $oPatternTableSqlQuery->setTableHeading("Document Routing"); |
| 184 | $oPatternTableSqlQuery->setDisplayColumnHeadings(true); | 165 | $oPatternTableSqlQuery->setDisplayColumnHeadings(true); |
| 185 | 166 | ||
| 186 | - $sToRender .= "<div id=\"documentRouting\" style=\"position:absolute;visibility:hidden;top:265px;left:130px;\">"; | ||
| 187 | $sToRender .= "\t<table border=\"0\" width=\"100%\">\n"; | 167 | $sToRender .= "\t<table border=\"0\" width=\"100%\">\n"; |
| 188 | $sToRender .= "\t<tr>\n"; | 168 | $sToRender .= "\t<tr>\n"; |
| 189 | $sToRender .= "\t\t<td>" . $oPatternTableSqlQuery->render() . "</td>\n"; | 169 | $sToRender .= "\t\t<td>" . $oPatternTableSqlQuery->render() . "</td>\n"; |
| @@ -222,9 +202,8 @@ function renderEditableDocumentRouting($oDocument) { | @@ -222,9 +202,8 @@ function renderEditableDocumentRouting($oDocument) { | ||
| 222 | } | 202 | } |
| 223 | $sToRender .= "\t</tr>"; | 203 | $sToRender .= "\t</tr>"; |
| 224 | $sToRender .= "\t</table>\n"; | 204 | $sToRender .= "\t</table>\n"; |
| 225 | - $sToRender .= "</div>"; | ||
| 226 | - return $sToRender; | ||
| 227 | - | 205 | + |
| 206 | + return renderDiv($sDivName, $sToRender); | ||
| 228 | } | 207 | } |
| 229 | 208 | ||
| 230 | function renderNonEditableDocumentRouting($oDocument) { | 209 | function renderNonEditableDocumentRouting($oDocument) { |
| @@ -240,46 +219,66 @@ function renderNonEditableDocumentRouting($oDocument) { | @@ -240,46 +219,66 @@ function renderNonEditableDocumentRouting($oDocument) { | ||
| 240 | $aColumns = array("role_name", "name", "precedence", "active", "done"); | 219 | $aColumns = array("role_name", "name", "precedence", "active", "done"); |
| 241 | $aColumnHeaders = array("Role", "User", "Seq", "Active", "Done"); | 220 | $aColumnHeaders = array("Role", "User", "Seq", "Active", "Done"); |
| 242 | $aColumnTypes = array(1,1,1,1,1); | 221 | $aColumnTypes = array(1,1,1,1,1); |
| 243 | - $oPatternTableSqlQuery = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnHeaders, "100%", "$default->rootUrl/control.php?action=modifyDocumentRouting",$aDBColumnArray,$aQueryStringVariableNames); | 222 | + $oPatternTableSqlQuery = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnHeaders, "540", "$default->rootUrl/control.php?action=modifyDocumentRouting",$aDBColumnArray,$aQueryStringVariableNames); |
| 244 | $oPatternTableSqlQuery->setTableHeading("Document Routing"); | 223 | $oPatternTableSqlQuery->setTableHeading("Document Routing"); |
| 245 | $oPatternTableSqlQuery->setDisplayColumnHeadings(true); | 224 | $oPatternTableSqlQuery->setDisplayColumnHeadings(true); |
| 246 | return $oPatternTableSqlQuery->render(); | 225 | return $oPatternTableSqlQuery->render(); |
| 247 | 226 | ||
| 248 | } | 227 | } |
| 249 | 228 | ||
| 250 | -function renderDocumentArchiveSettings($oDocument) { | ||
| 251 | - global $default; | ||
| 252 | - $sQuery = "SELECT d.id, atl.name, 'Edit' AS edit FROM $default->owl_document_archiving_table AS da " . | ||
| 253 | - "INNER JOIN $default->owl_archiving_type_lookup_table AS atl ON da.archiving_type_id=atl.id " . | ||
| 254 | - "INNER JOIN $default->owl_documents_table AS d ON da.document_id=d.id " . | ||
| 255 | - "WHERE d.id = " . $oDocument->getID(); | 229 | +function renderEditableLinkedDocuments($oDocument, $sDivName) { |
| 230 | + global $default; | ||
| 231 | + | ||
| 232 | + $sQuery = "SELECT D.id AS child_document_id, D.name, DL.id as document_link_id, DL.parent_document_id AS parent_document_id, 'Unlink' AS unlink " . | ||
| 233 | + "FROM documents AS D INNER JOIN document_link AS DL ON D.id = DL.child_document_id " . | ||
| 234 | + "WHERE DL.parent_document_id = " . $oDocument->getID(); | ||
| 235 | + | ||
| 236 | + $aColumns = array("name", "unlink"); | ||
| 237 | + $aColumnHeaders = array("Document"); | ||
| 238 | + $aColumnTypes = array(3,3); | ||
| 239 | + $aDBColumnArray = array("parent_document_id", "child_document_id","document_link_id"); | ||
| 240 | + $aQueryStringVariableNames = array("fParentDocumentID","fChildDocumentID", "fDocumentLinkID"); | ||
| 241 | + $aLinkURLs = array(0=>"$default->rootUrl/control.php?action=viewDocument", 1=>"$default->rootUrl/control.php?action=removeDocumentLink"); | ||
| 242 | + | ||
| 243 | + $oPatternTableSqlQuery = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnHeaders, "540", $aLinkURLs,$aDBColumnArray,$aQueryStringVariableNames); | ||
| 244 | + $oPatternTableSqlQuery->setTableHeading("Linked documents"); | ||
| 245 | + $oPatternTableSqlQuery->setDisplayColumnHeadings(true); | ||
| 256 | 246 | ||
| 257 | - $aColumns = array("name", "edit"); | ||
| 258 | - $aColumnHeaders = array("Archiving Type"); | 247 | + $sToRender .= "\t<table border=\"0\" width=\"100%\">\n"; |
| 248 | + $sToRender .= "\t<tr>\n"; | ||
| 249 | + $sToRender .= "\t\t<td>" . $oPatternTableSqlQuery->render() . "</td>\n"; | ||
| 250 | + $sToRender .= "\t</tr>"; | ||
| 251 | + $sToRender .= "\t<tr>\n"; | ||
| 252 | + $sToRender .= "<td><a href=\"$default->rootUrl/control.php?action=addDocumentLink&fDocumentID=" . $oDocument->getID() ."\"><img src=\"$default->graphicsUrl/widgets/add.gif\" border=\"0\"/></a></td>\n"; | ||
| 253 | + $sToRender .= "\t</tr>"; | ||
| 254 | + $sToRender .= "\t</table>\n"; | ||
| 255 | + return renderDiv($sDivName, $sToRender); | ||
| 256 | +} | ||
| 257 | + | ||
| 258 | +function renderNonEditableLinkedDocuments($oDocument, $sDivName) { | ||
| 259 | + global $default; | ||
| 260 | + | ||
| 261 | + $sQuery = "SELECT D.id, D.name, 'Delete' AS del " . | ||
| 262 | + "FROM documents AS D INNER JOIN document_link AS DL ON D.id = DL.child_document_id " . | ||
| 263 | + "WHERE DL.parent_document_id = " . $oDocument->getID(); | ||
| 264 | + | ||
| 265 | + $aColumns = array("name","del"); | ||
| 266 | + $aColumnNames = array("Document"); | ||
| 259 | $aColumnTypes = array(1,3); | 267 | $aColumnTypes = array(1,3); |
| 260 | - $aDBColumnArray = array("id"); | ||
| 261 | - $aQueryStringVariableNames = array("f "); | ||
| 262 | - $aLinkURLs = array(1=>"$default->rootUrl/control.php?action=modifyDocumentArchiveSettings"); | ||
| 263 | - $oPatternTableSqlQuery = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnHeaders, "100%", $aLinkURLs ,$aDBColumnArray,$aQueryStringVariableNames); | ||
| 264 | - $oPatternTableSqlQuery->setTableHeading("Archiving Settings"); | ||
| 265 | - $oPatternTableSqlQuery->setEmptyTableMessage("No archiving settings"); | ||
| 266 | - $oPatternTableSqlQuery->setDisplayColumnHeadings(true); | ||
| 267 | 268 | ||
| 268 | - $sToRender .= "<div id=\"archiveSettings\" style=\"position:absolute;visibility:hidden;top:265px;left:130px;\">"; | ||
| 269 | - $sToRender .= "\t<table border=\"0\" width=\"100%\">\n"; | 269 | + $oPatternListFromQuery = & new PatternListFromQuery($sQuery, $aColumns, $aColumnNames, $aColumnTypes); |
| 270 | + $oPatternListFromQuery->setTableHeading("Linked documents"); | ||
| 271 | + $oPatternListFromQuery->setTableWidth("100%"); | ||
| 272 | + | ||
| 273 | + $sToRender .= "\t<table border=\"0\" width=\"100%\">\n"; | ||
| 270 | $sToRender .= "\t<tr>\n"; | 274 | $sToRender .= "\t<tr>\n"; |
| 271 | $sToRender .= "\t\t<td>" . $oPatternTableSqlQuery->render() . "</td>\n"; | 275 | $sToRender .= "\t\t<td>" . $oPatternTableSqlQuery->render() . "</td>\n"; |
| 272 | $sToRender .= "\t</tr>"; | 276 | $sToRender .= "\t</tr>"; |
| 273 | - $sToRender .= "\t<tr>\n"; | ||
| 274 | - // if there are no archiving settings then allow their addition | ||
| 275 | - $oDocumentArchiving = DocumentArchiving::getFromDocumentID($oDocument->getID()); | ||
| 276 | - $sToRender .= "\t\t<td>" . ((!$oDocumentArchiving) ? "<a href=\"$default->rootUrl/control.php?action=addDocumentArchiveSettings&fDocumentID=" . $oDocument->getID() . "\"><img src=\"$default->graphicsUrl/widgets/add.gif\" border=\"0\"/></a>" : "") . "</td>\n"; | ||
| 277 | - $sToRender .= "\t</tr>"; | ||
| 278 | $sToRender .= "\t</table>\n"; | 277 | $sToRender .= "\t</table>\n"; |
| 279 | - $sToRender .= "</div>"; | ||
| 280 | - return $sToRender; | 278 | + return renderDiv($sDivName, $sToRender); |
| 281 | } | 279 | } |
| 282 | 280 | ||
| 281 | + | ||
| 283 | function displayActionButtons($oDocument, $bEdit) { | 282 | function displayActionButtons($oDocument, $bEdit) { |
| 284 | global $default; | 283 | global $default; |
| 285 | if ($bEdit) { | 284 | if ($bEdit) { |
| @@ -319,31 +318,53 @@ function displayActionButtons($oDocument, $bEdit) { | @@ -319,31 +318,53 @@ function displayActionButtons($oDocument, $bEdit) { | ||
| 319 | } | 318 | } |
| 320 | 319 | ||
| 321 | function renderDiv($sDivName, $sHtml) { | 320 | function renderDiv($sDivName, $sHtml) { |
| 322 | - return "<div id=\"$sDivName\" style=\"position:absolute;visibility:hidden;top:265px;left:130px;\">$sHtml</div>"; | 321 | + global $default; |
| 322 | + | ||
| 323 | + if ( in_array($default->browser, array("moz", "ns")) ) { | ||
| 324 | + return "<div id=\"$sDivName\" style=\"position:absolute;visibility:hidden;top:250px;left:130px;\">$sHtml</div>"; | ||
| 325 | + } else { | ||
| 326 | + return "<div id=\"$sDivName\" style=\"position:absolute;visibility:hidden;top:160px;left:0px;\">$sHtml</div>"; | ||
| 327 | + } | ||
| 323 | } | 328 | } |
| 324 | 329 | ||
| 330 | +function renderDocumentSection($sHeading) { | ||
| 331 | + return "<tr bgcolor=\"" . getColour($iColour) . "\"><td width=\"100%\">$sHeading</td></tr>\n"; | ||
| 332 | +} | ||
| 333 | + | ||
| 325 | function getEditPage($oDocument) { | 334 | function getEditPage($oDocument) { |
| 326 | global $default; | 335 | global $default; |
| 327 | - $iDocumentID = $oDocument->getID(); | ||
| 328 | - | ||
| 329 | - $sToRender = renderHeading("Document Detail") . renderDocumentPath($oDocument) . "\n\n"; | 336 | + |
| 337 | +// if ( ($default->browser == "moz") && ($default->version <= 4.79) ) { | ||
| 338 | + $sToRender = "<div id=\"headings\" style=\"position:absolute;visibility:visible;top:106px;left:132px;\">"; | ||
| 339 | +// } else { | ||
| 340 | +// $sToRender = "<div id=\"headings\" style=\"position:absolute;visibility:visible;top:0px;left:0px;\">"; | ||
| 341 | +// } | ||
| 342 | + | ||
| 343 | + $sToRender .= renderHeading("Document Detail"); | ||
| 344 | + $sToRender .= renderDocumentPath($oDocument) . "\n\n"; | ||
| 345 | + $sToRender .= "<table border=\"0\" width=\"540\">"; | ||
| 346 | + $sToRender .= renderDocumentSection("<a href=\"javascript:void();\" onClick=\"switchDiv('documentData');\">Document Data</a>"); | ||
| 347 | + $sToRender .= renderDocumentSection("<a href=\"javascript:void();\" onClick=\"switchDiv('genericMetaData');\">Generic Meta Data</a>"); | ||
| 348 | + $sToRender .= renderDocumentSection("<a href=\"javascript:void();\" onClick=\"switchDiv('typeSpecificMetaData');\">Type Specific Meta Data</a>"); | ||
| 349 | + $sToRender .= renderDocumentSection("<a href=\"javascript:void();\" onClick=\"switchDiv('archiveSettings');\">Archive Settings</a>"); | ||
| 350 | + $sToRender .= renderDocumentSection("<a href=\"javascript:void();\" onClick=\"switchDiv('documentRouting');\">Document Routing</a>"); | ||
| 351 | + $sToRender .= renderDocumentSection("<a href=\"javascript:void();\" onClick=\"switchDiv('linkedDocuments');\">Linked Documents</a>"); | ||
| 352 | + $sToRender .= "</table>"; | ||
| 353 | + $sToRender .= "</div>"; | ||
| 330 | 354 | ||
| 331 | - $sToRender .= renderHeading("<a href=\"javascript:void();\" onClick=\"switchDiv('documentData');\">Document Data</a>"); | ||
| 332 | - $sToRender .= renderHeading("<a href=\"javascript:void();\" onClick=\"switchDiv('genericMetaData');\">Generic Meta Data</a>"); | ||
| 333 | - $sToRender .= renderHeading("<a href=\"javascript:void();\" onClick=\"switchDiv('typeSpecificMetaData');\">Type Specific Meta Data</a>"); | ||
| 334 | - $sToRender .= renderHeading("<a href=\"javascript:void();\" onClick=\"switchDiv('archiveSettings');\">Archive Settings</a>"); | ||
| 335 | - $sToRender .= renderHeading("<a href=\"javascript:void();\" onClick=\"switchDiv('documentRouting');\">Document Routing</a>"); | ||
| 336 | - $sToRender .= renderHeading("<a href=\"javascript:void();\" onClick=\"switchDiv('linkedDocuments');\">Linked Documents</a>"); | ||
| 337 | - | ||
| 338 | - $sToRender .= renderDocumentData($oDocument, true); | ||
| 339 | - $sToRender .= renderTypeSpecificMetaData($oDocument); | ||
| 340 | - $sToRender .= renderDocumentArchiveSettings($oDocument); | ||
| 341 | - $sToRender .= renderEditableLinkedDocuments($oDocument); | ||
| 342 | - $sToRender .= renderEditableDocumentRouting($oDocument); | ||
| 343 | - $sToRender .= renderGenericMetaData($oDocument); | 355 | + $sToRender .= renderDocumentData($oDocument, "documentData", true); |
| 356 | + $sToRender .= renderDocumentArchiveSettings($oDocument, "archiveSettings"); | ||
| 357 | + $sToRender .= renderEditableDocumentRouting($oDocument, "documentRouting"); | ||
| 358 | + $sToRender .= renderGenericMetaData($oDocument, "genericMetaData"); | ||
| 359 | + $sToRender .= renderEditableLinkedDocuments($oDocument, "linkedDocuments"); | ||
| 360 | + $sToRender .= renderTypeSpecificMetaData($oDocument, "typeSpecificMetaData"); | ||
| 344 | 361 | ||
| 345 | - $sToRender .= "<div id=\"actionButtons\" style=\"position:absolute;top:265px;left:657px;\">"; | ||
| 346 | - $sToRender .= "<table>\n"; | 362 | +// if ( ($default->browser == "moz") && ($default->version <= 4.79) ) { |
| 363 | +// $sToRender .= "<div id=\"actionButtons\" style=\"position:absolute;visibility:visible;top:250px;left:657px;\">"; | ||
| 364 | +// } else { | ||
| 365 | + $sToRender .= "<div id=\"actionButtons\" style=\"position:absolute;visibility:visible;top:155px;left:665px;\">"; | ||
| 366 | +// } | ||
| 367 | + $sToRender .= "<table cellspacing=0 cellpadding=0>\n"; | ||
| 347 | $sToRender .= displayActionButtons($oDocument, true); | 368 | $sToRender .= displayActionButtons($oDocument, true); |
| 348 | $sToRender .= "</table>\n"; | 369 | $sToRender .= "</table>\n"; |
| 349 | $sToRender .= "</div>"; | 370 | $sToRender .= "</div>"; |