Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
freedom_searchprocess.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  * Interface to create new execution from batch
8  *
9  * @author Anakeen
10  * @version $Id: freedom_searchprocess.php,v 1.1 2005/08/19 16:14:50 eric Exp $
11  * @package FDL
12  * @subpackage
13  */
14 /**
15  */
16 
17 include_once ("FDL/Class.DocSearch.php");
18 include_once ("FDL/freedom_util.php");
19 include_once ("GENERIC/generic_util.php");
20 /**
21  * View a document
22  * @param Action &$action current action
23  * @global id int Http var : document identifier for process document
24  * @global target string Http var : window name when click on document
25  */
27 {
28  // -----------------------------------
29  // Get all the params
30  $docid = GetHttpVars("id"); // id doc to search
31  $target = GetHttpVars("target"); //
32  $dbaccess = $action->dbaccess;
33 
34  if ($docid == "") $action->exitError(_("related search aborted : no parameter found"));
35 
37  /*
38  * @var DocSearch $sdoc
39  */
40  $sdoc = createDoc($dbaccess, 5); //new DocSearch($dbaccess);
41  $sdoc->doctype = 'T'; // it is a temporary document (will be delete after)
42  $sdoc->title = sprintf(_("process search comes from %s") , $doc->title);
43 
44  $sdoc->Add();
45 
46  $sqlfilter[] = "locked != -1";
47 
48  $tdoc = $doc->getRevisions("TABLE");
49  $tid = array();
50  foreach ($tdoc as $k => $v) $tid[] = $v["id"];
51 
52  $sqlfilter[] = GetSqlCond($tid, 'exec_idref');
53  // $sqlfilter[]= "doctype ='F'";
54  // $sqlfilter[]= "usefor != 'D'";
55  // $sqlfilter[]= "(".implode(") OR (",$tfil).")";
56  $query = getSqlSearchDoc($dbaccess, 0, getFamIdFromName($dbaccess, "EXEC") , $sqlfilter);
57  $sdoc->AddQuery($query);
58  redirect($action, "FREEDOM", "FREEDOM_VIEW&target=$target&view=column&dirid=" . $sdoc->id);
59  // redirect($action,GetHttpVars("app"),"GENERIC_LIST&dirid=".$sdoc->id."&famid=$famid&catg=0");
60 
61 
62 }
$tdoc
global $action
getSqlSearchDoc($dbaccess, $dirid, $fromid, $sqlfilters=array(), $distinct=false, $latest=true, $trash="", $simplesearch=false, $folderRecursiveLevel=2, $join= '', $only="")
Definition: Lib.Dir.php:108
freedom_searchprocess(Action &$action)
exitError($texterr, $exit=true, $code="")
$docid
Definition: cleanFamily.php:13
createDoc($dbaccess, $fromid, $control=true, $defaultvalues=true, $temporary=false)
getFamIdFromName($dbaccess, $name)
new_Doc($dbaccess, $id= '', $latest=false)
GetSqlCond($Table, $column, $integer=false)
$dbaccess
Definition: checkVault.php:17
if(($docid!==0)&&(!is_numeric($docid))) $query
← centre documentaire © anakeen