{"action":"created","comment":{"url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/pulls/comments/157525691","pull_request_review_id":84172758,"id":157525691,"diff_hunk":"@@ -0,0 +1,99 @@\n+<?php\r\n+\r\n+/**\r\n+ * Created by PhpStorm.\r\n+ * User: Usuario\r\n+ * Date: 15/12/2017\r\n+ * Time: 12:18 PM\r\n+ */\r\n+class CRM_Civicase_Utils_Caselist {\r","path":"CRM/Civicase/Utils/Caselist.php","position":9,"original_position":9,"commit_id":"775e35a96639c6f3296e1280d71eab9125b86b3e","original_commit_id":"a4d573065fb8b06b6e1b3131b6c46b5e9f173ebc","user":{"login":"omarabuhussein","id":6275540,"avatar_url":"https://avatars1.githubusercontent.com/u/6275540?v=4","gravatar_id":"","url":"https://api.github.com/users/omarabuhussein","html_url":"https://github.com/omarabuhussein","followers_url":"https://api.github.com/users/omarabuhussein/followers","following_url":"https://api.github.com/users/omarabuhussein/following{/other_user}","gists_url":"https://api.github.com/users/omarabuhussein/gists{/gist_id}","starred_url":"https://api.github.com/users/omarabuhussein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omarabuhussein/subscriptions","organizations_url":"https://api.github.com/users/omarabuhussein/orgs","repos_url":"https://api.github.com/users/omarabuhussein/repos","events_url":"https://api.github.com/users/omarabuhussein/events{/privacy}","received_events_url":"https://api.github.com/users/omarabuhussein/received_events","type":"User","site_admin":false},"body":"Utils is a generic name, Probably CRM_Civicase_API_Caselist or CRM_Civicase_APIsHelper_Caselist is a bit better name.","created_at":"2017-12-18T16:04:48Z","updated_at":"2017-12-18T16:05:10Z","html_url":"https://github.com/civicrm/org.civicrm.civicase/pull/93#discussion_r157525691","pull_request_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/pulls/93","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/civicrm/org.civicrm.civicase/pulls/comments/157525691"},"html":{"href":"https://github.com/civicrm/org.civicrm.civicase/pull/93#discussion_r157525691"},"pull_request":{"href":"https://api.github.com/repos/civicrm/org.civicrm.civicase/pulls/93"}}},"pull_request":{"url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/pulls/93","id":157340803,"html_url":"https://github.com/civicrm/org.civicrm.civicase/pull/93","diff_url":"https://github.com/civicrm/org.civicrm.civicase/pull/93.diff","patch_url":"https://github.com/civicrm/org.civicrm.civicase/pull/93.patch","issue_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/issues/93","number":93,"state":"open","locked":false,"title":"CATL-939: Hook to Change Case Dashboard Table Structure","user":{"login":"MiyaNoctem","id":21999940,"avatar_url":"https://avatars0.githubusercontent.com/u/21999940?v=4","gravatar_id":"","url":"https://api.github.com/users/MiyaNoctem","html_url":"https://github.com/MiyaNoctem","followers_url":"https://api.github.com/users/MiyaNoctem/followers","following_url":"https://api.github.com/users/MiyaNoctem/following{/other_user}","gists_url":"https://api.github.com/users/MiyaNoctem/gists{/gist_id}","starred_url":"https://api.github.com/users/MiyaNoctem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MiyaNoctem/subscriptions","organizations_url":"https://api.github.com/users/MiyaNoctem/orgs","repos_url":"https://api.github.com/users/MiyaNoctem/repos","events_url":"https://api.github.com/users/MiyaNoctem/events{/privacy}","received_events_url":"https://api.github.com/users/MiyaNoctem/received_events","type":"User","site_admin":false},"body":"## Overview\r\nWe need to be able to use a hook to modify which columns to display in the table view, add new columns or alter content.  On the case tab of the contact record or in the case dashboard, we want to allow a developer to \"hook in\" additional fields and information related to that case. This could be:\r\n- A single field added\r\n- A set of fields added\r\n- Removing built-in fields from the list (one or multiple)\r\n- Allowing the developer to edit one or more fields\r\n\r\nFrom a UI perspective, once the developer applies this hook, they should be able to see the changes (new columns/reduced columns/edited columns etc) in the case tab of a contact record or the case dashboard.\r\n\r\n## Before\r\nColumns to be shown in case dashboard were hardcoded in the angular template being used to render the html.\r\n\r\n## After\r\n1. Added a new API action **gettablesummary** call that builds a paginated list of cases, plus a list of columns or headers that should be visible on the table, of the form `['<fieldname>' => '<label>']`.\r\n2. Edited the template for the case dashboard table so the columns shown are determined dynamically from the list of headers passed by the API call to **gettablesummary** action.\r\n3. Implemented a new hook class **CRM_CiviCase_Utils_Hook** with a new hook to be used to alter the new API call. The idea is that implemented hooks can alter either cases or headers, before returning the result.\r\n4. Added the call to the new hook before the result is returned on **gettablesummary**, passing as parameters the list of cases and the list of allowed columns, so they can be manipulated within the hook.\r\n","created_at":"2017-12-08T21:46:11Z","updated_at":"2017-12-18T16:05:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d73810df9b68effa4e782be0aa759274591cd53e","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/pulls/93/commits","review_comments_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/pulls/93/comments","review_comment_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/pulls/comments{/number}","comments_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/issues/93/comments","statuses_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/statuses/775e35a96639c6f3296e1280d71eab9125b86b3e","head":{"label":"MiyaNoctem:CATL-939-hook-to-change-table-structure","ref":"CATL-939-hook-to-change-table-structure","sha":"775e35a96639c6f3296e1280d71eab9125b86b3e","user":{"login":"MiyaNoctem","id":21999940,"avatar_url":"https://avatars0.githubusercontent.com/u/21999940?v=4","gravatar_id":"","url":"https://api.github.com/users/MiyaNoctem","html_url":"https://github.com/MiyaNoctem","followers_url":"https://api.github.com/users/MiyaNoctem/followers","following_url":"https://api.github.com/users/MiyaNoctem/following{/other_user}","gists_url":"https://api.github.com/users/MiyaNoctem/gists{/gist_id}","starred_url":"https://api.github.com/users/MiyaNoctem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MiyaNoctem/subscriptions","organizations_url":"https://api.github.com/users/MiyaNoctem/orgs","repos_url":"https://api.github.com/users/MiyaNoctem/repos","events_url":"https://api.github.com/users/MiyaNoctem/events{/privacy}","received_events_url":"https://api.github.com/users/MiyaNoctem/received_events","type":"User","site_admin":false},"repo":{"id":113032811,"name":"org.civicrm.civicase","full_name":"MiyaNoctem/org.civicrm.civicase","owner":{"login":"MiyaNoctem","id":21999940,"avatar_url":"https://avatars0.githubusercontent.com/u/21999940?v=4","gravatar_id":"","url":"https://api.github.com/users/MiyaNoctem","html_url":"https://github.com/MiyaNoctem","followers_url":"https://api.github.com/users/MiyaNoctem/followers","following_url":"https://api.github.com/users/MiyaNoctem/following{/other_user}","gists_url":"https://api.github.com/users/MiyaNoctem/gists{/gist_id}","starred_url":"https://api.github.com/users/MiyaNoctem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MiyaNoctem/subscriptions","organizations_url":"https://api.github.com/users/MiyaNoctem/orgs","repos_url":"https://api.github.com/users/MiyaNoctem/repos","events_url":"https://api.github.com/users/MiyaNoctem/events{/privacy}","received_events_url":"https://api.github.com/users/MiyaNoctem/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MiyaNoctem/org.civicrm.civicase","description":"CiviCase Extension","fork":true,"url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase","forks_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/forks","keys_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/teams","hooks_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/hooks","issue_events_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/issues/events{/number}","events_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/events","assignees_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/assignees{/user}","branches_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/branches{/branch}","tags_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/tags","blobs_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/git/refs{/sha}","trees_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/statuses/{sha}","languages_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/languages","stargazers_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/stargazers","contributors_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/contributors","subscribers_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/subscribers","subscription_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/subscription","commits_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/commits{/sha}","git_commits_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/git/commits{/sha}","comments_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/comments{/number}","issue_comment_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/issues/comments{/number}","contents_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/contents/{+path}","compare_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/merges","archive_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/downloads","issues_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/issues{/number}","pulls_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/pulls{/number}","milestones_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/milestones{/number}","notifications_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/labels{/name}","releases_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/releases{/id}","deployments_url":"https://api.github.com/repos/MiyaNoctem/org.civicrm.civicase/deployments","created_at":"2017-12-04T11:12:08Z","updated_at":"2017-12-04T11:12:10Z","pushed_at":"2017-12-18T15:24:35Z","git_url":"git://github.com/MiyaNoctem/org.civicrm.civicase.git","ssh_url":"git@github.com:MiyaNoctem/org.civicrm.civicase.git","clone_url":"https://github.com/MiyaNoctem/org.civicrm.civicase.git","svn_url":"https://github.com/MiyaNoctem/org.civicrm.civicase","homepage":null,"size":1045,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"civicrm:master","ref":"master","sha":"693cf3419ec85bf49ba53732c577a47f0ff12ba2","user":{"login":"civicrm","id":136373,"avatar_url":"https://avatars2.githubusercontent.com/u/136373?v=4","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":77814721,"name":"org.civicrm.civicase","full_name":"civicrm/org.civicrm.civicase","owner":{"login":"civicrm","id":136373,"avatar_url":"https://avatars2.githubusercontent.com/u/136373?v=4","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/org.civicrm.civicase","description":"CiviCase Extension","fork":false,"url":"https://api.github.com/repos/civicrm/org.civicrm.civicase","forks_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/forks","keys_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/keys{/key_id}","collaborators_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/teams","hooks_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/hooks","issue_events_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/issues/events{/number}","events_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/events","assignees_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/assignees{/user}","branches_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/branches{/branch}","tags_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/tags","blobs_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/git/refs{/sha}","trees_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/git/trees{/sha}","statuses_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/statuses/{sha}","languages_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/languages","stargazers_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/stargazers","contributors_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/contributors","subscribers_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/subscribers","subscription_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/subscription","commits_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/commits{/sha}","git_commits_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/git/commits{/sha}","comments_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/comments{/number}","issue_comment_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/issues/comments{/number}","contents_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/contents/{+path}","compare_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/compare/{base}...{head}","merges_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/merges","archive_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/downloads","issues_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/issues{/number}","pulls_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/pulls{/number}","milestones_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/milestones{/number}","notifications_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/labels{/name}","releases_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/releases{/id}","deployments_url":"https://api.github.com/repos/civicrm/org.civicrm.civicase/deployments","created_at":"2017-01-02T06:17:47Z","updated_at":"2017-10-09T16:46:31Z","pushed_at":"2017-12-18T15:24:36Z","git_url":"git://github.com/civicrm/org.civicrm.civicase.git","ssh_url":"git@github.com:civicrm/org.civicrm.civicase.git","clone_url":"https://github.com/civicrm/org.civicrm.civicase.git","svn_url":"https://github.com/civicrm/org.civicrm.civicase","homepage":null,"size":1014,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0"},"forks":6,"open_issues":5,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/civicrm/org.civicrm.civicase/pulls/93"},"html":{"href":"https://github.com/civicrm/org.civicrm.civicase/pull/93"},"issue":{"href":"https://api.github.com/repos/civicrm/org.civicrm.civicase/issues/93"},"comments":{"href":"https://api.github.com/repos/civicrm/org.civicrm.civicase/issues/93/comments"},"review_comments":{"href":"https://api.github.com/repos/civicrm/org.civicrm.civicase/pulls/93/comments"},"review_comment":{"href":"https://api.github.com/repos/civicrm/org.civicrm.civicase/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/civicrm/org.civicrm.civicase/pulls/93/commits"},"statuses":{"href":"https://api.github.com/repos/civicrm/org.civicrm.civicase/statuses/775e35a96639c6f3296e1280d71eab9125b86b3e"}},"author_association":"NONE"}}
{"actor":{"display_login":"omarabuhussein"}}