Thomas Bruederli
2013-02-13 a0e86dcdeb201bb2422b3e4b8e249c2868f4c5ab
Fix updating contacts
2 files modified
14 ■■■■■ changed files
program/js/app.js 10 ●●●●● patch | view | raw | blame | history
program/steps/addressbook/save.inc 4 ●●●● patch | view | raw | blame | history
program/js/app.js
@@ -4229,7 +4229,7 @@
  this.load_contact = function(cid, action, framed)
  {
    var win, url = {}, target = window,
      rec = this.contact_list.data[cid];
      rec = this.contact_list ? this.contact_list.data[cid] : null;
    if (win = this.get_frame_window(this.env.contentframe)) {
      url._framed = 1;
@@ -4240,8 +4240,8 @@
      if (!cid)
        this.contact_list.clear_selection();
      this.enable_command('compose', rec.email);
      this.enable_command('export-selected', rec._type != 'group');
      this.enable_command('compose', rec && rec.email);
      this.enable_command('export-selected', rec && rec._type != 'group');
    }
    else if (framed)
      return false;
@@ -4351,7 +4351,7 @@
  };
  // update a contact record in the list
  this.update_contact_row = function(cid, cols_arr, newcid, source)
  this.update_contact_row = function(cid, cols_arr, newcid, source, data)
  {
    var c, row, list = this.contact_list;
@@ -4378,6 +4378,8 @@
        list.selection[0] = newcid;
        row.style.display = '';
      }
      list.data[cid] = data;
    }
  };
program/steps/addressbook/save.inc
@@ -134,11 +134,11 @@
    $record['email'] = reset($CONTACTS->get_col_values('email', $record, true));
    $record['name']  = rcube_addressbook::compose_list_name($record);
    foreach (array('name', 'email') as $col)
    foreach (array('name') as $col)
      $a_js_cols[] = Q((string)$record[$col]);
    // update the changed col in list
    $OUTPUT->command('parent.update_contact_row', $cid, $a_js_cols, $newcid, $source);
    $OUTPUT->command('parent.update_contact_row', $cid, $a_js_cols, $newcid, $source, $record);
    // show confirmation
    $OUTPUT->show_message('successfullysaved', 'confirmation', null, false);