Add addresses
continuous-integration/drone/push Build is passing Details

This commit is contained in:
philipp lang 2022-10-06 21:25:35 +02:00
parent 5ed486559a
commit f10764dbb1
1 changed files with 14 additions and 9 deletions

View File

@ -360,6 +360,7 @@ class Member extends Model
'TEL' => $this->mobile_phone, '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',
]); ]);
if ($this->preferred_phone) { if ($this->preferred_phone) {
@ -374,22 +375,26 @@ class Member extends Model
$card->add('TEL', $this->work_phone, ['type' => 'work']); $card->add('TEL', $this->work_phone, ['type' => 'work']);
} }
if ($this->email) { if ($this->children_phone) {
$card->add('EMAIL', $this->email, ['type' => 'pref']); $card->add('TEL', $this->children_phone, ['type' => 'Kind']);
}
if ($this->email_parents) {
$card->add('EMAIL', $this->email_parents, ['type' => 'internet']);
} }
$card->add('ADDR', [ if ($this->email) {
$this->fullname, $card->add('EMAIL', $this->email, ['type' => 'Kind']);
$this->fullAddress, }
if ($this->email_parents) {
$card->add('EMAIL', $this->email_parents, ['type' => 'Eltern']);
}
$card->add('ADR', [
'',
'',
$this->address ?: '', $this->address ?: '',
$this->location ?: '', $this->location ?: '',
$this->region?->name ?: '', $this->region?->name ?: '',
$this->zip ?: '', $this->zip ?: '',
$this->country?->name ?: '', $this->country?->name ?: '',
], ['type' => 'postal']); ]);
return $card; return $card;
} }