ts('- select group -')) + CRM_Core_PseudoConstant::group(); $groupElement = $this->add('select', 'group_id', ts('Select Group'), $group, TRUE); CRM_Utils_System::setTitle(ts('Remove Contacts from Group')); $this->addDefaultButtons(ts('Remove from Group')); } /** * Set the default form values * * @access protected * * @return array the default array reference */ function setDefaultValues() { $defaults = array(); if ($this->get('context') === 'smog') { $defaults['group_id'] = $this->get('gid'); } return $defaults; } /** * process the form after the input has been submitted and validated * * @access public * * @return void */ public function postProcess() { $groupId = $this->controller->exportValue('RemoveFromGroup', 'group_id'); $group = CRM_Core_PseudoConstant::group(); list($total, $removed, $notRemoved) = CRM_Contact_BAO_GroupContact::removeContactsFromGroup($this->_contactIds, $groupId); $status = array(ts("%count contact removed from '%2'", array('count' => $removed, 'plural' => "%count contacts removed from '%2'", 2 => $group[$groupId]))); if ($notRemoved) { $status[] = ts('1 contact was already not in this group', array('count' => $notRemoved, 'plural' => '%count contacts were already not in this group')); } $status = '