Assign newly created contacts to the active group (#1486626) and fix group selection display (#1486619)

release-0.6
thomascube 15 years ago
parent 6b01133063
commit 8e3a6039cf

@ -1,6 +1,8 @@
CHANGELOG RoundCube Webmail CHANGELOG RoundCube Webmail
=========================== ===========================
- Fix address book/group selection (#1486619)
- Assign newly created contacts to the active group (#1486626)
- Added option not to mark messages as read when viewed in preview pane (#1485012) - Added option not to mark messages as read when viewed in preview pane (#1485012)
- Allow plugins modify the Sent folder when composing (#1486548) - Allow plugins modify the Sent folder when composing (#1486548)
- Added optional (max_recipients) support to restrict total number of recipients per message (#1484542) - Added optional (max_recipients) support to restrict total number of recipients per message (#1484542)

@ -212,7 +212,7 @@ class rcube_contacts extends rcube_addressbook
if ($col == 'ID' || $col == $this->primary_key) if ($col == 'ID' || $col == $this->primary_key)
{ {
$ids = !is_array($value) ? explode(',', $value) : $value; $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) else if ($strict)
$add_where[] = $this->db->quoteIdentifier($col).'='.$this->db->quote($value); $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'); $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; return $insert_id;
} }

@ -525,7 +525,7 @@ function rcube_webmail()
this.reset_qsearch(); this.reset_qsearch();
this.list_contacts(props); this.list_contacts(props);
this.enable_command('add', 'import', (this.env.address_sources && !this.env.address_sources[props].readonly)); this.enable_command('add', 'import', (this.env.address_sources && !this.env.address_sources[this.env.source].readonly));
} }
break; break;
@ -3443,8 +3443,7 @@ function rcube_webmail()
else if (group != this.env.group) else if (group != this.env.group)
page = this.env.current_page = 1; page = this.env.current_page = 1;
this.select_folder(src, this.env.source); this.select_folder((group ? 'G'+group : src), (this.env.group ? 'G'+this.env.group : this.env.source));
this.select_folder(group, this.env.group, 'rcmliG');
this.env.source = src; this.env.source = src;
this.env.group = group; this.env.group = group;
@ -3516,7 +3515,7 @@ function rcube_webmail()
if (action && (cid || action=='add') && !this.drag_active) if (action && (cid || action=='add') && !this.drag_active)
{ {
this.set_busy(true); this.set_busy(true);
target.location.href = this.env.comm_path+'&_action='+action+'&_source='+urlencode(this.env.source)+'&_cid='+urlencode(cid) + add_url; target.location.href = this.env.comm_path+'&_action='+action+'&_source='+urlencode(this.env.source)+'&_gid='+urlencode(this.env.group)+'&_cid='+urlencode(cid) + add_url;
} }
return true; return true;
}; };

@ -88,6 +88,7 @@ function get_form_tags($attrib)
if (empty($EDIT_FORM)) { if (empty($EDIT_FORM)) {
$hiddenfields = new html_hiddenfield(array('name' => '_source', 'value' => get_input_value('_source', RCUBE_INPUT_GPC))); $hiddenfields = new html_hiddenfield(array('name' => '_source', 'value' => get_input_value('_source', RCUBE_INPUT_GPC)));
$hiddenfields->add(array('name' => '_gid', 'value' => $CONTACTS->group_id));
if (($result = $CONTACTS->get_result()) && ($record = $result->first())) if (($result = $CONTACTS->get_result()) && ($record = $result->first()))
$hiddenfields->add(array('name' => '_cid', 'value' => $record['ID'])); $hiddenfields->add(array('name' => '_cid', 'value' => $record['ID']));

Loading…
Cancel
Save