From a15b2d59984898899cc7f3fb62ec65e6d4f6a8c8 Mon Sep 17 00:00:00 2001 From: Bostjan Skufca Date: Thu, 14 Apr 2016 02:39:54 +0200 Subject: [PATCH] Autocomplete refactoring: replace variable name '$id' with '$abook_id' Reason: Having genericly named variable $id in nested loops makes code unreadable. Replacing generic name '$id' with '$ENTITIY_id' format removes all ambiguity. --- program/steps/mail/autocomplete.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/program/steps/mail/autocomplete.inc b/program/steps/mail/autocomplete.inc index 61b43ef57..809bd66f1 100644 --- a/program/steps/mail/autocomplete.inc +++ b/program/steps/mail/autocomplete.inc @@ -64,8 +64,8 @@ if (!empty($book_types) && strlen($search)) { $books_num = count($book_types); $search_lc = mb_strtolower($search); - foreach ($book_types as $id) { - $abook = $RCMAIL->get_address_book($id); + foreach ($book_types as $abook_id) { + $abook = $RCMAIL->get_address_book($abook_id); $abook->set_pagesize($MAXNUM); if ($result = $abook->search($RCMAIL->config->get('contactlist_fields'), $search, $mode, true, true, 'email')) { @@ -135,7 +135,7 @@ if (!empty($book_types) && strlen($search)) { 'email' => $email, 'type' => 'group', 'id' => $group['ID'], - 'source' => $id, + 'source' => $abook_id, ); if (count($contacts) >= $MAXNUM) { @@ -152,7 +152,7 @@ if (!empty($book_types) && strlen($search)) { 'name' => $group['name'] . ' (' . intval($result->count) . ')', 'type' => 'group', 'id' => $group['ID'], - 'source' => $id + 'source' => $abook_id, ); if (count($contacts) >= $MAXNUM) {