17 include_once (
"FDL/viewfolder.php");
18 include_once (
"GENERIC/generic_util.php");
44 $target =
"finfo$famid";
45 setHttpVar(
"target", $target);
48 $searchMode =
$action->getParam(
"GENE_SEARCHMODE",
"words");
51 if ($onefamSearchMode) {
52 $searchMode = $onefamSearchMode;
55 $paginationType =
"basic";
59 $action->parent->addJsRef(
$action->getParam(
"CORE_JSURL") .
"/DHTMLapi.js",
false, $packGeneric);
60 $action->parent->addJsRef(
$action->getParam(
"CORE_JSURL") .
"/geometry.js",
false, $packGeneric);
61 $action->parent->addJsRef(
$action->getParam(
"CORE_JSURL") .
"/AnchorPosition.js",
false, $packGeneric);
62 $action->parent->addJsRef(
$action->getParam(
"CORE_PUBURL") .
"/FDL/Layout/common.js",
false, $packGeneric);
63 $action->parent->addJsRef(
$action->getParam(
"CORE_PUBURL") .
"/FDL/Layout/popupfunc.js",
false, $packGeneric);
64 $action->parent->addCssRef(
"css/dcp/main.css");
65 $action->parent->addCssRef(
"GENERIC:generic_list.css",
true);
68 if (!empty($applicationPaginationConfig)) {
70 if (isset($applicationPaginationConfig[$famName]) && isset($applicationPaginationConfig[$famName][
"paginationType"]) && !empty($applicationPaginationConfig[$famName][
"paginationType"])) {
71 $paginationType = $applicationPaginationConfig[$famName][
"paginationType"];
72 }
else if (isset($applicationPaginationConfig[
"*"]) && isset($applicationPaginationConfig[
"*"][
"paginationType"]) && !empty($applicationPaginationConfig[
"*"][
"paginationType"])) {
73 $paginationType = $applicationPaginationConfig[
"*"][
"paginationType"];
80 if (
$dir->isAlive() && (
$dir->defDoctype ==
'S')) {
81 $sfamid =
$dir->getRawValue(
"se_famid");
85 $wonglet = ($onglet !=
'N');
92 $action->lay->set(
"folderid",
"0");
94 if ($catg->doctype ==
'D')
$action->lay->set(
"folderid", $catg->id);
99 $pds = $catg->urlWhatEncodeSpec(
"");
100 $action->lay->set(
"pds", $pds);
102 $action->lay->set(
"fldtitle",
$dir->getHTMLTitle());
105 $action->lay->set(
"fldtitle", _(
"precise search"));
108 $action->lay->set(
"fldtitle",
$dir->getHTMLTitle());
112 $action->lay->eSet(
"ONEFAMORIGIN", $onefamOrigin);
113 $action->lay->eSet(
"famtarget", $target);
115 $action->lay->eSet(
"tab", $tab);
116 $action->lay->eSet(
"catg", $catgid);
121 $action->lay->set(
"nexticon",
"");
122 $action->lay->set(
"previcon",
"");
123 if ($searchMode ===
"words") {
124 $action->lay->set(
"SearchPlaceHolder",
___(
"Search words",
"generic"));
126 $action->lay->set(
"SearchPlaceHolder",
___(
"Search characters",
"generic"));
129 if ($sqlorder ==
"") {
132 setHttpVar(
"sqlorder", $sqlorder);
136 if ($sqlorder !=
"") {
138 if ($sqlorder[0] ==
"-") {
139 $sqlorder = substr($sqlorder, 1);
141 if (!in_array($sqlorder, $ndoc->fields)) {
142 setHttpVar(
"sqlorder",
"");
151 if (
$dir->fromid == 38) {
153 setHttpVar(
"sqlorder",
"--");
159 $action->lay->set(
"nexticon",
$action->getIcon(
"next.png",
N_(
"next") , 16));
163 if ($startpage > 0) {
165 $action->lay->set(
"previcon",
$action->getIcon(
"prev.png",
N_(
"prev") , 16));
172 "onglabel" =>
"A B C",
176 "onglabel" =>
"D E F",
180 "onglabel" =>
"G H I",
184 "onglabel" =>
"J K L",
188 "onglabel" =>
"M N O",
192 "onglabel" =>
"P Q R S",
196 "onglabel" =>
"T U V",
200 "onglabel" =>
"W X Y Z",
204 "onglabel" =>
"A - Z",
209 foreach ($onglet as $k => $v) {
210 if ($v[
"ongdir"] == $tab) $onglet[$k][
"ongclass"] =
"onglets";
211 else $onglet[$k][
"ongclass"] =
"onglet";
212 $onglet[$k][
"onglabel"] = str_replace(
" ",
"<BR>", $v[
"onglabel"]);
215 $action->lay->setBlockData(
"ONGLET", $onglet);
217 $paginationConfig = array(
218 "type" => $paginationType,
219 "onefamconfig" => $onefamOrigin,
225 "onglet" => $wonglet ?
"Y" :
"N"
227 $action->parent->setVolatileParam(
"paginationConfig", $paginationConfig);
228 $action->lay->set(
"onglet", $wonglet ?
"Y" :
"N");
229 $action->lay->set(
"hasOnglet", (!empty($wonglet)));
238 $tmode = explode(
",", $action->
getParam(
"GENE_VIEWMODE"));
242 foreach ($tmode as $v) {
244 list($fid, $vmode) = explode(
"|", $v);
245 $tview[$fid] = $vmode;
251 $tview[
$famid] = $prefview;
254 foreach ($tview as $k => $v) {
255 if ($k > 0) $tmode[] =
"$k|$v";
257 $pmode = implode(
",", $tmode);
258 $action->
setParamU(
"GENE_VIEWMODE", $pmode);
265 $action->layout = $action->
getLayoutFile(
"generic_listv.xml");
266 $action->lay =
new Layout($action->layout, $action);
274 $action->layout = $action->
getLayoutFile(
"generic_list.xml");
275 $action->lay =
new Layout($action->layout, $action);
293 if ($catgid == 0) $catgid =
$dirid;
295 $action->lay->set(
"ONESEARCH",
false);
296 $utreeSearch = array();
297 $streeSearch = array();
298 $hasSysSearch =
false;
300 if (isset($fdoc->dfldid) && $fdoc->dfldid > 0) {
303 $s->useCollection($fdoc->dfldid);
304 $s->setObjectReturn();
306 $dl =
$s->getDocumentList();
310 foreach ($dl as $ids =>
$search) {
311 if ((
$search->doctype ==
"S") && (
$search->fromid != $fdoc->id)) {
312 if (
$search->control(
"execute") !=
'') {
315 $stitle =
$search->getHTMLTitle();
317 $streeSearch[$ids][
"id"] = $ids;
318 $streeSearch[$ids][
"title"] = $stitle;
319 $streeSearch[$ids][
"selected"] = ($ids == $catgid) ?
"1" :
"0";
320 $streeSearch[$ids][
"isreport"] =
"0";
321 $streeSearch[$ids][
"gui_color"] =
$search->getRawValue(\Dcp\AttributeIdentifiers\Search::gui_color);
322 $streeSearch[$ids][
"isparam"] =
"0";
323 $keys =
$search->getRawValue(
"se_keys");
324 if (preg_match(
'/\?/', $keys)) {
325 $streeSearch[$ids][
"title"] =
"(P)" . $stitle;
326 $streeSearch[$ids][
"isparam"] =
"1";
329 $streeSearch[$ids][
"title"] =
"(R)" . $stitle;
330 $streeSearch[$ids][
"isreport"] =
"1";
335 $hasSysSearch = count($streeSearch) > 0;
336 $action->lay->set(
"ONESEARCH", ($hasSysSearch));
338 $action->lay->setBlockData(
"SYSSEARCH", $streeSearch);
341 $s->addFilter(
"owner=%d", $action->user->id);
343 $child = $fdoc->getChildFam();
344 if ($only || count($child) == 0) {
345 $s->addFilter(
"se_famid='%s'", $fdoc->id);
347 $childIds = array_keys($child);
348 $childIds[] = $fdoc->id;
349 $s->addFilter(
$s->sqlcond($childIds,
"se_famid"));
352 $s->addFilter(
"usefor!='G'");
353 $s->addFilter(
"doctype != 'T'");
354 $s->addFilter(
"se_memo='yes'");
355 $s->setObjectReturn(
true);
356 $dl =
$s->search()->getDocumentList();
357 $action->lay->set(
"MSEARCH",
false);
358 foreach ($dl as $ids =>
$search) {
359 if (!isset($streeSearch[$ids])) {
360 if (
$search->control(
"execute") !=
'') {
363 $stitle =
$search->getHTMLTitle();
364 $utreeSearch[$ids][
"id"] = $ids;
365 $utreeSearch[$ids][
"title"] = $stitle;
366 $utreeSearch[$ids][
"selected"] = ($ids == $catgid) ?
"1" :
"0";
367 $utreeSearch[$ids][
"isreport"] =
"0";
368 $utreeSearch[$ids][
"isparam"] =
"0";
369 $utreeSearch[$ids][
"gui_color"] =
$search->getRawValue(\Dcp\AttributeIdentifiers\Search::gui_color);
370 $keys =
$search->getRawValue(
"se_keys");
371 if (preg_match(
'/\?/', $keys)) {
372 $utreeSearch[$ids][
"title"] =
"(P)" . $stitle;
373 $utreeSearch[$ids][
"isparam"] =
"1";
376 $utreeSearch[$ids][
"title"] =
"(R)" . $stitle;
377 $utreeSearch[$ids][
"isreport"] =
"1";
382 $action->lay->set(
"MSEARCH", (count($utreeSearch) > 0 && $hasSysSearch));
383 $action->lay->setBlockData(
"USERSEARCH", $utreeSearch);
384 if (count($streeSearch) + count($utreeSearch) > 0) {
385 $action->lay->set(
"ONESEARCH",
true);
Layout is a template generator.
getDefUSort(Action &$action, $def="-revdate", $famid="")
viewfolder(Action &$action, $with_abstract=false, $with_popup=true, $column=false, $slice="-", $sqlfilters=array(), $famid="", $paginationType="none")
static getParameterValue($application, $parameterName)
if(!function_exists('pgettext')) ___($message, $context="")
getDefFam(Action &$action)
generic_viewmode(Action &$action, $famid)
getTabLetter(Action &$action, $famid="")
createDoc($dbaccess, $fromid, $control=true, $defaultvalues=true, $temporary=false)
getHttpVars($name, $def="", $scope="all")
new_Doc($dbaccess, $id= '', $latest=false)
setUkey(Action &$action, $famid, $key)
getNameFromId($dbaccess, $id)
getFamilySearches(Action $action, $dbaccess, $famid, $only=false)
getDefUKey(Action &$action)
getInherit(Action &$action, $famid="")