summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2010-04-13 07:24:09 +0000
committerthomascube <thomas@roundcube.net>2010-04-13 07:24:09 +0000
commit8e3a6039cfefb8f351d2696ebdcfa26cc5d4cef9 (patch)
tree32e17ad5447f3e7b61ddaa1f5d85d2c7f94a0849 /program/include
parent6b01133063cf1c138d4820f43206a4b16c802387 (diff)
Assign newly created contacts to the active group (#1486626) and fix group selection display (#1486619)
Diffstat (limited to 'program/include')
-rw-r--r--program/include/rcube_contacts.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/program/include/rcube_contacts.php b/program/include/rcube_contacts.php
index 070e00ffd..dd37972c2 100644
--- a/program/include/rcube_contacts.php
+++ b/program/include/rcube_contacts.php
@@ -212,7 +212,7 @@ class rcube_contacts extends rcube_addressbook
if ($col == 'ID' || $col == $this->primary_key)
{
$ids = !is_array($value) ? explode(',', $value) : $value;
- $add_where[] = $this->primary_key.' IN ('.join(',', $ids).')';
+ $add_where[] = 'c.' . $this->primary_key.' IN ('.join(',', $ids).')';
}
else if ($strict)
$add_where[] = $this->db->quoteIdentifier($col).'='.$this->db->quote($value);
@@ -336,6 +336,10 @@ class rcube_contacts extends rcube_addressbook
$insert_id = $this->db->insert_id('contacts');
}
+
+ // also add the newly created contact to the active group
+ if ($insert_id && $this->group_id)
+ $this->add_to_group($this->group_id, $insert_id);
return $insert_id;
}