BMLT Root Server
c_comdef_service_body.class.php
Go to the documentation of this file.
1 <?php
2 /***********************************************************************/
3 /** \file c_comdef_service_body.class.php
4  \brief The class file for the c_comdef_service_body class.
5 
6  This file is part of the Basic Meeting List Toolbox (BMLT).
7 
8  Find out more at: https://bmlt.app
9 
10  BMLT is free software: you can redistribute it and/or modify
11  it under the terms of the MIT License.
12 
13  BMLT is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  MIT License for more details.
17 
18  You should have received a copy of the MIT License along with this code.
19  If not, see <https://opensource.org/licenses/MIT>.
20 */
21 
22 defined('BMLT_EXEC') or die('Cannot Execute Directly'); // Makes sure that this file is in the correct context.
23 
24 require_once(dirname(__FILE__)."/../shared/classes/base_templates.inc.php");
25 
26 /***********************************************************************/
27 /** \class c_comdef_service_body
28 
29  \brief A Class for Service Body Objects
30 
31  The BMLT doesn't really care that much about the Service role of any
32  given Service Body. Indicators of such are provided so that clients
33  of the BMLT can keep track of them.
34 
35  The BMLT is more interested in the hierarchy of a Service Body. If a
36  Service Body has an owner or a secondary owner, then any member of
37  the owner or secondary owner can edit any meetings in the Service Body,
38  and and Service Body Administrators in an owner or secondary owner can
39  administer the Service Body itself.
40 
41 ***********************************************************************/
42 // These are defines used to specify what type of Service Body this is.
43 
44 // phpcs:disable Generic.NamingConventions.UpperCaseConstantName.ConstantNotUpperCase
45 define("c_comdef_service_body__GRP__", "GR"); // Regular Group
46 define("c_comdef_service_body__COP__", "CO"); // Co-Op
47 define("c_comdef_service_body__ASC__", "AS"); // Area Service Committee
48 define("c_comdef_service_body__RSC__", "RS"); // Regional Service Committee
49 define("c_comdef_service_body__WSC__", "WS"); // World Service Committee
50 define("c_comdef_service_body__MAS__", "MA"); // Metro Area Service Committee
51 define("c_comdef_service_body__ZFM__", "ZF"); // Zonal Forum
52 define("c_comdef_service_body__GSU__", "GS"); // Group Service Unit
53 define("c_comdef_service_body__LSU__", "LS"); // Local Service Unit
54 // phpcs:enable Generic.NamingConventions.UpperCaseConstantName.ConstantNotUpperCase
55 
56 // phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
57 // phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
59 // phpcs:enable PSR1.Classes.ClassDeclaration.MissingNamespace
60 // phpcs:enable Squiz.Classes.ValidClassName.NotCamelCaps
61 {
62  /// An integer, containing the unique ID of this service body.
63  private $_id_bigint = null;
64  /// An integer, with the ID of the principal administrator for this Service Body.
65  private $_principal_user_bigint = null;
66  /// A string, containing a CSV list of integers, each an ID for a user that has editor privileges for meetings for this Service Body.
67  private $_editors_string = null;
68  /// A string, containing the helpline (re-used KML file URI).
69  private $_kml_file_uri_string = null;
70  /// A string, containing a URI to a site that gives further information about the Service Body.
71  private $_uri_string = null;
72  /** An enum string, containing the Service Body type.
73  It can be one of the following:
74  - c_comdef_service_body__GRP__ Individual NA Group
75  - c_comdef_service_body__ASC__ Area Service Committee
76  - c_comdef_service_body__RSC__ Regional Service Committee
77  - c_comdef_service_body__WSC__ World Service Committee
78  - c_comdef_service_body__MAS__ Metro Area
79  - c_comdef_service_body__ZFM__ Zonal Forum
80  - c_comdef_service_body__GSU__ Group Service Unit
81  - c_comdef_service_body__LSU__ Local Service Unit
82  */
83  private $_sb_type = null;
84  /// An integer. The ID of the Service Body that "owns" this one.
85  private $_sb_owner = null;
86  /// An integer. Some Service Bodies can have "unofficial" "owners" (like Zonal Forums or Metro Areas).
87  private $_sb_owner_2 = null;
88  /// A string that contains the meeting contact email address.
89  private $_sb_meeting_email = null;
90 
91  /*******************************************************************/
92  /** \brief Updates or adds this instance to the database.
93 
94  \returns true if successful, false, otherwise.
95 
96  \throws a PDOException if there is a problem.
97  */
98  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
99  public function UpdateToDB(
100  $is_rollback = false ///< If true, this is a rollback operation.
101  ) {
102  $ret = false;
103 
105 
106  if ($this->UserCanEdit($user)) {
107  // We take a snapshot of the service body as it currently sits in the database as a "before" image.
108  $before = null;
109  $before_id = null;
110  $before_lang = null;
111  $before_obj = c_comdef_server::GetServiceBodyByIDObj($this->GetID());
112 
113  if ($before_obj instanceof c_comdef_service_body) {
114  $before_obj = clone $before_obj;
115  if ($before_obj instanceof c_comdef_service_body) {
116  $before_obj->RestoreFromDB();
117 
118  $before = $before_obj->SerializeObject();
119  $before_id = $before_obj->GetID();
120  $before_lang = $before_obj->GetLocalLang();
121  $before_obj = null;
122  }
123  }
124 
125  $this->DeleteFromDB_NoRecord();
126 
127  try {
128  $update = array();
129  if ($this->_id_bigint) {
130  array_push($update, $this->_id_bigint);
131  }
132 
133  array_push($update, $this->_principal_user_bigint);
134  array_push($update, $this->_editors_string);
135  array_push($update, $this->_kml_file_uri_string);
136  array_push($update, $this->_uri_string);
137  array_push($update, $this->GetLocalName());
138  array_push($update, $this->GetLocalDescription());
139  array_push($update, $this->GetLocalLang());
140  array_push($update, $this->GetWorldID());
141  array_push($update, $this->GetSBType());
142  array_push($update, $this->GeTOwnerID());
143  array_push($update, $this->GeTOwner2ID());
144  array_push($update, $this->GetContactEmail());
145 
146  $sql = "INSERT INTO `".c_comdef_server::GetServiceBodiesTableName_obj()."` (";
147  if ($this->_id_bigint) {
148  $sql .= "`id_bigint`,";
149  }
150  $sql .= "`principal_user_bigint`,`editors_string`,`kml_file_uri_string`,`uri_string`,`name_string`,`description_string`,`lang_enum`,`worldid_mixed`,`sb_type`,`sb_owner`,`sb_owner_2`,`sb_meeting_email`) VALUES (";
151  if ($this->_id_bigint) {
152  $sql .= "?,";
153  }
154  $sql .= "?,?,?,?,?,?,?,?,?,?,?,?)";
155  c_comdef_dbsingleton::preparedExec($sql, $update);
156  // If this is a new user, then we'll need to fetch the ID.
157  if (!$this->_id_bigint) {
158  $sql = "SELECT LAST_INSERT_ID()";
160  if (is_array($rows) && count($rows)) {
161  $this->_id_bigint = intval($rows[0]['last_insert_id()']);
162  }
163  }
164 
165  $after = $this->SerializeObject();
166  $after_id = $this->GetID();
167  $after_lang = $this->GetLocalLang();
168  $cType = (true == $is_rollback) ? 'comdef_change_type_rollback' : ((null != $before) ? 'comdef_change_type_change' : 'comdef_change_type_new');
169  c_comdef_server::AddNewChange($user->GetID(), $cType, $after_id, $before, $after, 'c_comdef_service_body', $before_id, $after_id, $before_lang, $after_lang);
170 
171  $ret = true;
172  } catch (Exception $ex) {
173  global $_COMDEF_DEBUG;
174 
175  if ($_COMDEF_DEBUG) {
176  echo "Exception Thrown in c_comdef_service_body::UpdateToDB()!<br />";
177  var_dump($ex);
178  }
179  throw ( $ex );
180  }
181  }
182 
183  return $ret;
184  }
185 
186  /*******************************************************************/
187  /** \brief Deletes this instance from the database without creating a change record.
188 
189  \returns true if successful, false, otherwise.
190 
191  \throws a PDOException if there is a problem.
192  */
193  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
194  public function DeleteFromDB_NoRecord()
195  {
196  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
197  $ret = false;
198 
199  if ($this->UserCanEdit()) {
200  try {
201  $sql = "DELETE FROM `".c_comdef_server::GetServiceBodiesTableName_obj()."` WHERE id_bigint=?";
202  c_comdef_dbsingleton::preparedExec($sql, array ( $this->GetID() ));
203  $ret = true;
204  } catch (Exception $ex) {
205  global $_COMDEF_DEBUG;
206 
207  if ($_COMDEF_DEBUG) {
208  echo "Exception Thrown in c_comdef_service_body::DeleteFromDB_NoRecord()!<br />";
209  var_dump($ex);
210  }
211  throw ( $ex );
212  }
213  }
214 
215  return $ret;
216  }
217 
218  /*******************************************************************/
219  /** \brief Deletes this instance from the database, and creates a change record.
220 
221  \returns true if successful, false, otherwise.
222 
223  \throws a PDOException if there is a problem.
224  */
225  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
226  public function DeleteFromDB()
227  {
228  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
229  $ret = false;
230 
232 
233  if ($this->UserCanEdit($user)) {
234  // We take a snapshot of the service body as it currently sits in the database as a "before" image.
235  $before = null;
236  $before_id = null;
237  $before_lang = null;
238  $before_obj = c_comdef_server::GetServiceBodyByIDObj($this->GetID());
239 
240  if ($before_obj instanceof c_comdef_service_body) {
241  $before = $before_obj->SerializeObject();
242  $before_id = $before_obj->GetID();
243  $before_lang = $before_obj->GetLocalLang();
244  $before_obj = null;
245  }
246 
247  $ret = $this->DeleteFromDB_NoRecord();
248 
249  if ($ret) {
250  c_comdef_server::AddNewChange($user->GetID(), 'comdef_change_type_delete', $this->GetID(), $before, null, 'c_comdef_service_body', $before_id, null, $before_lang, null);
251  }
252  }
253 
254  return $ret;
255  }
256 
257  /*******************************************************************/
258  /** \brief Updates this instance to the current values in the DB
259  (replacing current values of the instance).
260 
261  \throws a PDOException if there is a problem.
262  */
263  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
264  public function RestoreFromDB()
265  {
266  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
267  try {
268  if ($this->GetID()) {
269  $sql = "SELECT * FROM `".c_comdef_server::GetServiceBodiesTableName_obj()."` WHERE id_bigint=? LIMIT 1";
270  $rows = c_comdef_dbsingleton::preparedQuery($sql, array ( $this->GetID() ));
271  if (is_array($rows) && count($rows)) {
272  $this->_principal_user_bigint = $rows[0]['principal_user_bigint'];
273  $this->_editors_string = $rows[0]['editors_string'];
274  $this->_kml_file_uri_string = $rows[0]['kml_file_uri_string'];
275  $this->_uri_string = $rows[0]['uri_string'];
276  $this->SetLocalName($rows[0]['name_string']);
277  $this->SetLocalDescription($rows[0]['description_string']);
278  $this->SetLocalLang($rows[0]['lang_enum']);
279  $this->_sb_type = $rows[0]['sb_type'];
280  $this->SetOwnerID($rows[0]['sb_owner']);
281  $this->SetOwner2ID($rows[0]['sb_owner_2']);
282  $this->SetContactEmail($rows[0]['sb_meeting_email']);
283  }
284  }
285  } catch (Exception $ex) {
286  global $_COMDEF_DEBUG;
287 
288  if ($_COMDEF_DEBUG) {
289  echo "Exception Thrown in c_comdef_service_body::RestoreFromDB()!<br />";
290  var_dump($ex);
291  }
292  throw ( $ex );
293  }
294  }
295 
296  /*******************************************************************/
297  /** \brief The initial setup call for the class. If you send in values,
298  the object will set itself up to use them.
299 
300  */
301  public function __construct(
302  $in_parent_obj = null, ///< A reference to the parent object for this Service Body Object.
303  $in_id_bigint = null, ///< An integer, containing the ID of the object. If null or 0, then the object is new.
304  $in_principal_user_bigint = null, ///< An integer with the ID of the principal user for this Service Body.
305  $in_editors_string = null, ///< A string containing a CSV array of integers with editor user IDs
306  $in_kml_file_uri_string = null, ///< A string containing a URI to the KML file that displays this Service Body's boundaries.
307  $in_uri_string = null, ///< A string containing a URI to a site that has more information about the Service Body.
308  $in_name_string = null, ///< The local name of the Service Body as a string.
309  $in_description_string = null, ///< The local description of the Service Body as a string.
310  $in_lang_enum = null, ///< A string, with the language code for this Service Body.
311  $in_world_id_mixed = null, ///< A string, containing the World ID for this Service Body.
312  $in_sb_type = null,
313  // An enum string, containing the Service Body type.
314  // It can be one of the following:
315  // - c_comdef_service_body__GRP__ Individual NA Group
316  // - c_comdef_service_body__ASC__ Area Service Committee
317  // - c_comdef_service_body__RSC__ Regional Service Committee
318  // - c_comdef_service_body__WSC__ World Service Committee
319  // - c_comdef_service_body__MAS__ Metro Area
320  // - c_comdef_service_body__ZFM__ Zonal Forum
321  // - c_comdef_service_body__GSU__ Group Service Unit
322  // - c_comdef_service_body__LSU__ Local Service Unit
323  $in_sb_owner = null, ///< An integer. The ID of the Service Body that "owns" this Service Body.
324  $in_sb_owner_2 = null, ///< An integer. The ID of the "secondary" Service Body that "owns" this Service Body.
325  $in_sb_meeting_email = null ///< A string, containing any email address that is to be used for meeting contacts.
326  ) {
328 
329  /// This is the server language.
330  if (null == $in_lang_enum) {
331  $in_lang_enum = $comdef_global_language;
332  }
333 
334  /// Should never be necessary.
335  if (null == $in_lang_enum) {
336  $in_lang_enum = "en";
337  }
338 
339  // Set the five inherited values.
340  $this->SetParentObj($in_parent_obj);
341  $this->SetLocalLang($in_lang_enum);
342  $this->SetLocalName($in_name_string);
343  $this->SetWorldID($in_world_id_mixed);
344  $this->SetLocalDescription($in_description_string);
345 
346  // Set the local values.
347  $this->_id_bigint = $in_id_bigint;
348  $this->_principal_user_bigint = $in_principal_user_bigint;
349  $this->_editors_string = $in_editors_string;
350  $this->_kml_file_uri_string = $in_kml_file_uri_string;
351  $this->_uri_string = $in_uri_string;
352  $this->_sb_type = $in_sb_type;
353  $this->SetOwnerID($in_sb_owner);
354  $this->SetOwner2ID($in_sb_owner_2);
355  $this->SetContactEmail($in_sb_meeting_email);
356  }
357 
358  /*******************************************************************/
359  /** \brief Accessor - Returns the service body ID as an integer.
360 
361  \returns an integer, containing the service body ID.
362  */
363  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
364  public function GetID()
365  {
366  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
367  return $this->_id_bigint;
368  }
369 
370  /*******************************************************************/
371  /** \brief Accessor - Sets the service body ID as an integer.
372  */
373  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
374  public function SetID(
375  $in_service_body_id_bigint ///< An integer, with the service body ID.
376  ) {
377  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
378  $this->_id_bigint = $in_service_body_id_bigint;
379  }
380 
381  /*******************************************************************/
382  /** \brief Accessor - Returns the principal user for this service body.
383 
384  \returns an integer, containing the user ID.
385  */
386  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
387  public function GetPrincipalUserID()
388  {
389  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
390  return $this->_principal_user_bigint;
391  }
392 
393  /*******************************************************************/
394  /** \brief Accessor - Returns the principal user for this service body.
395 
396  \returns a reference to a c_comdef_user object of the principal user.
397  */
398  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
399  public function &GetPrincipalUserObj()
400  {
401  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
402  return c_comdef_server::GetUserByIDObj($this->_principal_user_bigint);
403  }
404 
405  /*******************************************************************/
406  /** \brief Accessor - Sets the principal user for this service body.
407  */
408  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
409  public function SetPrincipalUserID(
410  $in_principal_user_id_bigint ///< Integer, the principal user ID.
411  ) {
412  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
413  return $this->_principal_user_bigint = $in_principal_user_id_bigint;
414  }
415 
416  /*******************************************************************/
417  /** \brief Accessor - Returns the Service Body Type.
418 
419  \returns a string, containing the Type.
420  It can be one of the following:
421  - c_comdef_service_body__GRP__ Individual NA Group
422  - c_comdef_service_body__ASC__ Area Service Committee
423  - c_comdef_service_body__RSC__ Regional Service Committee
424  - c_comdef_service_body__WSC__ World Service Committee
425  - c_comdef_service_body__MAS__ Metro Area
426  - c_comdef_service_body__ZFM__ Zonal Forum
427  - c_comdef_service_body__GSU__ Group Service Unit
428  - c_comdef_service_body__LSU__ Local Service Unit
429  */
430  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
431  public function GetSBType()
432  {
433  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
434  return $this->_sb_type;
435  }
436 
437  /*******************************************************************/
438  /** \brief Accessor - Sets the URI of the KML file for the Service Boundaries.
439  */
440  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
441  public function SetSBType(
442  $in_sb_type
443  // A string, containing the Type
444  // It can be one of the following:
445  // - c_comdef_service_body__GRP__ Individual NA Group
446  // - c_comdef_service_body__ASC__ Area Service Committee
447  // - c_comdef_service_body__RSC__ Regional Service Committee
448  // - c_comdef_service_body__WSC__ World Service Committee
449  // - c_comdef_service_body__MAS__ Metro Area
450  // - c_comdef_service_body__ZFM__ Zonal Forum
451  // - c_comdef_service_body__GSU__ Group Service Unit
452  // - c_comdef_service_body__LSU__ Local Service Unit
453  ) {
454  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
455  $this->_sb_type = $in_sb_type;
456  }
457 
458  /*******************************************************************/
459  /** \brief Accessor - Returns the ID of the 'owner' of this object.
460 
461  \returns an integer, containing the owner ID.
462  */
463  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
464  public function GetOwnerID()
465  {
466  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
467  return $this->_sb_owner;
468  }
469 
470  /*******************************************************************/
471  /** \brief Accessor - Returns the ID of the 'secondary owner' of this object.
472 
473  \returns an integer, containing the owner ID of the secondary "owner."
474  */
475  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
476  public function GetOwner2ID()
477  {
478  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
479  return $this->_sb_owner_2;
480  }
481 
482  /*******************************************************************/
483  /** \brief Accessor - Returns the 'owner' of this object as a reference to an object.
484 
485  \returns a reference to the internal c_comdef_service_body object for the service body. Null if not found.
486  */
487  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
488  public function &GetOwnerIDObject()
489  {
490  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
491  $owner_id = $this->GetOwnerID();
493  return $ret;
494  }
495 
496  /*******************************************************************/
497  /** \brief Accessor - Returns the 'secondary owner' of this object as a reference to an object.
498 
499  \returns a reference to the internal c_comdef_service_body object for the service body. Null if not found.
500  */
501  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
502  public function &GetOwner2IDObject()
503  {
504  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
505  return c_comdef_server::GetServiceBodyByIDObj($this->GetOwner2ID());
506  }
507 
508  /*******************************************************************/
509  /** \brief Accessor - Sets the ID of the 'owner' of this object.
510  */
511  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
512  public function SetOwnerID(
513  $in_sb_owner ///< An integer, containing the owner of the object.
514  ) {
515  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
516  $this->_sb_owner = intval($in_sb_owner);
517  }
518 
519  /*******************************************************************/
520  /** \brief Accessor - Sets the ID of the 'secondary owner' of this object.
521  */
522  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
523  public function SetOwner2ID(
524  $in_sb_owner ///< An integer, containing the owner of the object.
525  ) {
526  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
527  $this->_sb_owner_2 = intval($in_sb_owner);
528  }
529 
530  /*******************************************************************/
531  /** \brief Accessor - Sets the ID of the 'owner' of this object by sending in an object reference.
532 
533  This will test, to ensure that a loop will not occur. The function
534  will return false if it determines that the hierarchy would result
535  in this object being its own ancestor.
536 
537  \returns true, if successful, false, if the ID would cause a loop.
538  */
539  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
540  public function SetOwnerObj(
541  &$in_sb_owner_obj ///< An integer, containing the owner of the object.
542  ) {
543  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
544  if ($in_sb_owner_obj instanceof c_comdef_service_body) {
545  return $this->SetOwnerID($in_sb_owner_obj->GetID());
546  }
547 
548  return false;
549  }
550 
551  /*******************************************************************/
552  /** \brief Accessor - Sets the ID of the 'secondary owner' of this object by sending in an object reference.
553 
554  This will test, to ensure that a loop will not occur. The function
555  will return false if it determines that the hierarchy would result
556  in this object being its own ancestor.
557 
558  \returns true, if successful, false, if the ID would cause a loop.
559  */
560  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
561  public function SetOwner2Obj(
562  &$in_sb_owner_obj ///< An integer, containing the secondary owner of the object.
563  ) {
564  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
565  if ($in_sb_owner_obj instanceof c_comdef_service_body) {
566  return $this->SetOwner2ID($in_sb_owner_obj->GetID());
567  }
568 
569  return false;
570  }
571 
572  /*******************************************************************/
573  /** \brief Accessor - Returns the helpline, as a string.
574 
575  \returns a string, containing the URI.
576  */
577  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
578  public function GetHelpline()
579  {
580  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
581  return $this->_kml_file_uri_string;
582  }
583 
584  /*******************************************************************/
585  /** \brief Accessor - Sets the URI of the KML file for the Service Boundaries.
586  */
587  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
588  public function SetHelpline(
589  $in_helpline_string ///< A string, containing the helpline number
590  ) {
591  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
592  $this->_kml_file_uri_string = $in_helpline_string;
593  }
594 
595  /*******************************************************************/
596  /** \brief Accessor - Returns the URI of a site with more information on the Service Body.
597 
598  \returns a string, containing the URI.
599  */
600  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
601  public function GetURI()
602  {
603  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
604  return $this->_uri_string;
605  }
606 
607  /*******************************************************************/
608  /** \brief Accessor - Sets the URI of a site with more information on the Service Body.
609  */
610  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
611  public function SetURI(
612  $in_uri_string ///< A string, containing the URI
613  ) {
614  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
615  $this->_uri_string = $in_uri_string;
616  }
617 
618  /*******************************************************************/
619  /** \brief Accessor - set the contact email string.
620  */
621  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
622  public function SetContactEmail( $in_email ///< A string. The email address to be set.
623  )
624  {
625  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
626  $this->_sb_meeting_email = $in_email;
627  }
628 
629  /*******************************************************************/
630  /** \brief Get the contact email for this Service Body.
631  If $in_recursive is false, then it simply looks at this Service Body.
632  This first looks at the Service Body Meeting Email. If that is not
633  there, it gets the email for the principal admin. If that is not
634  there, it percolates to the parent, recursively (if $in_recursive is true ).
635 
636  \returns a string, which is the contact email for this Service Body
637  */
638  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
639  public function GetContactEmail( $in_recursive = false ///< If this is true, then the function will return a recursive result. Default is false.
640  )
641  {
642  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
643  $ret = trim($this->_sb_meeting_email);
644 
645  if (!$ret && $in_recursive) {
646  $owner = $this->GetOwnerIDObject();
647 
648  if ($owner instanceof c_comdef_service_body) {
649  $ret = $owner->GetContactEmail($in_recursive);
650  }
651  }
652 
653  return $ret;
654  }
655 
656  /*******************************************************************/
657  /** \brief Accessor - Returns IDs for all the editors.
658 
659  \returns an array of integers, containing the editor IDs.
660  */
661  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
662  public function GetEditors()
663  {
664  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
665  $ret_array = array();
666 
667  $editor_ids = explode(",", $this->_editors_string);
668 
669  foreach ($editor_ids as $id) {
670  $id = intval($id);
671  array_push($ret_array, $id);
672  }
673 
674  return $ret_array;
675  }
676 
677  /*******************************************************************/
678  /** \brief Accessor - Returns user objects for all the editors.
679 
680  \returns an array of references to c_comdef_user objects. The associative key for each user will the ID for that user.
681  */
682  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
683  public function GetEditorsAsObjects()
684  {
685  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
686  $ret_array = array();
687 
688  $editor_ids = $this->GetEditors();
689 
690  foreach ($editor_ids as $id) {
691  $ret_array[$id] = c_comdef_server::GetUserByIDObj($id);
692  }
693 
694  return $ret_array;
695  }
696 
697  /*******************************************************************/
698  /** \brief Accessor - Returns true if the current user is an editor
699  for the Service Body, or if the user is an owner.
700 
701  \returns a boolean. True if the user is an editor or principal user.
702  */
703  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
704  public function IsUserInServiceBody( $in_user_object = null ///< A reference to an instance of c_comdef_user. If null, the current user is checked.
705  )
706  {
707  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
708  $ret = false;
709  // We load the server user if one wasn't supplied.
710  if (null == $in_user_object) {
711  $in_user_object = c_comdef_server::GetCurrentUserObj();
712  }
713 
714  // If it isn't a user object, we fail right there.
715  if ($in_user_object instanceof c_comdef_user) {
716  $in_user_object->RestoreFromDB(); // The reason you do this, is to ensure that the user wasn't modified "live." It's a security precaution.
717  $user_id = intval($in_user_object->GetID());
718  $in_user_object = null;
719 
720  if (intval($this->GetPrincipalUserID()) == $user_id) {
721  $ret = true;
722  } else {
723  $editors = $this->GetEditors();
724 
725  foreach ($editors as $editor) {
726  if ($user_id == intval($editor)) {
727  $ret = true;
728  break;
729  }
730  }
731  }
732  }
733  return $ret;
734  }
735 
736  /*******************************************************************/
737  /** \brief Accessor - Returns true if the current user is an editor
738  for the Service Body. Checks up the hierarchy recursively.
739 
740  \returns a boolean. True if the user is in the hierarchy (going up) of the Service Body.
741  */
742  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
743  public function IsUserInServiceBodyHierarchy( $in_user_object = null ///< A reference to an instance of c_comdef_user. If null, the current user is checked.
744  )
745  {
746  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
747  $ret = false;
748  // We load the server user if one wasn't supplied.
749  if (null == $in_user_object) {
750  $in_user_object = c_comdef_server::GetCurrentUserObj();
751  }
752 
753  // If it isn't a user object, we fail right there.
754  if ($in_user_object instanceof c_comdef_user) {
755  $in_user_object->RestoreFromDB(); // The reason you do this, is to ensure that the user wasn't modified "live." It's a security precaution.
756  // First, see if the user is in this Service Body.
757 
758  $ret = $this->IsUserInServiceBody($in_user_object);
759 
760  if (!$ret && $this->GetOwnerID()) {
761  $parent = c_comdef_server::GetServer()->GetServiceBodyByIDObj($this->GetOwnerID());
762  // Check the primary "parent" Service Body's hierarchy.
763  if ($parent instanceof c_comdef_service_body) {
764  if ($parent->IsUserInServiceBody($in_user_object)) {
765  $ret = true;
766  } else {
767  $ret = $parent->IsUserInServiceBodyHierarchy($in_user_object);
768  }
769  }
770  }
771 
772  if (!$ret && $this->GetOwner2ID()) {
773  $parent = c_comdef_server::GetServer()->GetServiceBodyByIDObj($this->GetOwner2ID());
774 
775  // Check the secondary "parent" Service Body's hierarchy.
776  if ($parent instanceof c_comdef_service_body) {
777  if ($parent->IsUserInServiceBody($in_user_object)) {
778  $ret = true;
779  } else {
780  $ret = $parent->IsUserInServiceBodyHierarchy($in_user_object);
781  }
782  }
783  }
784  }
785 
786  return $ret;
787  }
788 
789  /*******************************************************************/
790  /** \brief Accessor - Sets the editors by ID.
791 
792  \returns the processed string.
793  */
794  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
795  public function SetEditors(
796  $in_editor_id_array ///< An array of integers, containing the user IDs.
797  ) {
798  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
799  foreach ($in_editor_id_array as &$id) {
800  // We need valid, non-server admin IDs.
801  if ($id == $this->GetPrincipalUserID()) {
802  unset($id);
803  } else {
804  $user = c_comdef_server::GetOneUser($id);
805  if (($user instanceof c_comdef_user) && ($user->GetUserLevel() != _USER_LEVEL_SERVER_ADMIN)) {
806  unset($id);
807  } else {
808  $id = intval($id); // Just to be tinfoil...
809  }
810  }
811  }
812 
813  $this->_editors_string = implode(",", $in_editor_id_array);
814 
815  return $this->_editors_string;
816  }
817 
818  /*******************************************************************/
819  /** \brief Returns a storable serialization of the object, as a string.
820 
821  This is only used for the changes, as the serialized string may not
822  be easily searched.
823 
824  \returns a string, containing the table array, in serialized form.
825  */
826  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
827  public function SerializeObject()
828  {
829  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
830  $serialize_array = array(
831  $this->_id_bigint,
832  $this->_principal_user_bigint,
833  $this->_editors_string,
834  $this->_kml_file_uri_string,
835  $this->_uri_string,
836  $this->GetWorldID(),
837  $this->GetLocalName(),
838  $this->GetLocalDescription(),
839  $this->GetLocalLang(),
840  $this->_sb_type,
841  $this->_sb_owner,
842  $this->_sb_owner_2,
843  $this->GetContactEmail()
844  );
845 
846  return serialize($serialize_array);
847  }
848 
849  /*******************************************************************/
850  /** \brief This takes the serialized table, and instantiates a
851  new object from it.
852 
853  \returns a new instance of c_comdef_service_body, set up according to
854  the serialized data passed in.
855  */
856  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
857  public static function UnserializeObject(
858  $in_parent, ///< The parent object.
859  $serialized_string ///< A string containing the serialized data.
860  ) {
861  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
862  list ( $_id_bigint,
863  $_principal_user_bigint,
864  $_editors_string,
865  $_kml_file_uri_string,
866  $_uri_string,
867  $_worldid_mixed,
868  $_name_string,
869  $_description_string,
870  $_lang_enum,
871  $sb_type,
872  $sb_owner,
873  $sb_owner_2,
874  $sb_meeting_email ) = unserialize($serialized_string);
875 
876  return new c_comdef_service_body($in_parent, $_id_bigint, $_principal_user_bigint, $_editors_string, $_kml_file_uri_string, $_uri_string, $_name_string, $_description_string, $_lang_enum, $_worldid_mixed, $sb_type, $sb_owner, $sb_owner_2, $sb_meeting_email);
877  }
878 
879  /*******************************************************************/
880  /** \brief Test to see if a user is allowed to edit meetings in this
881  Service body.
882 
883  \returns true, if the user is allowed to edit, false, otherwise.
884  */
885  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
886  public function UserCanEditMeetings(
887  $in_user_object = null ///< A reference to a c_comdef_user object, for the user to be validated. If null, or not supplied, the server current user is tested.
888  ) {
889  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
890  $ret = $this->UserCanEdit($in_user_object); // First, see if we are able to edit this Service body. If so, then we're golden.
891 
892  if (!$ret) { // If not, then see if we are able to edit as a "guest."
893  if (null == $in_user_object) {
894  $in_user_object = c_comdef_server::GetCurrentUserObj();
895  }
896 
897  if ($in_user_object instanceof c_comdef_user) {
898  $in_user_object->RestoreFromDB(); // The reason you do this, is to ensure that the user wasn't modified "live." It's a security precaution.
899 
900  $editors = $this->GetEditors();
901 
902  foreach ($editors as $id) {
903  if (($in_user_object->GetID() == $id) && ($in_user_object->GetUserLevel() == _USER_LEVEL_SERVICE_BODY_ADMIN)) {
904  $ret = true;
905  break;
906  }
907  }
908 
909  if (!$ret) {
910  if ($this->GetOwnerID()) {
911  $parent = c_comdef_server::GetServiceBodyByIDObj($this->GetOwnerID());
912 
913  if ($parent instanceof c_comdef_service_body) {
914  $ret = $parent->UserCanEditMeetings($in_user_object);
915  }
916  }
917  }
918  }
919  }
920 
921  return $ret;
922  }
923 
924  /*******************************************************************/
925  /** \brief Test to see if a user is allowed to observe in this
926  Service body.
927 
928  \returns true, if the user is allowed to observe, false, otherwise.
929  */
930  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
931  public function UserCanObserve( $in_user_object = null ///< A reference to a c_comdef_user object, for the user to be validated. If null, or not supplied, the server current user is tested.
932  )
933  {
934  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
935  $ret = $this->UserCanEdit($in_user_object); // First, see if we are able to edit this Service body. If so, then we're golden.
936 
937  if (!$ret) { // If not, then see if we are able to edit as a "guest."
938  if (null == $in_user_object) {
939  $in_user_object = c_comdef_server::GetCurrentUserObj();
940  }
941 
942  if ($in_user_object instanceof c_comdef_user) {
943  $in_user_object->RestoreFromDB(); // The reason you do this, is to ensure that the user wasn't modified "live." It's a security precaution.
944 
945  $editors = $this->GetEditors();
946 
947  foreach ($editors as $id) {
948  if (($in_user_object->GetID() == $id) && (($in_user_object->GetUserLevel() == _USER_LEVEL_SERVICE_BODY_ADMIN) || ($in_user_object->GetUserLevel() == _USER_LEVEL_OBSERVER))) {
949  $ret = true;
950  break;
951  }
952  }
953 
954  if (!$ret) {
955  if ($this->GetOwnerID()) {
956  $parent = c_comdef_server::GetServiceBodyByIDObj($this->GetOwnerID());
957 
958  if ($parent instanceof c_comdef_service_body) {
959  $ret = $parent->UserCanObserve($in_user_object);
960  }
961  }
962  }
963  }
964  }
965 
966  return $ret;
967  }
968 
969  /*******************************************************************/
970  /** \brief Test to see if a user is allowed to edit an instance (change the data).
971  Service Body Administrators that are Editors in parent, or secondary parent
972  Service bodies can edit the Service body.
973 
974  \returns true, if the user is allowed to edit, false, otherwise.
975  */
976  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
977  public function UserCanEdit(
978  $in_user_object = null ///< A reference to a c_comdef_user object, for the user to be validated. If null, or not supplied, the server current user is tested.
979  ) {
980  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
981  $ret = false;
982 
983  // We load the server user if one wasn't supplied.
984  if (null == $in_user_object) {
985  $in_user_object = c_comdef_server::GetCurrentUserObj();
986  }
987 
988  // If it isn't a user object, we fail right there.
989  if ($in_user_object instanceof c_comdef_user) {
990  $in_user_object->RestoreFromDB(); // The reason you do this, is to ensure that the user wasn't modified "live." It's a security precaution.
991 
992  // User must be a Service Body Admin
993  if ($in_user_object->GetUserLevel() == _USER_LEVEL_SERVICE_BODY_ADMIN) {
994  // If there is an existing object, then we can't make changes unless it's allowed in the existing object.
995  $current_obj = c_comdef_server::GetServiceBodyByIDObj($this->GetID());
996 
997  $new_obj = false;
998 
999  // If there is no current object, then we are a new service body. Otherwise, block dope fiends by reloading.
1000  if ($current_obj instanceof c_comdef_service_body) {
1001  // We clone, in case changes have been made, and we don't want to screw them up.
1002  $current_obj = clone $current_obj;
1003  $current_obj->RestoreFromDB();
1004  } else {
1005  $current_obj = $this;
1006  }
1007 
1008  if ($current_obj instanceof c_comdef_service_body) {
1009  if (intval($current_obj->GetPrincipalUserID()) == intval($in_user_object->GetID())) {
1010  $ret = true;
1011  } else if ($this->GetOwnerID()) {
1012  $parent = c_comdef_server::GetServiceBodyByIDObj($this->GetOwnerID());
1013 
1014  if ($parent instanceof c_comdef_service_body) {
1015  $ret = $parent->UserCanEdit($in_user_object);
1016  }
1017  }
1018  }
1019  } elseif (c_comdef_server::IsUserServerAdmin()) { // The server admin can edit anything.
1020  $ret = true;
1021  }
1022  }
1023 
1024  return $ret;
1025  }
1026 
1027  /*******************************************************************/
1028  /** \brief Check to see if a given Service Body ID is anywhere in
1029  the "direct parent" hierarchy of this Service Body.
1030 
1031  \returns a boolean. True if the given Service Body appears in the
1032  hierarchy above it.
1033  */
1034  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1035  public function IsOwnedBy(
1036  $in_sb_id, ///< The ID of a potential owner.
1037  $in_direct = false ///< If this is set to true, then only the immediate parent is checked. Default is false.
1038  ) {
1039  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1040  $ret = false;
1042 
1043  if ($server instanceof c_comdef_server) {
1044  $sb_to_check = $server->GetServiceBodyByIDObj($in_sb_id);
1045 
1046  $parent = $this->GetOwnerID();
1047 
1048  if ($parent == $in_sb_id) {
1049  $ret = true;
1050  } elseif (!$in_direct) {
1051  if ($parent) {
1052  $sb_to_check = $server->GetServiceBodyByIDObj($parent);
1053 
1054  if ($sb_to_check instanceof c_comdef_service_body) {
1055  $ret = IsSBRecursive($in_sb_id, $sb_to_check->GetID(), $in_direct);
1056  }
1057  }
1058  }
1059  }
1060 
1061  return $ret;
1062  }
1063 }
SetOwner2Obj(&$in_sb_owner_obj)
Accessor - Sets the ID of the &#39;secondary owner&#39; of this object by sending in an object reference...
const c_comdef_service_body__GSU__
A Class for Service Body Objects.
static AddNewChange($in_user_id_bigint, $in_change_type, $in_service_body_id_bigint, $in_before_string, $in_after_string, $in_object_class_string, $in_before_obj_id_bigint, $in_after_obj_id_bigint, $in_before_obj_lang_enum=null, $in_after_obj_lang_enum=null, $in_name_string=null, $in_description_string=null, $in_lang_enum=null)
Creates a new change record in the Database.
GetHelpline()
Accessor - Returns the helpline, as a string.
GetID()
Accessor - Returns the service body ID as an integer.
static GetOneUser($in_id_bigint)
Given an ID for a user, it returns one instance.
const c_comdef_service_body__COP__
static preparedExec($sql, $params=array())
Wrapper for preparing and executing a PDOStatement that does not return a resultset e...
& GetOwnerIDObject()
Accessor - Returns the &#39;owner&#39; of this object as a reference to an object.
SetURI($in_uri_string)
Accessor - Sets the URI of a site with more information on the Service Body.
SerializeObject()
Returns a storable serialization of the object, as a string.
This class handles BMLT users. One instance is created for each user on the server.
$ret
Definition: contact.php:226
const c_comdef_service_body__WSC__
IsUserInServiceBody($in_user_object=null)
Accessor - Returns true if the current user is an editor for the Service Body, or if the user is an o...
SetSBType($in_sb_type)
Accessor - Sets the URI of the KML file for the Service Boundaries.
global $comdef_global_language
The local server language enum (Will default to English)
SetContactEmail($in_email)
Accessor - set the contact email string.
SetOwnerID($in_sb_owner)
Accessor - Sets the ID of the &#39;owner&#39; of this object.
const _USER_LEVEL_SERVICE_BODY_ADMIN
const _USER_LEVEL_OBSERVER
static preparedQuery($sql, $params=array(), $fetchKeyPair=false)
Wrapper for preparing and executing a PDOStatement that returns a resultset e.g. SELECT SQL statement...
DeleteFromDB()
Deletes this instance from the database, and creates a change record.
SetOwnerObj(&$in_sb_owner_obj)
Accessor - Sets the ID of the &#39;owner&#39; of this object by sending in an object reference.
const _USER_LEVEL_SERVER_ADMIN
UserCanEdit($in_user_object=null)
Test to see if a user is allowed to edit an instance (change the data). Service Body Administrators t...
GetSBType()
Accessor - Returns the Service Body Type.
IsUserInServiceBodyHierarchy($in_user_object=null)
Accessor - Returns true if the current user is an editor for the Service Body. Checks up the hierarch...
GetEditorsAsObjects()
Accessor - Returns user objects for all the editors.
const c_comdef_service_body__RSC__
SetHelpline($in_helpline_string)
Accessor - Sets the URI of the KML file for the Service Boundaries.
& GetPrincipalUserObj()
Accessor - Returns the principal user for this service body.
GetOwner2ID()
Accessor - Returns the ID of the &#39;secondary owner&#39; of this object.
static GetUserByIDObj($in_user_id_bigint)
Get the object for a single user, given an ID.
SetEditors($in_editor_id_array)
Accessor - Sets the editors by ID.
const c_comdef_service_body__ZFM__
const c_comdef_service_body__ASC__
GetEditors()
Accessor - Returns IDs for all the editors.
A very simple class that allows whatever format NAWS will use as an ID to be assigned to the object...
__construct($in_parent_obj=null, $in_id_bigint=null, $in_principal_user_bigint=null, $in_editors_string=null, $in_kml_file_uri_string=null, $in_uri_string=null, $in_name_string=null, $in_description_string=null, $in_lang_enum=null, $in_world_id_mixed=null, $in_sb_type=null, $in_sb_owner=null, $in_sb_owner_2=null, $in_sb_meeting_email=null)
The initial setup call for the class. If you send in values, the object will set itself up to use the...
const c_comdef_service_body__LSU__
$server
Definition: GetLangs.php:25
SetID($in_service_body_id_bigint)
Accessor - Sets the service body ID as an integer.
static GetServiceBodyByIDObj($in_service_body_id_bigint)
Get the object for a single service body, given an ID.
Interface for entities that can be rendered into serialized form.
DeleteFromDB_NoRecord()
Deletes this instance from the database without creating a change record.
static UnserializeObject($in_parent, $serialized_string)
This takes the serialized table, and instantiates a new object from it.
Interface for entities that store themselves in the database.
SetOwner2ID($in_sb_owner)
Accessor - Sets the ID of the &#39;secondary owner&#39; of this object.
GetPrincipalUserID()
Accessor - Returns the principal user for this service body.
This class is the main server class. It instantiates a PDO database object, and is the starting point...
UserCanObserve($in_user_object=null)
Test to see if a user is allowed to observe in this Service body.
GetOwnerID()
Accessor - Returns the ID of the &#39;owner&#39; of this object.
GetURI()
Accessor - Returns the URI of a site with more information on the Service Body.
defined('BMLT_EXEC') or define('BMLT_EXEC'
Definition: index.php:3
RestoreFromDB()
Updates this instance to the current values in the DB (replacing current values of the instance)...
const c_comdef_service_body__GRP__
const c_comdef_service_body__MAS__
SetPrincipalUserID($in_principal_user_id_bigint)
Accessor - Sets the principal user for this service body.
global $_COMDEF_DEBUG
This flag, when set to true, will cause extra debug information to be output.
static GetCurrentUserObj($in_is_ajax=false)
Get the current logged-in user, as a c_comdef_user instance.
UpdateToDB($is_rollback=false)
Updates or adds this instance to the database.
IsOwnedBy($in_sb_id, $in_direct=false)
Check to see if a given Service Body ID is anywhere in the "direct parent" hierarchy of this Service ...
UserCanEditMeetings($in_user_object=null)
Test to see if a user is allowed to edit meetings in this Service body.
& GetOwner2IDObject()
Accessor - Returns the &#39;secondary owner&#39; of this object as a reference to an object.
static IsUserServerAdmin($in_user_obj=null, $in_is_ajax=false)
Find out if the user is a server admin.
Interface for entities that authenticate users.
GetContactEmail($in_recursive=false)
Get the contact email for this Service Body. If $in_recursive is false, then it simply looks at this ...