From 5f9032979ca2a229c84bbe8243751b29d2881df4 Mon Sep 17 00:00:00 2001 From: steinm Date: Tue, 9 Oct 2012 09:59:25 +0000 Subject: [PATCH] - added searching for attributes --- op/op.Search.php | 32 +++++++++++++++++++++++++++----- out/out.SearchForm.php | 14 ++++++++++++++ 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/op/op.Search.php b/op/op.Search.php index aedde1ec2..fe7eb0365 100644 --- a/op/op.Search.php +++ b/op/op.Search.php @@ -92,6 +92,7 @@ if (isset($_GET['searchin']) && is_array($_GET["searchin"])) { case 1: // keywords case 2: // name case 3: // comment + case 4: // attributes $searchin[$si] = $si; break; } @@ -100,7 +101,7 @@ if (isset($_GET['searchin']) && is_array($_GET["searchin"])) { } // if none is checkd search all -if (count($searchin)==0) $searchin=array( 0, 1, 2, 3); +if (count($searchin)==0) $searchin=array( 0, 1, 2, 3, 4); // Check to see if the search has been restricted to a particular sub-tree in // the folder hierarchy. @@ -184,6 +185,11 @@ if(isset($_GET['categoryids']) && $_GET['categoryids']) { } } +if (isset($_GET["attributes"])) + $attributes = $_GET["attributes"]; +else + $attributes = array(); + // // Get the page number to display. If the result set contains more than // 25 entries, it is displayed across multiple pages. @@ -206,7 +212,7 @@ if (isset($_GET["pg"])) { // ---------------- Start searching ----------------------------------------- $startTime = getTime(); -$resArr = $dms->search($query, $limit, ($pageNumber-1)*$limit, $mode, $searchin, $startFolder, $owner, $status, $startdate, $stopdate, array(), array(), $categories); +$resArr = $dms->search($query, $limit, ($pageNumber-1)*$limit, $mode, $searchin, $startFolder, $owner, $status, $startdate, $stopdate, array(), array(), $categories, $attributes); $searchTime = getTime() - $startTime; $searchTime = round($searchTime, 2); @@ -234,6 +240,7 @@ print ""; print "\n\n"; print "\n"; print "\n"; +print "\n"; print "\n"; print "\n"; print "\n"; @@ -265,7 +272,20 @@ foreach ($entries as $entry) { } print $docName; print ""; - + + $attributes = $lc->getAttributes(); + print ""; + $owner = $document->getOwner(); print ""; $display_status=$lc->getStatus(); @@ -289,11 +309,13 @@ foreach ($entries as $entry) { print ""; print ""; + print ""; $owner = $folder->getOwner(); print ""; diff --git a/out/out.SearchForm.php b/out/out.SearchForm.php index aa205317f..7963783f6 100644 --- a/out/out.SearchForm.php +++ b/out/out.SearchForm.php @@ -103,9 +103,23 @@ function chooseKeywords(target) {
  • ()
  • +
  • +getAllAttributeDefinitions(array(LetoDMS_Core_AttributeDefinition::objtype_document, LetoDMS_Core_AttributeDefinition::objtype_documentcontent/*, LetoDMS_Core_AttributeDefinition::objtype_all*/)); + if($attrdefs) { + foreach($attrdefs as $attrdef) { +?> + + + + +
    ".getMLText("name")."".getMLText("attributes")."".getMLText("owner")."".getMLText("status")."".getMLText("version").""; + print "
      \n"; + $attributes = $lc->getAttributes(); + if($attributes) { + foreach($attributes as $attribute) { + $attrdef = $attribute->getAttributeDefinition(); + print "
    • ".htmlspecialchars($attrdef->getName()).": ".htmlspecialchars($attribute->getValue())."
    • \n"; + } + } + print "
    \n"; + print "
    ".htmlspecialchars($owner->getFullName())."getID()."\">getID()."\">"; $path = $folder->getPath(); - for ($i = 1; $i < count($path); $i++) { - print "/".htmlspecialchars($path[$i]->getName()); + print "/"; + for ($i = 1; $i < count($path)-1; $i++) { + print htmlspecialchars($path[$i]->getName())."/"; } print $folderName; print "".htmlspecialchars($owner->getFullName())."
    getName(); ?>
    :
    ()