{"action":"opened","number":2847,"pull_request":{"url":"https://api.github.com/repos/compucorp/civihr/pulls/2847","id":211821378,"node_id":"MDExOlB1bGxSZXF1ZXN0MjExODIxMzc4","html_url":"https://github.com/compucorp/civihr/pull/2847","diff_url":"https://github.com/compucorp/civihr/pull/2847.diff","patch_url":"https://github.com/compucorp/civihr/pull/2847.patch","issue_url":"https://api.github.com/repos/compucorp/civihr/issues/2847","number":2847,"state":"open","locked":false,"title":"PCHR-4060: Move the Import Menu Links to Configure","user":{"login":"backstageel","id":1692858,"node_id":"MDQ6VXNlcjE2OTI4NTg=","avatar_url":"https://avatars3.githubusercontent.com/u/1692858?v=4","gravatar_id":"","url":"https://api.github.com/users/backstageel","html_url":"https://github.com/backstageel","followers_url":"https://api.github.com/users/backstageel/followers","following_url":"https://api.github.com/users/backstageel/following{/other_user}","gists_url":"https://api.github.com/users/backstageel/gists{/gist_id}","starred_url":"https://api.github.com/users/backstageel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/backstageel/subscriptions","organizations_url":"https://api.github.com/users/backstageel/orgs","repos_url":"https://api.github.com/users/backstageel/repos","events_url":"https://api.github.com/users/backstageel/events{/privacy}","received_events_url":"https://api.github.com/users/backstageel/received_events","type":"User","site_admin":false},"body":"## Overview\r\nThis PR Moves all the Import Menu Links to  be Under Configure.\r\nIt also moves the function that creates import Multi-Value Custom Fields from hrui to hrcore.\r\nIt also creates the Import Job Roles menu in the database, instead of creating it via civicrm_navigationMenu hook.\r\n\r\n## Before\r\nThe Import menu items were under Staff Menu \r\n![screenshot_20180829_184932](https://user-images.githubusercontent.com/1692858/44802597-729ea100-abbc-11e8-8aff-b96ca7dbd668.png)\r\n\r\n## After\r\nThe Import menu items are under Configure Menu\r\n![screenshot_20180829_184725](https://user-images.githubusercontent.com/1692858/44802617-83e7ad80-abbc-11e8-8bf1-725e37db5b7e.png)\r\n\r\n\r\n## Technical Details\r\nWhile creating the menu using the following API call, the CiviCRM did not take the right weight:\r\n`civicrm_api3('Navigation', 'create', [\r\n        'label' => 'Import',\r\n        'name' => 'Import',\r\n        'parent_id' => $menu['parent_id'],\r\n        'domain_id' => $menu['domain_id'],\r\n        'permission' => $menu['permission'],\r\n        'is_active' => 1,\r\n        'weight' => $menu['weight'], //It was supposed to be -96, but was always set to 17\r\n      ]);`\r\nso i had to create the following function to adjust the menu weight after the creation:\r\n`private function up1031_adjustImportMenuWeight() {\r\n    $leaveWeight = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Navigation', 'leave_and_absences', 'weight', 'name');\r\n    civicrm_api3('Navigation', 'get', [\r\n      'name' => 'Import',\r\n      'api.Navigation.create' => [\r\n        'id' => '$value.id',\r\n        'weight' => $leaveWeight,\r\n      ],\r\n    ]);\r\n  }`","created_at":"2018-08-29T16:54:35Z","updated_at":"2018-08-29T16:54:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/compucorp/civihr/pulls/2847/commits","review_comments_url":"https://api.github.com/repos/compucorp/civihr/pulls/2847/comments","review_comment_url":"https://api.github.com/repos/compucorp/civihr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/compucorp/civihr/issues/2847/comments","statuses_url":"https://api.github.com/repos/compucorp/civihr/statuses/dbe314ef1bd98d409fcfaa38d5acdaf387a874a2","head":{"label":"compucorp:PCHR-4060-Move-the-import-functions-links","ref":"PCHR-4060-Move-the-import-functions-links","sha":"dbe314ef1bd98d409fcfaa38d5acdaf387a874a2","user":{"login":"compucorp","id":2040164,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwNDAxNjQ=","avatar_url":"https://avatars3.githubusercontent.com/u/2040164?v=4","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":10086903,"node_id":"MDEwOlJlcG9zaXRvcnkxMDA4NjkwMw==","name":"civihr","full_name":"compucorp/civihr","owner":{"login":"compucorp","id":2040164,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwNDAxNjQ=","avatar_url":"https://avatars3.githubusercontent.com/u/2040164?v=4","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","description":"CiviHR","fork":false,"url":"https://api.github.com/repos/compucorp/civihr","forks_url":"https://api.github.com/repos/compucorp/civihr/forks","keys_url":"https://api.github.com/repos/compucorp/civihr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/compucorp/civihr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/compucorp/civihr/teams","hooks_url":"https://api.github.com/repos/compucorp/civihr/hooks","issue_events_url":"https://api.github.com/repos/compucorp/civihr/issues/events{/number}","events_url":"https://api.github.com/repos/compucorp/civihr/events","assignees_url":"https://api.github.com/repos/compucorp/civihr/assignees{/user}","branches_url":"https://api.github.com/repos/compucorp/civihr/branches{/branch}","tags_url":"https://api.github.com/repos/compucorp/civihr/tags","blobs_url":"https://api.github.com/repos/compucorp/civihr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/compucorp/civihr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/compucorp/civihr/git/refs{/sha}","trees_url":"https://api.github.com/repos/compucorp/civihr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/compucorp/civihr/statuses/{sha}","languages_url":"https://api.github.com/repos/compucorp/civihr/languages","stargazers_url":"https://api.github.com/repos/compucorp/civihr/stargazers","contributors_url":"https://api.github.com/repos/compucorp/civihr/contributors","subscribers_url":"https://api.github.com/repos/compucorp/civihr/subscribers","subscription_url":"https://api.github.com/repos/compucorp/civihr/subscription","commits_url":"https://api.github.com/repos/compucorp/civihr/commits{/sha}","git_commits_url":"https://api.github.com/repos/compucorp/civihr/git/commits{/sha}","comments_url":"https://api.github.com/repos/compucorp/civihr/comments{/number}","issue_comment_url":"https://api.github.com/repos/compucorp/civihr/issues/comments{/number}","contents_url":"https://api.github.com/repos/compucorp/civihr/contents/{+path}","compare_url":"https://api.github.com/repos/compucorp/civihr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/compucorp/civihr/merges","archive_url":"https://api.github.com/repos/compucorp/civihr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/compucorp/civihr/downloads","issues_url":"https://api.github.com/repos/compucorp/civihr/issues{/number}","pulls_url":"https://api.github.com/repos/compucorp/civihr/pulls{/number}","milestones_url":"https://api.github.com/repos/compucorp/civihr/milestones{/number}","notifications_url":"https://api.github.com/repos/compucorp/civihr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/compucorp/civihr/labels{/name}","releases_url":"https://api.github.com/repos/compucorp/civihr/releases{/id}","deployments_url":"https://api.github.com/repos/compucorp/civihr/deployments","created_at":"2013-05-15T20:06:06Z","updated_at":"2018-08-29T13:35:23Z","pushed_at":"2018-08-29T16:42:22Z","git_url":"git://github.com/compucorp/civihr.git","ssh_url":"git@github.com:compucorp/civihr.git","clone_url":"https://github.com/compucorp/civihr.git","svn_url":"https://github.com/compucorp/civihr","homepage":null,"size":67092,"stargazers_count":32,"watchers_count":32,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":43,"mirror_url":null,"archived":false,"open_issues_count":8,"license":null,"forks":43,"open_issues":8,"watchers":32,"default_branch":"staging"}},"base":{"label":"compucorp:PCHR-4056-data-import-improvements","ref":"PCHR-4056-data-import-improvements","sha":"875d4b0c529d103add6b073d5ac2a8893e1722c6","user":{"login":"compucorp","id":2040164,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwNDAxNjQ=","avatar_url":"https://avatars3.githubusercontent.com/u/2040164?v=4","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":10086903,"node_id":"MDEwOlJlcG9zaXRvcnkxMDA4NjkwMw==","name":"civihr","full_name":"compucorp/civihr","owner":{"login":"compucorp","id":2040164,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwNDAxNjQ=","avatar_url":"https://avatars3.githubusercontent.com/u/2040164?v=4","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","description":"CiviHR","fork":false,"url":"https://api.github.com/repos/compucorp/civihr","forks_url":"https://api.github.com/repos/compucorp/civihr/forks","keys_url":"https://api.github.com/repos/compucorp/civihr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/compucorp/civihr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/compucorp/civihr/teams","hooks_url":"https://api.github.com/repos/compucorp/civihr/hooks","issue_events_url":"https://api.github.com/repos/compucorp/civihr/issues/events{/number}","events_url":"https://api.github.com/repos/compucorp/civihr/events","assignees_url":"https://api.github.com/repos/compucorp/civihr/assignees{/user}","branches_url":"https://api.github.com/repos/compucorp/civihr/branches{/branch}","tags_url":"https://api.github.com/repos/compucorp/civihr/tags","blobs_url":"https://api.github.com/repos/compucorp/civihr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/compucorp/civihr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/compucorp/civihr/git/refs{/sha}","trees_url":"https://api.github.com/repos/compucorp/civihr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/compucorp/civihr/statuses/{sha}","languages_url":"https://api.github.com/repos/compucorp/civihr/languages","stargazers_url":"https://api.github.com/repos/compucorp/civihr/stargazers","contributors_url":"https://api.github.com/repos/compucorp/civihr/contributors","subscribers_url":"https://api.github.com/repos/compucorp/civihr/subscribers","subscription_url":"https://api.github.com/repos/compucorp/civihr/subscription","commits_url":"https://api.github.com/repos/compucorp/civihr/commits{/sha}","git_commits_url":"https://api.github.com/repos/compucorp/civihr/git/commits{/sha}","comments_url":"https://api.github.com/repos/compucorp/civihr/comments{/number}","issue_comment_url":"https://api.github.com/repos/compucorp/civihr/issues/comments{/number}","contents_url":"https://api.github.com/repos/compucorp/civihr/contents/{+path}","compare_url":"https://api.github.com/repos/compucorp/civihr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/compucorp/civihr/merges","archive_url":"https://api.github.com/repos/compucorp/civihr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/compucorp/civihr/downloads","issues_url":"https://api.github.com/repos/compucorp/civihr/issues{/number}","pulls_url":"https://api.github.com/repos/compucorp/civihr/pulls{/number}","milestones_url":"https://api.github.com/repos/compucorp/civihr/milestones{/number}","notifications_url":"https://api.github.com/repos/compucorp/civihr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/compucorp/civihr/labels{/name}","releases_url":"https://api.github.com/repos/compucorp/civihr/releases{/id}","deployments_url":"https://api.github.com/repos/compucorp/civihr/deployments","created_at":"2013-05-15T20:06:06Z","updated_at":"2018-08-29T13:35:23Z","pushed_at":"2018-08-29T16:42:22Z","git_url":"git://github.com/compucorp/civihr.git","ssh_url":"git@github.com:compucorp/civihr.git","clone_url":"https://github.com/compucorp/civihr.git","svn_url":"https://github.com/compucorp/civihr","homepage":null,"size":67092,"stargazers_count":32,"watchers_count":32,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":43,"mirror_url":null,"archived":false,"open_issues_count":8,"license":null,"forks":43,"open_issues":8,"watchers":32,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/compucorp/civihr/pulls/2847"},"html":{"href":"https://github.com/compucorp/civihr/pull/2847"},"issue":{"href":"https://api.github.com/repos/compucorp/civihr/issues/2847"},"comments":{"href":"https://api.github.com/repos/compucorp/civihr/issues/2847/comments"},"review_comments":{"href":"https://api.github.com/repos/compucorp/civihr/pulls/2847/comments"},"review_comment":{"href":"https://api.github.com/repos/compucorp/civihr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/compucorp/civihr/pulls/2847/commits"},"statuses":{"href":"https://api.github.com/repos/compucorp/civihr/statuses/dbe314ef1bd98d409fcfaa38d5acdaf387a874a2"}},"author_association":"COLLABORATOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":172,"deletions":62,"changed_files":5}}
{"actor":{"display_login":"backstageel"}}