|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* @package org.openpsa.contacts |
|
4
|
|
|
* @author Nemein Oy http://www.nemein.com/ |
|
5
|
|
|
* @copyright Nemein Oy http://www.nemein.com/ |
|
6
|
|
|
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License |
|
7
|
|
|
*/ |
|
8
|
|
|
|
|
9
|
|
|
/** |
|
10
|
|
|
* MidCOM wrapped access to org_openpsa_person plus some utility methods |
|
11
|
|
|
* |
|
12
|
|
|
* @property string $firstname First name of the person |
|
13
|
|
|
* @property string $lastname Last name of the person |
|
14
|
|
|
* @property string $homephone Home phone number of the person |
|
15
|
|
|
* @property string $handphone Cell phone number of the person |
|
16
|
|
|
* @property string $workphone Work phone name of the person |
|
17
|
|
|
* @property string $homepage Homepage URL of the person |
|
18
|
|
|
* @property string $email Email address of the person |
|
19
|
|
|
* @property string $street Street address of the person |
|
20
|
|
|
* @property string $postcode Zip code of the person |
|
21
|
|
|
* @property string $city City of the person |
|
22
|
|
|
* @property string $extra Additional information about the person |
|
23
|
|
|
* @property integer $salutation |
|
24
|
|
|
* @property string $title |
|
25
|
|
|
* @property midgard_datetime $birthdate |
|
26
|
|
|
* @property string $pgpkey |
|
27
|
|
|
* @property string $country |
|
28
|
|
|
* @property string $fax |
|
29
|
|
|
* @package org.openpsa.contacts |
|
30
|
|
|
*/ |
|
31
|
|
|
class org_openpsa_contacts_person_dba extends midcom_db_person |
|
32
|
|
|
{ |
|
33
|
|
|
public string $__midcom_class_name__ = __CLASS__; |
|
34
|
|
|
public string $__mgdschema_class_name__ = 'org_openpsa_person'; |
|
35
|
|
|
|
|
36
|
|
|
public array $autodelete_dependents = [ |
|
37
|
|
|
'org_openpsa_calendar_event_member_dba' => 'uid', |
|
38
|
|
|
midcom_db_member::class => 'uid' |
|
39
|
|
|
]; |
|
40
|
|
|
|
|
41
|
38 |
|
public function __construct($identifier = null) |
|
42
|
|
|
{ |
|
43
|
38 |
|
if (!in_array(midcom::get()->config->get('person_class'), ['midgard_person', 'openpsa_person'])) { |
|
44
|
|
|
$this->__mgdschema_class_name__ = midcom::get()->config->get('person_class'); |
|
45
|
|
|
} |
|
46
|
38 |
|
parent::__construct($identifier); |
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
1 |
|
public function render_link() : string |
|
50
|
|
|
{ |
|
51
|
1 |
|
$siteconfig = new org_openpsa_core_siteconfig(); |
|
52
|
|
|
|
|
53
|
1 |
|
if ($contacts_url = $siteconfig->get_node_full_url('org.openpsa.contacts')) { |
|
54
|
1 |
|
return '<a href="' . $contacts_url . 'person/' . $this->guid . '/">' . $this->get_label() . "</a>"; |
|
55
|
|
|
} |
|
56
|
|
|
return $this->get_label(); |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
5 |
|
public function _on_deleting() : bool |
|
60
|
|
|
{ |
|
61
|
|
|
// FIXME: Call duplicate checker's dependency handling methods |
|
62
|
5 |
|
return parent::_on_deleting(); |
|
63
|
|
|
} |
|
64
|
|
|
} |
|
65
|
|
|
|