Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: CRM/Report/Form.php
- ===================================================================
- --- CRM/Report/Form.php (revision 41947)
- +++ CRM/Report/Form.php (working copy)
- @@ -891,6 +891,11 @@
- array('' => ts('- select group -')) + CRM_Core_PseudoConstant::staticGroup()
- );
- $this->assign('group', TRUE);
- + if(is_array($this->_contactTables) && count($this->_contactTables > 1)){
- + $this->addElement('select', 'btn_group_contact', ts('Contact to Add'),
- + array('' => ts('- choose contact -')) + $this->_contactTables
- + );
- + }
- }
- $label = ts('Add these Contacts to Group');
- @@ -3109,11 +3114,15 @@
- }
- function add2group($groupID) {
- - if (is_numeric($groupID) && isset($this->_aliases['civicrm_contact'])) {
- - $select = "SELECT DISTINCT {$this->_aliases['civicrm_contact']}.id AS addtogroup_contact_id, ";
- - $select = str_ireplace('SELECT SQL_CALC_FOUND_ROWS ', $select, $this->_select);
- + if (is_numeric($groupID) && isset($this->_aliases['honor_civicrm_contact'])) {
- + require_once 'CRM/Contact/BAO/GroupContact.php';
- - $sql = "{$select} {$this->_from} {$this->_where} {$this->_groupBy} {$this->_having} {$this->_orderBy}";
- + $contact = $this->_submitValues['btn_group_contact'];
- + $select = "SELECT DISTINCT {$this->_aliases[$contact]}.id AS addtogroup_contact_id";
- + // $select = str_ireplace('SELECT SQL_CALC_FOUND_ROWS ', $select, $this->_select);
- +
- + $sql = "{$select} {$this->_from} {$this->_where} AND {$this->_aliases[$contact]}.id IS NOT NULL {$this->_groupBy} {$this->_having} {$this->_orderBy}";
- +
- $dao = CRM_Core_DAO::executeQuery($sql);
- $contact_ids = array();
- Index: templates/CRM/Report/Form/Actions.tpl
- ===================================================================
- --- templates/CRM/Report/Form/Actions.tpl (revision 41947)
- +++ templates/CRM/Report/Form/Actions.tpl (working copy)
- @@ -48,13 +48,19 @@
- </table>
- </td>
- <td>
- - <table class="form-layout-compressed" align="right">
- + <table class="form-layout-compressed" align="right">
- {if $chartSupported}
- <tr>
- <td>{$form.charts.html|crmReplace:class:big}</td>
- <td align="right">{$form.$chart.html}</td>
- </tr>
- {/if}
- + {if $form.btn_group_contact}
- + <tr>
- + <td>{$form.btn_group_contact.html|crmReplace:class:big}</td>
- + <td align="right">{$form.$btn_group_contact.html}</td>
- + </tr>
- + {/if}
- {if $form.groups}
- <tr>
- <td>{$form.groups.html|crmReplace:class:big}</td>
Advertisement
Add Comment
Please, Sign In to add comment