Changeset ca38db5 in github
- Timestamp:
- Jun 1, 2010 2:11:57 PM (3 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- 5800fb6
- Parents:
- bb50290
- Files:
-
- 6 edited
-
program/js/app.js (modified) (7 diffs)
-
program/steps/addressbook/copy.inc (modified) (2 diffs)
-
skins/default/common.css (modified) (1 diff)
-
skins/default/ie6hacks.css (modified) (1 diff)
-
skins/default/images/messageactions.gif (modified) (previous)
-
skins/default/images/messageactions.png (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
program/js/app.js
r8e32dcd rca38db5 1244 1244 var moffset = this.initialListScrollTop-this.gui_objects.folderlist.parentNode.scrollTop; 1245 1245 var toffset = -moffset-boffset; 1246 var li, div, pos, mouse; 1246 var li, div, pos, mouse, check, oldclass, 1247 layerclass = 'draglayernormal'; 1248 1249 if (this.contact_list && this.contact_list.draglayer) 1250 oldclass = this.contact_list.draglayer.attr('class'); 1247 1251 1248 1252 mouse = rcube_event.get_mouse_pos(e); … … 1257 1261 this.env.last_folder_target = null; 1258 1262 } 1263 if (layerclass != oldclass && this.contact_list && this.contact_list.draglayer) 1264 this.contact_list.draglayer.attr('class', layerclass); 1259 1265 return; 1260 1266 } … … 1264 1270 pos = this.env.folder_coords[k]; 1265 1271 if (mouse.x >= pos.x1 && mouse.x < pos.x2 && mouse.y >= pos.y1 && mouse.y < pos.y2){ 1266 if ( this.check_droptarget(k)) {1272 if ((check = this.check_droptarget(k))) { 1267 1273 li = this.get_folder_li(k); 1268 1274 div = $(li.getElementsByTagName('div')[0]); … … 1287 1293 this.env.folder_coords[k].on = 1; 1288 1294 this.env.last_folder_target = k; 1295 layerclass = 'draglayer' + (check > 1 ? 'copy' : 'normal'); 1289 1296 } else { // Clear target, otherwise drag end will trigger move into last valid droptarget 1290 1297 this.env.last_folder_target = null; … … 1296 1303 } 1297 1304 } 1305 1306 if (layerclass != oldclass && this.contact_list && this.contact_list.draglayer) 1307 this.contact_list.draglayer.attr('class', layerclass); 1298 1308 } 1299 1309 }; … … 1510 1520 this.check_droptarget = function(id) 1511 1521 { 1522 var allow = false, copy = false; 1523 1512 1524 if (this.task == 'mail') 1513 return (this.env.mailboxes[id] && this.env.mailboxes[id].id != this.env.mailbox && !this.env.mailboxes[id].virtual); 1514 else if (this.task == 'addressbook') 1515 return (id != this.env.source && this.env.contactfolders[id] && !this.env.contactfolders[id].readonly && 1516 !(!this.env.source && this.env.contactfolders[id].group) && 1517 !(this.env.contactfolders[id].type == 'group' && this.env.contactfolders[this.env.source].readonly) && 1518 !(this.env.contactfolders[id].type == 'group' && this.env.contactfolders[id].source != this.env.source) && 1519 !(this.env.contactfolders[id].type == 'group' && this.env.contactfolders[id].id == this.env.group)); 1525 allow = (this.env.mailboxes[id] && this.env.mailboxes[id].id != this.env.mailbox && !this.env.mailboxes[id].virtual); 1520 1526 else if (this.task == 'settings') 1521 return (id != this.env.folder); 1527 allow = (id != this.env.folder); 1528 else if (this.task == 'addressbook') { 1529 if (id != this.env.source && this.env.contactfolders[id]) { 1530 if (this.env.contactfolders[id].type == 'group') { 1531 var target_abook = this.env.contactfolders[id].source; 1532 allow = this.env.contactfolders[id].id != this.env.group && !this.env.contactfolders[target_abook].readonly; 1533 copy = target_abook != this.env.source; 1534 } 1535 else { 1536 allow = !this.env.contactfolders[id].readonly; 1537 copy = true; 1538 } 1539 } 1540 } 1541 1542 return allow ? (copy ? 2 : 1) : 0; 1522 1543 }; 1523 1544 … … 3634 3655 cid = this.contact_list.get_selection().join(','); 3635 3656 3636 if (to.type == 'group') 3637 this.http_post('group-addmembers', '_cid='+urlencode(cid)+'&_source='+urlencode(this.env.source)+'&_gid='+urlencode(to.id)); 3638 else if (to.id != this.env.source && cid && this.env.address_sources[to.id] && !this.env.address_sources[to.id].readonly) 3639 this.http_post('copy', '_cid='+urlencode(cid)+'&_source='+urlencode(this.env.source)+'&_to='+urlencode(to.id)+(this.env.group ? '&_gid='+urlencode(this.env.group) : '')); 3657 if (to.type == 'group' && to.source == this.env.source) { 3658 this.http_post('group-addmembers', '_cid='+urlencode(cid) 3659 + '&_source='+urlencode(this.env.source) 3660 + '&_gid='+urlencode(to.id)); 3661 } 3662 else if (to.type == 'group' && !this.env.address_sources[to.source].readonly) { 3663 this.http_post('copy', '_cid='+urlencode(cid) 3664 + '&_source='+urlencode(this.env.source) 3665 + '&_to='+urlencode(to.source) 3666 + '&_togid='+urlencode(to.id) 3667 + (this.env.group ? '&_gid='+urlencode(this.env.group) : '')); 3668 } 3669 else if (to.id != this.env.source && cid && this.env.address_sources[to.id] && !this.env.address_sources[to.id].readonly) { 3670 this.http_post('copy', '_cid='+urlencode(cid) 3671 + '&_source='+urlencode(this.env.source) 3672 + '&_to='+urlencode(to.id) 3673 + (this.env.group ? '&_gid='+urlencode(this.env.group) : '')); 3674 } 3640 3675 }; 3641 3676 -
program/steps/addressbook/copy.inc
re095094 rca38db5 26 26 $cid = get_input_value('_cid', RCUBE_INPUT_POST); 27 27 $target = get_input_value('_to', RCUBE_INPUT_POST); 28 $target_group = get_input_value('_togid', RCUBE_INPUT_POST); 28 29 29 30 if ($cid && preg_match('/^[a-z0-9\-_=]+(,[a-z0-9\-_=]+)*$/i', $cid) && strlen($target) && $target !== $source) … … 33 34 34 35 if ($TARGET && $TARGET->ready && !$TARGET->readonly) { 36 if ($target_group && $TARGET->groups) 37 $TARGET->set_group($target_group); 38 35 39 $arr_cids = explode(',', $cid); 36 40 foreach ($arr_cids as $cid) { 37 $plugin = $RCMAIL->plugins->exec_hook('create_contact', array('record' => $CONTACTS->get_record($cid, true), 'source' => $target)); 38 $a_record = $plugin['record']; 41 $plugin = $RCMAIL->plugins->exec_hook('create_contact', array( 42 'record' => $CONTACTS->get_record($cid, true), 43 'source' => $target, 44 'group' => $target_group, 45 )); 46 $a_record = $plugin['record']; 39 47 40 if (!$plugin['abort'])48 if (!$plugin['abort']) 41 49 if ($TARGET->insert($a_record, true)) 42 50 $success++; -
skins/default/common.css
r35a39020 rca38db5 511 511 font-size: 11px; 512 512 white-space: nowrap; 513 opacity: 0.7; 513 opacity: 0.82; 514 border-radius: 3px; 515 -moz-border-radius: 3px; 516 -webkit-border-radius: 3px; 517 -moz-box-shadow: 1px 1px 12px #999; 518 -webkit-box-shadow: #999 1px 1px 12px; 519 } 520 521 .draglayernormal:before { 522 523 } 524 525 .draglayercopy:before { 526 position: absolute; 527 bottom: -5px; 528 left: -6px; 529 content: " "; 530 width: 14px; 531 height: 14px; 532 background: url(images/messageactions.png) -2px -128px no-repeat; 514 533 } 515 534 -
skins/default/ie6hacks.css
r98ef63c rca38db5 70 70 padding-bottom: 8px; 71 71 } 72 73 .draglayercopy:before { 74 background-image: url(images/messageactions.png); 75 }
Note: See TracChangeset
for help on using the changeset viewer.
