Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
Method.Wask.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5  * @package FDL
6 */
7 /**
8  * Ask documents
9  *
10  * @author Anakeen 2000
11  * @version $Id: Method.SpecialSearch.php,v 1.3 2007/08/01 14:07:12 eric Exp $
12  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13  * @package FDL
14  * @subpackage GED
15  */
16 /**
17  */
18 /**
19  * @begin-method-ignore
20  * this part will be deleted when construct document class until end-method-ignore
21  */
22 class _WASK extends Doc
23 {
24  /*
25  * @end-method-ignore
26  */
27  function postConstructor()
28  {
29  $this->dacls["answer"] = array(
30  "pos" => 31,
31  "description" => _("need answer")
32  );
33  $this->acls[] = "answer"; # _("answer")
34 
35  }
36  /**
37  * return sql query to search wanted document
38  */
39  function getAskLabels($keys)
40  {
41  $tk = array();
42  foreach ($keys as $k) {
43  $tk[$k] = $this->getAskLabel($k);
44  }
45  return $tk;
46  }
47 
48  function getAskLabel($keys)
49  {
50  $i = array_search($keys, $this->getTValue("was_keys"));
51  if ($i !== false) {
52  return $this->getTvalue("was_labels", "", $i);
53  }
54  return "";
55  }
56 
57  function DocControl($aclname)
58  {
59  return Doc::Control($aclname);
60  }
61  /**
62  * Special control in case of dynamic controlled profil
63  */
64  function Control($aclname)
65  {
66 
67  $err = $this->DocControl($aclname);
68  if ($err == "") return $err; // normal case
69  if ($this->getValue("DPDOC_FAMID") > 0) {
70  if ($this->doc) {
71  // special control for dynamic users
72  if (!isset($this->pdoc)) {
73  $pdoc = createTmpDoc($this->dbaccess, $this->fromid);
74  $err = $pdoc->Add();
75  if ($err != "") return "Wask::Control:" . $err; // can't create profil
76  $pdoc->setProfil($this->profid, $this->doc);
77  $this->pdoc = & $pdoc;
78  }
79  $err = $this->pdoc->DocControl($aclname);
80  }
81  }
82  return $err;
83  }
84 
85  function Set(&$doc)
86  {
87  if (!isset($this->doc)) {
88  $this->doc = & $doc;
89  }
90  }
91  /**
92  * @begin-method-ignore
93  * this part will be deleted when construct document class until end-method-ignore
94  */
95 }
96 /*
97  * @end-method-ignore
98 */
99 ?>
← centre documentaire © anakeen - published under CC License - Dynacase