thomascube
2010-04-13 8e3a6039cfefb8f351d2696ebdcfa26cc5d4cef9
Assign newly created contacts to the active group (#1486626) and fix group selection display (#1486619)

4 files modified
16 ■■■■■ changed files
CHANGELOG 2 ●●●●● patch | view | raw | blame | history
program/include/rcube_contacts.php 6 ●●●● patch | view | raw | blame | history
program/js/app.js 7 ●●●●● patch | view | raw | blame | history
program/steps/addressbook/edit.inc 1 ●●●● patch | view | raw | blame | history
CHANGELOG
@@ -1,6 +1,8 @@
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)
- Allow plugins modify the Sent folder when composing (#1486548)
- Added optional (max_recipients) support to restrict total number of recipients per message (#1484542)
program/include/rcube_contacts.php
@@ -212,7 +212,7 @@
      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 @@
        
      $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;
  }
program/js/app.js
@@ -525,7 +525,7 @@
            this.reset_qsearch();
          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;
@@ -3443,8 +3443,7 @@
    else if (group != this.env.group)
      page = this.env.current_page = 1;
    this.select_folder(src, this.env.source);
    this.select_folder(group, this.env.group, 'rcmliG');
    this.select_folder((group ? 'G'+group : src), (this.env.group ? 'G'+this.env.group : this.env.source));
    
    this.env.source = src;
    this.env.group = group;
@@ -3516,7 +3515,7 @@
    if (action && (cid || action=='add') && !this.drag_active)
      {
      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;
    };
program/steps/addressbook/edit.inc
@@ -88,6 +88,7 @@
  
  if (empty($EDIT_FORM)) {
    $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()))
      $hiddenfields->add(array('name' => '_cid', 'value' => $record['ID']));