18 include_once (
'FDL/Class.Doc.php');
45 if (isset($this->fromid)) $this->defProfFamId =
$this->fromid;
62 while (list($k, $v) = each($tk)) {
63 if ($ti[$k] ==
"") $cvk =
"CV$k";
65 $this->dacls[$cvk] = array(
67 "description" => $tl[$k]
80 $dc =
new DocCtrl($this->dbaccess);
81 $originals = $dc->dacls;
83 if ($this->nbId > 20) {
84 $err = _(
"Maximum 20 views by control");
85 } elseif (!preg_match(
'!^[0-9a-z_-]+$!i',
$value)) {
86 $err = _(
"You must use only a-z, 0-9, _, - caracters");
87 } elseif (array_key_exists(
$value, $originals)) {
88 $err = _(
"Impossible to name a view like a control acl");
92 foreach ($id_list as
$id) {
98 $err = _(
"Impossible to have several identical names");
110 foreach ($ti as $k => $v) {
120 "CV_LVIEW" => $tl[$k],
121 "CV_ZVIEW" => $tz[$k],
122 "CV_KVIEW" => $tk[$k],
123 "CV_MSKID" => $tm[$k]
134 foreach ($ti as $k => $v) {
145 foreach ($ti as $k => $v) {
146 if ($v ==
"") $ti[$k] =
"CV$k";
148 $this->setValue(
"CV_IDVIEW", $ti);
163 if ($this->
getValue(
"DPDOC_FAMID") > 0) {
166 if (!isset($this->pdoc)) {
167 $pdoc =
createDoc($this->dbaccess, $this->fromid,
false);
168 $pdoc->doctype =
"T";
171 if (
$err !=
"")
return "CVDoc::Control:" .
$err;
172 $pdoc->setProfil($this->profid, $this->doc);
175 $this->pdoc = & $pdoc;
177 $err = $this->pdoc->DocControl($aclname);
185 if (!isset($this->doc)) {
197 if ($edition && (!$this->doc->id)) {
198 $vidcreate = $this->
getValue(
"cv_idcview");
201 $viewU = $this->
getView($vidcreate);
203 foreach ($viewU as $k => $v) $view[strtolower($k) ] = $v;
208 $type = ($edition) ?
"VEDIT" :
"VCONS";
212 usort($tv,
"cmp_cvorder3");
213 foreach ($tv as $k => $v) {
214 if ($v[
"cv_order"] > 0) {
215 if ($v[
"cv_kview"] ==
$type) {
216 $err = $this->control($v[
"cv_idview"]);