{"action":"created","comment":{"url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/pulls/comments/76684098","id":76684098,"diff_hunk":"@@ -0,0 +1,82 @@\n+<?php\n+\n+/**\n+ * A trait with helper methods to be reused among this extension's tests\n+ */\n+trait TasksassignmentsTestTrait {\n+\n+  /**\n+   * Creates single (Individuals) contact from the provided data.\n+   *\n+   * @param array $params should contain first_name and last_name\n+   * @return int return the contact ID\n+   * @throws \\CiviCRM_API3_Exception\n+   */\n+  protected function createContact($params) {\n+    if (empty($params['contact_type'])) {\n+      $params['contact_type'] = \"Individual\";\n+    }\n+    $params['display_name'] = $params['first_name'] . ' ' . $params['last_name'];\n+    $contact = CRM_Contact_BAO_Contact::create($params);\n+\n+    return $contact->id;\n+  }\n+\n+  /**\n+   * Creates single (Individuals) contact from the provided data.\n+   *\n+   * @param array $params should contain first_name and last_name\n+   * @return int return the contact ID\n+   * @throws \\CiviCRM_API3_Exception\n+   */\n+  protected function createCaseType($params) {\n+    $caseType = CRM_Case_BAO_CaseType::create($params);\n+    return $caseType->id;\n+  }\n+\n+  /**\n+   * Creates single (Individuals) contact from the provided data.\n+   *\n+   * @param array $params should contain first_name and last_name\n+   * @return int return the contact ID\n+   * @throws \\CiviCRM_API3_Exception\n+   */\n+  protected function createCase($params) {\n+    $case = CRM_Case_BAO_Case::create($params);\n+    if (!empty($case->id)) {\n+      $contactParams = array('case_id' => $case->id, 'contact_id' => $params['creator_id']);\n+      CRM_Case_BAO_CaseContact::create($contactParams);\n+\n+      return $case->id;\n+    }\n+\n+    return NULL;\n+  }\n+\n+  /**\n+   * Creates single (Individuals) contact from the provided data.\n+   *\n+   * @param array $params should contain first_name and last_name\n+   * @return int return the contact ID\n+   * @throws \\CiviCRM_API3_Exception\n+   */","path":"uk.co.compucorp.civicrm.tasksassignments/tests/phpunit/TasksassignmentsTestTrait.php","position":14,"original_position":62,"commit_id":"532836e63d6f84f4fb6ffaa678d99e46b4c45b98","original_commit_id":"532836e63d6f84f4fb6ffaa678d99e46b4c45b98","user":{"login":"omarabuhussein","id":6275540,"avatar_url":"https://avatars.githubusercontent.com/u/6275540?v=3","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":"oops , I forget to fix TasksassignmentsTestTrait method docblocks","created_at":"2016-08-29T20:48:36Z","updated_at":"2016-08-29T20:48:36Z","html_url":"https://github.com/compucorp/civihr-tasks-assignments/pull/94#discussion_r76684098","pull_request_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/pulls/94","_links":{"self":{"href":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/pulls/comments/76684098"},"html":{"href":"https://github.com/compucorp/civihr-tasks-assignments/pull/94#discussion_r76684098"},"pull_request":{"href":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/pulls/94"}}},"pull_request":{"url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/pulls/94","id":83091764,"html_url":"https://github.com/compucorp/civihr-tasks-assignments/pull/94","diff_url":"https://github.com/compucorp/civihr-tasks-assignments/pull/94.diff","patch_url":"https://github.com/compucorp/civihr-tasks-assignments/pull/94.patch","issue_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/issues/94","number":94,"state":"open","locked":false,"title":"PCHR-1527: Fix add to assignment input when adding documents","user":{"login":"omarabuhussein","id":6275540,"avatar_url":"https://avatars.githubusercontent.com/u/6275540?v=3","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":"## Problem \r\n\r\nWhen trying to search in  (add to assignment) box , it was not showing any result and a the following error appear in the console  :\r\n\r\n```\"Error in resource configuration for action `query`. Expected response to contain an array but got an object (Request: GET `/index.php?q=civicrm/case/ajax/unclosed)\"```\r\n\r\nThe reason behind this is the deletion of this ajax end-point **civicrm/case/ajax/unclosed** in civicrm 4.7 and  a new quick-form method created **addEntityRef** to replace it . (https://github.com/civicrm/civicrm-core/commit/abd06efc426540ed16cb091093f90e13df2579f1)\r\n\r\n## Solution\r\n\r\nsince we are working with angular and **addEntityRef** cannot be used since it is a quick-form method , I restored the **civicrm/case/ajax/unclosed** and the callback method **unclosedCases** in T&A extension.\r\n\r\nSo now the results are avaliable , but there is still a problem with the front-end part that need to be fixed in order for the fetched data to be shown.\r\n\r\n![selection_101](https://cloud.githubusercontent.com/assets/6275540/18051638/7049e192-6dfe-11e6-8bbf-fb32a2308ab7.png)\r\n\r\n","created_at":"2016-08-29T12:37:11Z","updated_at":"2016-08-29T20:48:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"897fcb06c07bb60d3955b0e3f865147ffb1e03b0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/pulls/94/commits","review_comments_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/pulls/94/comments","review_comment_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/pulls/comments{/number}","comments_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/issues/94/comments","statuses_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/statuses/532836e63d6f84f4fb6ffaa678d99e46b4c45b98","head":{"label":"compucorp:PCHR-1527-fix-document-add-assignment-input","ref":"PCHR-1527-fix-document-add-assignment-input","sha":"532836e63d6f84f4fb6ffaa678d99e46b4c45b98","user":{"login":"compucorp","id":2040164,"avatar_url":"https://avatars.githubusercontent.com/u/2040164?v=3","gravatar_id":"","url":"https://api.github.com/users/compucorp","html_url":"https://github.com/compucorp","followers_url":"https://api.github.com/users/compucorp/followers","following_url":"https://api.github.com/users/compucorp/following{/other_user}","gists_url":"https://api.github.com/users/compucorp/gists{/gist_id}","starred_url":"https://api.github.com/users/compucorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/compucorp/subscriptions","organizations_url":"https://api.github.com/users/compucorp/orgs","repos_url":"https://api.github.com/users/compucorp/repos","events_url":"https://api.github.com/users/compucorp/events{/privacy}","received_events_url":"https://api.github.com/users/compucorp/received_events","type":"Organization","site_admin":false},"repo":{"id":33719821,"name":"civihr-tasks-assignments","full_name":"compucorp/civihr-tasks-assignments","owner":{"login":"compucorp","id":2040164,"avatar_url":"https://avatars.githubusercontent.com/u/2040164?v=3","gravatar_id":"","url":"https://api.github.com/users/compucorp","html_url":"https://github.com/compucorp","followers_url":"https://api.github.com/users/compucorp/followers","following_url":"https://api.github.com/users/compucorp/following{/other_user}","gists_url":"https://api.github.com/users/compucorp/gists{/gist_id}","starred_url":"https://api.github.com/users/compucorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/compucorp/subscriptions","organizations_url":"https://api.github.com/users/compucorp/orgs","repos_url":"https://api.github.com/users/compucorp/repos","events_url":"https://api.github.com/users/compucorp/events{/privacy}","received_events_url":"https://api.github.com/users/compucorp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/compucorp/civihr-tasks-assignments","description":"","fork":false,"url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments","forks_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/forks","keys_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/keys{/key_id}","collaborators_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/teams","hooks_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/hooks","issue_events_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/issues/events{/number}","events_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/events","assignees_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/assignees{/user}","branches_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/branches{/branch}","tags_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/tags","blobs_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/git/refs{/sha}","trees_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/git/trees{/sha}","statuses_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/statuses/{sha}","languages_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/languages","stargazers_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/stargazers","contributors_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/contributors","subscribers_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/subscribers","subscription_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/subscription","commits_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/commits{/sha}","git_commits_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/git/commits{/sha}","comments_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/comments{/number}","issue_comment_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/issues/comments{/number}","contents_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/contents/{+path}","compare_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/compare/{base}...{head}","merges_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/merges","archive_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/downloads","issues_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/issues{/number}","pulls_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/pulls{/number}","milestones_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/milestones{/number}","notifications_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/labels{/name}","releases_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/releases{/id}","deployments_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/deployments","created_at":"2015-04-10T09:18:16Z","updated_at":"2016-07-04T09:53:40Z","pushed_at":"2016-08-29T18:53:50Z","git_url":"git://github.com/compucorp/civihr-tasks-assignments.git","ssh_url":"git@github.com:compucorp/civihr-tasks-assignments.git","clone_url":"https://github.com/compucorp/civihr-tasks-assignments.git","svn_url":"https://github.com/compucorp/civihr-tasks-assignments","homepage":null,"size":6422,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"develop"}},"base":{"label":"compucorp:staging","ref":"staging","sha":"a45cef57920485e1673ac6e8d4eb8be7215113d5","user":{"login":"compucorp","id":2040164,"avatar_url":"https://avatars.githubusercontent.com/u/2040164?v=3","gravatar_id":"","url":"https://api.github.com/users/compucorp","html_url":"https://github.com/compucorp","followers_url":"https://api.github.com/users/compucorp/followers","following_url":"https://api.github.com/users/compucorp/following{/other_user}","gists_url":"https://api.github.com/users/compucorp/gists{/gist_id}","starred_url":"https://api.github.com/users/compucorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/compucorp/subscriptions","organizations_url":"https://api.github.com/users/compucorp/orgs","repos_url":"https://api.github.com/users/compucorp/repos","events_url":"https://api.github.com/users/compucorp/events{/privacy}","received_events_url":"https://api.github.com/users/compucorp/received_events","type":"Organization","site_admin":false},"repo":{"id":33719821,"name":"civihr-tasks-assignments","full_name":"compucorp/civihr-tasks-assignments","owner":{"login":"compucorp","id":2040164,"avatar_url":"https://avatars.githubusercontent.com/u/2040164?v=3","gravatar_id":"","url":"https://api.github.com/users/compucorp","html_url":"https://github.com/compucorp","followers_url":"https://api.github.com/users/compucorp/followers","following_url":"https://api.github.com/users/compucorp/following{/other_user}","gists_url":"https://api.github.com/users/compucorp/gists{/gist_id}","starred_url":"https://api.github.com/users/compucorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/compucorp/subscriptions","organizations_url":"https://api.github.com/users/compucorp/orgs","repos_url":"https://api.github.com/users/compucorp/repos","events_url":"https://api.github.com/users/compucorp/events{/privacy}","received_events_url":"https://api.github.com/users/compucorp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/compucorp/civihr-tasks-assignments","description":"","fork":false,"url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments","forks_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/forks","keys_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/keys{/key_id}","collaborators_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/teams","hooks_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/hooks","issue_events_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/issues/events{/number}","events_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/events","assignees_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/assignees{/user}","branches_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/branches{/branch}","tags_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/tags","blobs_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/git/refs{/sha}","trees_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/git/trees{/sha}","statuses_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/statuses/{sha}","languages_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/languages","stargazers_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/stargazers","contributors_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/contributors","subscribers_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/subscribers","subscription_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/subscription","commits_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/commits{/sha}","git_commits_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/git/commits{/sha}","comments_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/comments{/number}","issue_comment_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/issues/comments{/number}","contents_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/contents/{+path}","compare_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/compare/{base}...{head}","merges_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/merges","archive_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/downloads","issues_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/issues{/number}","pulls_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/pulls{/number}","milestones_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/milestones{/number}","notifications_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/labels{/name}","releases_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/releases{/id}","deployments_url":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/deployments","created_at":"2015-04-10T09:18:16Z","updated_at":"2016-07-04T09:53:40Z","pushed_at":"2016-08-29T18:53:50Z","git_url":"git://github.com/compucorp/civihr-tasks-assignments.git","ssh_url":"git@github.com:compucorp/civihr-tasks-assignments.git","clone_url":"https://github.com/compucorp/civihr-tasks-assignments.git","svn_url":"https://github.com/compucorp/civihr-tasks-assignments","homepage":null,"size":6422,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/pulls/94"},"html":{"href":"https://github.com/compucorp/civihr-tasks-assignments/pull/94"},"issue":{"href":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/issues/94"},"comments":{"href":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/issues/94/comments"},"review_comments":{"href":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/pulls/94/comments"},"review_comment":{"href":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/pulls/94/commits"},"statuses":{"href":"https://api.github.com/repos/compucorp/civihr-tasks-assignments/statuses/532836e63d6f84f4fb6ffaa678d99e46b4c45b98"}}}}
{"actor":{"display_login":"omarabuhussein"}}