{"action":"closed","number":821,"pull_request":{"url":"https://api.github.com/repos/civicrm/civihr/pulls/821","id":55769227,"html_url":"https://github.com/civicrm/civihr/pull/821","diff_url":"https://github.com/civicrm/civihr/pull/821.diff","patch_url":"https://github.com/civicrm/civihr/pull/821.patch","issue_url":"https://api.github.com/repos/civicrm/civihr/issues/821","number":821,"state":"closed","locked":false,"title":"Pchr 777 custom calculation api calls","user":{"login":"coldrunKacper","id":8986209,"avatar_url":"https://avatars.githubusercontent.com/u/8986209?v=3","gravatar_id":"","url":"https://api.github.com/users/coldrunKacper","html_url":"https://github.com/coldrunKacper","followers_url":"https://api.github.com/users/coldrunKacper/followers","following_url":"https://api.github.com/users/coldrunKacper/following{/other_user}","gists_url":"https://api.github.com/users/coldrunKacper/gists{/gist_id}","starred_url":"https://api.github.com/users/coldrunKacper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coldrunKacper/subscriptions","organizations_url":"https://api.github.com/users/coldrunKacper/orgs","repos_url":"https://api.github.com/users/coldrunKacper/repos","events_url":"https://api.github.com/users/coldrunKacper/events{/privacy}","received_events_url":"https://api.github.com/users/coldrunKacper/received_events","type":"User","site_admin":false},"body":"Adding two custom API calls for AppraisalCycle entity.\r\n\r\n//// 1. Getting distribution of cycle's appraisals by step:\r\n// Returns the number of appraisals belonging to the specific Appraisal Cycle ID,\r\n// distributed by step.\r\n\r\n// JavaScript usage example:\r\n```javascript\r\nCRM.api3('AppraisalCycle', 'getappraisalsperstep', {\r\n  \"sequential\": 1,\r\n  \"appraisal_cycle_id\": 1,  // required\r\n  \"include_appraisals\": 1   // optional, default = 0\r\n}).done(function(result) {\r\n  // do something\r\n});\r\n```\r\n// response example:\r\n```javascript\r\n{\r\n\t\"is_error\":0,\r\n\t\"version\":3,\r\n\t\"count\":2,\r\n\t\"values\":[{\r\n\t\t\"status_id\":\"1\",\r\n\t\t\"status_name\":\"Awaiting self appraisal\",\r\n\t\t\"appraisals_count\":\"3\",\r\n\t\t\"appraisals\":[{  // \"appraisals\" array appear only when passing \"include_appraisals\" = 1\r\n\t\t\t// appraisal 1\r\n\t\t},\r\n\t\t{\r\n\t\t\t// appraisal 2\r\n\t\t},\r\n\t\t{\r\n\t\t\t// appraisal 3\r\n\t\t}]\r\n\t},\r\n\t{\r\n\t\t\"status_id\":\"2\",\r\n\t\t\"status_name\":\"Awaiting manager appraisal\",\r\n\t\t\"appraisals_count\":\"1\",\r\n\t\t\"appraisals\":[{  // \"appraisals\" array appear only when passing \"include_appraisals\" = 1\r\n\t\t\t// appraisal 4\r\n\t\t}]\r\n\t}]\r\n}\r\n```\r\n\r\n//// 2. Getting Status Overview:\r\n// Returns a list of all the possible cycle steps/status, containing for each of them\r\n// the number of due and overdue contacts. The appraisals to be counted are only those\r\n// belonging to active cycles.\r\n\r\n// JavaScript usage example:\r\n```javascript\r\nCRM.api3('AppraisalCycle', 'getstatusoverview', {\r\n  \"sequential\": 1\r\n}).done(function(result) {\r\n  // do something\r\n});\r\n```\r\n\r\n// response example:\r\n```javascript\r\n{\r\n\t\"is_error\":0,\r\n\t\"version\":3,\r\n\t\"count\":5,\r\n\t\"values\":[{\r\n\t\t\"status_id\":1,\r\n\t\t\"status_name\":\"Awaiting self appraisal\",\r\n\t\t\"contacts_count\":{\r\n\t\t\t\"due\":0,\r\n\t\t\t\"overdue\":10\r\n\t\t}\r\n\t},\r\n\t{\r\n\t\t\"status_id\":2,\r\n\t\t\"status_name\":\"Awaiting manager appraisal\",\r\n\t\t\"contacts_count\":{\r\n\t\t\t\"due\":2,\r\n\t\t\t\"overdue\":3\r\n\t\t}\r\n\t},\r\n\t{\r\n\t\t\"status_id\":3,\r\n\t\t\"status_name\":\"Awaiting grade\",\r\n\t\t\"contacts_count\":{\r\n\t\t\t\"due\":0,\r\n\t\t\t\"overdue\":7\r\n\t\t}\r\n\t},\r\n\t{\r\n\t\t\"status_id\":4,\r\n\t\t\"status_name\":\"Awaiting HR approval\",\r\n\t\t\"contacts_count\":{\r\n\t\t\t\"due\":6,\r\n\t\t\t\"overdue\":0\r\n\t\t}\r\n\t},\r\n\t{\r\n\t\t\"status_id\":5,\r\n\t\t\"status_name\":\"Complete\",\r\n\t\t\"contacts_count\":{\r\n\t\t\t\"due\":6,\r\n\t\t\t\"overdue\":0\r\n\t\t}\r\n\t}]\r\n}\r\n```","created_at":"2016-01-12T15:05:02Z","updated_at":"2016-01-13T12:31:37Z","closed_at":"2016-01-13T12:31:37Z","merged_at":"2016-01-13T12:31:37Z","merge_commit_sha":"285b0275ce7c7a5cfb9a9da834e8b410c69938dc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/civicrm/civihr/pulls/821/commits","review_comments_url":"https://api.github.com/repos/civicrm/civihr/pulls/821/comments","review_comment_url":"https://api.github.com/repos/civicrm/civihr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/civicrm/civihr/issues/821/comments","statuses_url":"https://api.github.com/repos/civicrm/civihr/statuses/9ca3fb49a84ef203d4b67d2a00244d990422ad9d","head":{"label":"civicrm:PCHR-777-custom-calculation-api-calls","ref":"PCHR-777-custom-calculation-api-calls","sha":"9ca3fb49a84ef203d4b67d2a00244d990422ad9d","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":10086903,"name":"civihr","full_name":"civicrm/civihr","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/civihr","description":"CiviHR","fork":false,"url":"https://api.github.com/repos/civicrm/civihr","forks_url":"https://api.github.com/repos/civicrm/civihr/forks","keys_url":"https://api.github.com/repos/civicrm/civihr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/civicrm/civihr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/civicrm/civihr/teams","hooks_url":"https://api.github.com/repos/civicrm/civihr/hooks","issue_events_url":"https://api.github.com/repos/civicrm/civihr/issues/events{/number}","events_url":"https://api.github.com/repos/civicrm/civihr/events","assignees_url":"https://api.github.com/repos/civicrm/civihr/assignees{/user}","branches_url":"https://api.github.com/repos/civicrm/civihr/branches{/branch}","tags_url":"https://api.github.com/repos/civicrm/civihr/tags","blobs_url":"https://api.github.com/repos/civicrm/civihr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/civicrm/civihr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/civicrm/civihr/git/refs{/sha}","trees_url":"https://api.github.com/repos/civicrm/civihr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/civicrm/civihr/statuses/{sha}","languages_url":"https://api.github.com/repos/civicrm/civihr/languages","stargazers_url":"https://api.github.com/repos/civicrm/civihr/stargazers","contributors_url":"https://api.github.com/repos/civicrm/civihr/contributors","subscribers_url":"https://api.github.com/repos/civicrm/civihr/subscribers","subscription_url":"https://api.github.com/repos/civicrm/civihr/subscription","commits_url":"https://api.github.com/repos/civicrm/civihr/commits{/sha}","git_commits_url":"https://api.github.com/repos/civicrm/civihr/git/commits{/sha}","comments_url":"https://api.github.com/repos/civicrm/civihr/comments{/number}","issue_comment_url":"https://api.github.com/repos/civicrm/civihr/issues/comments{/number}","contents_url":"https://api.github.com/repos/civicrm/civihr/contents/{+path}","compare_url":"https://api.github.com/repos/civicrm/civihr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/civicrm/civihr/merges","archive_url":"https://api.github.com/repos/civicrm/civihr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/civicrm/civihr/downloads","issues_url":"https://api.github.com/repos/civicrm/civihr/issues{/number}","pulls_url":"https://api.github.com/repos/civicrm/civihr/pulls{/number}","milestones_url":"https://api.github.com/repos/civicrm/civihr/milestones{/number}","notifications_url":"https://api.github.com/repos/civicrm/civihr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/civicrm/civihr/labels{/name}","releases_url":"https://api.github.com/repos/civicrm/civihr/releases{/id}","created_at":"2013-05-15T20:06:06Z","updated_at":"2016-01-11T10:33:03Z","pushed_at":"2016-01-13T12:31:37Z","git_url":"git://github.com/civicrm/civihr.git","ssh_url":"git@github.com:civicrm/civihr.git","clone_url":"https://github.com/civicrm/civihr.git","svn_url":"https://github.com/civicrm/civihr","homepage":null,"size":17328,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":3,"forks":19,"open_issues":3,"watchers":1,"default_branch":"develop"}},"base":{"label":"civicrm:develop","ref":"develop","sha":"82e3d74b95d4c4eb12a553fc1fba2f9b48ce85e9","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":10086903,"name":"civihr","full_name":"civicrm/civihr","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/civihr","description":"CiviHR","fork":false,"url":"https://api.github.com/repos/civicrm/civihr","forks_url":"https://api.github.com/repos/civicrm/civihr/forks","keys_url":"https://api.github.com/repos/civicrm/civihr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/civicrm/civihr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/civicrm/civihr/teams","hooks_url":"https://api.github.com/repos/civicrm/civihr/hooks","issue_events_url":"https://api.github.com/repos/civicrm/civihr/issues/events{/number}","events_url":"https://api.github.com/repos/civicrm/civihr/events","assignees_url":"https://api.github.com/repos/civicrm/civihr/assignees{/user}","branches_url":"https://api.github.com/repos/civicrm/civihr/branches{/branch}","tags_url":"https://api.github.com/repos/civicrm/civihr/tags","blobs_url":"https://api.github.com/repos/civicrm/civihr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/civicrm/civihr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/civicrm/civihr/git/refs{/sha}","trees_url":"https://api.github.com/repos/civicrm/civihr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/civicrm/civihr/statuses/{sha}","languages_url":"https://api.github.com/repos/civicrm/civihr/languages","stargazers_url":"https://api.github.com/repos/civicrm/civihr/stargazers","contributors_url":"https://api.github.com/repos/civicrm/civihr/contributors","subscribers_url":"https://api.github.com/repos/civicrm/civihr/subscribers","subscription_url":"https://api.github.com/repos/civicrm/civihr/subscription","commits_url":"https://api.github.com/repos/civicrm/civihr/commits{/sha}","git_commits_url":"https://api.github.com/repos/civicrm/civihr/git/commits{/sha}","comments_url":"https://api.github.com/repos/civicrm/civihr/comments{/number}","issue_comment_url":"https://api.github.com/repos/civicrm/civihr/issues/comments{/number}","contents_url":"https://api.github.com/repos/civicrm/civihr/contents/{+path}","compare_url":"https://api.github.com/repos/civicrm/civihr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/civicrm/civihr/merges","archive_url":"https://api.github.com/repos/civicrm/civihr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/civicrm/civihr/downloads","issues_url":"https://api.github.com/repos/civicrm/civihr/issues{/number}","pulls_url":"https://api.github.com/repos/civicrm/civihr/pulls{/number}","milestones_url":"https://api.github.com/repos/civicrm/civihr/milestones{/number}","notifications_url":"https://api.github.com/repos/civicrm/civihr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/civicrm/civihr/labels{/name}","releases_url":"https://api.github.com/repos/civicrm/civihr/releases{/id}","created_at":"2013-05-15T20:06:06Z","updated_at":"2016-01-11T10:33:03Z","pushed_at":"2016-01-13T12:31:37Z","git_url":"git://github.com/civicrm/civihr.git","ssh_url":"git@github.com:civicrm/civihr.git","clone_url":"https://github.com/civicrm/civihr.git","svn_url":"https://github.com/civicrm/civihr","homepage":null,"size":17328,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":3,"forks":19,"open_issues":3,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/civicrm/civihr/pulls/821"},"html":{"href":"https://github.com/civicrm/civihr/pull/821"},"issue":{"href":"https://api.github.com/repos/civicrm/civihr/issues/821"},"comments":{"href":"https://api.github.com/repos/civicrm/civihr/issues/821/comments"},"review_comments":{"href":"https://api.github.com/repos/civicrm/civihr/pulls/821/comments"},"review_comment":{"href":"https://api.github.com/repos/civicrm/civihr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/civicrm/civihr/pulls/821/commits"},"statuses":{"href":"https://api.github.com/repos/civicrm/civihr/statuses/9ca3fb49a84ef203d4b67d2a00244d990422ad9d"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"coldrunKacper","id":8986209,"avatar_url":"https://avatars.githubusercontent.com/u/8986209?v=3","gravatar_id":"","url":"https://api.github.com/users/coldrunKacper","html_url":"https://github.com/coldrunKacper","followers_url":"https://api.github.com/users/coldrunKacper/followers","following_url":"https://api.github.com/users/coldrunKacper/following{/other_user}","gists_url":"https://api.github.com/users/coldrunKacper/gists{/gist_id}","starred_url":"https://api.github.com/users/coldrunKacper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coldrunKacper/subscriptions","organizations_url":"https://api.github.com/users/coldrunKacper/orgs","repos_url":"https://api.github.com/users/coldrunKacper/repos","events_url":"https://api.github.com/users/coldrunKacper/events{/privacy}","received_events_url":"https://api.github.com/users/coldrunKacper/received_events","type":"User","site_admin":false},"comments":2,"review_comments":0,"commits":1,"additions":108,"deletions":0,"changed_files":2}}