summaryrefslogtreecommitdiff
path: root/program/steps/addressbook
diff options
context:
space:
mode:
Diffstat (limited to 'program/steps/addressbook')
-rw-r--r--program/steps/addressbook/copy.inc6
-rw-r--r--program/steps/addressbook/func.inc2
-rw-r--r--program/steps/addressbook/import.inc7
-rw-r--r--program/steps/addressbook/move.inc6
-rw-r--r--program/steps/addressbook/save.inc4
5 files changed, 15 insertions, 10 deletions
diff --git a/program/steps/addressbook/copy.inc b/program/steps/addressbook/copy.inc
index 9114cb1fd..e4e276591 100644
--- a/program/steps/addressbook/copy.inc
+++ b/program/steps/addressbook/copy.inc
@@ -88,9 +88,9 @@ foreach ($cids as $source => $cid) {
}
}
else {
- $record = $result->first();
- $ids[] = $record['ID'];
- $errormsg = empty($a_record['email']) ? 'contactnameexists' : 'contactexists';
+ $record = $result->first();
+ $ids[] = $record['ID'];
+ $errormsg = empty($email) ? 'contactnameexists' : 'contactexists';
}
}
diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc
index b33396baf..be0dd2a33 100644
--- a/program/steps/addressbook/func.inc
+++ b/program/steps/addressbook/func.inc
@@ -160,7 +160,7 @@ function rcmail_contact_source($source=null, $init_env=false, $writable=false)
return $CONTACTS;
$OUTPUT->set_env('readonly', $CONTACTS->readonly);
- $OUTPUT->set_env('source', $source);
+ $OUTPUT->set_env('source', (string) $source);
// reduce/extend $CONTACT_COLTYPES with specification from the current $CONTACT object
if (is_array($CONTACTS->coltypes)) {
diff --git a/program/steps/addressbook/import.inc b/program/steps/addressbook/import.inc
index 33e473242..5dee5c06a 100644
--- a/program/steps/addressbook/import.inc
+++ b/program/steps/addressbook/import.inc
@@ -308,10 +308,11 @@ function rcmail_import_buttons($attrib)
$out = $OUTPUT->button(array('command' => 'list', 'prop' => $target, 'label' => 'done') + $attrib);
}
else {
- $out = $OUTPUT->button(array('command' => 'list', 'label' => 'cancel') + $attrib);
- $out .= ' ';
+ $cancel = $OUTPUT->button(array('command' => 'list', 'label' => 'cancel') + $attrib);
$attrib['class'] = trim($attrib['class'] . ' mainaction');
- $out .= $OUTPUT->button(array('command' => 'import', 'label' => 'import') + $attrib);
+ $out = $OUTPUT->button(array('command' => 'import', 'label' => 'import') + $attrib);
+ $out .= ' ';
+ $out .= $cancel;
}
return $out;
diff --git a/program/steps/addressbook/move.inc b/program/steps/addressbook/move.inc
index 6a70e7bda..7a730af77 100644
--- a/program/steps/addressbook/move.inc
+++ b/program/steps/addressbook/move.inc
@@ -97,9 +97,9 @@ foreach ($cids as $source => $source_cids) {
}
}
else {
- $record = $result->first();
- $ids[] = $record['ID'];
- $errormsg = empty($a_record['email']) ? 'contactnameexists' : 'contactexists';
+ $record = $result->first();
+ $ids[] = $record['ID'];
+ $errormsg = empty($email) ? 'contactnameexists' : 'contactexists';
}
}
diff --git a/program/steps/addressbook/save.inc b/program/steps/addressbook/save.inc
index 94556f96b..7451f433b 100644
--- a/program/steps/addressbook/save.inc
+++ b/program/steps/addressbook/save.inc
@@ -165,6 +165,10 @@ if (!empty($cid)) {
$a_js_cols[] = rcube::Q((string)$record[$col]);
}
+ // performance: unset some big data items we don't need here
+ $record = array_intersect_key($record, array('ID' => 1,'email' => 1,'name' => 1));
+ $record['_type'] = 'person';
+
// update the changed col in list
$OUTPUT->command('parent.update_contact_row', $cid, $a_js_cols, $newcid, $source, $record);