17 include_once (
"FDL/Class.DocSearch.php");
18 include_once (
"FDL/freedom_util.php");
19 include_once (
"GENERIC/generic_util.php");
32 $searchMode = $action->
getParam(
"GENE_SEARCHMODE",
"words");
34 $mysearches = ($action->
getArgument(
"mysearches") ==
"yes");
39 if ($onefamSearchMode) {
40 $searchMode = $onefamSearchMode;
50 if (
$dir->isAlive()) {
51 $sfamid =
$dir->getRawValue(
"se_famid",
$famid);
61 $sdoc->title = sprintf(_(
"my search %s") ,
$keyword);
62 $sdoc->setValue(
"se_famid", 16);
65 $sdoc->title = sprintf(_(
"my searches about %s") , $fdoc->title);
68 $full = ($searchMode ===
"words");
70 $sqlfilter = $sdoc->getSqlGeneralFilters(
$keyword,
"yes",
false,
$full);
72 if ($sqlorder ==
"") {
73 $sdoc->clearValue(
"se_orderby");
75 $sqlfilter[] =
"owner=" . $action->user->id;
76 $sqlfilter[] =
"se_famid='" . pg_escape_string(
$famid) .
"'";
81 "onefam" => $onefamOrigin,
90 if (
$doc->defDoctype ==
'S') {
97 $sdoc->title = sprintf(_(
"Search : %s") ,
$keyword);
100 $sdoc->title = sprintf(_(
"search contains %s in all state") ,
$keyword);
102 $sdoc->title = sprintf(_(
"search contains %s in %s") ,
$keyword,
$doc->getTitle());
105 $sdoc->setValue(
"se_famid", $sfamid);
112 throw new \Dcp\Exception(sprintf(_(
"incorrect global filter %s") ,
$keyword));
114 $usePartial = ($searchMode ===
"characters");
121 switch ($e->getDcpCode()) {
123 $err = sprintf(_(
"incorrect global filter %s") ,
$keyword);
129 $err = $e->getMessage();
136 catch(Exception $e) {
137 $err = $e->getMessage();
145 if ($sqlorder ==
"") {
146 $sdoc->clearValue(
"se_orderby");
154 "onefam" => $onefamOrigin,
156 "dirid" => $sdoc->id,
161 "onefam" => $onefamOrigin,
171 foreach ($args as $k => $v) {
174 $action->set(
"GENERIC_LIST", $action->parent);
176 $action->lay->template = $gen;
177 $action->lay->noparse =
true;
if(substr($wsh, 0, 1)!= '/') $args
getSqlSearchDoc($dbaccess, $dirid, $fromid, $sqlfilters=array(), $distinct=false, $latest=true, $trash="", $simplesearch=false, $folderRecursiveLevel=2, $join= '', $only="")
getDefUSort(Action &$action, $def="-revdate", $famid="")
getDefFld(Action &$action)
static checkGeneralFilter($keyword)
static getParameterValue($application, $parameterName)
static getGeneralFilter($keywords, $useSpell=false, &$pertinenceOrder= '', &$highlightWords= '', $usePartial=false)
getDefFam(Action &$action)
generic_search(Action &$action)
new_Doc($dbaccess, $id= '', $latest=false)
setUkey(Action &$action, $famid, $key)
executeGenericList(Action &$action, array $args)
static getArgument($k, $def= '')
if(($docid!==0)&&(!is_numeric($docid))) $query
createTmpDoc($dbaccess, $fromid, $defaultvalue=true)
getInherit(Action &$action, $famid="")
if($file) if($subject==""&&$file) if($subject=="") $err