);
}
+ /** User accessible version of the type
+ */
+ public function displayType($short = false)
+ {
+ switch ($this->type) {
+ case Phone::TYPE_FIXED:
+ return $short ? 'Tél' : 'Fixe';
+ case Phone::TYPE_FAX:
+ return 'Fax';
+ case Phone::TYPE_MOBILE:
+ return $short ? 'Mob' : 'Mobile';
+ default:
+ return $this->type;
+ }
+ }
+
/** Returns true if this phone's link matches the flags
*/
public function hasLink($flags) {
$this->TableRow($l, utf8_decode($a->text));
foreach ($a->phones() as $phone) {
- $this->TableRow(utf8_decode($phone->type),
+ $this->TableRow(utf8_decode($phone->displayType()),
utf8_decode($phone->display), 'Mono');
}
}
$this->TableRow('adresse pro', utf8_decode($a->address()->text));
}
foreach ($a->phones() as $phone) {
- $this->TableRow(utf8_decode($phone->type),
+ $this->TableRow(utf8_decode($phone->displayType()),
utf8_decode($phone->display), 'Mono');
}
}
if (count($param['tels'])) {
foreach ($param['tels'] as $tel) {
$tel_type = ($param['dcd'] ? 'Dernier ' : '');
- switch ($tel->type) {
- case Phone::TYPE_FIXED:
- $tel_type .= 'Tél';
- break;
- case Phone::TYPE_FAX:
- $tel_type .= 'Fax';
- break;
- case Phone::TYPE_MOBILE:
- $tel_type .= 'Mob';
- break;
- default:
- $tel_type .= $tel->type;
- }
+ $tel_type .= $tel->displayType(true);
$txthtml .= "<div>\n<em>" . $tel_type . " : </em>\n<strong>" . $tel->display . "</strong>\n";
$comment = "";
if ($tel->comment != "") {