{"action":"created","comment":{"url":"https://api.github.com/repos/pkp/pkp-lib/pulls/comments/76111465","id":76111465,"diff_hunk":"@@ -0,0 +1,218 @@\n+<?php\n+\n+/**\n+ * @file classes/notification/managerDelegate/EditingStatusNotificationManager.inc.php\n+ *\n+ * Copyright (c) 2014-2016 Simon Fraser University Library\n+ * Copyright (c) 2003-2016 John Willinsky\n+ * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.\n+ *\n+ * @class EditingStatusNotificationManager\n+ * @ingroup classses_notification_managerDelegate\n+ *\n+ * @brief Editing status notifications types manager delegate.\n+ */\n+\n+import('lib.pkp.classes.notification.NotificationManagerDelegate');\n+\n+class EditingStatusNotificationManager extends NotificationManagerDelegate {\n+\n+\t/**\n+\t * Constructor.\n+\t * @param $notificationType int NOTIFICATION_TYPE_...\n+\t */\n+\tfunction EditingStatusNotificationManager($notificationType) {\n+\t\tparent::NotificationManagerDelegate($notificationType);\n+\t}\n+\n+\t/**\n+\t * @copydoc PKPNotificationOperationManager::getNotificationMessage()\n+\t */\n+\tpublic function getNotificationMessage($request, $notification) {\n+\t\tswitch ($notification->getType()) {\n+\t\t\tcase NOTIFICATION_TYPE_ASSIGN_COPYEDITOR:\n+\t\t\t\treturn __('notification.type.assignCopyeditors');\n+\t\t\tcase NOTIFICATION_TYPE_AWAITING_COPYEDITS:\n+\t\t\t\treturn __('notification.type.awaitingCopyedits');\n+\t\t}\n+\t}\n+\n+\t/**\n+\t * @copydoc PKPNotificationOperationManager::getNotificationUrl()\n+\t */\n+\tpublic function getNotificationUrl($request, $notification) {\n+\t\t$url = parent::getNotificationUrl($request, $notification);\n+\t\t$dispatcher = Application::getDispatcher();\n+\t\t$contextDao = Application::getContextDAO();\n+\t\t$context = $contextDao->getById($notification->getContextId());\n+\n+\t\tswitch ($notification->getType()) {\n+\t\t\tcase NOTIFICATION_TYPE_ASSIGN_COPYEDITOR:\n+\t\t\tcase NOTIFICATION_TYPE_AWAITING_COPYEDITS:\n+\t\t\t\tassert($notification->getAssocType() == ASSOC_TYPE_SUBMISSION && is_numeric($notification->getAssocId()));\n+\t\t\t\treturn $dispatcher->url($request, ROUTE_PAGE, $context->getPath(), 'workflow', 'access', $notification->getAssocId());\n+\t\t}\n+\t}\n+\n+\t/**\n+\t * @copydoc PKPNotificationOperationManager::getStyleClass()\n+\t */\n+\tpublic function getStyleClass($notification) {\n+\t\treturn NOTIFICATION_STYLE_CLASS_INFORMATION;\n+\t}\n+\n+\t/**\n+\t * @copydoc NotificationManagerDelegate::updateNotification()\n+\t */\n+\tpublic function updateNotification($request, $userIds, $assocType, $assocId) {\n+\t\t$context = $request->getContext();\n+\t\t$contextId = $context->getId();\n+\n+\t\tassert($assocType == ASSOC_TYPE_SUBMISSION);\n+\t\t$submissionId = $assocId;\n+\t\t$submissionDao = Application::getSubmissionDAO();\n+\t\t$submission = $submissionDao->getById($submissionId);\n+\n+\t\t$stageAssignmentDao = DAORegistry::getDAO('StageAssignmentDAO');\n+\t\t$editorStageAssignments = $stageAssignmentDao->getEditorsAssignedToStage($submissionId, $submission->getStageId());\n+\n+\t\t// One way to check if a copyeditor is assigned\n+\t\t// Get the 'copyedit assignment' notifications\n+\t\t$copyEditorAssigned = false;\n+\t\t$notificationDao = DAORegistry::getDAO('NotificationDAO'); /* @var $notificationDao NotificationDAO */\n+\t\t$copyEditAssignmentNotificationFactory = $notificationDao->getByAssoc(","path":"classes/notification/managerDelegate/EditingStatusNotificationManager.inc.php","position":83,"original_position":83,"commit_id":"46a68ec37af7fb3c442c554b78e139a0099549bd","original_commit_id":"46a68ec37af7fb3c442c554b78e139a0099549bd","user":{"login":"bozana","id":378421,"avatar_url":"https://avatars.githubusercontent.com/u/378421?v=3","gravatar_id":"","url":"https://api.github.com/users/bozana","html_url":"https://github.com/bozana","followers_url":"https://api.github.com/users/bozana/followers","following_url":"https://api.github.com/users/bozana/following{/other_user}","gists_url":"https://api.github.com/users/bozana/gists{/gist_id}","starred_url":"https://api.github.com/users/bozana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bozana/subscriptions","organizations_url":"https://api.github.com/users/bozana/orgs","repos_url":"https://api.github.com/users/bozana/repos","events_url":"https://api.github.com/users/bozana/events{/privacy}","received_events_url":"https://api.github.com/users/bozana/received_events","type":"User","site_admin":false},"body":"OK :-)","created_at":"2016-08-24T18:23:40Z","updated_at":"2016-08-24T18:23:40Z","html_url":"https://github.com/pkp/pkp-lib/pull/1752#discussion_r76111465","pull_request_url":"https://api.github.com/repos/pkp/pkp-lib/pulls/1752","_links":{"self":{"href":"https://api.github.com/repos/pkp/pkp-lib/pulls/comments/76111465"},"html":{"href":"https://github.com/pkp/pkp-lib/pull/1752#discussion_r76111465"},"pull_request":{"href":"https://api.github.com/repos/pkp/pkp-lib/pulls/1752"}}},"pull_request":{"url":"https://api.github.com/repos/pkp/pkp-lib/pulls/1752","id":82574933,"html_url":"https://github.com/pkp/pkp-lib/pull/1752","diff_url":"https://github.com/pkp/pkp-lib/pull/1752.diff","patch_url":"https://github.com/pkp/pkp-lib/pull/1752.patch","issue_url":"https://api.github.com/repos/pkp/pkp-lib/issues/1752","number":1752,"state":"open","locked":false,"title":"banner notifications","user":{"login":"bozana","id":378421,"avatar_url":"https://avatars.githubusercontent.com/u/378421?v=3","gravatar_id":"","url":"https://api.github.com/users/bozana","html_url":"https://github.com/bozana","followers_url":"https://api.github.com/users/bozana/followers","following_url":"https://api.github.com/users/bozana/following{/other_user}","gists_url":"https://api.github.com/users/bozana/gists{/gist_id}","starred_url":"https://api.github.com/users/bozana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bozana/subscriptions","organizations_url":"https://api.github.com/users/bozana/orgs","repos_url":"https://api.github.com/users/bozana/repos","events_url":"https://api.github.com/users/bozana/events{/privacy}","received_events_url":"https://api.github.com/users/bozana/received_events","type":"User","site_admin":false},"body":"S. https://github.com/pkp/pkp-lib/issues/1710\r\nThis fixes also https://github.com/pkp/pkp-lib/issues/1682","created_at":"2016-08-24T16:27:05Z","updated_at":"2016-08-24T18:23:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f6c6aa875d8dd6d8ab8fcd13acf9d051a9f9ab2a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/pkp/pkp-lib/pulls/1752/commits","review_comments_url":"https://api.github.com/repos/pkp/pkp-lib/pulls/1752/comments","review_comment_url":"https://api.github.com/repos/pkp/pkp-lib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pkp/pkp-lib/issues/1752/comments","statuses_url":"https://api.github.com/repos/pkp/pkp-lib/statuses/46a68ec37af7fb3c442c554b78e139a0099549bd","head":{"label":"bozana:1710fix-2","ref":"1710fix-2","sha":"46a68ec37af7fb3c442c554b78e139a0099549bd","user":{"login":"bozana","id":378421,"avatar_url":"https://avatars.githubusercontent.com/u/378421?v=3","gravatar_id":"","url":"https://api.github.com/users/bozana","html_url":"https://github.com/bozana","followers_url":"https://api.github.com/users/bozana/followers","following_url":"https://api.github.com/users/bozana/following{/other_user}","gists_url":"https://api.github.com/users/bozana/gists{/gist_id}","starred_url":"https://api.github.com/users/bozana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bozana/subscriptions","organizations_url":"https://api.github.com/users/bozana/orgs","repos_url":"https://api.github.com/users/bozana/repos","events_url":"https://api.github.com/users/bozana/events{/privacy}","received_events_url":"https://api.github.com/users/bozana/received_events","type":"User","site_admin":false},"repo":{"id":1022431,"name":"pkp-lib","full_name":"bozana/pkp-lib","owner":{"login":"bozana","id":378421,"avatar_url":"https://avatars.githubusercontent.com/u/378421?v=3","gravatar_id":"","url":"https://api.github.com/users/bozana","html_url":"https://github.com/bozana","followers_url":"https://api.github.com/users/bozana/followers","following_url":"https://api.github.com/users/bozana/following{/other_user}","gists_url":"https://api.github.com/users/bozana/gists{/gist_id}","starred_url":"https://api.github.com/users/bozana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bozana/subscriptions","organizations_url":"https://api.github.com/users/bozana/orgs","repos_url":"https://api.github.com/users/bozana/repos","events_url":"https://api.github.com/users/bozana/events{/privacy}","received_events_url":"https://api.github.com/users/bozana/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bozana/pkp-lib","description":"PKP Web Application Library","fork":true,"url":"https://api.github.com/repos/bozana/pkp-lib","forks_url":"https://api.github.com/repos/bozana/pkp-lib/forks","keys_url":"https://api.github.com/repos/bozana/pkp-lib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bozana/pkp-lib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bozana/pkp-lib/teams","hooks_url":"https://api.github.com/repos/bozana/pkp-lib/hooks","issue_events_url":"https://api.github.com/repos/bozana/pkp-lib/issues/events{/number}","events_url":"https://api.github.com/repos/bozana/pkp-lib/events","assignees_url":"https://api.github.com/repos/bozana/pkp-lib/assignees{/user}","branches_url":"https://api.github.com/repos/bozana/pkp-lib/branches{/branch}","tags_url":"https://api.github.com/repos/bozana/pkp-lib/tags","blobs_url":"https://api.github.com/repos/bozana/pkp-lib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bozana/pkp-lib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bozana/pkp-lib/git/refs{/sha}","trees_url":"https://api.github.com/repos/bozana/pkp-lib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bozana/pkp-lib/statuses/{sha}","languages_url":"https://api.github.com/repos/bozana/pkp-lib/languages","stargazers_url":"https://api.github.com/repos/bozana/pkp-lib/stargazers","contributors_url":"https://api.github.com/repos/bozana/pkp-lib/contributors","subscribers_url":"https://api.github.com/repos/bozana/pkp-lib/subscribers","subscription_url":"https://api.github.com/repos/bozana/pkp-lib/subscription","commits_url":"https://api.github.com/repos/bozana/pkp-lib/commits{/sha}","git_commits_url":"https://api.github.com/repos/bozana/pkp-lib/git/commits{/sha}","comments_url":"https://api.github.com/repos/bozana/pkp-lib/comments{/number}","issue_comment_url":"https://api.github.com/repos/bozana/pkp-lib/issues/comments{/number}","contents_url":"https://api.github.com/repos/bozana/pkp-lib/contents/{+path}","compare_url":"https://api.github.com/repos/bozana/pkp-lib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bozana/pkp-lib/merges","archive_url":"https://api.github.com/repos/bozana/pkp-lib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bozana/pkp-lib/downloads","issues_url":"https://api.github.com/repos/bozana/pkp-lib/issues{/number}","pulls_url":"https://api.github.com/repos/bozana/pkp-lib/pulls{/number}","milestones_url":"https://api.github.com/repos/bozana/pkp-lib/milestones{/number}","notifications_url":"https://api.github.com/repos/bozana/pkp-lib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bozana/pkp-lib/labels{/name}","releases_url":"https://api.github.com/repos/bozana/pkp-lib/releases{/id}","deployments_url":"https://api.github.com/repos/bozana/pkp-lib/deployments","created_at":"2010-10-25T14:14:36Z","updated_at":"2014-08-01T14:24:08Z","pushed_at":"2016-08-24T16:18:26Z","git_url":"git://github.com/bozana/pkp-lib.git","ssh_url":"git@github.com:bozana/pkp-lib.git","clone_url":"https://github.com/bozana/pkp-lib.git","svn_url":"https://github.com/bozana/pkp-lib","homepage":"http://pkp.sfu.ca","size":37570,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"dev"}},"base":{"label":"pkp:master","ref":"master","sha":"30b2e12d6e96a33604d351fdffd429a4a666c78b","user":{"login":"pkp","id":130896,"avatar_url":"https://avatars.githubusercontent.com/u/130896?v=3","gravatar_id":"","url":"https://api.github.com/users/pkp","html_url":"https://github.com/pkp","followers_url":"https://api.github.com/users/pkp/followers","following_url":"https://api.github.com/users/pkp/following{/other_user}","gists_url":"https://api.github.com/users/pkp/gists{/gist_id}","starred_url":"https://api.github.com/users/pkp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkp/subscriptions","organizations_url":"https://api.github.com/users/pkp/orgs","repos_url":"https://api.github.com/users/pkp/repos","events_url":"https://api.github.com/users/pkp/events{/privacy}","received_events_url":"https://api.github.com/users/pkp/received_events","type":"Organization","site_admin":false},"repo":{"id":316712,"name":"pkp-lib","full_name":"pkp/pkp-lib","owner":{"login":"pkp","id":130896,"avatar_url":"https://avatars.githubusercontent.com/u/130896?v=3","gravatar_id":"","url":"https://api.github.com/users/pkp","html_url":"https://github.com/pkp","followers_url":"https://api.github.com/users/pkp/followers","following_url":"https://api.github.com/users/pkp/following{/other_user}","gists_url":"https://api.github.com/users/pkp/gists{/gist_id}","starred_url":"https://api.github.com/users/pkp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkp/subscriptions","organizations_url":"https://api.github.com/users/pkp/orgs","repos_url":"https://api.github.com/users/pkp/repos","events_url":"https://api.github.com/users/pkp/events{/privacy}","received_events_url":"https://api.github.com/users/pkp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pkp/pkp-lib","description":"PKP Web Application Library","fork":false,"url":"https://api.github.com/repos/pkp/pkp-lib","forks_url":"https://api.github.com/repos/pkp/pkp-lib/forks","keys_url":"https://api.github.com/repos/pkp/pkp-lib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pkp/pkp-lib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pkp/pkp-lib/teams","hooks_url":"https://api.github.com/repos/pkp/pkp-lib/hooks","issue_events_url":"https://api.github.com/repos/pkp/pkp-lib/issues/events{/number}","events_url":"https://api.github.com/repos/pkp/pkp-lib/events","assignees_url":"https://api.github.com/repos/pkp/pkp-lib/assignees{/user}","branches_url":"https://api.github.com/repos/pkp/pkp-lib/branches{/branch}","tags_url":"https://api.github.com/repos/pkp/pkp-lib/tags","blobs_url":"https://api.github.com/repos/pkp/pkp-lib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pkp/pkp-lib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pkp/pkp-lib/git/refs{/sha}","trees_url":"https://api.github.com/repos/pkp/pkp-lib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pkp/pkp-lib/statuses/{sha}","languages_url":"https://api.github.com/repos/pkp/pkp-lib/languages","stargazers_url":"https://api.github.com/repos/pkp/pkp-lib/stargazers","contributors_url":"https://api.github.com/repos/pkp/pkp-lib/contributors","subscribers_url":"https://api.github.com/repos/pkp/pkp-lib/subscribers","subscription_url":"https://api.github.com/repos/pkp/pkp-lib/subscription","commits_url":"https://api.github.com/repos/pkp/pkp-lib/commits{/sha}","git_commits_url":"https://api.github.com/repos/pkp/pkp-lib/git/commits{/sha}","comments_url":"https://api.github.com/repos/pkp/pkp-lib/comments{/number}","issue_comment_url":"https://api.github.com/repos/pkp/pkp-lib/issues/comments{/number}","contents_url":"https://api.github.com/repos/pkp/pkp-lib/contents/{+path}","compare_url":"https://api.github.com/repos/pkp/pkp-lib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pkp/pkp-lib/merges","archive_url":"https://api.github.com/repos/pkp/pkp-lib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pkp/pkp-lib/downloads","issues_url":"https://api.github.com/repos/pkp/pkp-lib/issues{/number}","pulls_url":"https://api.github.com/repos/pkp/pkp-lib/pulls{/number}","milestones_url":"https://api.github.com/repos/pkp/pkp-lib/milestones{/number}","notifications_url":"https://api.github.com/repos/pkp/pkp-lib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pkp/pkp-lib/labels{/name}","releases_url":"https://api.github.com/repos/pkp/pkp-lib/releases{/id}","deployments_url":"https://api.github.com/repos/pkp/pkp-lib/deployments","created_at":"2009-09-24T19:30:31Z","updated_at":"2016-08-22T20:34:11Z","pushed_at":"2016-08-24T18:17:11Z","git_url":"git://github.com/pkp/pkp-lib.git","ssh_url":"git@github.com:pkp/pkp-lib.git","clone_url":"https://github.com/pkp/pkp-lib.git","svn_url":"https://github.com/pkp/pkp-lib","homepage":"http://pkp.sfu.ca","size":54429,"stargazers_count":66,"watchers_count":66,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":162,"mirror_url":null,"open_issues_count":255,"forks":162,"open_issues":255,"watchers":66,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pkp/pkp-lib/pulls/1752"},"html":{"href":"https://github.com/pkp/pkp-lib/pull/1752"},"issue":{"href":"https://api.github.com/repos/pkp/pkp-lib/issues/1752"},"comments":{"href":"https://api.github.com/repos/pkp/pkp-lib/issues/1752/comments"},"review_comments":{"href":"https://api.github.com/repos/pkp/pkp-lib/pulls/1752/comments"},"review_comment":{"href":"https://api.github.com/repos/pkp/pkp-lib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pkp/pkp-lib/pulls/1752/commits"},"statuses":{"href":"https://api.github.com/repos/pkp/pkp-lib/statuses/46a68ec37af7fb3c442c554b78e139a0099549bd"}}}}
{"actor":{"display_login":"bozana"}}