Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
fdl_process.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  * Emailing
9  *
10  * @author Anakeen 2005
11  * @version $Id: fdl_process.php,v 1.2 2005/06/28 08:37:46 eric Exp $
12  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13  * @package FDL
14  * @subpackage
15  */
16 /**
17  */
18 
19 include_once ("FDL/mailcard.php");
20 include_once ("FDL/modcard.php");
21 /**
22  * Fusion all document to be printed
23  * @param Action &$action current action
24  * @global docid Http var : folder id (generaly an action)
25  * @global fromedit Http var : (Y|N) if Y action comes from edition else from viewing
26  * @global zonebodycard Http var : definition of the zone used for print
27  */
28 function fdl_process(&$action)
29 {
30  // GetAllParameters
31  $docid = GetHttpVars("id");
32  $udocid = GetHttpVars("uid");
33  $fromedit = (GetHttpVars("fromedit", "Y") == "Y"); // need to compose temporary doc
34  $method = "::fdl_pubprint(pubm_title,pubm_body)";
35 
36  $dbaccess = $action->GetParam("FREEDOM_DB");
37 
39  if ($udocid > 0) {
40  $t[] = getTDoc($dbaccess, $udocid);
41  } else {
42  $t = $doc->getContent(true, array() , true);
43  }
44  if ($fromedit) {
45  $doc = $doc->copy(true, false);
47  $doc->modify();
48  };
49 
50  $subject = $doc->getValue("pubm_title");
51  $body = $doc->getValue("pubm_body");
52  if (preg_match("/\[us_[a-z0-9_]+\]/i", $body)) {
53  foreach ($t as $k => $v) {
54  $mail = getv($v, "us_mail");
55  if ($mail == "") {
56  $action->AddWarningMsg(_("no email address found"));
57  }
58  $zoneu = $zonebodycard . "?uid=" . $v["id"];
59 
60  $tlay[] = array(
61  "doc" => $doc->viewDoc($zoneu, "", true) ,
62  "subject" => $v["title"]
63  );
64  }
65  } else {
66  $laydoc = $doc->viewDoc($zonebodycard, "", true);
67 
68  foreach ($t as $k => $v) {
69  $tlay[] = array(
70  "doc" => $laydoc,
71  "subject" => $v["title"]
72  );
73  }
74  }
75  if ($err) $action->AddWarningMsg($err);
76  if (count($t) == 0) $action->AddWarningMsg(_("no avalaible persons found"));
77 
78  $action->lay->setBlockData("DOCS", $tlay);
79  $action->lay->set("BGIMG", $doc->getHtmlAttrValue("pubm_bgimg"));
80 }
81 ?>
← centre documentaire © anakeen - published under CC License - Dynacase