20 include_once (
"FDL/Class.DocSearch.php");
21 include_once (
"FDL/freedom_util.php");
22 include_once (
"GENERIC/generic_util.php");
39 $attr = $fdoc->getAttribute($aid);
40 $enum = $attr->getEnum();
41 $kindname = $enum[$kid];
48 $sdoc->title = sprintf(_(
"search %s") , $kid);
49 if ((
$dirid == 0) || (
$dir->id ==
getDefFld($action))) $sdoc->title = sprintf(_(
"search %s is %s") , $attr->getLabel() , $kindname);
50 else $sdoc->title = sprintf(_(
"search %s is %s in %s") , $attr->getLabel() , $kindname,
$dir->gettitle());
56 if (
$dir->defDoctype ==
'S') {
58 $pds =
$dir->urlWhatEncodeSpec(
"");
65 $kid = str_replace(
'\.',
'-dot-', $kid);
66 if (strrpos($kid,
'.') !==
false) $kid = substr($kid, strrpos($kid,
'.') + 1);
70 $sqlfilter[] =
"locked != -1";
74 $a = $fdoc->getAttribute($aid);
78 $enum =
$a->getEnum();
80 foreach ($enum as $k => $v) {
81 $k = str_replace(
'\.',
'-dot-', $k);
82 if (in_array($kid, explode(
".", $k))) {
83 $tkids[] = pg_escape_string(str_replace(
'-dot-',
'.', substr($k, strrpos(
"." . $k,
'.'))));
86 if (
$a->type ==
"enum") {
88 $sqlfilter[] =
"in_textlist($aid,'" . implode(
"') or in_textlist($aid,'", $tkids) .
"')";
90 $sqlfilter[] =
"$aid='" . implode(
"' or $aid='", $tkids) .
"'";
98 redirect($action, $action->
getArgument(
"app") ,
"GENERIC_LIST&onefam=$onefamOrigin&famid=$famid&dirid=" . $sdoc->id .
"&catg=" .
$dirid);
getSqlSearchDoc($dbaccess, $dirid, $fromid, $sqlfilters=array(), $distinct=false, $latest=true, $trash="", $simplesearch=false, $folderRecursiveLevel=2, $join= '', $only="")
print< H1 > Check Database< i > $dbaccess</i ></H1 > $a
getDefFld(Action &$action)
generic_search_kind(Action &$action)
getDefFam(Action &$action)
new_Doc($dbaccess, $id= '', $latest=false)
setUkey(Action &$action, $famid, $key)
static getArgument($k, $def= '')
if(($docid!==0)&&(!is_numeric($docid))) $query
createTmpDoc($dbaccess, $fromid, $defaultvalue=true)