Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
modcard.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  * Modification of document
8  *
9  * @author Anakeen
10  * @version $Id: modcard.php,v 1.111 2009/01/12 12:11:42 eric Exp $
11  * @package FDL
12  * @subpackage
13  */
14 /**
15  */
16 
17 include_once ("FDL/Class.Doc.php");
18 include_once ("FDL/Class.DocAttr.php");
19 include_once ("FDL/freedom_util.php");
20 include_once ("FDL/Lib.Vault.php");
21 include_once ("VAULT/Class.VaultFile.php");
22 include_once ("Lib.FileMime.php");
23 /**
24  * Modify a document
25  * @param Action $action
26  * @param int $ndocid
27  * @param array $info
28  * @return string
29  */
30 function modcard(Action & $action, &$ndocid, &$info = array())
31 {
32  // modify a card values from editcard
33  // -----------------------------------
34  // Get all the params
35  $docid = GetHttpVars("id", 0);
36  $classid = GetHttpVars("classid", 0);
37  $usefor = GetHttpVars("usefor"); // use for default values for a document
38  $vid = GetHttpVars("vid"); // special controlled view
39  $noredirect = (GetHttpVars("noredirect")); // true if return need edition
40  $quicksave = (GetHttpVars("quicksave") == "1"); // true if return need edition
41  $force = (GetHttpVars("fstate", "no") == "yes"); // force change
42  $dbaccess = $action->dbaccess;
43  $ndocid = $docid;
44 
45  global $_POST;
46  if (count($_POST) == 0) return sprintf(_("Document cannot be created.\nThe upload size limit is %s bytes.") , ini_get('post_max_size'));
47 
48  if (($usefor == "D") || ($usefor == "Q")) {
49  // set values to family document
50  $err = specialmodcard($action, $usefor);
51  $ndocid = $classid;
52  return $err;
53  }
54  $commentSubstitute = '';
55  if ($docid == 0) {
56  // add new document
57  // search the good class of document
58  $doc = createDoc($dbaccess, $classid);
59  if (!$doc) $action->exitError(sprintf(_("no privilege to create this kind (%d) of document") , $classid));
60 
61  $fdoc = $doc->getFamilyDocument();
62  if ($fdoc->control('icreate') != "") $action->exitError(sprintf(_("no privilege to create interactivaly this kind (%s) of document") , $fdoc->title));
63  $doc->owner = $action->user->id;
64  $doc->locked = 0;
65  if ($doc->fromid <= 0) {
66  $doc->profid = "0"; // NO PROFILE ACCESS
67 
68  }
69 
70  $incumbentName = $action->user->getIncumbentPrivilege($fdoc, 'icreate');
71  if ($incumbentName) $commentSubstitute = sprintf(_("(substitute of %s) : ") , $incumbentName);
72  } else {
73  // initialise object
75 
76  $err = $doc->lock(true); // autolock
77  if ($err != "") $action->ExitError($err);
78  // test object permission before modify values (no access control on values yet)
79  $err = $doc->canEdit();
80  if ($err != "") $action->ExitError($err);
81  $incumbentName = $action->user->getIncumbentPrivilege($doc, 'edit');
82  if ($incumbentName) $commentSubstitute = sprintf(_("(substitute of %s) : ") , $incumbentName);
83  }
84  // apply specified mask
85  if (($vid != "") && ($doc->cvid > 0)) {
86  // special controlled view
87 
88  /*
89  * @var CVDoc $cvdoc
90  */
91  $cvdoc = new_Doc($dbaccess, $doc->cvid);
92  $cvdoc->Set($doc);
93  $err = $cvdoc->control($vid); // control special view
94  if ($err != "") $action->exitError($err);
95  $tview = $cvdoc->getView($vid);
96  $doc->setMask($tview["CV_MSKID"]); // apply mask to avoid modification of invisible attribute
97 
98  } else if ($doc->cvid > 0) {
99  $doc->setMask($doc::USEMASKCVEDIT);
100  }
101  // ------------------------------
103 
104  if ((!$noredirect) && ($err != "")) {
105  $action->Addwarningmsg($err);
106  }
107  if (!$err) {
108  // verify preStore.
109  $err = $doc->preStore();
110  if (!$err) {
111  if (($action->getArgument("noconstraint") != "Y") || ($action->user->id != 1)) {
112  $err = $doc->verifyAllConstraints(false, $info);
113  }
114  }
115  }
116  // verify attribute constraint
117  if ($err && !$noredirect) {
118  // redirect to edit action
119  //get action where to redirect
120  $eapp = getHttpVars("eapp");
121  $eact = getHttpVars("eact");
122  $eparams = getHttpVars("eparams");
123  $appl = $action->parent;
124  if ($eapp) {
125  $appl->Set($eapp, $action->parent->parent);
126  $action->set($eact, $appl);
127  if ($eparams) {
128  $eparams = explode('&', $eparams);
129  foreach ($eparams as $eparam) {
130  $eparam = explode('=', $eparam);
131  setHttpVar($eparam[0], $eparam[1]);
132  }
133  }
134  } else {
135  if ($appl->name != "GENERIC") {
136  global $core;
137  $appl->Set("GENERIC", $core);
138  }
139  $action->Set("GENERIC_EDIT", $appl);
140  }
141  setHttpVar("zone", getHttpVars("ezone"));
142  setHttpVar("viewconstraint", "Y");
143  $action->addWarningMsg(_("Some constraint attribute are not respected.\nYou must correct these values before save document."));
144  $action->addWarningMsg($err);
145  echo ($action->execute());
146  exit;
147  }
148  if ($err == "") {
149  try {
150  if ($docid == 0) {
151  // now can create new doc
152  $err = $doc->Add();
153  if ($err != "") {
154  if ($noredirect) {
155  //$action->addWarningMsg($err);
156  return $err;
157  } else {
158  $action->ExitError($err);
159  }
160  }
161  $doc->disableEditControl(); // in case of dynamic profil from computed attributes
162  $doc->initid = $doc->id; // it is initial doc
163  $ndocid = $doc->id;
164  }
165 
166  $doc->lmodify = 'Y'; // locally modified
167  $ndocid = $doc->id;
168  if (!$quicksave) { // else quick save
169  $doc->refresh();
170 
171  if (needRefreshRn($doc)) $doc->refreshRn(); // hasNewFiles set by insertFile below
172  $msg = $doc->postStore();
173  if ($msg) $action->addWarningMsg($msg);
174  // add trace to know when and who modify the document
175  if ($docid == 0) {
176  //$doc->Addcomment(_("creation"));
177 
178  } else {
179  $olds = $doc->getOldRawValues();
180  if (is_array($olds)) {
181  $keys = array();
182  foreach ($olds as $ka => $va) {
183  $oa = $doc->getAttribute($ka);
184  $keys[] = $oa->getLabel();
185  }
186  $skeys = implode(", ", $keys);
187  $doc->addHistoryEntry($commentSubstitute . sprintf(_("change %s") , $skeys) , HISTO_INFO, "MODIFY");
188  } else {
189  $doc->addHistoryEntry($commentSubstitute . _("change") , HISTO_INFO, "MODIFY");
190  }
191  }
192  if ($err == "") {
193  $err.= $doc->Modify();
194  }
195  // if ( $docid == 0 ) $err=$doc-> PostCreated();
196  $doc->unlock(true); // disabled autolock
197  if (($err == "") && ($doc->doctype != 'T')) {
198  // change state if needed
199  $newstate = GetHttpVars("newstate", "");
200  $comment = GetHttpVars("comment", "");
201 
202  $err = "";
203 
204  if (($newstate != "") && ($newstate != "-")) {
205 
206  if ($doc->wid > 0) {
207  if ($newstate != "-") {
208  /*
209  * @var WDoc $wdoc
210  */
211  $wdoc = new_Doc($dbaccess, $doc->wid);
212 
213  $wdoc->Set($doc);
214  $wdoc->disableEditControl(); // only to pass ask parameters
215  setPostVars($wdoc, $info); // set for ask values
216  $wdoc->enableEditControl();
217  $err = $wdoc->ChangeState($newstate, $comment, $force);
218  }
219  }
220  } else {
221  // test if auto revision
222  $fdoc = $doc->getFamilyDocument();
223 
224  if ($fdoc->schar == "R") {
225  $doc->revise(sprintf("%s : %s", _("auto revision") , $comment));
226  } else {
227  if ($comment != "") $doc->addHistoryEntry($commentSubstitute . $comment);
228  }
229  }
230  $ndocid = $doc->id;
231  }
232  } else {
233  // just quick save
234  if ($err == "") {
235  $err.= $doc->Modify();
236  }
237  }
238  }
239  catch(Exception $e) {
240  $err = $e->getMessage();
241  }
242  }
243 
244  if (!$err) {
245  if ($info) {
246  foreach ($info as $k => $v) {
247  if ($v["err"] != "") $err = $v["err"];
248  }
249  }
250  // add events for folders
251  $fdlids = $doc->getParentFolderIds();
252  foreach ($fdlids as $fldid) {
253  $action->AddActionDone("MODFOLDERCONTAINT", $fldid);
254  }
255  }
256  return $err;
257 }
258 
259 function setPostVars(Doc & $doc, &$info = array())
260 {
261  // update POSGRES text values
262  global $_POST;
263  global $_FILES;
264  $err = "";
265 
266  foreach ($_POST as $k => $v) {
267 
268  if ($k[0] == "_") // document attributes begin with _
269  {
270 
271  $attrid = substr($k, 1);
272  if (is_array($v)) {
273  if (isset($v["-1"])) unset($v["-1"]);
274  if (isset($v["__1x_"])) unset($v["__1x_"]);
275 
276  if ((count($v) == 0)) $value = " "; // delete column
277  else $value = $v;
278  //$value = array_values($value);
279  if (count($v) == 1 && $v[0] === '' && (count($doc->getMultipleRawValues($attrid)) == 0)) {
280  $value = '';
281  $oa = $doc->getAttribute($attrid);
282  if ($oa && $oa->fieldSet && $oa->fieldSet->type == "array") {
283  /*
284  * @var NormaLAttribute $oa
285  */
286  $arrayAids = $doc->attributes->getArrayElements($oa->fieldSet->id);
287  // detect if it is a empty row => in this case
288  $canCut = true;
289  foreach ($arrayAids as $taid) {
290  if (!empty($_POST['_' . $taid->id][0])) {
291  $canCut = false;
292  break;
293  }
294  }
295  if ($canCut) $value = '';
296  }
297  }
298  } else $value = $v;
299 
300  if ($value == "") $doc->SetValue($attrid, DELVALUE);
301  else {
302  $kerr = '';
303  $seterr = $doc->SetValue($attrid, $value, -1, $kerr);
304  if ($seterr) {
305  $oa = $doc->getAttribute($attrid);
306  if ($oa) {
307  $info[$oa->id] = array(
308  "id" => $oa->id,
309  "err" => $seterr
310  );
311  if ($oa->inArray()) {
312  $info[$oa->id]["index"] = $kerr;
313  }
314  $ola = $oa->getLabel();
315  $err.= sprintf("%s : %s\n", $ola, $seterr);
316  }
317  }
318  }
319  }
320  }
321  // ------------------------------
322  // update POSGRES files values
323  foreach ($_FILES as $k => $v) {
324  if ($k[0] == "_") // freedom attributes begin with _
325  {
326  $k = substr($k, 1);
327 
328  $filename = insert_file($doc, $k);
329  if ($filename != "") {
330  if (substr($k, 0, 4) == "UPL_") $k = substr($k, 4);
331  $doc->SetValue($k, $filename);
332  }
333  }
334  }
335  // delete first empty row
336  $ta = $doc->getNormalAttributes();
337  foreach ($ta as $k => $v) {
338  if ($v->type == "array") {
339  $tv = $doc->getArrayRawValues($v->id);
340  if (count($tv) == 1) {
341  $fv = current($tv);
342  $vempty = true;
343  foreach ($fv as $fk => $fvv) {
344  if ($fvv) {
345  $vempty = false;
346  break;
347  }
348  }
349  if ($vempty) {
350  $doc->removeArrayRow($v->id, 0);
351  }
352  }
353  }
354  }
355  return $err;
356 }
357 /**
358  * insert file in VAULT from HTTP upload
359  * @param Doc $doc
360  * @param $attrid
361  * @param bool $strict
362  * @return array|string
363  * @throws \Dcp\Core\Exception
364  */
365 function insert_file(Doc & $doc, $attrid, $strict = false)
366 {
367  /*
368  * @var Action $action
369  */
370  global $action;
371  global $_FILES;
372 
373  if ($strict) $postfiles = $_FILES[$attrid];
374  else $postfiles = $_FILES["_" . $attrid];
375  $oa = $doc->getAttribute(substr($attrid, 4));
376  $oriid = "IFORI_" . substr($attrid, 4);
377  $orinames = getHttpVars($oriid); // when use preventfilechange option
378  if (is_array($postfiles['tmp_name'])) { // array of file
379  /*
380  * Transpose:
381  *
382  * $postfiles = array(
383  * 'tmp_name' => array(
384  * 0 => '/tmp/aaa',
385  * [...],
386  * N => '/tmp/nnn'
387  * ),
388  * [...],
389  * 'error' => array(
390  * 0 => 0,
391  * [...],
392  * N => 0
393  * )
394  * );
395  *
396  * into:
397  *
398  * $tuserfiles = array(
399  * 0 => array(
400  * 'tmp_name' => '/tmp/aaa',
401  * [...],
402  * 'error' => 0
403  * ),
404  * [...],
405  * N => array(
406  * 'tmp_name' => '/tmp/nnn',
407  * [...],
408  * 'error' => 0
409  * )
410  * );
411  *
412  */
413  $tuserfiles = array();
414  foreach ($postfiles as $kp => $v) {
415  foreach ($v as $k => $ufv) {
416  if ($k >= 0) {
417  $tuserfiles[$k][$kp] = $ufv;
418  if (!empty($orinames[$k])) {
419  if (!$tuserfiles[$k]["realname"]) {
420  $tuserfiles[$k]["realname"] = $tuserfiles[$k]["name"];
421  $tuserfiles[$k]["name"] = $orinames[$k];
422  }
423  }
424  if ($oa) $tuserfiles[$k]["oldvalue"] = $doc->getMultipleRawValues($oa->id, "", $k);
425  }
426  }
427  }
428  } else { // only one file
429  if ($orinames) {
430  $postfiles["realname"] = $postfiles["name"];
431  $postfiles["name"] = $orinames;
432  }
433  if ($oa) $postfiles["oldvalue"] = $doc->getRawValue($oa->id);
434  $tuserfiles[] = $postfiles;
435  }
436 
437  $rtold = array(); // array of file to be returned
438  if ($doc) $rtold = $doc->rawValueToArray($doc->getOldRawValue(substr($attrid, 4))); // special in case of file modification by DAV in revised document
439  $oa = $doc->getAttribute(substr($attrid, 4));
440  $rt = $doc->getMultipleRawValues($attrid); // in case of modified only a part of array files
441  unset($tuserfiles['__1x_']);
442 
443  foreach ($tuserfiles as $k => $userfile) {
444  $rt[$k] = "";
445  if ($userfile['name'] == " ") {
446  $rt[$k] = " "; // delete reference file
447  continue;
448  }
449 
450  if ($userfile['error'] != UPLOAD_ERR_OK) {
451  if ($userfile['error'] == UPLOAD_ERR_NO_FILE) {
452  /**
453  * In our case, an empty input field is not an error but it
454  * means that the input field value has not been changed.
455  *
456  * So, UPLOAD_ERR_NO_FILE is not a real error, but a special
457  * case in our handling of uploaded files.
458  */
459  // if no file specified, keep current file
460  // reuse old value
461  if (substr($attrid, 0, 3) == "UPL") {
462  $oldfile = getHttpVars(substr($attrid, 3));
463  if (!is_array($oldfile)) {
464  $vid1 = 0;
465  $vid2 = 0;
466  if (isset($rtold[0]) && preg_match(PREGEXPFILE, $rtold[0], $reg)) {
467  $vid1 = $reg[2];
468  }
469  if (preg_match(PREGEXPFILE, $oldfile, $reg)) {
470  $vid2 = $reg[2];
471  }
472 
473  if (($vid1 > 0) && ($vid2 > 0) && ($vid1 > $vid2)) {
474  $rt[$k] = $rtold[0];
475  } // in case of DAV auto clone when revised doc
476  else {
477  $rt[$k] = $oldfile;
478  }
479  } else {
480  if (isset($oldfile[$k])) {
481  // print "RECENT $oldfile[$k] :<b>".searchmorerecent($rtold,$oldfile[$k])."</b><br>";
482  $recent = searchmorerecent($rtold, $oldfile[$k]);
483  if ($recent) $rt[$k] = $recent;
484  else $rt[$k] = $oldfile[$k];
485  }
486  }
487  }
488  } else {
489  /**
490  * Other codes are "real" errors and must be reported.
491  */
492  switch ($userfile['error']) {
493  case UPLOAD_ERR_INI_SIZE: // 1
494  $err = sprintf(_("Filename '%s' cannot be transmitted.\nThe Size Limit is %s bytes.") , $userfile['name'], ini_get('upload_max_filesize'));
495  break;
496 
497  case UPLOAD_ERR_FORM_SIZE: // 2
498  $err = sprintf(_("Filename '%s' cannot be transmitted.\nThe Size Limit was specified in the HTML form.") , $userfile['name']);
499  break;
500 
501  case UPLOAD_ERR_PARTIAL: // 3
502  $err = sprintf(_("Filename '%s' cannot be transmitted completly.\nMay be saturation of server disk.") , $userfile['name']);
503  break;
504 
505  case UPLOAD_ERR_NO_TMP_DIR: // 6
506  $err = sprintf(_("Filename '%s' cannot be transmitted.\nMissing a temporary folder.") , $userfile['name']);
507  break;
508 
509  case UPLOAD_ERR_CANT_WRITE: // 7
510  $err = sprintf(_("Filename '%s' cannot be transmitted.\nFailed to write file to disk.") , $userfile['name']);
511  break;
512 
513  case UPLOAD_ERR_EXTENSION: // 8
514  $err = sprintf(_("Filename '%s' cannot be transmitted.\nA PHP extension stopped the file upload.") , $userfile['name']);
515  break;
516 
517  default:
518  $err = sprintf(_("Filename '%s' cannot be transmitted (%d).") , $userfile['name'], $userfile['error']);
519  }
520  $action->ExitError($err);
521  }
522  } else {
523  /**
524  * Handle successful non-empty input field uploads
525  */
526  if (file_exists($userfile['tmp_name'])) {
527  if (is_uploaded_file($userfile['tmp_name'])) {
528  // move to add extension
529  $fname = rawurldecode($userfile['name']);
530  $err = vault_store($userfile['tmp_name'], $vid, $fname);
531  // read system mime
532  $userfile['type'] = getSysMimeFile($userfile['tmp_name'], $userfile['name']);
533 
534  if ($err != "") {
535  AddWarningMsg($err);
536  $doc->addHistoryEntry(sprintf(_("file %s : %s") , $fname, $err) , HISTO_WARNING);
537  } else {
538  if ($oa && $oa->getOption('preventfilechange') == "yes") {
539  if (preg_match(PREGEXPFILE, $userfile["oldvalue"], $reg)) {
540  $expectname = vault_uniqname($reg[2]);
541  if ($expectname && ($expectname != $userfile["realname"])) {
542  $ext = substr($expectname, strrpos($expectname, '.'));
543  $prefix = substr($expectname, 0, strrpos($expectname, '}') + 1);
544 
545  $realext = substr($userfile["realname"], strrpos($userfile["realname"], '.'));
546  $realprefix = substr($userfile["realname"], 0, strrpos($userfile["realname"], '}', strrpos($expectname, '.') - 2) + 1);
547 
548  if (($ext != $realext) || ($prefix != $realprefix)) {
549  $doc->addHistoryEntry(sprintf(_("%s : file %s has been replaced by new file %s") , $oa->getLabel() , $reg[3], $userfile["name"]) , HISTO_WARNING);
550  }
551  }
552  }
553  }
554  $rt[$k] = $userfile['type'] . "|" . $vid . '|' . $fname; // return file type and upload file name
555 
556  }
557  } else {
558  $err = sprintf(_("Possible file upload attack: filename '%s'.") , $userfile['name']);
559  $action->ExitError($err);
560  }
561  } else {
562  $err = sprintf(_("Filename '%s' cannot be transmitted.\nNo file was uploaded.") , $userfile['name']);
563  $action->exitError($err);
564  }
565  }
566  }
567 
568  if ((count($rt) == 0) || ((count($rt) == 1) && (current($rt) == ""))) return "";
569  // return file type and upload file name
570  return ($rt);
571 }
572 function needRefreshRn(Doc & $doc)
573 {
574  $fa = $doc->GetFileAttributes();
575  foreach ($fa as $aid => $oa) {
576  $rn = $oa->getOption("rn");
577  $ov = $doc->getOldRawValue($aid);
578  if ($rn && $ov) return true;
579  }
580 
581  return false;
582 }
583 function searchmorerecent($rt, $file)
584 {
585  foreach ($rt as $k => $v) {
586  if (preg_match(PREGEXPFILE, $v, $reg)) {
587  $vid1 = $reg[2];
588  $fn1 = $reg[3];
589  if (preg_match(PREGEXPFILE, $file, $reg)) {
590  $vid2 = $reg[2];
591  $fn2 = $reg[3];
592  if (($vid1 > 0) && ($vid2 > 0) && ($vid1 > $vid2) && ($fn1 == $fn2)) return $v;
593  }
594  }
595  }
596  return false;
597 }
598 // -----------------------------------
599 function specialmodcard(Action & $action, $usefor)
600 {
601 
602  global $_POST;
603  global $_FILES;
604 
605  $dbaccess = $action->dbaccess;
606  $classid = GetHttpVars("classid", 0);
607  /*
608  * @var DocFam $cdoc
609  */
610  $cdoc = new_Doc($dbaccess, $classid); // family doc
611  $tmod = array();
612  $err = '';
613  foreach ($_POST as $k => $v) {
614  //print $k.":".$v."<BR>";
615  if ($k[0] == "_") // freedom attributes begin with _
616  {
617  $attrid = substr($k, 1);
618  if (is_array($v)) {
619  if (isset($v["-1"])) unset($v["-1"]);
620  if (isset($v["__1x_"])) unset($v["__1x_"]);
621  $value = $v;
622  } else {
623  $value = trim($v);
624  }
625  if ($cdoc->getAttribute($attrid)) {
626  if ($usefor == "D") $cdoc->setDefValue($attrid, $value);
627  else if ($usefor == "Q") $err.= $cdoc->setParam($attrid, $value);
628  $tmod[$attrid] = $value;
629  }
630  }
631  }
632  // ------------------------------
633  // update POSGRES files values
634  foreach ($_FILES as $k => $v) {
635  if ($k[0] == "_") // freedom attributes begin with _
636  {
637  $k = substr($k, 1);
638 
639  $filename = insert_file($cdoc, $k);
640 
641  if ($filename != "") {
642  if (substr($k, 0, 4) == "UPL_") $k = substr($k, 4);
643  if ($usefor == "D") $cdoc->setDefValue($k, $filename);
644  else if ($usefor == "Q") $err.= $cdoc->setParam($k, $filename);
645 
646  $tmod[$k] = $filename;
647  }
648  }
649  }
650 
651  if (!$err) {
652  $cdoc->modify();
653  if (count($tmod) > 0) {
654  $s = '';
655  if ($usefor == "D") $s = _("modify default values :");
656  else if ($usefor == "Q") $s = _("modify parameters :");
657  $s.= " ";
658  foreach ($tmod as $k => $v) {
659  if (is_array($v)) {
660  $v = '[' . join(', ', $v) . ']';
661  }
662  $s.= "$k:$v, ";
663  }
664  $cdoc->addHistoryEntry($s);
665  }
666  }
667  return $err;
668 }
669 /**
670  * Check for PHP's max_input_vars corruption.
671  *
672  * The check is only performed if the action is executed with the variable checkMaxInputVars=yes
673  *
674  * @param Action $action The action that received the POSTed data
675  * @param string $inputNameValue Name and value of last input to detect corruption (default is '__detect_max_input_vars__')
676  * @return bool
677  */
678 function check_max_input_vars(Action & $action, $inputNameValue = '__check_max_input_vars__')
679 {
680  if ($action->getArgument('checkMaxInputVars') == 'yes' && $action->getArgument($inputNameValue) != $inputNameValue) {
681  return false;
682  }
683  return true;
684 }
specialmodcard(Action &$action, $usefor)
Definition: modcard.php:599
vault_uniqname($idfile, $teng_name="")
Definition: Lib.Vault.php:127
getNormalAttributes($onlyopt=false)
Definition: Class.Doc.php:2387
global $appl
Definition: checkVault.php:9
addWarningMsg($msg)
$comment
Definition: fdl_execute.php:35
global $action
& getAttribute($idAttr, &$oa=null, $useMask=true)
Definition: Class.Doc.php:2152
global $_POST
Definition: chgpasswd.php:17
getOldRawValue($attrid)
Definition: Class.Doc.php:4375
const HISTO_INFO
static rawValueToArray($v)
Definition: Class.Doc.php:6228
needRefreshRn(Doc &$doc)
Definition: modcard.php:572
$filename
const HISTO_WARNING
getSysMimeFile($f, $fn="")
$file
const PREGEXPFILE
Definition: Class.Doc.php:54
if($famId) $s
getArrayRawValues($idAttr, $index=-1)
Definition: Class.Doc.php:3292
setPostVars(Doc &$doc, &$info=array())
Definition: modcard.php:259
removeArrayRow($idAttr, $index)
Definition: Class.Doc.php:3328
Set($name, &$parent)
exitError($texterr, $exit=true, $code="")
$docid
Definition: cleanFamily.php:13
searchmorerecent($rt, $file)
Definition: modcard.php:583
$force
getMultipleRawValues($idAttr, $def="", $index=-1)
Definition: Class.Doc.php:3240
createDoc($dbaccess, $fromid, $control=true, $defaultvalues=true, $temporary=false)
getHttpVars($name, $def="", $scope="all")
Definition: Lib.Http.php:124
switch($command) exit
Definition: checkVault.php:46
new_Doc($dbaccess, $id= '', $latest=false)
vault_store($filename, &$vid, $ftitle="")
Definition: Lib.Vault.php:153
static getArgument($k, $def= '')
const DELVALUE
Definition: Class.Doc.php:46
$dbaccess
Definition: checkVault.php:17
$info
Definition: geticon.php:30
modcard(Action &$action, &$ndocid, &$info=array())
Definition: modcard.php:30
insert_file(Doc &$doc, $attrid, $strict=false)
Definition: modcard.php:365
if($file) if($subject==""&&$file) if($subject=="") $err
addHistoryEntry($comment= '', $level=DocHisto::INFO, $code= '', $uid= '')
Definition: Class.Doc.php:4707
check_max_input_vars(Action &$action, $inputNameValue= '__check_max_input_vars__')
Definition: modcard.php:678
getRawValue($idAttr, $def="")
Definition: Class.Doc.php:3117
$value
$core
Definition: chgpasswd.php:33
← centre documentaire © anakeen