Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
generic_isearch.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5  * @package FDL
6 */
7 /**
8  * Searches of referenced documents
9  *
10  * @author Anakeen 2000
11  * @version $Id: generic_isearch.php,v 1.13 2007/09/07 07:23:57 eric Exp $
12  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13  * @package FDL
14  * @subpackage
15  */
16 /**
17  */
18 
19 include_once ("FDL/Class.DocSearch.php");
20 include_once ("FDL/freedom_util.php");
21 include_once ("GENERIC/generic_util.php");
22 
23 include_once ("FDL/Class.DocRel.php");
24 // -----------------------------------
26 {
27  // -----------------------------------
28  // Get all the params
29  $docid = GetHttpVars("id"); // id doc to search
30  $famid = GetHttpVars("famid", 0); // restriction of search
31  $viewone = GetHttpVars("viewone"); //
32  $generic = (GetHttpVars("generic") == "Y"); //
33  $dbaccess = $action->GetParam("FREEDOM_DB");
34 
35  if (($famid !== 0) && (!is_numeric($famid))) {
36  $nfamid = getFamIdFromName($dbaccess, $famid);
37  if (!$nfamid) $action->addWarningMsg(sprintf("family %s not found", $famid));
38  else $famid = $nfamid;
39  }
40 
41  if ($docid == "") $action->exitError(_("related search aborted : no parameter found"));
42 
44 
45  $sdoc = createTmpDoc($dbaccess, 38); //new Special Seraches
46  $sdoc->setValue("ba_title", sprintf(_("related documents of %s") , $doc->title));
47  $sdoc->setValue("se_phpfile", "fdlsearches.php");
48  $sdoc->setValue("se_phpfunc", "relateddoc");
49  $sdoc->setValue("se_phparg", "$docid,$famid");
50 
51  $sdoc->Add();
52 
53  setHttpVar("dirid", $sdoc->id);
54  if ($generic) {
55  include_once ("GENERIC/generic_list.php");
56  generic_list($action);
57  // redirect($action,"GENERIC","GENERIC_LIST&dirid=".$sdoc->id."&famid=$famid&catg=0");
58 
59  } else {
60  include_once ("FREEDOM/freedom_view.php");
61  $action->parent->name = "FREEDOM";
62  $freedomApp = new Application($action->dbaccess);
63  $freedomApp->Set('FREEDOM', $action->parent);
64  $viewMode = $freedomApp->getParam('FREEDOM_VIEW');
65  setHttpVar("view", $viewMode);
66  setHttpVar("target", "gisearch");
67  freedom_view($action, false);
68  // redirect($action,"FREEDOM","FREEDOM_VIEW&viewone=$viewone&dirid=".$sdoc->id);
69 
70  }
71  //
72 
73 
74 }
75 ?>
← centre documentaire © anakeen - published under CC License - Dynacase