Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision b611e9e6

Von Moritz Bunkus vor mehr als 5 Jahren hinzugefügt

  • ID b611e9e6e77f845f8b8ded6eb5303a0a6bf83ae8
  • Vorgänger 822f5cf7
  • Nachfolger 18345d9b

Telefonnummernsuche: Datenank-ID & Typ zurückgeben

Unterschiede anzeigen:

SL/Controller/PhoneNumber.pm
74 74

  
75 75
  return {
76 76
    full_name => join(' ', grep { $_ ne '' } map { $_ // '' } ($chosen->cp_title, $chosen->cp_givenname, $chosen->cp_name)),
77
    id        => $chosen->cp_id,
78
    type      => 'contact',
77 79
    map({ my $method = "cp_$_"; ($_ => $chosen->$method // '') } qw(title givenname name phone1 phone2 mobile1 mobile2 fax)),
78 80
  };
79 81
}
......
111 113
    full_name => $chosen->name  // '',
112 114
    phone1    => $chosen->phone // '',
113 115
    fax       => $chosen->fax   // '',
116
    id        => $chosen->id,
117
    type      => ref($chosen) eq 'SL::DB::Customer' ? 'customer' : 'vendor',
114 118
    map({ ($_ => '') } qw(title givenname name phone2 mobile1 mobile2)),
115 119
  };
116 120
}
......
178 182

  
179 183
=over 4
180 184

  
185
=item C<id> — the database ID of the corresponding record
186

  
187
=item C<type> — describes the type of record returned; can be either
188
C<contact>, C<customer> or C<vendor>
189

  
181 190
=item C<full_name> — for contacts this is the concatenation of the
182 191
title, given name and family name; for customers/vendors it's the
183 192
company name

Auch abrufbar als: Unified diff