Commit 3cc6bfea4618c1a9e00542c5e7b0639f5b8484d6
1 parent
ecff1aa2
integrating document archiving into document view page
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1926 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
14 additions
and
13 deletions
presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc
| ... | ... | @@ -173,16 +173,18 @@ function renderNonEditableDocumentRouting($oDocument) { |
| 173 | 173 | |
| 174 | 174 | function renderDocumentArchiveSettings($oDocument) { |
| 175 | 175 | global $default; |
| 176 | - $sQuery = "SELECT d.id, expiration_date, utilisation_threshold, 'Edit' as edit FROM $default->owl_archive_settings_table AS a " . | |
| 177 | - "INNER JOIN $default->owl_documents_table as d on a.document_id=d.id " . | |
| 176 | + $sQuery = "SELECT d.id, atl.name, 'Edit' AS edit FROM $default->owl_document_archiving_table AS da " . | |
| 177 | + "INNER JOIN $default->owl_archiving_type_lookup_table AS atl ON da.archiving_type_id=atl.id " . | |
| 178 | + "INNER JOIN $default->owl_documents_table AS d ON da.document_id=d.id " . | |
| 178 | 179 | "WHERE d.id = " . $oDocument->getID(); |
| 179 | 180 | |
| 180 | - $aColumns = array("expiration_date", "utilisation_threshold", "edit"); | |
| 181 | - $aColumnHeaders = array("Expiration Date", "Utilisation Threshold"); | |
| 182 | - $aColumnTypes = array(1,1,3); | |
| 181 | + $aColumns = array("name", "edit"); | |
| 182 | + $aColumnHeaders = array("Archiving Type"); | |
| 183 | + $aColumnTypes = array(1,3); | |
| 183 | 184 | $aDBColumnArray = array("id"); |
| 184 | 185 | $aQueryStringVariableNames = array("fDocumentID"); |
| 185 | - $oPatternTableSqlQuery = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnHeaders, "90%", "$default->rootUrl/control.php?action=modifyDocumentArchiveSettings",$aDBColumnArray,$aQueryStringVariableNames); | |
| 186 | + $aLinkURLs = array(1=>"$default->rootUrl/control.php?action=modifyDocumentArchiveSettings"); | |
| 187 | + $oPatternTableSqlQuery = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnHeaders, "90%", $aLinkURLs ,$aDBColumnArray,$aQueryStringVariableNames); | |
| 186 | 188 | $oPatternTableSqlQuery->setTableHeading("Archiving Settings"); |
| 187 | 189 | $oPatternTableSqlQuery->setEmptyTableMessage("No archiving settings"); |
| 188 | 190 | $oPatternTableSqlQuery->setDisplayColumnHeadings(true); |
| ... | ... | @@ -219,7 +221,7 @@ function displayActionButtons($oDocument, $bEdit) { |
| 219 | 221 | } |
| 220 | 222 | $sToRender .= "<td><a onClick=\"alert('This will download a copy of the document and is not the same as Checking Out a document- changes to this downloaded file will not be managed in the DMS.'); return true;\" href=\"" . generateControllerLink("viewDocument", "fDocumentID=" . $oDocument->getID() . "&fForDownload=1") . "\"><img src=\"$default->graphicsUrl/widgets/download.gif\" border=\"0\" /></a></td>\n"; |
| 221 | 223 | $sToRender .= "<td><a href=\"" . generateControllerLink("viewDiscussion", "fDocumentID=" . $oDocument->getID() . "&fForDiscussion=1") . "\"><img src=\"$default->graphicsUrl/widgets/discussion.gif\" border=\"0\" /></a></td>\n"; |
| 222 | - //$sToRender .= "<td><a href=\"" . generateControllerLink("archiveDocument", "fDocumentID=" . $oDocument->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/archive.gif\" border=\"0\" /></a></td>\n"; | |
| 224 | + $sToRender .= "<td><a href=\"" . generateControllerLink("archiveDocument", "fDocumentID=" . $oDocument->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/archive.gif\" border=\"0\" /></a></td>\n"; | |
| 223 | 225 | |
| 224 | 226 | return $sToRender; |
| 225 | 227 | } |
| ... | ... | @@ -264,19 +266,18 @@ function getEditPage($oDocument) { |
| 264 | 266 | $sToRender .= "<td valign=top>\n"; |
| 265 | 267 | |
| 266 | 268 | $sToRender .= "\t<table border=\"0\">\n"; |
| 267 | - /* | |
| 269 | + | |
| 268 | 270 | $sToRender .= "\t<tr>\n"; |
| 269 | 271 | $sToRender .= "\t\t<td>" . renderDocumentArchiveSettings($oDocument) . "</td>\n"; |
| 270 | 272 | $sToRender .= "\t</tr>"; |
| 271 | 273 | // if there are no archiving settings then allow their addition |
| 272 | - $oArchiveSettings = ArchiveSettings::getFromDocumentID($iDocumentID); | |
| 273 | - if (!$oArchiveSettings) { | |
| 274 | + $oDocumentArchiving = DocumentArchiving::getFromDocumentID($iDocumentID); | |
| 275 | + if (!$oDocumentArchiving) { | |
| 274 | 276 | $sToRender .= "\t<tr>\n"; |
| 275 | - $sToRender .= "\t\t<td><a href=\"$default->rootUrl/control.php?action=modifyDocumentArchiveSettings&fDocumentID=$iDocumentID\"><img src=\"$default->graphicsUrl/widgets/edit.gif\" border=\"0\"/></a></td>\n"; | |
| 277 | + $sToRender .= "\t\t<td><a href=\"$default->rootUrl/control.php?action=addDocumentArchiveSettings&fDocumentID=$iDocumentID\"><img src=\"$default->graphicsUrl/widgets/add.gif\" border=\"0\"/></a></td>\n"; | |
| 276 | 278 | $sToRender .= "\t</tr>"; |
| 277 | 279 | } |
| 278 | - */ | |
| 279 | - | |
| 280 | + | |
| 280 | 281 | $sToRender .= "\t<tr>\n"; |
| 281 | 282 | $sToRender .= "\t\t<td>" . renderEditableDocumentRouting($oDocument) . "</td>\n"; |
| 282 | 283 | $sToRender .= "\t</tr>"; | ... | ... |