Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
FDL_external.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  * Functions used for edition help
8  *
9  * @author Anakeen
10  * @version $Id: FDL_external.php,v 1.71 2009/01/13 09:37:25 eric Exp $
11  * @package FDL
12  * @subpackage
13  */
14 /**
15  */
16 
17 include_once ("FDL/Class.Dir.php");
18 include_once ("FDL/Lib.Dir.php");
19 
20 function vault_filename($th, $fileid)
21 {
22 
23  if (preg_match(PREGEXPFILE, $fileid, $reg)) {
24  // reg[1] is mime type
25  $vf = newFreeVaultFile($th->dbaccess);
26  if ($vf->Show($reg[2], $info) == "") $fname = $info->name;
27  else $fname = sprintf(_("file %d") , $th->initid);
28  } else {
29  $fname = sprintf(_("file %d") , $th->initid);
30  }
31 
32  return array(
33  $fname
34  );
35 }
36 /**
37  * Functions used for edition help
38  *
39  * @param string $dbaccess database specification
40  * @param int $docid identifier document
41  * @return array first item : the title
42  */
44 {
45 
47  if ($doc->isAffected()) return array(
48  $doc->title
49  );
50  return array(
51  "?",
52  " "
53  ); // suppress
54 
55 }
56 /**
57  * link enum definition from other def
58  */
59 function linkenum($famid, $attrid)
60 {
61 
63  if (!is_numeric($famid)) $famid = getFamIdFromName($dbaccess, $famid);
64  $soc = new_Doc($dbaccess, $famid);
65  if ($soc->isAffected()) {
66  /*
67  * @var NormalAttribute $a
68  */
69  $a = $soc->getAttribute($attrid);
70 
71  return EnumAttributeTools::getFlatEnumNotation($soc->id, $a->id);
72  }
73  return "";
74 }
75 /**
76  * get mail address from MAILRECIPENT families
77  * @param $dbaccess
78  * @param $name
79  * @return array|string
80  */
81 function lmail($dbaccess, $name)
82 {
83 
84  $tr = array();
85  $sf = new SearchDoc($dbaccess, -1);
86  $sf->setObjectReturn();
87  $sf->overrideViewControl();
88  $sf->addFilter("atags ~* 'MAILRECIPIENT'");
89  $dlf = $sf->search()->getDocumentList();
90 
91  if ($dlf->count() == 0) return sprintf(_("none families are described to be used as recipient"));
92  foreach ($dlf as $fam) {
93  $cfam = createTmpDoc($dbaccess, $fam->id);
94  /*
95  * @var IMailRecipient $cfam
96  */
97  if (!method_exists($cfam, "getMail")) return sprintf(_("family %s does not implement IMailRecipent - missing getMail method") , $fam->name);
98  if (!method_exists($cfam, "getMailAttribute")) return sprintf(_("family %s does not implement IMailRecipent - missing getMailAttribute method") , $fam->name);
99  if (!method_exists($cfam, "getMailTitle")) return sprintf(_("family %s does not implement IMailRecipient - missing getMailTitle method") , $fam->name);
100 
101  $mailAttr = $cfam->getMailAttribute();
102  $s = new SearchDoc($dbaccess, $fam->id);
103  $s->setObjectReturn();
104  $s->setSlice(100);
105  if ($mailAttr) $s->addFilter("%s is not null", $mailAttr);
106  if ($name != "") {
107  if ($mailAttr) $s->addFilter("(title ~* '%s') or (%s ~* '%s')", $name, $mailAttr, $name);
108  else $s->addFilter("(title ~* '%s')", $name, $name);
109  }
110  $dl = $s->search()->getDocumentList();
111  foreach ($dl as $dest) {
112  /**
113  * @var \Dcp\Family\IUSER $dest
114  */
115  $mailTitle = $dest->getMailTitle();
116  $mail = $dest->getMail();
117  if ($mailTitle == '') {
118  $mailTitle = $mail;
119  }
120  $usw = $dest->getRawValue("us_whatid");
121  $uid = "";
122  if ($usw > 0) {
123  $uid = $dest->id;
124  $type = "link"; //$type="link"; // cause it is a bool
125 
126  } else {
127  $type = "plain"; //$type="plain";
128  $uid = " ";
129  }
130  $tr[] = array(
131  xml_entity_encode($mailTitle) ,
132  $mail,
133  $uid,
134  $type
135  );
136  }
137  }
138  usort($tr, function ($a, $b)
139  {
140  return strcasecmp($a[0], $b[0]);
141  });
142  return $tr;
143 }
144 
145 function tplmail($dbaccess, $type, $famid, $wfamid, $name)
146 {
147  switch ($type) {
148  case 'F': // address fix
149  return lmail($dbaccess, $name);
150  break;
151 
152  case 'A': // value of attribute
153  if (!$famid) {
154  return _("family must be defined");
155  }
156  $ta = getFamAttribute($dbaccess, $famid, 'text', false, $name);
157  return $ta;
158  break;
159 
160  case 'D': // value of attribute
161  if (!$famid) {
162  return _("family must be defined");
163  }
164  $ta = getFamAttribute($dbaccess, $famid, 'docid', false, $name);
165  $ta = array_merge($ta, getFamAttribute($dbaccess, $famid, 'account', false, $name));
166  return $ta;
167  break;
168 
169  case 'DE':
170  if (!$famid) {
171  return _("family must be defined");
172  }
173  $ta = getFamAttribute($dbaccess, $famid, 'docid', true, $name);
174  $ta = array_merge($ta, getFamAttribute($dbaccess, $famid, 'account', true, $name));
175  return $ta;
176  break;
177 
178  case 'G': // value of attribute
179  if (!$famid) {
180  return _("family must be defined");
181  }
182  $ta = getFamAttribute($dbaccess, $famid, 'file', false, $name);
183  $ta = array_merge($ta, getFamAttribute($dbaccess, $famid, 'image', false, $name));
184  return $ta;
185  break;
186 
187  case 'E': // value of attribute
188  if (!$famid) {
189  return _("family must be defined");
190  }
191  $ta = getFamAttribute($dbaccess, $famid, '', true, $name);
192  return $ta;
193  case 'WA': // value of attribute
194  if (!$wfamid) {
195  return _("cycle family must be defined");
196  }
197  $ta = getFamAttribute($dbaccess, $wfamid, 'text', false, $name);
198  return $ta;
199  break;
200 
201  case 'WE': // value of attribute
202  if (!$wfamid) {
203  return _("cycle family must be defined");
204  }
205  $ta = getFamAttribute($dbaccess, $wfamid, '', true, $name);
206  return $ta;
207  break;
208 
209  case 'WD': // value of attribute
210  if (!$wfamid) {
211  return _("cycle family must be defined");
212  }
213  $ta = getFamAttribute($dbaccess, $wfamid, 'docid', false, $name);
214  return $ta;
215  break;
216 
217  case 'PR':
218  if (!$famid) {
219  return _("family must be defined");
220  }
221  $ta = getFamAttribute($dbaccess, $famid, 'docid', true, $name);
222  return $ta;
223  break;
224 
225  case 'WPR':
226  if (!$wfamid) {
227  return _("cycle family must be defined");
228  }
229  $ta = getFamAttribute($dbaccess, $wfamid, 'docid', true, $name);
230  return $ta;
231  break;
232 
233  case 'P':
234  return getGlobalsParameters($name);
235  break;
236 
237  case 'RD':
238  return recipientDocument($dbaccess, $name);
239  break;
240  }
241  return "error tplmail($dbaccess,$type,$famid, $name)";
242 }
243 
244 function tpluser($dbaccess, $type, $famid, $wfamid, $name)
245 {
246  switch ($type) {
247  case 'F': // address fix
248  $users = lfamily($dbaccess, "IUSER", $name);
249  if (is_array($users)) {
250  foreach ($users as $k => $v) {
251  $users[$k][1] = $v[1] . ' (' . $v[2] . ')';
252  }
253  }
254  return $users;
255  default:
256  return tplmail($dbaccess, $type, $famid, $wfamid, $name);
257  }
258 }
259 
260 function getGlobalsParameters($name)
261 {
262  include_once ("Class.QueryDb.php");
263  $q = new QueryDb("", "ParamDef");
264 
265  $tr = array();
266  $q->AddQuery("isglob = 'Y'");
267  if ($name) $q->AddQuery("name ~* '" . pg_escape_string($name) . "'");
268  $q->order_by = "name";
269  $la = $q->Query(0, 20, "TABLE");
270  foreach ($la as $k => $v) {
271  $p = $v["name"] . ' (' . $v["descr"] . ')';
272  $tr[] = array(
273  $p,
274  $p
275  );
276  }
277  return $tr;
278 }
279 /**
280  * attribut list to be use in mail template
281  */
282 function getFamAttribute($dbaccess, $famid, $type = "text", $param = false, $name = "")
283 {
284  $doc = createDoc($dbaccess, $famid, false);
285  $tr = array();
286  if ($param) {
287  $tinter = $doc->getParamAttributes();
288  } else {
289  $tinter = $doc->GetNormalAttributes();
290  }
291  $name = strtolower($name);
292  // HERE HERE HERE
293  $pattern_name = preg_quote($name, "/");
294  $pattern_type = ($type);
295  foreach ($tinter as $k => $v) {
296  if (($name == "") || (preg_match("/$pattern_name/i", $v->getLabel() , $reg)) || (preg_match("/$pattern_name/", $v->id, $reg))) {
297  preg_match("/$pattern_type/", $v->type, $reg);
298  if (($type == "") || ($v->type == $type) || ((strpos($type, '|') > 0) && (preg_match("/$pattern_type/", $v->type, $reg)))) {
299  $r = $v->id . ' (' . $v->getLabel() . ')';
300  $tr[] = array(
301  $r,
302  $r
303  );
304  }
305  }
306  }
307  return $tr;
308 }
309 // liste des familles
310 function lfamilies($dbaccess, $name = '', $subfam = "")
311 {
312  //'lsociety(D,US_SOCIETY):US_IDSOCIETY,US_SOCIETY,
313  global $action;
314 
315  if ($subfam == "") {
316  $tinter = GetClassesDoc($dbaccess, $action->user->id, 0, "TABLE");
317  } else {
318  if (!is_numeric($subfam)) {
319  $subfam = getFamIdFromName($dbaccess, $subfam);
320  }
321  $cdoc = new_Doc($dbaccess, $subfam);
322  $tinter = $cdoc->GetChildFam();
323  $tinter[] = get_object_vars($cdoc);
324  }
325 
326  $tr = array();
327 
328  $name = strtolower($name);
329  // HERE HERE HERE
330  $pattern_name = preg_quote($name, "/");
331  foreach ($tinter as $v) {
332  $ftitle = DocFam::getLangTitle($v);
333  if (($name == "") || (preg_match("/$pattern_name/i", $ftitle, $reg))) {
334  $tr[] = array(
335  $ftitle,
336  $v["id"],
337  $ftitle
338  );
339  }
340  }
341  return $tr;
342 }
343 // liste des documents par familles
344 
345 /**
346  * list of documents of a same family
347  *
348  * @param string $dbaccess database specification
349  * @param string $famid family identifier (if 0 any family). It can be internal name
350  * @param string $name string filter on the title
351  * @param int $dirid identifier of folder for restriction to a folder tree (deprecated)
352  * @param array $filter additionnals SQL filters
353  * @param string $idid the document id to use (default: id)
354  * @param bool $withDiacritic to search with accent
355  * @return array/string*3 array of (title, identifier, title)
356  */
357 function lfamily($dbaccess, $famid, $name = "", $dirid = 0, $filter = array() , $idid = "id", $withDiacritic = false)
358 {
359  $only = false;
360  if ($famid[0] == '-') {
361  $only = true;
362  $famid = substr($famid, 1);
363  }
364 
365  if (!is_numeric($famid)) {
366  $famName = $famid;
367  $famid = getFamIdFromName($dbaccess, $famName);
368  if ($famid <= 0) {
369  return sprintf(_("family %s not found") , $famName);
370  }
371  }
372  $s = new SearchDoc($dbaccess, $famid); //$famid=-(abs($famid));
373  if ($only) {
374  $s->only = true;
375  }
376  if (!is_array($filter)) {
377  if (trim($filter) != "") $filter = array(
378  $filter
379  );
380  else $filter = array();
381  }
382  if (count($filter) > 0) {
383  foreach ($filter as $f) {
384  $s->addFilter($f);
385  }
386  }
387 
388  if ($name != "" && is_string($name)) {
389  if (!$withDiacritic) {
390  $name = setDiacriticRules(mb_strtolower($name));
391  }
392  $s->addFilter("title ~* '%s'", $name);
393  }
394  $s->setSlice(100);
395 
396  if ($dirid) $s->useCollection($dirid);
397  $s->returnsOnly(array(
398  "title",
399  $idid
400  ));
401  $tinter = $s->search();
402  if ($s->getError()) {
403  return $s->getError();
404  }
405 
406  $tr = array();
407 
408  foreach ($tinter as $k => $v) {
409  $tr[] = array(
410  htmlspecialchars($v["title"]) ,
411  $v[$idid],
412  $v["title"]
413  );
414  }
415  return $tr;
416 }
417 /**
418  * create preg rule to search without diacritic
419  * @see lfamily
420  * @param string $text
421  * @return string rule for preg
422  */
423 function setDiacriticRules($text)
424 {
425  $dias = array(
426  "a|à|á|â|ã|ä|Ã¥",
427  "o|ò|ó|ô|õ|ö|ø",
428  "e|è|é|ê|ë",
429  "c|ç",
430  "i|ì|í|î|ï",
431  "u|ù|ú|û|ü",
432  "y|ÿ",
433  "n|ñ"
434  );
435  foreach ($dias as $dia) {
436  $text = preg_replace("/[" . str_replace("|", "", $dia) . "]/u", "[$dia]", $text);
437  }
438  return $text;
439 }
440 // alias name
441 
442 /**
443  * @deprecated use lfamily instead
444  * @param $dbaccess
445  * @param $famid
446  * @param string $name
447  * @param int $dirid
448  * @param array $filter
449  * @param string $idid
450  * @return mixed
451  */
452 function lfamilly($dbaccess, $famid, $name = "", $dirid = 0, $filter = array() , $idid = "id")
453 {
454  return lfamily($dbaccess, $famid, $name, $dirid, $filter, $idid);
455 }
456 /**
457  * list of documents of a same family and their specific attributes
458  *
459  * @param string $dbaccess database specification
460  * @param string $famid family identifier (if 0 any family). It can be internal name
461  * @param string $name string filter on the title
462  * @param string $attrids argument variable of name of attribute to be returned
463  * @return array/string*3 array of (title, identifier, attr1, attr2, ...)
464  */
465 function lfamilyvalues($dbaccess, $famid, $name = "")
466 {
467  //'lsociety(D,US_SOCIETY):US_IDSOCIETY,US_SOCIETY,
468  global $action;
469 
470  $only = false;
471  if ($famid[0] == '-') {
472  $only = true;
473  $famid = substr($famid, 1);
474  }
475 
476  if (!is_numeric($famid)) {
478  }
479  $filter = array();
480  if ($name != "") {
481  $name = pg_escape_string($name);
482  $filter[] = "title ~* '$name'";
483  }
484  $attr = array();
485  $args = func_get_args();
486  foreach ($args as $k => $v) {
487  if ($k > 2) $attr[] = strtolower($v);
488  }
489  //$famid=-(abs($famid));
490  if ($only) $famid = - ($famid);
491  $tinter = internalGetDocCollection($dbaccess, $dirid = 0, 0, 100, $filter, $action->user->id, "TABLE", $famid, false, "title");
492 
493  $tr = array();
494 
495  foreach ($tinter as $k => $v) {
496  $tr[$k] = array(
497  $v["title"]
498  );
499  foreach ($attr as $a) {
500  $tr[$k][] = $v[$a];
501  }
502  }
503  return $tr;
504 }
505 /**
506  * list of documents of a same family and which are in the $kid category
507  *
508  * @param string $dbaccess database specification
509  * @param string $famname family internal name
510  * @param string $aid enum attribute identifier
511  * @param string $kid enum key to search
512  * @param string $name string filter on the title
513  * @param array $filter additionnals SQL filters
514  * @return array/string*3 array of (title, identifier, title)
515  */
516 function lkfamily($dbaccess, $famname, $aid, $kid, $name, $filter = array())
517 {
518  //'lsociety(D,US_SOCIETY):US_IDSOCIETY,US_SOCIETY,
519  global $action;
520 
521  if ($name != "") {
522  $name = pg_escape_string($name);
523  $filter[] = "title ~* '.*$name.*'";
524  }
525 
526  $tinter = getKindDoc($dbaccess, $famname, $aid, $kid, $name, $filter);
527 
528  $tr = array();
529 
530  foreach ($tinter as $k => $v) {
531 
532  $tr[] = array(
533  $v["title"],
534  $v["id"],
535  $v["title"]
536  );
537  }
538  return $tr;
539 }
540 /**
541  * return account documents
542  * @param string $filterName title filter key
543  * @param int $limit max account returned
544  * @return array
545  */
546 function fdlGetDocuments($families, $filterName = '', $limit = 15, $extraFilter = '')
547 {
548  $tout = array();
549  $famname = explode('|', $families);
550 
551  foreach ($famname as $famid) {
552  if (count($tout) < $limit) {
553  $s = new SearchDoc(getDbAccess() , $famid);
554  if ($filterName) $s->addFilter("title ~* '%s'", $filterName);
555  if ($extraFilter) $s->addFilter($extraFilter);
556  $s->setSlice($limit);
557  $s->setObjectReturn();
558  $s->search();
559  if ($s->getError()) return $s->getError();
560 
561  while ($doc = $s->getNextDoc()) {
562  $title = $doc->getHTMLTitle();
563  $tout[] = array(
564  sprintf('<img width="10px" src="%s">%s', $doc->getIcon('', 10) , $title) ,
565  $doc->initid,
566  $title
567  );
568  }
569  }
570  }
571  if ((count($tout) == 0) && ($filterName != '')) return sprintf(_("no document match '%s'") , $filterName);
572  return $tout;
573 }
574 /**
575  * return account list
576  * @param string $filterName filter key
577  * @param int $limit max result limit
578  * @param string $options option for role or group
579  * @return array|string
580  */
581 function fdlGetAccounts($filterName = '', $limit = 15, $options = '')
582 {
583  $sort = 'lastname';
584  $searchinmail = false;
585  $s = new SearchAccount();
586  $s->setSlice($limit);
587  if (preg_match('/usemailfilter\s*=([^|]*)/', $options, $regMatch)) {
588  $searchinmail = trim($regMatch[1]);
589  $searchinmail = ($searchinmail == "yes");
590  }
591  if (preg_match('/role\s*=([^|]*)/', $options, $regRole)) {
592  $roles = explode(',', $regRole[1]);
593 
594  foreach ($roles as $role) {
595  try {
596  $s->addRoleFilter($role);
597  }
598  catch(Exception $e) {
599  return $e->getMessage();
600  }
601  }
602  }
603  if (preg_match('/group\s*=([^|]*)/', $options, $regGroup)) {
604  $groups = explode(',', $regGroup[1]);
605 
606  foreach ($groups as $group) {
607  try {
608  $s->addGroupFilter($group);
609  }
610  catch(Exception $e) {
611  return $e->getMessage();
612  }
613  }
614  }
615 
616  if (preg_match('/match\s*=([^|]*)/', $options, $regMatch)) {
617  $match = trim($regMatch[1]);
618  switch ($match) {
619  case 'all':
620  break;
621 
622  case 'group':
623  $s->setTypeFilter($s::groupType);
624  break;
625 
626  case 'role':
627  $s->setTypeFilter($s::roleType);
628  break;
629 
630  default:
631  $s->setTypeFilter($s::userType);
632  }
633  } else {
634  $s->setTypeFilter($s::userType);
635  }
636 
637  if (preg_match('/family\s*=([^|]*)/', $options, $regMatch)) {
638  $match = trim($regMatch[1]);
639  $s->filterFamily($match);
640  }
641  $tr = array();
642 
643  $condName = "";
644  if ($filterName) {
645  $tname = explode(' ', $filterName);
646  $condmail = '';
647  if ($searchinmail) $condmail = sprintf("|| ' ' || coalesce(mail,'')");
648  foreach ($tname as $name) {
649  if ($condName) $condName.= " AND ";
650  $condName.= sprintf("(coalesce(firstname,'') || ' ' || coalesce(lastname,'') %s ~* '%s')", $condmail, pg_escape_string(setDiacriticRules($name)));
651  }
652  }
653 
654  if ($condName) $s->addFilter($condName);
655  if (!$sort) $sort = 'lastname';
656  $s->setOrder($sort);
657  $s->overrideViewControl(false);
658  $al = $s->search();
659  foreach ($al as $account) {
660 
661  $mail = $account->mail ? (' (' . mb_substr($account->mail, 0, 40) . ')') : '';
662  $tr[] = array(
663  htmlspecialchars($account->lastname . " " . $account->firstname . $mail) ,
664  $account->fid,
665  $account->lastname . " " . $account->firstname
666  );
667  }
668 
669  return $tr;
670 }
671 /**
672  * return list of string for multiple static choice
673  *
674  * @param string $val filter value - can be empty => see all choices
675  * @param string $enum possible choices like 'the first|the second|the last'
676  * @return array/string*2 array of (enum, enum)
677  */
678 function lenum($val, $enum)
679 {
680  // $enum like 'a|b|c'
681  $tenum = explode("|", $enum);
682 
683  $tr = array();
684  // HERE HERE HERE
685  $pattern_val = preg_quote($val, "/");
686  foreach ($tenum as $k => $v) {
687 
688  if (($val == "") || (preg_match("/$pattern_val/i", $v, $reg))) $tr[] = array(
689  $v,
690  $v
691  );
692  }
693  return $tr;
694 }
695 /**
696  * list of enum possibilities
697  * @internal use for enum when eformat=auto
698  * @param string $famid family identifier
699  * @param string $attrid enum identifier
700  * @param string $val label filter
701  * @return array/string*2 array of (enum, enum)
702  */
703 function fdlGetEnumValues($famid, $attrid, $val = '')
704 {
705  $doc = new_doc('', $famid);
706  /*
707  * @var NormalAttribute $enumAttribute
708  */
709  $enumAttribute = $doc->getAttribute($attrid);
710  if (!$enumAttribute) {
711  return sprintf("enum attribute %s not found [family %s]", $attrid, $famid);
712  }
713  $tenumLabel = $enumAttribute->getEnumLabel(null, false);
714  $tr = array();
715  foreach ($tenumLabel as $key => $label) {
716  if (($val == "") || (preg_match("!" . preg_quote($val, "!") . "!iu", $label, $reg))) {
717  $tr[] = array(
718  htmlspecialchars($label, ENT_NOQUOTES) ,
719  $label,
720  $key
721  );
722  }
723  }
724 
725  return $tr;
726 }
727 /**
728  * return list of string for multiple static choice
729  *
730  * @param string $val filter value - can be empty => see all choices
731  * @param string $enum possible choices like 'the first|the second|the last'
732  * @deprecated replaced by fdlGetEnumValues
733  * @return array/string*2 array of (enum, enum)
734  */
735 function lenumvalues($enum, $val = "")
736 {
737  // $enum like 'a|A,b|B'
738  $val = trim($val);
739  $val = str_replace(array(
740  '&comma;',
741  '&point;'
742  ) , array(
743  ',',
744  '.'
745  ) , $val);
746  $val = str_replace(array(
747  '&lpar;',
748  '&rpar;',
749  ) , array(
750  '(',
751  ')'
752  ) , $val);
753  $enum = str_replace(array(
754  '---',
755  '&lpar;',
756  '&rpar;',
757  ) , array(
758  ',',
759  '(',
760  ')'
761  ) , $enum);
762 
763  $tenum = $tenumLabel = array();
764  EnumAttributeTools::flatEnumNotationToEnumArray($enum, $tenum, $tenumLabel);
765  $tr = array();
766  foreach ($tenumLabel as $key => $label) {
767  $slabel = str_replace(array(
768  '&comma;',
769  '&point;'
770  ) , array(
771  ',',
772  '.'
773  ) , $label);
774  if (($val == "") || (preg_match("!" . preg_quote($val, "!") . "!i", $slabel, $reg))) $tr[] = array(
775  "$slabel",
776  $slabel,
777  $key
778  );
779  }
780 
781  return $tr;
782 }
783 // liste des profils
784 function lprofil($dbaccess, $name, $famid = 0)
785 {
786  //'lsociety(D,US_SOCIETY):US_IDSOCIETY,US_SOCIETY,
787  global $action;
788  $dirid = 0;
789  if ($famid > 0) {
790  $fdoc = createTmpDoc($dbaccess, $famid);
791  if ($fdoc->defDoctype == 'D') return lfamily($dbaccess, 4, $name);
792  else if ($fdoc->defDoctype == 'S') return lfamily($dbaccess, 6, $name);
793  else return lfamily($dbaccess, 3, $name, 0, array(
794  "fromid=3"
795  ));
796  }
797 
798  return lfamily($dbaccess, 3, $name, $dirid);
799 }
800 // liste des masque
801 function lmask($dbaccess, $name, $maskfamid = "")
802 {
803 
804  $filter = array();
805  if ($maskfamid > 0) {
806  $mdoc = new_Doc($dbaccess, $maskfamid);
807  $chdoc = $mdoc->GetFromDoc();
808  $filter[] = GetSqlCond($chdoc, "msk_famid");
809  // $filter[]="msk_famid='$maskfamid'"; // when workflow will have attribut to say the compatible families
810 
811  }
812  return lfamily($dbaccess, "MASK", $name, 0, $filter);
813 }
814 // view control list
815 function lcvdoc($dbaccess, $name, $cvfamid = "")
816 {
817  $filter = array();
818  if ($cvfamid > 0) {
819  $mdoc = new_Doc($dbaccess, $cvfamid);
820  $chdoc = $mdoc->GetFromDoc();
821  $filter[] = GetSqlCond($chdoc, "cv_famid");
822  }
823  return lfamily($dbaccess, "CVDOC", $name, 0, $filter);
824 }
825 // mail template list
826 function lmailtemplatedoc($dbaccess, $name, $cvfamid = "")
827 {
828  $filter = array();
829  if ($cvfamid > 0) {
830  $mdoc = new_Doc($dbaccess, $cvfamid);
831  $chdoc = $mdoc->GetFromDoc();
832  $filter[] = "tmail_family is null or (" . GetSqlCond($chdoc, "tmail_family") . ')';
833  }
834  return lfamily($dbaccess, "MAILTEMPLATE", $name, 0, $filter);
835 }
836 // timer list
837 function ltimerdoc($dbaccess, $name, $cvfamid = "")
838 {
839  $filter = array();
840  if ($cvfamid > 0) {
841  $mdoc = new_Doc($dbaccess, $cvfamid);
842  $chdoc = $mdoc->GetFromDoc();
843  $filter[] = "tm_family is null or (" . GetSqlCond($chdoc, "tm_family") . ')';
844  }
845  return lfamily($dbaccess, "TIMER", $name, 0, $filter);
846 }
847 /**
848  * search list not filters
849  */
850 function lsearches($dbaccess, $name)
851 {
852 
853  $filter = array(
854  "fromid=5 or fromid=16"
855  );
856  return lfamily($dbaccess, "SEARCH", $name, 0, $filter);
857 }
858 /**
859  * tab list not filters
860  */
861 function ltabs($dbaccess, $name)
862 {
863 
864  $filter = array(
865  "fromid=5 or fromid=16"
866  );
867  $ls = lfamily($dbaccess, "SEARCH", $name, 0, $filter);
868 
869  $fld = lfamily($dbaccess, "2", $name);
870 
871  $all = array_merge($ls, $fld);
872  return $all;
873 }
874 // liste des zones possibles
875 // $tview VCONS|VEDIT
876 function lzone_($dbaccess, $tview, $famid = "")
877 {
878  $tz = array();
879 
880  $filter = array();
881  if ($famid > 0) {
882  $fdoc = new_Doc($dbaccess, $famid);
883  $cdoc = createDoc($dbaccess, $famid, false);
884  if ($tview == "VEDIT") $tz = $cdoc->eviews;
885  else $tz = $cdoc->cviews;
886  $oz = lzone_($dbaccess, $tview, $fdoc->fromid);
887  $tz = array_merge($oz, $tz);
888  } else {
889  $fdoc = new_Doc($dbaccess);
890  if ($tview == "VEDIT") $tz = $fdoc->eviews;
891  else $tz = $fdoc->cviews;
892  }
893 
894  return $tz;
895 }
896 
897 function lzone($dbaccess, $tview, $famid = "")
898 {
899  $tz = lzone_($dbaccess, $tview, $famid);
900  $tz = array_unique($tz);
901  $tr = array();
902  foreach ($tz as $v) {
903  $tr[] = array(
904  $v,
905  $v
906  );
907  }
908 
909  return $tr;
910 }
911 
912 function lview($tidview, $tlview)
913 {
914  $tr = array();
915 
916  if (is_array($tidview)) {
917  foreach ($tidview as $k => $v) {
918  $currentViewId = trim($v);
919  if ('' !== $currentViewId) {
920  $currentViewlabel = $tlview[$k];
921  $tr[] = array(
922  htmlspecialchars(sprintf("%s (%s)", $currentViewlabel, $currentViewId)) ,
923  $currentViewId,
924  sprintf("%s (%s)", $currentViewlabel, $currentViewId)
925  );
926  }
927  }
928  }
929 
930  return $tr;
931 }
932 /**
933  * Get columns (attribute ir property) that can be used to present of
934  * the report's result
935  *
936  * @param $dbaccess
937  * @param $famid
938  * @param string $name
939  * @return array
940  */
941 function getReportColumns($dbaccess, $famid, $name = "")
942 {
943  $doc = createDoc($dbaccess, $famid, false);
944  $tr = array();
945  $pattern = preg_quote($name, "/");
946  // Properties
947  $propList = array(
948  "title" => _("doctitle") ,
949  "revdate" => _("revdate") ,
950  "revision" => _("revision") ,
951  "owner" => _("owner") ,
952  "state" => _("step") ,
953  "id" => _("document id")
954  );
955  foreach ($propList as $propName => $propLabel) {
956  if (($name == "") || (preg_match("/$pattern/i", $propLabel, $m))) {
957  $propLabel = mb_ucfirst($propLabel);
958  $tr[] = array(
959  $propLabel,
960  $propName,
961  $propLabel
962  );
963  }
964  }
965  $relTypes = array(
966  "docid",
967  "account",
968  "thesaurus"
969  );
970  // Attributes
971  $attrList = $doc->getNormalAttributes();
972  foreach ($attrList as $attr) {
973  if ($attr->type == "array") continue;
974  if (($name == "") || (preg_match("/$pattern/i", $attr->getLabel() , $m))) {
975  $html = '<b><i>' . _getParentLabel($attr) . '</i></b><br/><span>&nbsp;&nbsp;' . $attr->getLabel() . '</span>';
976  $tr[] = array(
977  $html,
978  $attr->id,
979  $attr->getLabel() ,
980  ''
981  );
982  if (in_array($attr->type, $relTypes)) {
983  $html = '<b><i>' . _getParentLabel($attr) . '</i></b><br/><span>&nbsp;&nbsp;' . $attr->getLabel() . '<i> (' . _("report:docid") . ')</i></span>';
984  $tr[] = array(
985  $html,
986  $attr->id,
987  sprintf("%s (%s)", $attr->getLabel() , _("report:docid")) ,
988  "docid"
989  );
990  }
991  }
992  }
993  return $tr;
994 }
995 
996 function reportChooseColumns(&$action, $id)
997 {
998  // print "DB=$dbaccess, NOM=$nom ID=$id";
999  // $action->lay->set("enclosname", $nom);
1000 
1001  /**
1002  * @var \Dcp\Family\Report $doc
1003  */
1004  $doc = new_doc("", $id);
1005  if ($doc->doctype == "C") {
1006  $doc = createTmpDoc($doc->dbaccess, $id);
1007  $doc->setValue(\Dcp\AttributeIdentifiers\Report::se_famid, getHttpVars("_se_famid"));
1008  }
1009  $doc->lay = & $action->lay;
1010  $doc->reportchoosecolumns();
1011 }
1012 /**
1013  * Get columns (attribute or property) than can be used to order the
1014  * report's result.
1015  *
1016  * @param $dbaccess
1017  * @param $famid
1018  * @param string $name
1019  * @return array
1020  */
1022 {
1023  $doc = createDoc($dbaccess, $famid, false);
1024  $tr = array();
1025  $pattern = preg_quote($name, "/");
1026  // Properties
1027  $propList = getSortProperties($dbaccess, $famid, $name);
1028  foreach ($propList as $prop) {
1029  if (($name == "") || (preg_match("/$pattern/i", $prop[1], $m))) {
1030  $tr[] = $prop;
1031  }
1032  }
1033  // Attributes
1034  $attrList = $doc->getSortAttributes();
1035  foreach ($attrList as $attr) {
1036  if (($name == "") || (preg_match("/$pattern/i", $attr->getLabel() , $m))) {
1037  $html = '<b><i>' . _getParentLabel($attr) . '</i></b><br/><span>&nbsp;&nbsp;' . $attr->getLabel() . '</span>';
1038  $tr[] = array(
1039  $html,
1040  $attr->id,
1041  $attr->getLabel() ,
1042  $attr->getOption('sortable')
1043  );
1044  }
1045  }
1046  return $tr;
1047 }
1048 // liste des attributs d'une famille
1049 function getDocAttr($dbaccess, $famid, $name = "")
1050 {
1051  return getSortAttr($dbaccess, $famid, $name, false);
1052 }
1053 // liste des attributs triable d'une famille
1054 function getSortAttr($dbaccess, $famid, $name = "", $sort = true)
1055 {
1056  $docfam = new DocFam($dbaccess, $famid);
1057  //'lsociety(D,US_SOCIETY):US_IDSOCIETY,US_SOCIETY,
1058  $doc = createDoc($dbaccess, $famid, false);
1059 
1060  $tr = array();
1061  $pattern_name = preg_quote($name, "/");
1062 
1063  if ($sort) {
1064  $tr = getSortProperties($dbaccess, $famid, $name);
1065  $tinter = $doc->GetSortAttributes();
1066  } else {
1067  $tinter = $doc->GetNormalAttributes();
1068  }
1069 
1070  foreach ($tinter as $k => $v) {
1071  if (($name == "") || (preg_match("/$pattern_name/i", $v->getLabel() , $reg))) {
1072  $dv = '<b><i>' . _getParentLabel($v) . '</i></b><br/><span>&nbsp;&nbsp;' . $v->getLabel() . '</span>';
1073  $tr[] = array(
1074  $dv,
1075  $v->id,
1076  $v->getLabel() ,
1077  $v->getOption('sortable')
1078  );
1079  }
1080  }
1081 
1082  return $tr;
1083 }
1084 /**
1085  * Get sortable properties with their default sort order
1086  *
1087  * @param $dbaccess
1088  * @param $famid
1089  * @param string $name filter to match the property's label
1090  * @return array
1091  */
1092 function getSortProperties($dbaccess, $famid, $name = "")
1093 {
1094  $pattern = preg_quote($name, "/");
1095  $docfam = new DocFam($dbaccess, $famid);
1096  $props = $docfam->getSortProperties();
1097  $ret = array();
1098  foreach ($props as $propName => $config) {
1099  if ($config['sort'] != 'asc' && $config['sort'] != 'desc') {
1100  continue;
1101  }
1102 
1103  switch ($propName) {
1104  case 'state':
1105  if ($docfam->wid <= 0) {
1106  /* Excerpt from
1107  * http://www.php.net/manual/en/control-structures.switch.php
1108  *
1109  * "Note that unlike some other languages, the continue statement
1110  * applies to switch and acts similar to break. If you have a
1111  * switch inside a loop and wish to continue to the next
1112  * iteration of the outer loop, use continue 2."
1113  */
1114  continue 2;
1115  }
1116  $label = _("state");
1117  break;
1118 
1119  case 'title':
1120  $label = _("doctitle");
1121  break;
1122 
1123  case 'initid':
1124  $label = _("createdate");
1125  break;
1126 
1127  default:
1128  $label = Doc::$infofields[$propName]['label'];
1129  if ($label != '') {
1130  $label = _($label);
1131  }
1132  }
1133 
1134  if ($name != "" && !preg_match("/$pattern/i", $label)) {
1135  continue;
1136  }
1137 
1138  $ret[] = array(
1139  $label,
1140  $propName,
1141  $label,
1142  $config['sort']
1143  );
1144  }
1145  return $ret;
1146 }
1147 /**
1148  * @param NormalAttribute|FieldsetAttribute $oa
1149  * @return string
1150  */
1151 function _getParentLabel($oa)
1152 {
1153  if ($oa && $oa->fieldSet && $oa->fieldSet->id != Adoc::HIDDENFIELD) {
1154  return _getParentLabel($oa->fieldSet) . $oa->fieldSet->getLabel() . '/';
1155  }
1156  return '';
1157 }
1158 
1159 function laction($dbaccess, $famid, $name, $type)
1160 {
1161  $filter = array();
1162  $filter[] = "act_type='$type'";
1163  return lfamily($dbaccess, $famid, $name, 0, $filter);
1164 }
1165 /**
1166  * return list of what application
1167  */
1168 function lapplications($n = "")
1169 {
1170  $q = new QueryDb("", "Application");
1171 
1172  $tr = array();
1173  if ($n != "") $q->AddQuery("name ~* '$n'");
1174  $la = $q->Query(0, 0, "TABLE");
1175  if (is_array($la)) {
1176  foreach ($la as $k => $v) {
1177  $tr[] = array(
1178  $v["name"] . ":" . $v["short_name"],
1179  $v["name"]
1180  );
1181  }
1182  }
1183  return $tr;
1184 }
1185 /**
1186  * return list of what action for one application
1187  */
1188 function lactions($app, $n = "")
1189 {
1190  $tr = array();
1191  $q = new QueryDb("", "Application");
1192  $q->AddQuery("name = '$app'");
1193  $la = $q->Query(0, 0, "TABLE");
1194  if ($q->nb == 1) {
1195  $appid = $la[0]["id"];
1196  if ($appid > 0) {
1197  $q = new QueryDb("", "Action");
1198  $q->AddQuery("id_application = $appid");
1199  if ($n != "") $q->AddQuery("name ~* '$n'");
1200  $la = $q->Query(0, 0, "TABLE");
1201 
1202  if ($q->nb > 0) {
1203  foreach ($la as $k => $v) {
1204  $tr[] = array(
1205  $v["name"] . ":" . _($v["short_name"]) ,
1206  $v["name"]
1207  );
1208  }
1209  }
1210  }
1211  }
1212  return $tr;
1213 }
1214 
1215 function lapi($name = "")
1216 {
1217  $cmd = sprintf("cd %s/API;ls -1 *.php| cut -f1 -d'.'", escapeshellarg(DEFAULT_PUBDIR));
1218  $apis = shell_exec($cmd);
1219  $tapi = explode("\n", $apis);
1220 
1221  $tr = array();
1222  // HERE HERE HERE
1223  $pattern_name = preg_quote($name, "/");
1224  foreach ($tapi as $k => $v) {
1225  $v0 = trim($v);
1226  if (($name == "") || (preg_match("/$pattern_name/i", $v0, $reg))) $tr[] = array(
1227  $v0,
1228  $v0
1229  );
1230  }
1231  return ($tr);
1232 }
1233 
1234 function lstates($dbaccess, $wid, $name = "")
1235 {
1236  $doc = createDoc($dbaccess, $wid, false);
1237 
1238  $tr = array();
1239  if ($doc && method_exists($doc, "getStates")) {
1240  /*
1241  * @var WDoc $doc
1242  */
1243  $states = $doc->getStates();
1244  // HERE HERE HERE
1245  $pattern_name = preg_quote($name, "/");
1246  foreach ($states as $k => $v) {
1247  if (($name == "") || (preg_match("/$pattern_name/i", $v, $reg))) $tr[] = array(
1248  $v . ' (' . _($v) . ')',
1249  $v
1250  );
1251  }
1252  } else return sprintf(_("need to select workflow"));
1253 
1254  return $tr;
1255 }
1256 
1257 function ldocstates($dbaccess, $docid, $name = "")
1258 {
1259  $doc = new_doc($dbaccess, $docid);
1260  $tr = array();
1261  if ($doc->isAlive() && $doc->wid) {
1262  $wdoc = new_doc($dbaccess, $doc->wid, false);
1263  if ($wdoc && method_exists($wdoc, "getStates")) {
1264  /*
1265  * @var WDoc $wdoc
1266  */
1267  $states = $wdoc->getStates();
1268  // HERE HERE HERE
1269  $pattern_name = preg_quote($name, "/");
1270  foreach ($states as $k => $v) {
1271  if (($name == "") || (preg_match("/$pattern_name/i", $v, $reg))) $tr[] = array(
1272  $v . ' (' . _($v) . ')',
1273  $v . ' (' . _($v) . ')'
1274  );
1275  }
1276  } else return sprintf(_("no workflow for this document"));
1277  } else return sprintf(_("no workflow for this document"));
1278  return $tr;
1279 }
1280 
1281 function lmethods($dbaccess, $famid, $name = "")
1282 {
1283  $doc = createDoc($dbaccess, $famid, false);
1284 
1285  $tr = array();
1286  if ($doc) {
1287  $methods = get_class_methods($doc);
1288  $pattern_name = preg_quote($name, "/");
1289  foreach ($methods as $k => $v) {
1290  if (($name == "") || (preg_match("/$pattern_name/i", $v, $reg))) $tr[] = array(
1291  $v,
1292  '::' . $v . '()'
1293  );
1294  }
1295  } else return sprintf(_("need to select family"));
1296 
1297  return $tr;
1298 }
1299 /**
1300  * retrieve information from postgresql database
1301  * @param string $dbaccess the database coordonates
1302  * @param string $table the name of sql table where search data
1303  * @param string $filter the sql where clause to filter
1304  * @param string $more dynamic others arg to define column to retrieve
1305  */
1306 function db_query($dbaccess, $table, $filter)
1307 {
1308  $conn = pg_connect($dbaccess);
1309  if (!$conn) {
1310  return sprintf(_("connexion to %s has failed") , $dbaccess);
1311  }
1312 
1313  $args = func_get_args();
1314  $cols = array();
1315  $order = '';
1316  $tdn = array(); // display name
1317  foreach ($args as $k => $v) {
1318  if ($k > 2) {
1319  if (substr($v, -2) == ":H") {
1320  $v = substr($v, 0, -2);
1321  } else {
1322  if (!$order) $order = strtolower($v);
1323  $tdn[] = $k - 3;
1324  }
1325  $cols[] = (strtolower($v));
1326  }
1327  }
1328  if (count($cols) == 0) {
1329  return sprintf(_("no columns specified"));
1330  }
1331  if (count($tdn) == 0) {
1332  return sprintf(_("all columns are hiddens"));
1333  }
1334 
1335  $select = "select " . implode(",", $cols);
1336  $from = "from " . pg_escape_string($table);
1337  $orderby = "order by " . ($order);
1338  foreach ($_POST as $k => $v) {
1339  if ($k[0] == '_') {
1340  $filter = preg_replace('/' . substr($k, 1) . '/i', pg_escape_string(trim(stripslashes($v))) , $filter);
1341  }
1342  }
1343 
1344  $where = "where $filter";
1345  $limit = "limit 100";
1346  $sql = $select . ' ' . $from . ' ' . $where . ' ' . $orderby . ' ' . $limit;
1347  $result = @pg_query($conn, $sql);
1348  if (!$result) {
1349  return sprintf(_("query %s has failed") , $sql);
1350  }
1351 
1352  $kr = 0;
1353  $t = array();
1354  while ($row = pg_fetch_row($result)) {
1355  $dn = '';
1356  foreach ($tdn as $vi) $dn.= $row[$vi] . ' ';
1357  $t[$kr][] = $dn;
1358  foreach ($row as $ki => $vi) $t[$kr][] = $vi;
1359  $kr++;
1360  }
1361 
1362  return $t;
1363 }
1364 
1365 function recipientDocument($dbaccess, $name)
1366 {
1367  $tr = array();
1368  $sf = new SearchDoc($dbaccess, -1);
1369  $sf->setObjectReturn();
1370  $sf->overrideViewControl();
1371  $sf->addFilter("atags ~* E'\\\\yMAILRECIPIENT\\\\y'");
1372  $dlf = $sf->search()->getDocumentList();
1373 
1374  if ($dlf->count() == 0) return sprintf(_("none families are described to be used as recipient"));
1375  foreach ($dlf as $fam) {
1376  $cfam = createTmpDoc($dbaccess, $fam->id);
1377  /*
1378  * @var IMailRecipient $cfam
1379  */
1380  if (!is_a($cfam, "IMailRecipient")) {
1381  return sprintf(_("Family '%s' does not implements IMailRecipient interface.") , $fam->name);
1382  }
1383 
1384  $mailAttr = $cfam->getMailAttribute();
1385  $s = new SearchDoc($dbaccess, $fam->id);
1386  $s->setObjectReturn();
1387  $s->setSlice(100);
1388  if ($mailAttr) $s->addFilter("%s is not null", $mailAttr);
1389  if ($name != "") {
1390  if ($mailAttr) $s->addFilter("(title ~* '%s') or (%s ~* '%s')", $name, $mailAttr, $name);
1391  else $s->addFilter("(title ~* '%s')", $name, $name);
1392  }
1393  $dl = $s->search()->getDocumentList();
1394  foreach ($dl as $dest) {
1395  /**
1396  * @var \Dcp\Family\IUSER $dest
1397  */
1398  $mailTitle = $dest->getMailTitle();
1399  $mail = $dest->getMail();
1400  if ($mailTitle == '') {
1401  $mailTitle = $mail;
1402  }
1403  $tr[] = array(
1404  xml_entity_encode($mailTitle) ,
1405  xml_entity_encode(sprintf("%d (%s)", $dest->id, $dest->getTitle())) ,
1406  xml_entity_encode($dest->getTitle())
1407  );
1408  }
1409  }
1410  usort($tr, function ($a, $b)
1411  {
1412  return strcasecmp($a[0], $b[0]);
1413  });
1414  return $tr;
1415 }
$dest
Definition: resizeimg.php:231
ldocstates($dbaccess, $docid, $name="")
lfamilly($dbaccess, $famid, $name="", $dirid=0, $filter=array(), $idid="id")
static $infofields
Definition: Class.Doc.php:105
if(substr($wsh, 0, 1)!= '/') $args
setDiacriticRules($text)
global $action
lview($tidview, $tlview)
newFreeVaultFile($dbaccess)
Definition: Lib.Util.php:17
global $_POST
Definition: chgpasswd.php:17
lapi($name="")
lsearches($dbaccess, $name)
lapplications($n="")
print< H1 > Check Database< i > $dbaccess</i ></H1 > $a
Definition: checklist.php:45
lenumvalues($enum, $val="")
vault_filename($th, $fileid)
lcvdoc($dbaccess, $name, $cvfamid="")
$ret
ltimerdoc($dbaccess, $name, $cvfamid="")
laction($dbaccess, $famid, $name, $type)
lfamily($dbaccess, $famid, $name="", $dirid=0, $filter=array(), $idid="id", $withDiacritic=false)
const PREGEXPFILE
Definition: Class.Doc.php:54
if($famId) $s
linkenum($famid, $attrid)
lenum($val, $enum)
_getParentLabel($oa)
db_query($dbaccess, $table, $filter)
getReportColumns($dbaccess, $famid, $name="")
lmailtemplatedoc($dbaccess, $name, $cvfamid="")
static flatEnumNotationToEnumArray($phpfunc, array &$theEnum, array &$theEnumlabel=array(), $locale= '')
const DEFAULT_PUBDIR
Definition: Lib.Prefix.php:28
ltabs($dbaccess, $name)
lzone_($dbaccess, $tview, $famid="")
foreach($argv as $arg) $cmd
fdlGetEnumValues($famid, $attrid, $val= '')
$docid
Definition: cleanFamily.php:13
GetClassesDoc($dbaccess, $userid, $classid=0, $qtype="LIST", $extraFilters=array())
Definition: Lib.Dir.php:906
$tout
Definition: checklist.php:47
getSortProperties($dbaccess, $famid, $name="")
lfamilyvalues($dbaccess, $famid, $name="")
lmask($dbaccess, $name, $maskfamid="")
fdlGetAccounts($filterName= '', $limit=15, $options= '')
tplmail($dbaccess, $type, $famid, $wfamid, $name)
$app
static getFlatEnumNotation($famid, $attrid)
createDoc($dbaccess, $fromid, $control=true, $defaultvalues=true, $temporary=false)
$conn
Definition: pginfo.php:29
getHttpVars($name, $def="", $scope="all")
Definition: Lib.Http.php:124
gettitle($dbaccess, $docid)
internalGetDocCollection($dbaccess, $dirid, $start="0", $slice="ALL", $sqlfilters=array(), $userid=1, $qtype="LIST", $fromid="", $distinct=false, $orderby="title", $latest=true, $trash="", &$debug=null, $folderRecursiveLevel=2, $join= '',\SearchDoc &$searchDoc=null)
Definition: Lib.Dir.php:428
getGlobalsParameters($name)
getFamIdFromName($dbaccess, $name)
mb_ucfirst($s)
Definition: Lib.Common.php:105
getKindDoc($dbaccess, $famname, $aid, $kid, $name="", $sqlfilter=array(), $limit=100, $qtype="TABLE", $userid=0)
Definition: Lib.Dir.php:740
fdlGetDocuments($families, $filterName= '', $limit=15, $extraFilter= '')
if(is_numeric($parms['famid'])) $attrList
getSortAttr($dbaccess, $famid, $name="", $sort=true)
getDocAttr($dbaccess, $famid, $name="")
getDbAccess()
Definition: Lib.Common.php:368
lprofil($dbaccess, $name, $famid=0)
new_Doc($dbaccess, $id= '', $latest=false)
lfamilies($dbaccess, $name= '', $subfam="")
tpluser($dbaccess, $type, $famid, $wfamid, $name)
GetSqlCond($Table, $column, $integer=false)
lzone($dbaccess, $tview, $famid="")
lkfamily($dbaccess, $famname, $aid, $kid, $name, $filter=array())
$from
static getLangTitle($values)
lstates($dbaccess, $wid, $name="")
lactions($app, $n="")
$vf
Definition: geticon.php:28
$account
Definition: guest.php:36
$dbaccess
Definition: checkVault.php:17
$info
Definition: geticon.php:30
lmethods($dbaccess, $famid, $name="")
xml_entity_encode($s)
Definition: Lib.Util.php:596
createTmpDoc($dbaccess, $fromid, $defaultvalue=true)
getReportSortableColumns($dbaccess, $famid, $name="")
$param
Definition: import_size.php:31
getFamAttribute($dbaccess, $famid, $type="text", $param=false, $name="")
← centre documentaire © anakeen