From b611e9e6e77f845f8b8ded6eb5303a0a6bf83ae8 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 22 Mar 2019 13:02:52 +0100 Subject: [PATCH] =?utf8?q?Telefonnummernsuche:=20Datenank-ID=20&=20Typ=20z?= =?utf8?q?ur=C3=BCckgeben?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/PhoneNumber.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/SL/Controller/PhoneNumber.pm b/SL/Controller/PhoneNumber.pm index 4bfbe3ebb..5b83a353f 100644 --- a/SL/Controller/PhoneNumber.pm +++ b/SL/Controller/PhoneNumber.pm @@ -74,6 +74,8 @@ sub find_contact_for_number { return { full_name => join(' ', grep { $_ ne '' } map { $_ // '' } ($chosen->cp_title, $chosen->cp_givenname, $chosen->cp_name)), + id => $chosen->cp_id, + type => 'contact', map({ my $method = "cp_$_"; ($_ => $chosen->$method // '') } qw(title givenname name phone1 phone2 mobile1 mobile2 fax)), }; } @@ -111,6 +113,8 @@ sub find_customer_vendor_for_number { full_name => $chosen->name // '', phone1 => $chosen->phone // '', fax => $chosen->fax // '', + id => $chosen->id, + type => ref($chosen) eq 'SL::DB::Customer' ? 'customer' : 'vendor', map({ ($_ => '') } qw(title givenname name phone2 mobile1 mobile2)), }; } @@ -178,6 +182,11 @@ fields are present: =over 4 +=item C — the database ID of the corresponding record + +=item C — describes the type of record returned; can be either +C, C or C + =item C — for contacts this is the concatenation of the title, given name and family name; for customers/vendors it's the company name -- 2.20.1