From d106734be470207db0e12704c2568dafe3a7789c Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Tue, 1 Jun 2010 14:59:24 +0200 Subject: [PATCH] Phones flags should not be empty. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- upgrade/newdirectory-0.0.1/phones.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/upgrade/newdirectory-0.0.1/phones.php b/upgrade/newdirectory-0.0.1/phones.php index 9bc08cd..f7260e8 100755 --- a/upgrade/newdirectory-0.0.1/phones.php +++ b/upgrade/newdirectory-0.0.1/phones.php @@ -61,6 +61,7 @@ $phones = XDB::iterRow('SELECT ap.pid, q.profile_mobile_pub, q.profile_mobile INNER JOIN account_profiles AS ap ON (q.user_id = ap.uid AND FIND_IN_SET(\'owner\', ap.perms)) WHERE q.profile_mobile <> \'\''); while (list($pid, $pub, $phone) = $phones->next()) { + $pub = ($pub == '' ? 'private' : $pub); $fmt_phone = format_phone_number($phone); if ($fmt_phone != '') { $display = format_display_number($fmt_phone, $error); @@ -80,6 +81,7 @@ $phones = XDB::iterator('SELECT ap.pid, e.entrid, e.tel, e.fax, e.mobile, e.tel INNER JOIN account_profiles AS ap ON (e.uid = ap.uid AND FIND_IN_SET(\'owner\', ap.perms)) ORDER BY ap.pid'); while ($row = $phones->next()) { + $row['tel_pub'] = ($row['tel_pub'] == '' ? 'private' : $row['tel_pub']); $request = 'INSERT INTO profile_phones (pid, link_type, link_id, tel_id, tel_type, search_tel, display_tel, pub) VALUES ({?}, \'pro\', {?}, {?}, {?}, {?}, {?}, {?})'; $fmt_fixed = format_phone_number($row['tel']); @@ -117,6 +119,7 @@ $phones = XDB::iterator('SELECT ap.pid, t.adrid, t.telid, t.tel_type, t.tel_pub $conversions = array(); $other_count = 0; while ($row = $phones->next()) { + $row['tel_pub'] = ($row['tel_pub'] == '' ? 'private' : $row['tel_pub']); $fmt_phone = format_phone_number($row['tel']); if ($fmt_phone != '') { $display = format_display_number($fmt_phone, $error); -- 2.1.4