From f10764dbb15d434f5104189d2f7376d69726e593 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Thu, 6 Oct 2022 21:25:35 +0200 Subject: [PATCH] Add addresses --- app/Member/Member.php | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/app/Member/Member.php b/app/Member/Member.php index 79b29912..6865a0c4 100644 --- a/app/Member/Member.php +++ b/app/Member/Member.php @@ -360,6 +360,7 @@ class Member extends Model 'TEL' => $this->mobile_phone, 'N' => [$this->lastname, $this->firstname, '', '', ''], 'BDAY' => $this->birthday->format('Ymd'), + 'CATEGORIES' => 'Scoutrobot', ]); if ($this->preferred_phone) { @@ -374,22 +375,26 @@ class Member extends Model $card->add('TEL', $this->work_phone, ['type' => 'work']); } - if ($this->email) { - $card->add('EMAIL', $this->email, ['type' => 'pref']); - } - if ($this->email_parents) { - $card->add('EMAIL', $this->email_parents, ['type' => 'internet']); + if ($this->children_phone) { + $card->add('TEL', $this->children_phone, ['type' => 'Kind']); } - $card->add('ADDR', [ - $this->fullname, - $this->fullAddress, + if ($this->email) { + $card->add('EMAIL', $this->email, ['type' => 'Kind']); + } + if ($this->email_parents) { + $card->add('EMAIL', $this->email_parents, ['type' => 'Eltern']); + } + + $card->add('ADR', [ + '', + '', $this->address ?: '', $this->location ?: '', $this->region?->name ?: '', $this->zip ?: '', $this->country?->name ?: '', - ], ['type' => 'postal']); + ]); return $card; }