";
- $sql = $default->db;
- // perform query
- if ($sql->query($sQuery)) {
- if ($sql->num_rows() > 0) {
- $sToRender .= "| The following archived documents meet your search string.";
- $sToRender .= " |
| Select the documents you'd like to restore, and click 'Restore', or 'Cancel' to abort |
\n";
-
- while ($sql->next_record()) {
- // and print document paths with checkboxes
- $oDocument = Document::get($sql->f("document_id"));
- $sToRender .= "\t\n";
- $sToRender .= "\t\t| \n";
- $sToRender .= "getID() . "\"/>\n";
- $sToRender .= $oDocument->getDisplayPath() . "\n";
- $sToRender .= "\t\t | \n";
- $sToRender .= "\t
\n";
- }
- $sToRender .= "graphicsUrl/widgets/restore.gif\" border=\"0\"/>\n";
- $sToRender .= generateControllerLink("archivedDocuments", "", " graphicsUrl/widgets/cancel.gif\" border=\"0\"> |
");
- } else {
- $sToRender .= "| Your query did not return any archived documents.";
- $sToRender .= " |
" . generateControllerLink("archivedDocuments", "", " graphicsUrl/widgets/back.gif\" border=\"0\">") . " |
\n";
- }
- } else {
- // query failed
- $sToRender .= "| There was an error processing your query- please try again later.";
- $sToRender .= " |
" . generateControllerLink("archivedDocuments", "", " graphicsUrl/widgets/back.gif\" border=\"0\">") . " |
\n";
- }
+ $sToRender .= "";
return $sToRender;
diff --git a/presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/manageArchivedDocumentsBL.php b/presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/manageArchivedDocumentsBL.php
index a5158f8..41e4649 100644
--- a/presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/manageArchivedDocumentsBL.php
+++ b/presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/manageArchivedDocumentsBL.php
@@ -8,6 +8,8 @@ require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc");
require_once("$default->fileSystemRoot/lib/visualpatterns/PatternBrowsableSearchResults.inc");
require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListBox.inc");
require_once("$default->uiDirectory/documentmanagement/documentUI.inc");
+require_once("$default->uiDirectory/search/advancedSearchUI.inc");
+require_once("$default->uiDirectory/search/advancedSearchUtil.inc");
require_once("archivedDocumentsUI.inc");
require_once("$default->fileSystemRoot/presentation/Html.inc");
@@ -31,8 +33,21 @@ if (checkSession()) {
if (strlen($fSearchString) > 0) {
// perform the search and display the results
- $fStartIndex = isset($fStartIndex) ? $fStartIndex : 0;
- $oContent->setHtml(renderArchivedDocumentsResultsPage($fSearchString, $fStartIndex));
+ $sMetaTagIDs = getChosenMetaDataTags();
+ if (strlen($sMetaTagIDs) > 0) {
+ $sSQLSearchString = getSQLSearchString($fSearchString);
+ $sDocumentIDs = getApprovedDocumentString($sMetaTagIDs, $sSQLSearchString, "Archived");
+ if (strlen($sDocumentIDs) > 0) {
+ // display the documents
+ $oContent->setHtml(renderArchivedDocumentsResultsPage($sDocumentIDs));
+ } else {
+ $oContent->setHtml(getSearchPage($fSearchString, explode(",",$sMetaTagIDs), "Archived Documents Search", true));
+ $sErrorMessage = "No documents matched your search criteria";
+ }
+ } else {
+ $oContent->setHtml(getSearchPage($fSearchString, array(), "Archived Documents Search", true));
+ $sErrorMessage = "Please select at least one criteria to search by";
+ }
} else if ($fDocumentIDs) {
// got some documents to restore
@@ -72,12 +87,16 @@ if (checkSession()) {
$oContent->setHtml(renderRestoreConfirmationPage($aDocuments));
}
} else {
- // display the search form
- $oContent->setHtml(renderSearchPage());
+ // display the advanced search form, but specify that only archived documents must be returned
+ //getSearchPage($sSearchString = "", $aMetaTagIDs = array(), $sHeading = "Advanced Search", $bSearchArchive = false) {
+ $oContent->setHtml(getSearchPage("", array(), "Archived Documents Search", true));
}
// build the page
- require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc");
+ require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc");
+ if (isset($sErrorMessage)) {
+ $main->setErrorMessage($sErrorMessage);
+ }
$main->setCentralPayload($oContent);
$main->setFormAction($_SERVER['PHP_SELF']);
$main->setHasRequiredFields(true);