{"action":"created","comment":{"url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/pulls/comments/67108141","id":67108141,"diff_hunk":"@@ -0,0 +1,167 @@\n+/*\n+ * This file is part of the Sulu CMS.\n+ *\n+ * (c) MASSIVE ART WebServices GmbH\n+ *\n+ * This source file is subject to the MIT license that is bundled\n+ * with this source code in the file LICENSE.\n+ */\n+\n+define(['app-config'], function(AppConfig) {\n+\n+    'use strict';\n+\n+    // get contact type based on information given\n+    var getContactType = function(data, contactTypeName) {\n+            var typeInfo, compareAttribute, i, type,\n+                contactType = 0,\n+                contactTypes,\n+                section = AppConfig.getSection('sulu-contact-extension'); // get contact types\n+\n+            if (!section || section.length > 0 || !section.hasOwnProperty('contactTypes')) {\n+                return false;\n+            } else {\n+                contactTypes = section.contactTypes;\n+            }\n+\n+            if (!!data && data.hasOwnProperty('id') && data.hasOwnProperty('type')) {\n+                typeInfo = data.type;\n+                compareAttribute = 'id';\n+            } else if (contactTypeName) {\n+                typeInfo = contactTypeName;\n+                compareAttribute = 'name';\n+            } else {\n+                typeInfo = 0;\n+                compareAttribute = 'id';\n+            }\n+\n+            // get contact type information\n+            for (i in contactTypes) {\n+                type = contactTypes[i];\n+                if (type[compareAttribute] === typeInfo) {\n+                    contactType = type;\n+                    break;\n+                }\n+            }\n+\n+            return contactType;\n+        },\n+\n+        /**\n+         * Returns items for header.\n+         *\n+         * @param {Object} contactTypes\n+         * @param {String} key\n+         *\n+         * @returns {Object}\n+         */\n+        getHeaderItem = function(contactTypes, key) {\n+\n+            var item;\n+            this.sandbox.util.each(contactTypes, function(name, el) {\n+                if (el.name === key) {\n+                    item = {\n+                        title: this.sandbox.translate(el.translation + '.conversion'),\n+                        callback: function() {\n+                            this.sandbox.emit('sulu.contacts.contact.convert', el);\n+                        }.bind(this)\n+                    };\n+                    return false;\n+                }\n+            }.bind(this));\n+\n+            return item;\n+        },\n+\n+        /**\n+         * Sets header toolbar with conversion options according to configuration.\n+         */\n+        setHeaderToolbar = function(contactType) {\n+            if (!contactType.convertableTo || !Object.keys(contactType.convertableTo).length) {\n+                this.sandbox.emit('sulu.header.toolbar.item.hide', 'settings');\n+            }\n+        };\n+\n+    return {\n+","path":"Resources/public/js/services/contact-header.js","position":86,"original_position":86,"commit_id":"5a647c73067b2082cbf35019d1f674ba13bdc07f","original_commit_id":"5a647c73067b2082cbf35019d1f674ba13bdc07f","user":{"login":"turbo-ele","id":5152633,"avatar_url":"https://avatars.githubusercontent.com/u/5152633?v=3","gravatar_id":"","url":"https://api.github.com/users/turbo-ele","html_url":"https://github.com/turbo-ele","followers_url":"https://api.github.com/users/turbo-ele/followers","following_url":"https://api.github.com/users/turbo-ele/following{/other_user}","gists_url":"https://api.github.com/users/turbo-ele/gists{/gist_id}","starred_url":"https://api.github.com/users/turbo-ele/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/turbo-ele/subscriptions","organizations_url":"https://api.github.com/users/turbo-ele/orgs","repos_url":"https://api.github.com/users/turbo-ele/repos","events_url":"https://api.github.com/users/turbo-ele/events{/privacy}","received_events_url":"https://api.github.com/users/turbo-ele/received_events","type":"User","site_admin":false},"body":"remove empty line","created_at":"2016-06-15T06:48:50Z","updated_at":"2016-06-15T06:48:50Z","html_url":"https://github.com/sulu/SuluContactExtensionBundle/pull/46#discussion_r67108141","pull_request_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/pulls/46","_links":{"self":{"href":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/pulls/comments/67108141"},"html":{"href":"https://github.com/sulu/SuluContactExtensionBundle/pull/46#discussion_r67108141"},"pull_request":{"href":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/pulls/46"}}},"pull_request":{"url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/pulls/46","id":73716637,"html_url":"https://github.com/sulu/SuluContactExtensionBundle/pull/46","diff_url":"https://github.com/sulu/SuluContactExtensionBundle/pull/46.diff","patch_url":"https://github.com/sulu/SuluContactExtensionBundle/pull/46.patch","issue_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/issues/46","number":46,"state":"open","locked":false,"title":"added contact types","user":{"login":"stemod","id":8983812,"avatar_url":"https://avatars.githubusercontent.com/u/8983812?v=3","gravatar_id":"","url":"https://api.github.com/users/stemod","html_url":"https://github.com/stemod","followers_url":"https://api.github.com/users/stemod/followers","following_url":"https://api.github.com/users/stemod/following{/other_user}","gists_url":"https://api.github.com/users/stemod/gists{/gist_id}","starred_url":"https://api.github.com/users/stemod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stemod/subscriptions","organizations_url":"https://api.github.com/users/stemod/orgs","repos_url":"https://api.github.com/users/stemod/repos","events_url":"https://api.github.com/users/stemod/events{/privacy}","received_events_url":"https://api.github.com/users/stemod/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-06-14T10:36:58Z","updated_at":"2016-06-15T06:48:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"886c7ea55d7752cc6f57a4a0772e3b70cefcffd3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/pulls/46/commits","review_comments_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/pulls/46/comments","review_comment_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/issues/46/comments","statuses_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/statuses/5a647c73067b2082cbf35019d1f674ba13bdc07f","head":{"label":"sulu:feature/contact-types","ref":"feature/contact-types","sha":"5a647c73067b2082cbf35019d1f674ba13bdc07f","user":{"login":"sulu","id":5717006,"avatar_url":"https://avatars.githubusercontent.com/u/5717006?v=3","gravatar_id":"","url":"https://api.github.com/users/sulu","html_url":"https://github.com/sulu","followers_url":"https://api.github.com/users/sulu/followers","following_url":"https://api.github.com/users/sulu/following{/other_user}","gists_url":"https://api.github.com/users/sulu/gists{/gist_id}","starred_url":"https://api.github.com/users/sulu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sulu/subscriptions","organizations_url":"https://api.github.com/users/sulu/orgs","repos_url":"https://api.github.com/users/sulu/repos","events_url":"https://api.github.com/users/sulu/events{/privacy}","received_events_url":"https://api.github.com/users/sulu/received_events","type":"Organization","site_admin":false},"repo":{"id":34324017,"name":"SuluContactExtensionBundle","full_name":"sulu/SuluContactExtensionBundle","owner":{"login":"sulu","id":5717006,"avatar_url":"https://avatars.githubusercontent.com/u/5717006?v=3","gravatar_id":"","url":"https://api.github.com/users/sulu","html_url":"https://github.com/sulu","followers_url":"https://api.github.com/users/sulu/followers","following_url":"https://api.github.com/users/sulu/following{/other_user}","gists_url":"https://api.github.com/users/sulu/gists{/gist_id}","starred_url":"https://api.github.com/users/sulu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sulu/subscriptions","organizations_url":"https://api.github.com/users/sulu/orgs","repos_url":"https://api.github.com/users/sulu/repos","events_url":"https://api.github.com/users/sulu/events{/privacy}","received_events_url":"https://api.github.com/users/sulu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sulu/SuluContactExtensionBundle","description":"Sulu contact extension bundle","fork":false,"url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle","forks_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/forks","keys_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/teams","hooks_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/hooks","issue_events_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/issues/events{/number}","events_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/events","assignees_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/assignees{/user}","branches_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/branches{/branch}","tags_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/tags","blobs_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/languages","stargazers_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/stargazers","contributors_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/contributors","subscribers_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/subscribers","subscription_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/subscription","commits_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/contents/{+path}","compare_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/merges","archive_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/downloads","issues_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/issues{/number}","pulls_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/labels{/name}","releases_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/releases{/id}","deployments_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/deployments","created_at":"2015-04-21T11:53:59Z","updated_at":"2016-03-30T13:57:30Z","pushed_at":"2016-06-14T10:36:58Z","git_url":"git://github.com/sulu/SuluContactExtensionBundle.git","ssh_url":"git@github.com:sulu/SuluContactExtensionBundle.git","clone_url":"https://github.com/sulu/SuluContactExtensionBundle.git","svn_url":"https://github.com/sulu/SuluContactExtensionBundle","homepage":"","size":232,"stargazers_count":0,"watchers_count":0,"language":"PHP","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":"sulu:develop","ref":"develop","sha":"e3dde08760d000534c617de91e966058211cf6e9","user":{"login":"sulu","id":5717006,"avatar_url":"https://avatars.githubusercontent.com/u/5717006?v=3","gravatar_id":"","url":"https://api.github.com/users/sulu","html_url":"https://github.com/sulu","followers_url":"https://api.github.com/users/sulu/followers","following_url":"https://api.github.com/users/sulu/following{/other_user}","gists_url":"https://api.github.com/users/sulu/gists{/gist_id}","starred_url":"https://api.github.com/users/sulu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sulu/subscriptions","organizations_url":"https://api.github.com/users/sulu/orgs","repos_url":"https://api.github.com/users/sulu/repos","events_url":"https://api.github.com/users/sulu/events{/privacy}","received_events_url":"https://api.github.com/users/sulu/received_events","type":"Organization","site_admin":false},"repo":{"id":34324017,"name":"SuluContactExtensionBundle","full_name":"sulu/SuluContactExtensionBundle","owner":{"login":"sulu","id":5717006,"avatar_url":"https://avatars.githubusercontent.com/u/5717006?v=3","gravatar_id":"","url":"https://api.github.com/users/sulu","html_url":"https://github.com/sulu","followers_url":"https://api.github.com/users/sulu/followers","following_url":"https://api.github.com/users/sulu/following{/other_user}","gists_url":"https://api.github.com/users/sulu/gists{/gist_id}","starred_url":"https://api.github.com/users/sulu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sulu/subscriptions","organizations_url":"https://api.github.com/users/sulu/orgs","repos_url":"https://api.github.com/users/sulu/repos","events_url":"https://api.github.com/users/sulu/events{/privacy}","received_events_url":"https://api.github.com/users/sulu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sulu/SuluContactExtensionBundle","description":"Sulu contact extension bundle","fork":false,"url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle","forks_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/forks","keys_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/teams","hooks_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/hooks","issue_events_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/issues/events{/number}","events_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/events","assignees_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/assignees{/user}","branches_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/branches{/branch}","tags_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/tags","blobs_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/languages","stargazers_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/stargazers","contributors_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/contributors","subscribers_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/subscribers","subscription_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/subscription","commits_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/contents/{+path}","compare_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/merges","archive_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/downloads","issues_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/issues{/number}","pulls_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/labels{/name}","releases_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/releases{/id}","deployments_url":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/deployments","created_at":"2015-04-21T11:53:59Z","updated_at":"2016-03-30T13:57:30Z","pushed_at":"2016-06-14T10:36:58Z","git_url":"git://github.com/sulu/SuluContactExtensionBundle.git","ssh_url":"git@github.com:sulu/SuluContactExtensionBundle.git","clone_url":"https://github.com/sulu/SuluContactExtensionBundle.git","svn_url":"https://github.com/sulu/SuluContactExtensionBundle","homepage":"","size":232,"stargazers_count":0,"watchers_count":0,"language":"PHP","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/sulu/SuluContactExtensionBundle/pulls/46"},"html":{"href":"https://github.com/sulu/SuluContactExtensionBundle/pull/46"},"issue":{"href":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/issues/46"},"comments":{"href":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/issues/46/comments"},"review_comments":{"href":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/pulls/46/comments"},"review_comment":{"href":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/pulls/46/commits"},"statuses":{"href":"https://api.github.com/repos/sulu/SuluContactExtensionBundle/statuses/5a647c73067b2082cbf35019d1f674ba13bdc07f"}}}}
{"actor":{"display_login":"turbo-ele"}}