Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
Class.MailTemplate.php
Go to the documentation of this file.
1 <?php
2 /*
3  * Mail template document
4  * @author Anakeen
5  * @package FDL
6 */
7 /**
8  * Mail template document
9  */
10 namespace Dcp\Core;
12 {
13  /**
14  * always show a user notification
15  */
16  const NOTIFY_SENDMAIL_ALWAYS = 'always';
17  /**
18  * only show a notification if an error occured
19  */
20  const NOTIFY_SENDMAIL_ERRORS_ONLY = 'errors only';
21  /**
22  * never show a notification
23  */
24  const NOTIFY_SENDMAIL_NEVER = 'never';
25  /**
26  * show notification according to CORE_NOTIFY_SENDMAIL parameter
27  */
28  const NOTIFY_SENDMAIL_AUTO = 'auto';
29 
30  public $ifiles = array();
31  public $sendercopy = true;
32  public $keys = array();
33 
34  protected $notifySendMail = self::NOTIFY_SENDMAIL_AUTO;
35  protected $stopIfNoRecip = false;
36  function preEdition()
37  {
38  global $action;
39 
40  if ($mailfamily = $this->getRawValue("tmail_family", getHttpVars("TMAIL_FAMILY"))) {
41  $action->parent->AddJsRef(htmlspecialchars("?app=FDL&action=FCKDOCATTR&famid=" . urlencode($mailfamily) , ENT_QUOTES));
42  }
43  }
44  /**
45  * Check if the relation is correct and the attribute does exists
46  *
47  * @param string $values Relation to check
48  * @param array $doc Field and values of document attributes
49  * @return string Error if attribute not found, else empty string
50  */
51  private function checkAttributeExistsInRelation($values, array $doc)
52  {
53  $tattrid = explode(":", $values);
54  if (count($tattrid) == 1) { //no relation
55  if (!array_key_exists($tattrid[0], $doc)) return sprintf(_("Send mail error : Attribute %s not found.") , $tattrid[0]);
56  return "";
57  }
58  $lattrid = array_pop($tattrid); // last attribute
59  foreach ($tattrid as $v) {
60  if (!array_key_exists($v, $doc)) return sprintf(_("Send mail error : Relation to attribute %s not found. Incorrect relation key: %s") , $lattrid, $v);
61  $docids = getLatestDocIds($this->dbaccess, array(
62  $doc[$v]
63  ));
64  if (!$docids) {
65  return sprintf(_("Send mail error : Relation to attribute %s not found. Relation key %s does'nt link to a document") , $lattrid, $v);
66  }
67  $doc = getTDoc($this->dbaccess, array_pop($docids));
68  if (!$doc) return sprintf(_("Send mail error : Relation to attribute %s not found. Relation key %s does'nt link to a document") , $lattrid, $v);
69  }
70  if (!array_key_exists($lattrid, $doc)) return sprintf(_("Send mail error : Attribute %s not found.") , $lattrid);
71  return "";
72  }
73 
74  /**
75  * @param \Doc $doc Document to use for complete mail
76  * @param array $keys extra keys to complete mail body or subject
77  *
78  * @return \Dcp\Mail\Message (return null if no recipients)
79  * @throws \Dcp\Exception
80  */
81  public function getMailMessage(\Doc & $doc, $keys = array())
82  {
83 
84  global $action;
85  $this->keys = $keys;
86 
87  $message = new \Dcp\Mail\Message();
88 
89  $tdest = $this->getArrayRawValues("tmail_dest");
90 
91  $dest = array(
92  "to" => array() ,
93  "cc" => array() ,
94  "bcc" => array() ,
95  "from" => array()
96  );
97  $from = trim($this->getRawValue("tmail_from"));
98  if ($from) {
99  $tdest[] = array(
100  "tmail_copymode" => "from",
101  "tmail_desttype" => $this->getRawValue("tmail_fromtype") ,
102  "tmail_recip" => $from
103  );
104  }
105  $wdoc = null;
106  if ($doc->wid) {
107  /**
108  * @var \WDoc $wdoc
109  */
110  $wdoc = new_doc($this->dbaccess, $doc->wid);
111  }
112  $udoc = null;
113  foreach ($tdest as $k => $v) {
114  $toccbcc = $v["tmail_copymode"];
115  $type = $v["tmail_desttype"];
116  $mail = '';
117  switch ($type) {
118  case 'F': // fixed address
119  $mail = $v["tmail_recip"];
120  break;
121 
122  case 'A': // text attribute
123  $aid = strtok($v["tmail_recip"], " ");
124  $err = $this->checkAttributeExistsInRelation($aid, getLatestTDoc($this->dbaccess, $doc->initid));
125  if ($err) {
126  $action->log->error($err);
127  $doc->addHistoryEntry($err);
128  throw new \Dcp\Exception($err);
129  }
130  $mail = $doc->getRValue($aid);
131  break;
132 
133  case 'WA': // workflow text attribute
134  if ($wdoc) {
135  $aid = strtok($v["tmail_recip"], " ");
136  $err = $this->checkAttributeExistsInRelation($aid, getLatestTDoc($this->dbaccess, $wdoc->initid));
137  if ($err) {
138  $action->log->error($err);
139  $wdoc->addHistoryEntry($err);
140  throw new \Dcp\Exception($err);
141  }
142  $mail = $wdoc->getRValue($aid);
143  }
144  break;
145 
146  case 'E': // text parameter
147  $aid = strtok($v["tmail_recip"], " ");
148  if (!$doc->getAttribute($aid)) {
149  $action->log->error(sprintf(_("Send mail error : Parameter %s doesn't exists") , $aid));
150  $doc->addHistoryEntry(sprintf(_("Send mail error : Parameter %s doesn't exists") , $aid));
151  throw new \Dcp\Exception(sprintf(_("Send mail error : Parameter %s doesn't exists") , $aid));
152  }
153  $mail = $doc->getFamilyParameterValue($aid);
154  break;
155 
156  case 'WE': // workflow text parameter
157  if ($wdoc) {
158  $aid = strtok($v["tmail_recip"], " ");
159  if (!$wdoc->getAttribute($aid)) {
160  $action->log->error(sprintf(_("Send mail error : Parameter %s doesn't exists") , $aid));
161  $wdoc->addHistoryEntry(sprintf(_("Send mail error : Parameter %s doesn't exists") , $aid));
162  throw new \Dcp\Exception(sprintf(_("Send mail error : Parameter %s doesn't exists") , $aid));
163  }
164  $mail = $wdoc->getFamilyParameterValue($aid);
165  }
166  break;
167 
168  case 'DE': // param user relation
169 
170  case 'D': // user relations
171 
172  case 'WD': // user relations
173  if ($type == 'D' || $type == 'DE') {
174  $udoc = $doc;
175  } elseif ($wdoc) {
176  $udoc = $wdoc;
177  }
178  if ($udoc) {
179  $aid = strtok($v["tmail_recip"], " ");
180  if (!$udoc->getAttribute($aid) && !array_key_exists(strtolower($aid) , $udoc->getParamAttributes())) {
181  $action->log->error(sprintf(_("Send mail error : Attribute %s not found") , $aid));
182  $doc->addHistoryEntry(sprintf(_("Send mail error : Attribute %s not found") , $aid));
183  throw new \Dcp\Exception(sprintf(_("Send mail error : Attribute %s not found") , $aid));
184  }
185  if ($type == 'DE') {
186  $vdocid = $udoc->getFamilyParameterValue($aid);
187  } else {
188  $vdocid = $udoc->getRawValue($aid); // for array of users
189 
190  }
191  $vdocid = str_replace('<BR>', "\n", $vdocid);
192  if (strpos($vdocid, "\n")) {
193  $tvdoc = $this->rawValueToArray($vdocid);
194  $tmail = array();
195  $it = new \DocumentList();
196  $it->addDocumentIdentifiers($tvdoc);
197  /**
198  * @var \Dcp\Family\IUSER|\Dcp\Family\IGROUP|\Dcp\Family\ROLE $aDoc
199  */
200  foreach ($it as $aDoc) {
201  $umail = '';
202  if (method_exists($aDoc, "getMail")) {
203  $umail = $aDoc->getMail();
204  }
205  if (!$umail) {
206  $umail = $aDoc->getRawValue('us_mail', '');
207  }
208  if (!$umail) {
209  $umail = $aDoc->getRawValue('grp_mail', '');
210  }
211  if ($umail) {
212  $tmail[] = $umail;
213  }
214  }
215  $mail = implode(",", $tmail);
216  } else {
217  if (strpos($aid, ':')) {
218  $mail = $udoc->getRValue($aid);
219  } else {
220  /**
221  * @var \Dcp\Family\IUSER|\Dcp\Family\IGROUP|\Dcp\Family\ROLE $aDoc
222  */
223  $aDoc = new_Doc("", $vdocid);
224  $mail = '';
225  if (method_exists($aDoc, "getMail")) {
226  $mail = $aDoc->getMail();
227  }
228  if (!$mail) {
229  $mail = $aDoc->getRawValue('us_mail', '');
230  }
231  if (!$mail) {
232  $mail = $aDoc->getRawValue('grp_mail', '');
233  }
234  }
235  }
236  }
237  break;
238 
239  case 'P':
240  $aid = strtok($v["tmail_recip"], " ");
241  if (!getParam($aid)) {
242  $action->log->error(sprintf(_("Send mail error : Parameter %s doesn't exists") , $aid));
243  $doc->addHistoryEntry(sprintf(_("Send mail error : Parameter %s doesn't exists") , $aid));
244  throw new \Dcp\Exception( sprintf(_("Send mail error : Parameter %s doesn't exists") , $aid));
245  }
246  $mail = getParam($aid);
247  break;
248 
249  case 'RD':
250  $recipDocId = $v['tmail_recip'];
251  if (preg_match('/^(?P<id>\d+)/', $v['tmail_recip'], $m)) {
252  /**
253  * Extract document's id from tmail_recip value
254  */
255  $recipDocId = $m['id'];
256  }
257  /**
258  * @var \IMailRecipient|\Doc $recipientDoc
259  */
260  $recipientDoc = new_Doc($this->dbaccess, $recipDocId, true);
261  if (!is_object($recipientDoc) || !$recipientDoc->isAlive()) {
262  $err = sprintf(_("Send mail error: recipient document '%s' does not exists.") , $recipDocId);
263  $action->log->error($err);
264  $doc->addHistoryEntry($err);
265  throw new \Dcp\Exception($err);
266  }
267  if (!is_a($recipientDoc, 'IMailRecipient')) {
268  $err = sprintf(_("Send mail error: recipient document '%s' does not implements IMailRecipient interface.") , $recipDocId);
269  $action->log->error($err);
270  $doc->addHistoryEntry($err);
271  throw new \Dcp\Exception($err);
272  }
273  $mail = $recipientDoc->getMail();
274  break;
275  }
276  if ($mail) $dest[$toccbcc][] = str_replace(array(
277  "\n",
278  "\r"
279  ) , array(
280  ",",
281  ""
282  ) , $mail);
283  }
284  $subject = $this->generateMailInstance($doc, $this->getRawValue("tmail_subject"));
285  $subject = str_replace(array(
286  "\n",
287  "\r",
288  "<BR>"
289  ) , array(
290  " ",
291  " ",
292  ", "
293  ) , html_entity_decode($subject, ENT_COMPAT, "UTF-8"));
294  $pfout = $this->generateMailInstance($doc, $this->getRawValue("tmail_body") , $this->getAttribute("tmail_body"));
295  // delete empty address
296  $dest['to'] = array_filter($dest['to'], function ($v)
297  {
298  return !preg_match('/^\s*$/', $v);
299  });
300  $dest['cc'] = array_filter($dest['cc'], function ($v)
301  {
302  return !preg_match('/^\s*$/', $v);
303  });
304  $dest['bcc'] = array_filter($dest['bcc'], function ($v)
305  {
306  return !preg_match('/^\s*$/', $v);
307  });
308  $dest['from'] = array_filter($dest['from'], function ($v)
309  {
310  return !preg_match('/^\s*$/', $v);
311  });
312 
313  $this->addSubstitutes($dest);
314 
315  $to = implode(',', $dest['to']);
316  $cc = implode(',', $dest['cc']);
317  $bcc = implode(',', $dest['bcc']);
318  $from = implode(',', $dest['from']); // only one value expected for from
319  if ($from == "") {
320  $from = getMailAddr($action->user->id, true);
321  }
322  if ($from == "") {
323  $from = getParam('SMTP_FROM');
324  }
325  if ($from == "") {
326  $from = $action->user->login . '@' . (isset($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"] : "");
327  }
328 
329  if (trim($to . $cc . $bcc) == "") {
330  $action->log->info(sprintf(_("Send mail info : can't send mail %s: no sendee found") , $subject));
331  $doc->addHistoryEntry(sprintf(_("Send mail info : can't send mail %s: no sendee found") , $subject) , HISTO_NOTICE);
332  if ($this->stopIfNoRecip) {
333  return null;
334  }
335  } //nobody to send data
336  if ($this->sendercopy && getParam("FDL_BCC") == "yes") {
337  $umail = getMailAddr($this->userid);
338  if ($umail != "") $bcc.= (trim($bcc) == "" ? "" : ",") . $umail;
339  }
340 
341  $body = new \Dcp\Mail\Body($pfout, 'text/html');
342  $message->setBody($body);
343  // ---------------------------
344  // add inserted image
345  foreach ($this->ifiles as $k => $v) {
346  if (file_exists($v)) {
347  $message->addBodyRelatedAttachment(new \Dcp\Mail\RelatedAttachment($v, $k, sprintf("image/%s", fileextension($v)) , $k));
348  }
349  }
350  //send attachment
351  $ta = $this->getMultipleRawValues("tmail_attach");
352  foreach ($ta as $k => $v) {
353  $err = $this->checkAttributeExistsInRelation(strtok($v, " ") , getLatestTDoc($this->dbaccess, $doc->initid));
354  if ($err) {
355  $action->log->error($err);
356  $doc->addHistoryEntry($err);
357  throw new \Dcp\Exception($err);
358  }
359  $vf = $doc->getRValue(strtok($v, " "));
360  if ($vf) {
361  $tvf = $this->rawValueToArray($vf);
362  foreach ($tvf as $vf) {
363  if ($vf) {
364  $fileinfo = $this->getFileInfo($vf);
365  if ($fileinfo["path"]) {
366  $message->addAttachment(new \Dcp\Mail\Attachment($fileinfo['path'], $fileinfo['name'], $fileinfo['mime_s']));
367  }
368  }
369  }
370  }
371  }
372  /*
373  $err = sendmail($to, $from, $cc, $bcc, $subject, $multi_mix);
374  */
375  $message->setFrom($from);
376  $message->addTo($to);
377  $message->addCc($cc);
378  $message->addBcc($bcc);
379  $message->setSubject($subject);
380  return $message;
381  }
382 
383  /**
384  * send document by email using this template
385  * @param \Doc $doc document to send
386  * @param array $keys extra keys used for template
387  * @return string error - empty if no error -
388  */
389  public function sendDocument(\Doc & $doc, $keys = array())
390  {
391  global $action;
392 
393  include_once ("FDL/sendmail.php");
394  include_once ("FDL/Lib.Vault.php");
395  $err = '';
396  if (!$doc->isAffected()) {
397  return $err;
398  }
399 
400  try {
401  $this->stopIfNoRecip=true;
402  $message = $this->getMailMessage($doc, $keys);
403  if (!$message) {
404  return "";
405  }
406  $this->stopIfNoRecip=false;
407  } catch (\Exception $e) {
408  $this->stopIfNoRecip=false;
409  return $e->getMessage();
410  }
411  $err = $message->send();
412 
413  $to = $message->getTo();
414  $cc = $message->getCc();
415  $bcc = $message->getBCC();
416  $subject=$message->subject;
417  $from=$message->getFrom();
418  $savecopy = $this->getRawValue("tmail_savecopy") == "yes";
419  if (($err == "") && $savecopy) {
420  createSentMessage($to, $from, $cc, $bcc, $subject, $message, $doc);
421  }
422  $recip = "";
423  if ($to) {
424  $recip.= sprintf(_("sendmailto %s") , $to);
425  }
426  if ($cc) {
427  $recip.= ' ' . sprintf(_("sendmailcc %s") , $cc);
428  }
429  if ($bcc) {
430  $recip.= ' ' . sprintf(_("sendmailbcc %s") , $bcc);
431  }
432 
433  if (self::NOTIFY_SENDMAIL_AUTO === $this->notifySendMail) {
434  $notifySendMail = \ApplicationParameterManager::getParameterValue('CORE', 'CORE_NOTIFY_SENDMAIL');
435  if (is_null($notifySendMail)) {
436  $notifySendMail = self::NOTIFY_SENDMAIL_ALWAYS;
437  }
438  } else {
440  }
441 
442  if ($err == "") {
443  $doc->addHistoryEntry(sprintf(_("send mail %s with template %s") , $recip, $this->title) , HISTO_INFO, "SENDMAIL");
444  $action->log->info(sprintf(_("Mail %s sent to %s") , $subject, $recip));
445  if (self::NOTIFY_SENDMAIL_ALWAYS === $notifySendMail) {
446  addWarningMsg(sprintf(_("send mail %s") , $recip));
447  }
448  } else {
449  $doc->addHistoryEntry(sprintf(_("cannot send mail %s with template %s : %s") , $recip, $this->title, $err) , HISTO_ERROR);
450  $action->log->error(sprintf(_("cannot send mail %s to %s : %s") , $subject, $recip, $err));
451  if (self::NOTIFY_SENDMAIL_ALWAYS === $notifySendMail || self::NOTIFY_SENDMAIL_ERRORS_ONLY === $notifySendMail) {
452  addWarningMsg(sprintf(_("cannot send mail %s") , $err));
453  }
454  }
455  return $err;
456  }
457  /**
458  * determine if a notification should be displayed to the user
459  *
460  * @param string $notifySendMail one of the NOTIFY_SENDMAIL_* const
461  * @return string error if the value is invalid, empty string in case of success
462  */
464  {
465  $allowedValues = [self::NOTIFY_SENDMAIL_ALWAYS, self::NOTIFY_SENDMAIL_ERRORS_ONLY, self::NOTIFY_SENDMAIL_NEVER, self::NOTIFY_SENDMAIL_AUTO];
466 
467  if (!in_array($notifySendMail, $allowedValues)) {
468  throw new Exception("MAIL0001", $notifySendMail, implode("' , '", $allowedValues));
469  } else {
470  $this->notifySendMail = $notifySendMail;
471  }
472  return '';
473  }
474  /**
475  * update template with document values
476  * @param \Doc $doc
477  * @param string $tpl template content
478  * @param \NormalAttribute|bool $oattr
479  * @return string
480  */
481  private function generateMailInstance(\Doc & $doc, $tpl, $oattr = false)
482  {
483  global $action;
484  $tpl = str_replace("&#x5B;", "[", $tpl); // replace [ convverted in Doc::setValue()
485  $doc->lay = new \Layout("", $action, $tpl);
486 
487  $ulink = ($this->getRawValue("tmail_ulink") == "yes");
488  /* Expand layout's [TAGS] */
489  $doc->viewdefaultcard("mail", $ulink, false, true);
490  foreach ($this->keys as $k => $v) $doc->lay->set($k, $v);
491  $body = $doc->lay->gen();
492  $body = preg_replace_callback(array(
493  "/SRC=\"([^\"]+)\"/",
494  "/src=\"([^\"]+)\"/"
495  ) , function ($matches)
496  {
497  return $this->srcfile($matches[1]);
498  }
499  , $body);
500  /* Expand remaining HTML constructions */
501  if ($oattr !== false && $oattr->type == 'htmltext') {
502  $body = $doc->getHtmlValue($oattr, $body, "mail", $ulink);
503  }
504  return $body;
505  }
506  /**
507  * add substitute account mail addresses
508  * @param array $dests
509  */
510  private function addSubstitutes(array & $dests)
511  {
512  $sql = "SELECT incumbent.login as inlogin, incumbent.mail as inmail, substitut.firstname || ' ' || substitut.lastname as suname , substitut.mail as sumail from users as incumbent, users as substitut where substitut.id=incumbent.substitute and incumbent.substitute is not null and incumbent.mail is not null and substitut.mail is not null;";
513  simpleQuery($this->dbaccess, $sql, $substituteMails);
514  foreach (array(
515  "to",
516  "cc",
517  "bcc"
518  ) as $td) {
519  if (!isset($dests[$td])) {
520  continue;
521  }
522  foreach ($dests[$td] as & $aDest) {
523  foreach ($substituteMails as $aSumail) {
524  $suName = str_replace('"', '', sprintf(_("%s (as substitute)") , $aSumail["suname"]));
525  $aDest = str_replace(sprintf('<%s>', $aSumail["inmail"]) , sprintf('<%s>, "%s" <%s>', $aSumail["inmail"], $suName, $aSumail["sumail"]) , $aDest);
526 
527  $aDest = preg_replace(sprintf('/(^|,|\s)(%s)/', preg_quote($aSumail["inmail"], "/")) , sprintf('\1\2, "%s" <%s>', $suName, $aSumail["sumail"]) , $aDest);
528  }
529  }
530  unset($aDest);
531  }
532  }
533 
534  private function getUniqId()
535  {
536  static $unid = 0;
537  if (!$unid) $unid = date('Ymdhis');
538  return $unid;
539  }
540  private function srcfile($src)
541  {
542  $vext = array(
543  "gif",
544  "png",
545  "jpg",
546  "jpeg",
547  "bmp"
548  );
549 
550  if (substr($src, 0, 3) == "cid") return "src=\"$src\"";
551  if (substr($src, 0, 4) == "http") {
552  $chopped_src = '';
553  // Detect HTTP URLs pointing to myself
554  foreach (array(
555  'CORE_URLINDEX',
556  'CORE_PUBURL'
557  ) as $url) {
558  $url = getParam($url);
559  if (strlen($url) <= 0) {
560  continue;
561  }
562  if (strcmp(substr($src, 0, strlen($url)) , $url) == 0) {
563  // Chop the URL base part, and leave only the args/vars
564  $chopped_src = substr($src, strlen($url));
565  break;
566  }
567  }
568  if ($chopped_src == '') {
569  return sprintf('src="%s"', $src);
570  }
571  $src = $chopped_src;
572  }
573  $cid = $src;
574 
575  if (preg_match("/.*app=FDL.*action=EXPORTFILE.*vid=([0-9]*)/", $src, $reg)) {
576  $info = vault_properties($reg[1]);
577  $src = $info->path;
578  $cid = "cid" . $this->getUniqId() . $reg[1] . '.' . fileextension($info->path);
579  } elseif (preg_match('!file/(?P<docid>\d+)/(?P<vid>\d+)/(?P<attrid>[^/]+)/(?P<index>[^/]+)/(?P<fname>[^?]+)!', $src, $reg)) {
580  $info = vault_properties($reg['vid']);
581  $src = $info->path;
582  $cid = "cid" . $this->getUniqId() . $reg[1] . '.' . fileextension($info->path);
583  }
584 
585  if (!in_array(strtolower(fileextension($src)) , $vext)) {
586  return "";
587  }
588 
589  $this->ifiles[$cid] = $src;
590  return "src=\"cid:$cid\"";
591  }
592  /**
593  * @begin-method-ignore
594  * this part will be deleted when construct document class until end-method-ignore
595  */
596 }
597 /**
598  * @end-method-ignore
599  */
$dest
Definition: resizeimg.php:231
vault_properties(NormalAttribute $attr)
Definition: Class.Doc.php:8224
getTDoc($dbaccess, $id, $sqlfilters=array(), $result=array())
global $action
& getAttribute($idAttr, &$oa=null, $useMask=true)
Definition: Class.Doc.php:2152
getMailAddr($userid, $full=false)
Definition: Lib.Common.php:133
const HISTO_INFO
static rawValueToArray($v)
Definition: Class.Doc.php:6228
$message
static getParameterValue($application, $parameterName)
addWarningMsg($msg)
Definition: Lib.Common.php:95
fileextension($filename, $ext="nop")
const HISTO_NOTICE
getArrayRawValues($idAttr, $index=-1)
Definition: Class.Doc.php:3292
viewdefaultcard($target="_self", $ulink=true, $abstract=false, $viewhidden=false)
Definition: Class.Doc.php:7099
isAffected()
setNotification($notifySendMail)
getRValue($RidAttr, $def="", $latest=true, $html=false)
Definition: Class.Doc.php:4333
$to
getFamilyParameterValue($idp, $def="")
Definition: Class.Doc.php:1538
getLatestTDoc($dbaccess, $initid, $sqlfilters=array(), $fromid=false)
$subject
const HISTO_ERROR
getMultipleRawValues($idAttr, $def="", $index=-1)
Definition: Class.Doc.php:3240
getHttpVars($name, $def="", $scope="all")
Definition: Lib.Http.php:124
getParam($param, $defv="")
Definition: Class.Doc.php:8686
sendDocument(\Doc &$doc, $keys=array())
$bcc
getHtmlValue($oattr, $value, $target="_self", $htmllink=true, $index=-1, $entities=true, $abstract=false)
Definition: Class.Doc.php:6457
getFileInfo($filesvalue, $key="", $returnType="array")
Definition: Class.Doc.php:8253
global $_SERVER
new_Doc($dbaccess, $id= '', $latest=false)
$cc
$values
Definition: Class.Doc.php:546
$from
getLatestDocIds($dbaccess, $ids)
$vf
Definition: geticon.php:28
$info
Definition: geticon.php:30
simpleQuery($dbaccess, $query, &$result=array(), $singlecolumn=false, $singleresult=false, $useStrict=null)
Definition: Lib.Common.php:484
if($file) if($subject==""&&$file) if($subject=="") $err
addHistoryEntry($comment= '', $level=DocHisto::INFO, $code= '', $uid= '')
Definition: Class.Doc.php:4707
getRawValue($idAttr, $def="")
Definition: Class.Doc.php:3117
← centre documentaire © anakeen