{"action":"created","comment":{"url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/pulls/comments/93762114","pull_request_review_id":14296727,"id":93762114,"diff_hunk":"@@ -0,0 +1,82 @@\n+import AbstractFormView from '../../../Service/Form/View/AbstractFormView'\n+import Status           from '../../Model/Status/Status'\n+import FlashMessageBag  from '../../../Service/FlashMessage/FlashMessageBag'\n+import FlashMessage     from '../../../Service/FlashMessage/FlashMessage'\n+\n+/**\n+ * @class NewStatusView\n+ */\n+class NewStatusView extends AbstractFormView\n+{\n+    /**\n+     * Pre initialize\n+     * @param {Object} options\n+     */\n+    preinitialize(options) {\n+        super.preinitialize(options);\n+        this.events['click button.submit-continue-form'] = '_submit';\n+    }\n+\n+    /**\n+     * Render view\n+     */\n+    render() {\n+        let template = this._renderTemplate('Status/newStatusView', {messages: FlashMessageBag.getMessages()});\n+        this.$el.html(template);\n+        this._$formRegion = $('.form-new', this.$el);\n+        super.render();\n+\n+        return this;\n+    }\n+\n+    /**\n+     * @param  {Object} event\n+     *\n+     * @return {Object}\n+     */\n+    getStatusCodeForm(event) {\n+        let statusCodeForm = {\n+            '422': $.proxy(this.refreshRender, this),\n+            '201': $.proxy(this._redirectEditStatus, this)\n+        };\n+\n+        if ($(event.currentTarget).hasClass('submit-continue-form')) {\n+            statusCodeForm['201'] = $.proxy(this._redirectNewStatus, this);\n+        }\n+\n+        return statusCodeForm;\n+    }\n+\n+    /**\n+     * Redirect to edit status view\n+     *\n+     * @param {mixed}  data\n+     * @param {string} textStatus\n+     * @param {object} jqXHR\n+     * @private\n+     */\n+    _redirectEditStatus(data, textStatus, jqXHR) {\n+        let statusId = jqXHR.getResponseHeader('statusId');\n+        if (null === statusId) {\n+            throw new ApplicationError('Invalid statusId');\n+        }\n+        let url = Backbone.history.generateUrl('editStatus', {statusId: statusId});\n+        Backbone.Events.trigger('form:deactivate', this);\n+        Backbone.history.navigate(url, true);\n+    }\n+\n+    /**\n+     * Redirect to new status view\n+     *\n+     * @param {mixed}  data\n+     * @private\n+     */\n+    _redirectNewStatus(data) {\n+        let message = new FlashMessage(data, 'success');\n+        FlashMessageBag.addMessageFlash(message);","path":"WorkflowAdminBundle/Resources/public/ecmascript/OpenOrchestra/Application/View/Status/NewStatusView.js","position":76,"original_position":76,"commit_id":"f8fd8d1ff272eb9228d2265706ff3c20a18dbc2d","original_commit_id":"f8fd8d1ff272eb9228d2265706ff3c20a18dbc2d","user":{"login":"alavieille","id":11750768,"avatar_url":"https://avatars.githubusercontent.com/u/11750768?v=3","gravatar_id":"","url":"https://api.github.com/users/alavieille","html_url":"https://github.com/alavieille","followers_url":"https://api.github.com/users/alavieille/followers","following_url":"https://api.github.com/users/alavieille/following{/other_user}","gists_url":"https://api.github.com/users/alavieille/gists{/gist_id}","starred_url":"https://api.github.com/users/alavieille/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alavieille/subscriptions","organizations_url":"https://api.github.com/users/alavieille/orgs","repos_url":"https://api.github.com/users/alavieille/repos","events_url":"https://api.github.com/users/alavieille/events{/privacy}","received_events_url":"https://api.github.com/users/alavieille/received_events","type":"User","site_admin":false},"body":"i think this part isn't necessary","created_at":"2016-12-23T12:48:23Z","updated_at":"2016-12-23T12:48:32Z","html_url":"https://github.com/open-orchestra/open-orchestra-cms-bundle/pull/2040#discussion_r93762114","pull_request_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/pulls/2040","_links":{"self":{"href":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/pulls/comments/93762114"},"html":{"href":"https://github.com/open-orchestra/open-orchestra-cms-bundle/pull/2040#discussion_r93762114"},"pull_request":{"href":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/pulls/2040"}}},"pull_request":{"url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/pulls/2040","id":98930782,"html_url":"https://github.com/open-orchestra/open-orchestra-cms-bundle/pull/2040","diff_url":"https://github.com/open-orchestra/open-orchestra-cms-bundle/pull/2040.diff","patch_url":"https://github.com/open-orchestra/open-orchestra-cms-bundle/pull/2040.patch","issue_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/issues/2040","number":2040,"state":"open","locked":false,"title":"2 0 status edition","user":{"login":"ngilain","id":6725138,"avatar_url":"https://avatars.githubusercontent.com/u/6725138?v=3","gravatar_id":"","url":"https://api.github.com/users/ngilain","html_url":"https://github.com/ngilain","followers_url":"https://api.github.com/users/ngilain/followers","following_url":"https://api.github.com/users/ngilain/following{/other_user}","gists_url":"https://api.github.com/users/ngilain/gists{/gist_id}","starred_url":"https://api.github.com/users/ngilain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngilain/subscriptions","organizations_url":"https://api.github.com/users/ngilain/orgs","repos_url":"https://api.github.com/users/ngilain/repos","events_url":"https://api.github.com/users/ngilain/events{/privacy}","received_events_url":"https://api.github.com/users/ngilain/received_events","type":"User","site_admin":false},"body":"Add status edition screen\r\nhttps://github.com/open-orchestra/open-orchestra/pull/1118\r\nhttps://github.com/open-orchestra/open-orchestra-cms-bundle/pull/2040\r\nhttps://github.com/open-orchestra/open-orchestra-model-bundle/pull/708\r\nhttps://github.com/open-orchestra/open-orchestra-model-interface/pull/269","created_at":"2016-12-21T13:16:04Z","updated_at":"2016-12-23T12:48:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e0ab4b9cdf2f14d5d06270fc3ae17af78e0b327c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/pulls/2040/commits","review_comments_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/pulls/2040/comments","review_comment_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/issues/2040/comments","statuses_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/statuses/f8fd8d1ff272eb9228d2265706ff3c20a18dbc2d","head":{"label":"open-orchestra:2-0_status_edition","ref":"2-0_status_edition","sha":"f8fd8d1ff272eb9228d2265706ff3c20a18dbc2d","user":{"login":"open-orchestra","id":11756116,"avatar_url":"https://avatars.githubusercontent.com/u/11756116?v=3","gravatar_id":"","url":"https://api.github.com/users/open-orchestra","html_url":"https://github.com/open-orchestra","followers_url":"https://api.github.com/users/open-orchestra/followers","following_url":"https://api.github.com/users/open-orchestra/following{/other_user}","gists_url":"https://api.github.com/users/open-orchestra/gists{/gist_id}","starred_url":"https://api.github.com/users/open-orchestra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-orchestra/subscriptions","organizations_url":"https://api.github.com/users/open-orchestra/orgs","repos_url":"https://api.github.com/users/open-orchestra/repos","events_url":"https://api.github.com/users/open-orchestra/events{/privacy}","received_events_url":"https://api.github.com/users/open-orchestra/received_events","type":"Organization","site_admin":false},"repo":{"id":21900253,"name":"open-orchestra-cms-bundle","full_name":"open-orchestra/open-orchestra-cms-bundle","owner":{"login":"open-orchestra","id":11756116,"avatar_url":"https://avatars.githubusercontent.com/u/11756116?v=3","gravatar_id":"","url":"https://api.github.com/users/open-orchestra","html_url":"https://github.com/open-orchestra","followers_url":"https://api.github.com/users/open-orchestra/followers","following_url":"https://api.github.com/users/open-orchestra/following{/other_user}","gists_url":"https://api.github.com/users/open-orchestra/gists{/gist_id}","starred_url":"https://api.github.com/users/open-orchestra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-orchestra/subscriptions","organizations_url":"https://api.github.com/users/open-orchestra/orgs","repos_url":"https://api.github.com/users/open-orchestra/repos","events_url":"https://api.github.com/users/open-orchestra/events{/privacy}","received_events_url":"https://api.github.com/users/open-orchestra/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/open-orchestra/open-orchestra-cms-bundle","description":"The open orchestra cms bundle","fork":false,"url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle","forks_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/forks","keys_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/teams","hooks_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/hooks","issue_events_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/issues/events{/number}","events_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/events","assignees_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/assignees{/user}","branches_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/branches{/branch}","tags_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/tags","blobs_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/statuses/{sha}","languages_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/languages","stargazers_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/stargazers","contributors_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/contributors","subscribers_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/subscribers","subscription_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/subscription","commits_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/contents/{+path}","compare_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/merges","archive_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/downloads","issues_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/issues{/number}","pulls_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/pulls{/number}","milestones_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/milestones{/number}","notifications_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/labels{/name}","releases_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/releases{/id}","deployments_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/deployments","created_at":"2014-07-16T12:49:27Z","updated_at":"2016-10-25T14:24:36Z","pushed_at":"2016-12-22T22:49:44Z","git_url":"git://github.com/open-orchestra/open-orchestra-cms-bundle.git","ssh_url":"git@github.com:open-orchestra/open-orchestra-cms-bundle.git","clone_url":"https://github.com/open-orchestra/open-orchestra-cms-bundle.git","svn_url":"https://github.com/open-orchestra/open-orchestra-cms-bundle","homepage":"http://open-orchestra.com","size":19401,"stargazers_count":5,"watchers_count":5,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":16,"forks":3,"open_issues":16,"watchers":5,"default_branch":"master"}},"base":{"label":"open-orchestra:master","ref":"master","sha":"385f7db44a2f511f7abe36dc2a32c921b708c851","user":{"login":"open-orchestra","id":11756116,"avatar_url":"https://avatars.githubusercontent.com/u/11756116?v=3","gravatar_id":"","url":"https://api.github.com/users/open-orchestra","html_url":"https://github.com/open-orchestra","followers_url":"https://api.github.com/users/open-orchestra/followers","following_url":"https://api.github.com/users/open-orchestra/following{/other_user}","gists_url":"https://api.github.com/users/open-orchestra/gists{/gist_id}","starred_url":"https://api.github.com/users/open-orchestra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-orchestra/subscriptions","organizations_url":"https://api.github.com/users/open-orchestra/orgs","repos_url":"https://api.github.com/users/open-orchestra/repos","events_url":"https://api.github.com/users/open-orchestra/events{/privacy}","received_events_url":"https://api.github.com/users/open-orchestra/received_events","type":"Organization","site_admin":false},"repo":{"id":21900253,"name":"open-orchestra-cms-bundle","full_name":"open-orchestra/open-orchestra-cms-bundle","owner":{"login":"open-orchestra","id":11756116,"avatar_url":"https://avatars.githubusercontent.com/u/11756116?v=3","gravatar_id":"","url":"https://api.github.com/users/open-orchestra","html_url":"https://github.com/open-orchestra","followers_url":"https://api.github.com/users/open-orchestra/followers","following_url":"https://api.github.com/users/open-orchestra/following{/other_user}","gists_url":"https://api.github.com/users/open-orchestra/gists{/gist_id}","starred_url":"https://api.github.com/users/open-orchestra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-orchestra/subscriptions","organizations_url":"https://api.github.com/users/open-orchestra/orgs","repos_url":"https://api.github.com/users/open-orchestra/repos","events_url":"https://api.github.com/users/open-orchestra/events{/privacy}","received_events_url":"https://api.github.com/users/open-orchestra/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/open-orchestra/open-orchestra-cms-bundle","description":"The open orchestra cms bundle","fork":false,"url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle","forks_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/forks","keys_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/teams","hooks_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/hooks","issue_events_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/issues/events{/number}","events_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/events","assignees_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/assignees{/user}","branches_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/branches{/branch}","tags_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/tags","blobs_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/statuses/{sha}","languages_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/languages","stargazers_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/stargazers","contributors_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/contributors","subscribers_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/subscribers","subscription_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/subscription","commits_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/contents/{+path}","compare_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/merges","archive_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/downloads","issues_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/issues{/number}","pulls_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/pulls{/number}","milestones_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/milestones{/number}","notifications_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/labels{/name}","releases_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/releases{/id}","deployments_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/deployments","created_at":"2014-07-16T12:49:27Z","updated_at":"2016-10-25T14:24:36Z","pushed_at":"2016-12-22T22:49:44Z","git_url":"git://github.com/open-orchestra/open-orchestra-cms-bundle.git","ssh_url":"git@github.com:open-orchestra/open-orchestra-cms-bundle.git","clone_url":"https://github.com/open-orchestra/open-orchestra-cms-bundle.git","svn_url":"https://github.com/open-orchestra/open-orchestra-cms-bundle","homepage":"http://open-orchestra.com","size":19401,"stargazers_count":5,"watchers_count":5,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":16,"forks":3,"open_issues":16,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/pulls/2040"},"html":{"href":"https://github.com/open-orchestra/open-orchestra-cms-bundle/pull/2040"},"issue":{"href":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/issues/2040"},"comments":{"href":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/issues/2040/comments"},"review_comments":{"href":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/pulls/2040/comments"},"review_comment":{"href":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/pulls/2040/commits"},"statuses":{"href":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/statuses/f8fd8d1ff272eb9228d2265706ff3c20a18dbc2d"}}}}
{"actor":{"display_login":"alavieille"}}