Skip to content

Commit

Permalink
CRM-21128 Personal Campaign Page selection with force=1 in Find Contr…
Browse files Browse the repository at this point in the history
…ibutions (#8997)

* Personal Campaign can now be passed in force mode

Passing pcpid=n with force=1 alloow to search on corresponding Personal
Campaign id

* Improves parameter passing

Now cope with both single value form (pcpid=n) and multivalue form
(pcpid[]=n&pcpid[]=m)

* Removed useless ++$n

* Fixed checkstyle warnings

* Operator spacing and comment indentation
  • Loading branch information
alar77 authored and eileenmcnaughton committed Sep 1, 2017
1 parent 4c46020 commit 29d72d9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CRM/Contribute/Form/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,16 @@ public function fixFormValues() {
$this->_defaults['contribution_status_id'] = array($status => 1);
}

$pcpid = (array) CRM_Utils_Request::retrieve('pcpid', 'String', $this);
if ($pcpid) {
// Add new pcpid to the tail of the array...
foreach ($pcpid as $pcpIdList) {
$this->_formValues['contribution_pcp_made_through_id'][] = $pcpIdList;
}
// and avoid any duplicate
$this->_formValues['contribution_pcp_made_through_id'] = array_unique($this->_formValues['contribution_pcp_made_through_id']);
}

$cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this);

if ($cid) {
Expand Down

0 comments on commit 29d72d9

Please sign in to comment.