summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-08-22 12:25:08 +0000
committeralecpl <alec@alec.pl>2011-08-22 12:25:08 +0000
commit5db6f96d22b14651bc1a90413b57c96411249fb4 (patch)
treeed91cd00179ac292d736d13a2f4700ee0d6b9f30 /program
parentc269b4958746db8e4f035536112e871387e3040d (diff)
- Fix contact row update after name change when in searching mode, update changelog
Diffstat (limited to 'program')
-rw-r--r--program/js/app.js9
-rw-r--r--program/steps/addressbook/save.inc6
2 files changed, 11 insertions, 4 deletions
diff --git a/program/js/app.js b/program/js/app.js
index 6da5a578c..808adc575 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -3997,12 +3997,19 @@ function rcube_webmail()
};
// update a contact record in the list
- this.update_contact_row = function(cid, cols_arr, newcid)
+ this.update_contact_row = function(cid, cols_arr, newcid, source)
{
var c, row, list = this.contact_list;
cid = String(cid).replace(this.identifier_expr, '_');
+ // when in searching mode, concat cid with the source name
+ if (!list.rows[cid]) {
+ cid = cid+'-'+source;
+ if (newcid)
+ newcid = newcid+'-'+source;
+ }
+
if (list.rows[cid] && (row = list.rows[cid].obj)) {
for (c=0; c<cols_arr.length; c++)
if (row.cells[c])
diff --git a/program/steps/addressbook/save.inc b/program/steps/addressbook/save.inc
index c463bf7fe..ddbd630ef 100644
--- a/program/steps/addressbook/save.inc
+++ b/program/steps/addressbook/save.inc
@@ -104,12 +104,13 @@ if (isset($a_record['photo'])) {
$RCMAIL->session->remove('contacts');
}
+$source = get_input_value('_source', RCUBE_INPUT_GPC);
// update an existing contact
if (!empty($cid))
{
$plugin = $RCMAIL->plugins->exec_hook('contact_update',
- array('id' => $cid, 'record' => $a_record, 'source' => get_input_value('_source', RCUBE_INPUT_GPC)));
+ array('id' => $cid, 'record' => $a_record, 'source' => $source));
$a_record = $plugin['record'];
if (!$plugin['abort'])
@@ -136,7 +137,7 @@ if (!empty($cid))
$a_js_cols[] = Q((string)$record[$col]);
// update the changed col in list
- $OUTPUT->command('parent.update_contact_row', $cid, $a_js_cols, $newcid);
+ $OUTPUT->command('parent.update_contact_row', $cid, $a_js_cols, $newcid, $source);
// show confirmation
$OUTPUT->show_message('successfullysaved', 'confirmation', null, false);
@@ -152,7 +153,6 @@ if (!empty($cid))
// insert a new contact
else {
- $source = get_input_value('_source', RCUBE_INPUT_GPC);
// Name of the addressbook already selected on the list
$orig_source = get_input_value('_orig_source', RCUBE_INPUT_GPC);