Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
Method.FAddBook.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  * Adsress book methods for persons
9  *
10  * @author Anakeen 2005
11  * @version $Id: Method.FAddBook.php,v 1.15 2008/05/13 10:21:01 eric Exp $
12  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13  * @package FDL
14  * @subpackage USERCARD
15  */
16 /**
17  */
18 public $faddbook_card = "USERCARD:VIEWPERSON:T";
19 public $faddbook_resume = "USERCARD:FADDBOOK_RESUME:U";
20 
21 function faddbook_resume($target = "finfo", $ulink = true, $abstract = false)
22 {
23 
24  global $action;
25  $action->parent->AddCssRef("USERCARD:faddbook.css", true);
26 
27  $imgu = "";
28  $img = $this->getValue("us_photo");
29  if ($img == "") {
30  $this->lay->set("hasPhoto", false);
31  } else {
32  $this->lay->set("hasPhoto", true);
33  $imgu = $this->GetHtmlValue($this->getAttribute("us_photo") , $img);
34  $this->lay->set("photo", $imgu);
35  }
36 
37  $this->lay->set("nom", $this->getValue("us_lname"));
38  $this->lay->set("prenom", $this->getValue("us_fname"));
39 
40  $soc = $this->getValue("us_society");
41  $this->lay->set("hasSoc", ($soc != "" ? true : false));
42  $this->lay->set("societe", $soc);
43 
44  $mail = $this->getValue("us_mail");
45  $this->lay->set("hasMail", ($mail != "" ? true : false));
46  $this->lay->set("addmail", $mail);
47 
48  $mob = $this->getValue("us_mobile");
49  $this->lay->set("nomob", $mob);
50  $this->lay->set("hasMob", ($mob != "" ? true : false));
51 
52  $tel = $this->getValue("us_phone");
53  $this->lay->set("notel", $tel);
54  $this->lay->set("hasTel", ($tel != "" ? true : false));
55 
56  $sky = $this->getValue("us_skypeid");
57  $this->lay->set("skypeid", $sky);
58  $this->lay->set("hasSky", ($sky != "" ? true : false));
59 
60  $msn = $this->getValue("us_msnid");
61  $this->lay->set("msnid", $msn);
62  $this->lay->set("hasMsn", ($msn != "" ? true : false));
63 
64  return;
65 }
66 
67 function faddbook_card($target = "finfo", $ulink = true, $abstract = false)
68 {
69  // list of attributes displayed directly in layout
70  global $action;
71  $action->parent->AddCssRef("USERCARD:faddbook.css", true);
72  $action->parent->AddJsRef($action->GetParam("CORE_PUBURL") . "/USERCARD/Layout/faddbook.js");
73 
74  setHttpVar("specialmenu", "menuab");
75 
76  $ta = array(
77  "us_workweb",
78  "us_photo",
79  "us_lname",
80  "us_fname",
81  "us_society",
82  "us_civility",
83  "us_mail",
84  "us_phone",
85  "us_mobile",
86  "us_fax",
87  "us_intphone",
88  "us_workaddr",
89  "us_workcedex",
90  "us_country",
91  "us_workpostalcode",
92  "us_worktown"
93  );
94 
95  $this->viewdefaultcard($target, $ulink, $abstract);
96  $la = $this->getAttributes();
97  $to = array();
98  $tabs = array();
99  foreach ($la as $k => $v) {
100  $va = $this->getValue($v->id);
101  if (($va || ($v->type == "array")) && (!in_array($v->id, $ta)) && (!$v->inArray())) {
102 
103  if ((($v->mvisibility == "R") || ($v->mvisibility == "W"))) {
104  if ($v->type == "array") {
105  $hv = $this->getHtmlValue($v, $va, $target, $ulink);
106  if ($hv) {
107  $to[] = array(
108  "lothers" => $v->labelText,
109  "aid" => $v->id,
110  "vothers" => $hv,
111  "isarray" => true
112  );
113  $tabs[$v->fieldSet->labelText][] = $v->id;
114  }
115  } else {
116  $to[] = array(
117  "lothers" => $v->labelText,
118  "aid" => $v->id,
119  "vothers" => $this->getHtmlValue($v, $va, $target, $ulink) ,
120  "isarray" => false
121  );
122  $tabs[$v->fieldSet->labelText][] = $v->id;
123  }
124  }
125  }
126  }
127  $this->lay->setBlockData("OTHERS", $to);
128  $ltabs = array();
129  foreach ($tabs as $k => $v) {
130  $ltabs[$k] = array(
131  "tabtitle" => $k,
132  "aids" => "['" . implode("','", $v) . "']"
133  );
134  }
135  $this->lay->setBlockData("TABS", $ltabs);
136 }
137 
138 function viewperson($target = "finfo", $ulink = true, $abstract = false)
139 {
140  $this->viewdefaultcard($target, $ulink, $abstract);
141  $socid = $this->getValue("us_idsociety");
142  if ($socid) $soc = new_doc($this->dbaccess, $socid);
143  if ($socid && $soc->isAlive()) {
144  $this->lay->set("socphone", $soc->getValue("si_phone"));
145  $this->lay->set("socfax", $soc->getValue("si_fax"));
146  } else {
147  $this->lay->set("socphone", "");
148  $this->lay->set("socfax", "");
149  }
150  $secid = $this->getValue("us_idsecr");
151  if ($secid) $sec = new_doc($this->dbaccess, $secid);
152  if ($secid && $sec->isAlive()) {
153  $this->lay->set("secrphone", $sec->getValue("us_pphone"));
154  } else {
155  $this->lay->set("secrphone", "");
156  }
157 }
158 ?>
← centre documentaire © anakeen - published under CC License - Dynacase