update vcard
continuous-integration/drone/push Build is passing Details

This commit is contained in:
philipp lang 2022-10-07 23:04:38 +02:00
parent e3619a0f84
commit 8a30a71964
1 changed files with 6 additions and 18 deletions

View File

@ -408,42 +408,30 @@ class Member extends Model
$card = new VCard([ $card = new VCard([
'VERSION' => '3.0', 'VERSION' => '3.0',
'FN' => $this->fullname, 'FN' => $this->fullname,
'TEL' => $this->mobile_phone,
'N' => [$this->lastname, $this->firstname, '', '', ''], 'N' => [$this->lastname, $this->firstname, '', '', ''],
'BDAY' => $this->birthday->format('Ymd'), 'BDAY' => $this->birthday->format('Ymd'),
'CATEGORIES' => 'Scoutrobot', 'CATEGORIES' => 'Scoutrobot',
'UID' => $this->slug, 'UID' => $this->slug,
]); ]);
$card->add('child.X-ABLABEL', 'Kind'); if ($this->main_phone) {
$card->add('parent.X-ABLABEL', 'Eltern'); $card->add('TEL', $this->main_phone, ['type' => 'voice']);
if ($this->preferred_phone) {
$card->add('TEL', $this->preferred_phone, ['type' => 'pref']);
}
if ($this->preferred_email) {
$card->add('EMAIL', $this->preferred_email, ['type' => 'pref']);
} }
if ($this->mobile_phone) { if ($this->mobile_phone) {
$card->add('TEL', $this->mobile_phone, ['type' => 'cell']); $card->add('TEL', $this->mobile_phone, ['type' => 'work']);
}
if ($this->work_phone) {
$card->add('TEL', $this->work_phone, ['type' => 'work']);
} }
if ($this->children_phone) { if ($this->children_phone) {
$card->add('child.TEL', $this->children_phone); $card->add('TEL', $this->children_phone, ['type' => 'cell']);
} }
if ($this->email) { if ($this->email) {
$card->add('child.EMAIL', $this->email); $card->add('EMAIL', $this->email, ['type' => 'internet']);
} }
if ($this->email_parents) { if ($this->email_parents) {
$card->add('parent.EMAIL', $this->email_parents); $card->add('EMAIL', $this->email_parents, ['type' => 'aol']);
} }
$card->add('ADR', [ $card->add('ADR', [