{"action":"created","comment":{"url":"https://api.github.com/repos/civicrm/civicrm-core/pulls/comments/67952018","id":67952018,"diff_hunk":"@@ -931,5 +931,286 @@ public static function getOwnerNotificationId($component_id, $component = 'contr\n       return $ownerNotificationId;\n     }\n   }\n+\t\n+\t/**\n+   * wrapper for ajax pcp selector.\n+   *\n+   * @param array $params\n+   *   Associated array for params record id.\n+   *\n+   * @return array\n+   *   associated array of pcp list\n+   *   -rp = rowcount\n+   *   -page= offset\n+   * @todo there seems little reason for the small number of functions that call this to pass in\n+   * params that then need to be translated in this function since they are coding them when calling\n+   */\n+  static public function getPcpListSelector(&$params) {\n+    // format the params\n+    $params['offset'] = ($params['page'] - 1) * $params['rp'];\n+    $params['rowCount'] = $params['rp'];\n+    $params['sort'] = CRM_Utils_Array::value('sortBy', $params);\n+\n+    // get pcps\n+    $pcps = CRM_PCP_BAO_PCP::getPcpList($params);\n+    $params['total'] = CRM_PCP_BAO_PCP::getPcpCount($params);\n+\n+    // format params and add links\n+    $pcpList = array();\n+    if (!empty($pcps)) {\n+      foreach ($pcps as $id => $value) {\n+        $value['class'][] = 'crm-entity';\n+        $pcpList[$id]['class'] = $value['id'] . ',' . implode(' ', $value['class']);\n+        $pcpList[$id]['pcp_id'] = $value['id'];\n+        $pcpList[$id]['pcp_name'] = $value['pcp_title'];\n+        $value['class'][] = 'crm-entity';\n+        $pcpList[$id]['class'] = $value['id'] . ',' . implode(' ', $value['class']);\n+        $pcpList[$id]['pcp_supporter'] = CRM_Utils_Array::value('pcp_supporter', $value);\n+        $pcpList[$id]['pcp_page'] = CRM_Utils_Array::value('pcp_page', $value);\n+        $pcpList[$id]['pcp_start_date'] = CRM_Utils_Array::value('pcp_start_date', $value);\n+        $pcpList[$id]['pcp_end_date'] = CRM_Utils_Array::value('pcp_end_date', $value) ? $value['pcp_end_date'] : '(ongoing)';\n+        $pcpList[$id]['pcp_status'] = CRM_Utils_Array::value('pcp_status', $value);\n+        $pcpList[$id]['action'] = CRM_Utils_Array::value('action', $value);\n+      }\n+      return $pcpList;\n+    }\n+  }\n+  \n+    /**\n+   * This function to get list of pcps.\n+   *\n+   * @param array $params\n+   *   Associated array for params.\n+   *\n+   * @return array\n+   */\n+  public static function getPcpList(&$params) {\n+    $config = CRM_Core_Config::singleton();\n+\n+    $whereClause = self::whereClause($params, FALSE);\n+\n+    //$this->pagerAToZ( $whereClause, $params );\n+\n+    if (!empty($params['rowCount']) &&\n+      $params['rowCount'] > 0\n+    ) {\n+      $limit = \" LIMIT {$params['offset']}, {$params['rowCount']} \";\n+    }\n+\n+    $orderBy = ' ORDER BY pcps.title asc';\n+    if (!empty($params['sort'])) {\n+      $orderBy = ' ORDER BY ' . CRM_Utils_Type::escape($params['sort'], 'String');","path":"CRM/PCP/BAO/PCP.php","position":72,"original_position":72,"commit_id":"a47ad209214649dc96a5be8395f2862a54f0915d","original_commit_id":"a47ad209214649dc96a5be8395f2862a54f0915d","user":{"login":"eileenmcnaughton","id":336308,"avatar_url":"https://avatars.githubusercontent.com/u/336308?v=3","gravatar_id":"","url":"https://api.github.com/users/eileenmcnaughton","html_url":"https://github.com/eileenmcnaughton","followers_url":"https://api.github.com/users/eileenmcnaughton/followers","following_url":"https://api.github.com/users/eileenmcnaughton/following{/other_user}","gists_url":"https://api.github.com/users/eileenmcnaughton/gists{/gist_id}","starred_url":"https://api.github.com/users/eileenmcnaughton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eileenmcnaughton/subscriptions","organizations_url":"https://api.github.com/users/eileenmcnaughton/orgs","repos_url":"https://api.github.com/users/eileenmcnaughton/repos","events_url":"https://api.github.com/users/eileenmcnaughton/events{/privacy}","received_events_url":"https://api.github.com/users/eileenmcnaughton/received_events","type":"User","site_admin":false},"body":"There is now a special escaping function on the CRM_Utils_Type class for use with ORDER BY","created_at":"2016-06-21T21:07:43Z","updated_at":"2016-06-21T21:07:43Z","html_url":"https://github.com/civicrm/civicrm-core/pull/8045#discussion_r67952018","pull_request_url":"https://api.github.com/repos/civicrm/civicrm-core/pulls/8045","_links":{"self":{"href":"https://api.github.com/repos/civicrm/civicrm-core/pulls/comments/67952018"},"html":{"href":"https://github.com/civicrm/civicrm-core/pull/8045#discussion_r67952018"},"pull_request":{"href":"https://api.github.com/repos/civicrm/civicrm-core/pulls/8045"}}},"pull_request":{"url":"https://api.github.com/repos/civicrm/civicrm-core/pulls/8045","id":64643135,"html_url":"https://github.com/civicrm/civicrm-core/pull/8045","diff_url":"https://github.com/civicrm/civicrm-core/pull/8045.diff","patch_url":"https://github.com/civicrm/civicrm-core/pull/8045.patch","issue_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/8045","number":8045,"state":"open","locked":false,"title":"CRM-18323- PCP Search implementation like group search","user":{"login":"Kajakaran","id":7429798,"avatar_url":"https://avatars.githubusercontent.com/u/7429798?v=3","gravatar_id":"","url":"https://api.github.com/users/Kajakaran","html_url":"https://github.com/Kajakaran","followers_url":"https://api.github.com/users/Kajakaran/followers","following_url":"https://api.github.com/users/Kajakaran/following{/other_user}","gists_url":"https://api.github.com/users/Kajakaran/gists{/gist_id}","starred_url":"https://api.github.com/users/Kajakaran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kajakaran/subscriptions","organizations_url":"https://api.github.com/users/Kajakaran/orgs","repos_url":"https://api.github.com/users/Kajakaran/repos","events_url":"https://api.github.com/users/Kajakaran/events{/privacy}","received_events_url":"https://api.github.com/users/Kajakaran/received_events","type":"User","site_admin":false},"body":"PCP Search screen improved similar to Group Search screen\r\n\r\nissue:- If we have too many Personal Campaign Pages, server crashes because search page brings all PCPs every time we navigate to PCP search\r\n\r\nFurther, PCP search screen has lack of filters like PCP supporter Name, PCP title, Event/Contribution starts, Event/Contribution Ends on and etc. \r\n\r\n\r\n\r\nhttps://issues.civicrm.org/jira/browse/CRM-18323","created_at":"2016-03-30T15:06:08Z","updated_at":"2016-06-21T21:07:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fdc712568e49ca8f16afd98db1a70b15705cc7b0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/civicrm/civicrm-core/pulls/8045/commits","review_comments_url":"https://api.github.com/repos/civicrm/civicrm-core/pulls/8045/comments","review_comment_url":"https://api.github.com/repos/civicrm/civicrm-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/8045/comments","statuses_url":"https://api.github.com/repos/civicrm/civicrm-core/statuses/a47ad209214649dc96a5be8395f2862a54f0915d","head":{"label":"Kajakaran:pcp_search","ref":"pcp_search","sha":"a47ad209214649dc96a5be8395f2862a54f0915d","user":{"login":"Kajakaran","id":7429798,"avatar_url":"https://avatars.githubusercontent.com/u/7429798?v=3","gravatar_id":"","url":"https://api.github.com/users/Kajakaran","html_url":"https://github.com/Kajakaran","followers_url":"https://api.github.com/users/Kajakaran/followers","following_url":"https://api.github.com/users/Kajakaran/following{/other_user}","gists_url":"https://api.github.com/users/Kajakaran/gists{/gist_id}","starred_url":"https://api.github.com/users/Kajakaran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kajakaran/subscriptions","organizations_url":"https://api.github.com/users/Kajakaran/orgs","repos_url":"https://api.github.com/users/Kajakaran/repos","events_url":"https://api.github.com/users/Kajakaran/events{/privacy}","received_events_url":"https://api.github.com/users/Kajakaran/received_events","type":"User","site_admin":false},"repo":{"id":19678717,"name":"civicrm-core","full_name":"Kajakaran/civicrm-core","owner":{"login":"Kajakaran","id":7429798,"avatar_url":"https://avatars.githubusercontent.com/u/7429798?v=3","gravatar_id":"","url":"https://api.github.com/users/Kajakaran","html_url":"https://github.com/Kajakaran","followers_url":"https://api.github.com/users/Kajakaran/followers","following_url":"https://api.github.com/users/Kajakaran/following{/other_user}","gists_url":"https://api.github.com/users/Kajakaran/gists{/gist_id}","starred_url":"https://api.github.com/users/Kajakaran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kajakaran/subscriptions","organizations_url":"https://api.github.com/users/Kajakaran/orgs","repos_url":"https://api.github.com/users/Kajakaran/repos","events_url":"https://api.github.com/users/Kajakaran/events{/privacy}","received_events_url":"https://api.github.com/users/Kajakaran/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Kajakaran/civicrm-core","description":"CiviCRM (Core Application and Framework)","fork":true,"url":"https://api.github.com/repos/Kajakaran/civicrm-core","forks_url":"https://api.github.com/repos/Kajakaran/civicrm-core/forks","keys_url":"https://api.github.com/repos/Kajakaran/civicrm-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Kajakaran/civicrm-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Kajakaran/civicrm-core/teams","hooks_url":"https://api.github.com/repos/Kajakaran/civicrm-core/hooks","issue_events_url":"https://api.github.com/repos/Kajakaran/civicrm-core/issues/events{/number}","events_url":"https://api.github.com/repos/Kajakaran/civicrm-core/events","assignees_url":"https://api.github.com/repos/Kajakaran/civicrm-core/assignees{/user}","branches_url":"https://api.github.com/repos/Kajakaran/civicrm-core/branches{/branch}","tags_url":"https://api.github.com/repos/Kajakaran/civicrm-core/tags","blobs_url":"https://api.github.com/repos/Kajakaran/civicrm-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Kajakaran/civicrm-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Kajakaran/civicrm-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/Kajakaran/civicrm-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Kajakaran/civicrm-core/statuses/{sha}","languages_url":"https://api.github.com/repos/Kajakaran/civicrm-core/languages","stargazers_url":"https://api.github.com/repos/Kajakaran/civicrm-core/stargazers","contributors_url":"https://api.github.com/repos/Kajakaran/civicrm-core/contributors","subscribers_url":"https://api.github.com/repos/Kajakaran/civicrm-core/subscribers","subscription_url":"https://api.github.com/repos/Kajakaran/civicrm-core/subscription","commits_url":"https://api.github.com/repos/Kajakaran/civicrm-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/Kajakaran/civicrm-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/Kajakaran/civicrm-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/Kajakaran/civicrm-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/Kajakaran/civicrm-core/contents/{+path}","compare_url":"https://api.github.com/repos/Kajakaran/civicrm-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Kajakaran/civicrm-core/merges","archive_url":"https://api.github.com/repos/Kajakaran/civicrm-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Kajakaran/civicrm-core/downloads","issues_url":"https://api.github.com/repos/Kajakaran/civicrm-core/issues{/number}","pulls_url":"https://api.github.com/repos/Kajakaran/civicrm-core/pulls{/number}","milestones_url":"https://api.github.com/repos/Kajakaran/civicrm-core/milestones{/number}","notifications_url":"https://api.github.com/repos/Kajakaran/civicrm-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Kajakaran/civicrm-core/labels{/name}","releases_url":"https://api.github.com/repos/Kajakaran/civicrm-core/releases{/id}","deployments_url":"https://api.github.com/repos/Kajakaran/civicrm-core/deployments","created_at":"2014-05-11T22:07:36Z","updated_at":"2016-02-24T17:12:00Z","pushed_at":"2016-03-30T14:39:00Z","git_url":"git://github.com/Kajakaran/civicrm-core.git","ssh_url":"git@github.com:Kajakaran/civicrm-core.git","clone_url":"https://github.com/Kajakaran/civicrm-core.git","svn_url":"https://github.com/Kajakaran/civicrm-core","homepage":null,"size":119973,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"civicrm:master","ref":"master","sha":"6ffd3f44524a23c86cfecf2e38f99aebcb1527f1","user":{"login":"civicrm","id":136373,"avatar_url":"https://avatars.githubusercontent.com/u/136373?v=3","gravatar_id":"","url":"https://api.github.com/users/civicrm","html_url":"https://github.com/civicrm","followers_url":"https://api.github.com/users/civicrm/followers","following_url":"https://api.github.com/users/civicrm/following{/other_user}","gists_url":"https://api.github.com/users/civicrm/gists{/gist_id}","starred_url":"https://api.github.com/users/civicrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/civicrm/subscriptions","organizations_url":"https://api.github.com/users/civicrm/orgs","repos_url":"https://api.github.com/users/civicrm/repos","events_url":"https://api.github.com/users/civicrm/events{/privacy}","received_events_url":"https://api.github.com/users/civicrm/received_events","type":"Organization","site_admin":false},"repo":{"id":8495499,"name":"civicrm-core","full_name":"civicrm/civicrm-core","owner":{"login":"civicrm","id":136373,"avatar_url":"https://avatars.githubusercontent.com/u/136373?v=3","gravatar_id":"","url":"https://api.github.com/users/civicrm","html_url":"https://github.com/civicrm","followers_url":"https://api.github.com/users/civicrm/followers","following_url":"https://api.github.com/users/civicrm/following{/other_user}","gists_url":"https://api.github.com/users/civicrm/gists{/gist_id}","starred_url":"https://api.github.com/users/civicrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/civicrm/subscriptions","organizations_url":"https://api.github.com/users/civicrm/orgs","repos_url":"https://api.github.com/users/civicrm/repos","events_url":"https://api.github.com/users/civicrm/events{/privacy}","received_events_url":"https://api.github.com/users/civicrm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/civicrm/civicrm-core","description":"CiviCRM (Core Application and Framework)","fork":false,"url":"https://api.github.com/repos/civicrm/civicrm-core","forks_url":"https://api.github.com/repos/civicrm/civicrm-core/forks","keys_url":"https://api.github.com/repos/civicrm/civicrm-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/civicrm/civicrm-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/civicrm/civicrm-core/teams","hooks_url":"https://api.github.com/repos/civicrm/civicrm-core/hooks","issue_events_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/events{/number}","events_url":"https://api.github.com/repos/civicrm/civicrm-core/events","assignees_url":"https://api.github.com/repos/civicrm/civicrm-core/assignees{/user}","branches_url":"https://api.github.com/repos/civicrm/civicrm-core/branches{/branch}","tags_url":"https://api.github.com/repos/civicrm/civicrm-core/tags","blobs_url":"https://api.github.com/repos/civicrm/civicrm-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/civicrm/civicrm-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/civicrm/civicrm-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/civicrm/civicrm-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/civicrm/civicrm-core/statuses/{sha}","languages_url":"https://api.github.com/repos/civicrm/civicrm-core/languages","stargazers_url":"https://api.github.com/repos/civicrm/civicrm-core/stargazers","contributors_url":"https://api.github.com/repos/civicrm/civicrm-core/contributors","subscribers_url":"https://api.github.com/repos/civicrm/civicrm-core/subscribers","subscription_url":"https://api.github.com/repos/civicrm/civicrm-core/subscription","commits_url":"https://api.github.com/repos/civicrm/civicrm-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/civicrm/civicrm-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/civicrm/civicrm-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/civicrm/civicrm-core/contents/{+path}","compare_url":"https://api.github.com/repos/civicrm/civicrm-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/civicrm/civicrm-core/merges","archive_url":"https://api.github.com/repos/civicrm/civicrm-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/civicrm/civicrm-core/downloads","issues_url":"https://api.github.com/repos/civicrm/civicrm-core/issues{/number}","pulls_url":"https://api.github.com/repos/civicrm/civicrm-core/pulls{/number}","milestones_url":"https://api.github.com/repos/civicrm/civicrm-core/milestones{/number}","notifications_url":"https://api.github.com/repos/civicrm/civicrm-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/civicrm/civicrm-core/labels{/name}","releases_url":"https://api.github.com/repos/civicrm/civicrm-core/releases{/id}","deployments_url":"https://api.github.com/repos/civicrm/civicrm-core/deployments","created_at":"2013-03-01T06:11:56Z","updated_at":"2016-06-16T21:58:21Z","pushed_at":"2016-06-21T20:52:08Z","git_url":"git://github.com/civicrm/civicrm-core.git","ssh_url":"git@github.com:civicrm/civicrm-core.git","clone_url":"https://github.com/civicrm/civicrm-core.git","svn_url":"https://github.com/civicrm/civicrm-core","homepage":null,"size":164124,"stargazers_count":157,"watchers_count":157,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":429,"mirror_url":null,"open_issues_count":131,"forks":429,"open_issues":131,"watchers":157,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/civicrm/civicrm-core/pulls/8045"},"html":{"href":"https://github.com/civicrm/civicrm-core/pull/8045"},"issue":{"href":"https://api.github.com/repos/civicrm/civicrm-core/issues/8045"},"comments":{"href":"https://api.github.com/repos/civicrm/civicrm-core/issues/8045/comments"},"review_comments":{"href":"https://api.github.com/repos/civicrm/civicrm-core/pulls/8045/comments"},"review_comment":{"href":"https://api.github.com/repos/civicrm/civicrm-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/civicrm/civicrm-core/pulls/8045/commits"},"statuses":{"href":"https://api.github.com/repos/civicrm/civicrm-core/statuses/a47ad209214649dc96a5be8395f2862a54f0915d"}}}}
{"actor":{"display_login":"eileenmcnaughton"}}