diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-06-01 18:11:57 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-06-01 18:11:57 +0000 |
| commit | 3ca46aacec94c0dd0b233c4be9a91297a8c10e9d (patch) | |
| tree | 5a64620a4892813aa673fa9fa32f4fe9ad15ea85 /roundcubemail/program/steps | |
| parent | c9995cd86091d8e44947bb747faf376937ef6c2f (diff) | |
Allow to drag into groups of another address source
git-svn-id: https://svn.roundcube.net/trunk@3694 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps')
| -rw-r--r-- | roundcubemail/program/steps/addressbook/copy.inc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/roundcubemail/program/steps/addressbook/copy.inc b/roundcubemail/program/steps/addressbook/copy.inc index c8076c40e..2d3a91a6f 100644 --- a/roundcubemail/program/steps/addressbook/copy.inc +++ b/roundcubemail/program/steps/addressbook/copy.inc @@ -25,6 +25,7 @@ if (!$OUTPUT->ajax_call) $cid = get_input_value('_cid', RCUBE_INPUT_POST); $target = get_input_value('_to', RCUBE_INPUT_POST); +$target_group = get_input_value('_togid', RCUBE_INPUT_POST); if ($cid && preg_match('/^[a-z0-9\-_=]+(,[a-z0-9\-_=]+)*$/i', $cid) && strlen($target) && $target !== $source) { @@ -32,12 +33,19 @@ if ($cid && preg_match('/^[a-z0-9\-_=]+(,[a-z0-9\-_=]+)*$/i', $cid) && strlen($t $TARGET = $RCMAIL->get_address_book($target); if ($TARGET && $TARGET->ready && !$TARGET->readonly) { + if ($target_group && $TARGET->groups) + $TARGET->set_group($target_group); + $arr_cids = explode(',', $cid); foreach ($arr_cids as $cid) { - $plugin = $RCMAIL->plugins->exec_hook('create_contact', array('record' => $CONTACTS->get_record($cid, true), 'source' => $target)); - $a_record = $plugin['record']; + $plugin = $RCMAIL->plugins->exec_hook('create_contact', array( + 'record' => $CONTACTS->get_record($cid, true), + 'source' => $target, + 'group' => $target_group, + )); + $a_record = $plugin['record']; - if (!$plugin['abort']) + if (!$plugin['abort']) if ($TARGET->insert($a_record, true)) $success++; } |
