Changeset 8458c7ca in github


Ignore:
Timestamp:
Jan 23, 2011 1:10:40 PM (2 years ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
c6be456
Parents:
06670e4
Message:

When creating a new contact, add it to the selected group; consider the selected group when deleting a contact

Location:
program
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • program/js/app.js

    rde06fc3 r8458c7ca  
    37663766        this.show_contentframe(false); 
    37673767    } 
     3768 
     3769    if (this.env.group) 
     3770      qs += '&_gid='+urlencode(this.env.group); 
    37683771 
    37693772    // also send search request to get the right records from the next page 
  • program/steps/addressbook/save.inc

    r0501b63 r8458c7ca  
    132132  $a_record['name'] = join(' ', array_filter(array($a_record['prefix'], $a_record['firstname'], $a_record['middlename'], $a_record['surname'], $a_record['suffix'],))); 
    133133 
    134 #var_dump($a_record); 
    135134 
    136135// Basic input checks (TODO: delegate to $CONTACTS instance) 
     
    243242 
    244243  if ($insert_id) { 
     244    // add new contact to the specified group 
     245    if ($CONTACTS->group_id) { 
     246      $plugin = $RCMAIL->plugins->exec_hook('group_addmembers', array('group_id' => $CONTACTS->group_id, 'ids' => $insert_id, 'source' => $source)); 
     247 
     248      if (!$plugin['abort']) { 
     249        if (($maxnum = $RCMAIL->config->get('max_group_members', 0)) && ($CONTACTS->count()->count + 1 > $maxnum)) 
     250          $OUTPUT->show_message('maxgroupmembersreached', 'warning', array('max' => $maxnum)); 
     251 
     252        $CONTACTS->add_to_group($gid, $plugin['ids']); 
     253      } 
     254    } 
     255     
    245256    // add contact row or jump to the page where it should appear 
    246257    $CONTACTS->reset(); 
Note: See TracChangeset for help on using the changeset viewer.