X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fcarnet%2Foutlook.inc.php;h=03913a85286007a03377ac56770095d03c33bd12;hb=1dd218522cea6ae08998b0ca107c8fec608ddce8;hp=791b15c34433e9b6037d294e5dfbb912a1969785;hpb=b3ad574ddfd8697b6342356fb23e756ba8cabb0f;p=platal.git diff --git a/modules/carnet/outlook.inc.php b/modules/carnet/outlook.inc.php index 791b15c..03913a8 100644 --- a/modules/carnet/outlook.inc.php +++ b/modules/carnet/outlook.inc.php @@ -31,8 +31,15 @@ class Outlook { $contact['Ville ('.$adr_type.')'] = $adr->locality; $contact['Dép/Région ('.$adr_type.')'] = $adr->administrativeArea; $contact['Pays ('.$adr_type.')'] = $adr->country; - $contact['Téléphone ('.$adr_type.')'] = $adr->fixed_tel; - $contact['Télécopie ('.$adr_type.')'] = $adr->fax_tel; + $phones = $adr->phones(); + foreach ($phones as $p) { + if ($p->hasType(Profile::PHONE_TYPE_FIXED)) { + $contact['Téléphone ('.$adr_type.')'] = $p->display; + } + if ($p->hasType(Profile::PHONE_TYPE_FAX)) { + $contact['Télécopie ('.$adr_type.')'] = $p->display; + } + } } private static function profile_to_contact(&$p) { @@ -105,7 +112,7 @@ class Outlook { return $contact; } - private static function protect($t) { + private static function protect(&$t) { if (empty($t)) { return '""'; } @@ -113,8 +120,8 @@ class Outlook { return '"'.strtr(utf8_decode($t),'"', '\\"').'"'; } - public static function output_profiles(&$profiles, $lang) { - header("Content-Type: text/plain;charset=iso8859-15"); + public static function output_profiles($profiles, $lang) { + pl_content_headers("text/plain", "iso8859-15"); $fields =& Outlook::$contact_fields[$lang]; foreach ($fields as $i => $k) { if ($i != 0) { @@ -131,7 +138,8 @@ class Outlook { echo Outlook::protect($values[$k]); } else { // HACK to fix fullname - echo Outlook::protect($p->firstName()." ".$p->lastName()); + $fullname = $p->firstName()." ".$p->lastName(); + echo Outlook::protect($fullname); } } echo "\r\n";