当前位置: 首页>>代码示例>>PHP>>正文


PHP NotificationManager::createNotification方法代码示例

本文整理汇总了PHP中NotificationManager::createNotification方法的典型用法代码示例。如果您正苦于以下问题:PHP NotificationManager::createNotification方法的具体用法?PHP NotificationManager::createNotification怎么用?PHP NotificationManager::createNotification使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NotificationManager的用法示例。


在下文中一共展示了NotificationManager::createNotification方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setVerified

 public function setVerified($bool)
 {
     NotificationManager::createNotification($this, "Your account was verified.", array());
     $database = new DatabaseManager();
     $database->query("UPDATE `users` SET `verified`='" . $database->sanitize($bool) . "' WHERE `email`='" . $database->sanitize($this->getEmail()) . "'");
     apc_store('userObject_' . $this->blid, $this, 600);
 }
开发者ID:hoff121324,项目名称:GlassWebsite,代码行数:7,代码来源:UserObject.php

示例2: execute

 /**
  * Save announcement.
  * @param $request Request
  */
 function execute(&$request)
 {
     $announcement = parent::execute();
     $journalId = $this->getContextId();
     // Send a notification to associated users
     import('classes.notification.NotificationManager');
     $notificationManager = new NotificationManager();
     $roleDao =& DAORegistry::getDAO('RoleDAO');
     $notificationUsers = array();
     $allUsers = $roleDao->getUsersByJournalId($journalId);
     while (!$allUsers->eof()) {
         $user =& $allUsers->next();
         $notificationUsers[] = array('id' => $user->getId());
         unset($user);
     }
     foreach ($notificationUsers as $userRole) {
         $notificationManager->createNotification($request, $userRole['id'], NOTIFICATION_TYPE_NEW_ANNOUNCEMENT, $journalId, ASSOC_TYPE_ANNOUNCEMENT, $announcement->getId());
     }
     $notificationManager->sendToMailingList($request, $notificationManager->createNotification($request, UNSUBSCRIBED_USER_NOTIFICATION, NOTIFICATION_TYPE_NEW_ANNOUNCEMENT, $journalId, ASSOC_TYPE_ANNOUNCEMENT, $announcement->getId()));
 }
开发者ID:yuricampos,项目名称:ojs,代码行数:24,代码来源:AnnouncementForm.inc.php

示例3: execute

 /**
  * Save announcement.
  */
 function execute()
 {
     parent::execute();
     $journal =& Request::getJournal();
     $journalId = $journal->getId();
     // Send a notification to associated users
     import('notification.NotificationManager');
     $notificationManager = new NotificationManager();
     $roleDao =& DAORegistry::getDAO('RoleDAO');
     $notificationUsers = array();
     $allUsers = $roleDao->getUsersByJournalId($journalId);
     while (!$allUsers->eof()) {
         $user =& $allUsers->next();
         $notificationUsers[] = array('id' => $user->getId());
         unset($user);
     }
     $url = Request::url(null, 'announcement', 'view', array(1));
     foreach ($notificationUsers as $userRole) {
         $notificationManager->createNotification($userRole['id'], 'notification.type.newAnnouncement', null, $url, 1, NOTIFICATION_TYPE_NEW_ANNOUNCEMENT);
     }
     $notificationManager->sendToMailingList($notificationManager->createNotification(0, 'notification.type.newAnnouncement', null, $url, 1, NOTIFICATION_TYPE_NEW_ANNOUNCEMENT));
 }
开发者ID:philschatz,项目名称:ojs,代码行数:25,代码来源:AnnouncementForm.inc.php

示例4: execute

 /**
  * Save announcement.
  */
 function execute()
 {
     $announcement = parent::execute();
     $press =& Request::getPress();
     $pressId = $press->getId();
     // Send a notification to associated users
     import('lib.pkp.classes.notification.NotificationManager');
     $userGroupDao =& DAORegistry::getDAO('RoleAssignmentDAO');
     $notificationUsers = array();
     $allUsers = $userGroupDao->getUsersByContextId($pressId);
     while (!$allUsers->eof()) {
         $user =& $allUsers->next();
         $notificationUsers[] = array('id' => $user->getId());
         unset($user);
     }
     $url = Request::url(null, 'announcement', 'view', array($announcement->getId()));
     $notificationManager = new NotificationManager();
     foreach ($notificationUsers as $userRole) {
         $notificationManager->createNotification($userRole['id'], 'notification.type.newAnnouncement', null, $url, 1, NOTIFICATION_TYPE_NEW_ANNOUNCEMENT);
     }
     $notificationManager->sendToMailingList($notificationManager->createNotification(0, 'notification.type.newAnnouncement', null, $url, 1, NOTIFICATION_TYPE_NEW_ANNOUNCEMENT));
 }
开发者ID:jerico-dev,项目名称:omp,代码行数:25,代码来源:AnnouncementForm.inc.php

示例5: updateContext

 /**
  * Update an existing journal.
  * @param $args array
  * @param $request PKPRequest
  * @return string Serialized JSON object
  */
 function updateContext($args, $request)
 {
     // Identify the context Id.
     $contextId = $request->getUserVar('contextId');
     // Form handling.
     $settingsForm = new JournalSiteSettingsForm($contextId);
     $settingsForm->readInputData();
     if (!$settingsForm->validate()) {
         $json = new JSONMessage(false);
         return $json->getString();
     }
     PluginRegistry::loadCategory('blocks');
     // The context settings form will return a context path in two cases:
     // 1 - if a new context was created;
     // 2 - if a press path of an existing context was edited.
     $newContextPath = $settingsForm->execute($request);
     // Create the notification.
     $notificationMgr = new NotificationManager();
     $user = $request->getUser();
     $notificationMgr->createTrivialNotification($user->getId());
     // Check for the two cases above.
     if ($newContextPath) {
         $context = $request->getContext();
         if (is_null($contextId)) {
             // CASE 1: new press created.
             // Create notification related to payment method configuration.
             $contextDao = Application::getContextDAO();
             $newContext = $contextDao->getByPath($newContextPath);
             $notificationMgr->createNotification($request, null, NOTIFICATION_TYPE_CONFIGURE_PAYMENT_METHOD, $newContext->getId(), ASSOC_TYPE_JOURNAL, $newContext->getId(), NOTIFICATION_LEVEL_NORMAL);
             // redirect and set the parameter to open the press
             // setting wizard modal after redirection.
             return $this->_getRedirectEvent($request, $newContextPath, true);
         } else {
             // CASE 2: check if user is in the context of
             // the press being edited.
             if ($context && $context->getId() == $contextId) {
                 return $this->_getRedirectEvent($request, $newContextPath, false);
             }
         }
     }
     return DAO::getDataChangedEvent($contextId);
 }
开发者ID:jalperin,项目名称:ojs,代码行数:48,代码来源:JournalGridHandler.inc.php

示例6: execute

 /**
  * @copydoc ContextSettingsForm::execute()
  */
 function execute($request)
 {
     $context = $request->getContext();
     // Get the selected payment plugin
     $paymentPluginName = $this->getData('paymentPluginName');
     if (isset($this->paymentPlugins[$paymentPluginName])) {
         $plugin = $this->paymentPlugins[$paymentPluginName];
         // Save the plugin-specific settings
         foreach ($plugin->getSettingsFormFieldNames() as $settingName) {
             $plugin->updateSetting($context->getId(), $settingName, $this->getData($settingName));
         }
         // Remove notification.
         $notificationDao = DAORegistry::getDAO('NotificationDAO');
         $notificationDao->deleteByAssoc($context->getAssocType(), $context->getId(), null, NOTIFICATION_TYPE_CONFIGURE_PAYMENT_METHOD, $context->getId());
     } else {
         // Create notification.
         $notificationMgr = new NotificationManager();
         $notificationMgr->createNotification($request, null, NOTIFICATION_TYPE_CONFIGURE_PAYMENT_METHOD, $context->getId(), $context->getAssocType(), $context->getId(), NOTIFICATION_LEVEL_NORMAL);
     }
     return parent::execute($request);
 }
开发者ID:doana,项目名称:pkp-lib,代码行数:24,代码来源:PaymentMethodForm.inc.php

示例7: saveReviewFormResponse

 /**
  * Save review form response.
  * @param $reviewId int
  * @param $reviewFormId int
  */
 function saveReviewFormResponse($reviewId, $reviewFormId)
 {
     if (!HookRegistry::call('ReviewerAction::saveReviewFormResponse', array($reviewId, $reviewFormId))) {
         import('classes.submission.form.ReviewFormResponseForm');
         $reviewForm = new ReviewFormResponseForm($reviewId, $reviewFormId);
         $reviewForm->readInputData();
         if ($reviewForm->validate()) {
             $reviewForm->execute();
             // Send a notification to associated users
             import('lib.pkp.classes.notification.NotificationManager');
             $notificationManager = new NotificationManager();
             $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
             $sectionDecisionDao =& DAORegistry::getDAO('SectionDecisionDAO');
             $reviewAssignment = $reviewAssignmentDao->getById($reviewId);
             $sectionDecision =& $sectionDecisionDao->getSectionDecision($reviewAssignment->getDecisionId());
             $articleId = $sectionDecision->getArticleId();
             $articleDao =& DAORegistry::getDAO('ArticleDAO');
             $article =& $articleDao->getArticle($articleId);
             $notificationUsers = $article->getAssociatedUserIds();
             foreach ($notificationUsers as $userRole) {
                 $url = Request::url(null, $userRole['role'], 'submission', array($article->getId(), 'submissionReview'), null, 'peerReview');
                 $notificationManager->createNotification($userRole['id'], 'notification.type.reviewerFormComment', $article->getScientificTitle, $url, 1, NOTIFICATION_TYPE_REVIEWER_FORM_COMMENT);
             }
         } else {
             $reviewForm->display();
             return false;
         }
         return true;
     }
 }
开发者ID:elavaud,项目名称:hrp_ct,代码行数:35,代码来源:ReviewerAction.inc.php

示例8: saveSuppFile

 /**
  * Save a supplementary file.
  * @param $args array ($suppFileId)
  */
 function saveSuppFile($args, $request)
 {
     $articleId = $request->getUserVar('articleId');
     $submissionLayoutHandler = new SubmissionLayoutHandler();
     $submissionLayoutHandler->validate($articleId);
     $submission =& $submissionLayoutHandler->submission;
     $this->setupTemplate(true, $articleId, 'editing');
     $suppFileId = (int) array_shift($args);
     $journal =& $request->getJournal();
     import('classes.submission.form.SuppFileForm');
     $submitForm = new SuppFileForm($submission, $journal, $suppFileId);
     $submitForm->readInputData();
     if ($submitForm->validate()) {
         $submitForm->execute();
         // Send a notification to associated users
         import('lib.pkp.classes.notification.NotificationManager');
         $notificationManager = new NotificationManager();
         $articleDao =& DAORegistry::getDAO('ArticleDAO');
         $article =& $articleDao->getArticle($articleId);
         $notificationUsers = $article->getAssociatedUserIds(true, false);
         foreach ($notificationUsers as $userRole) {
             $url = $request->url(null, $userRole['role'], 'submissionEditing', $article->getId(), null, 'layout');
             $notificationManager->createNotification($userRole['id'], 'notification.type.suppFileModified', $article->getLocalizedTitle(), $url, 1, NOTIFICATION_TYPE_SUPP_FILE_MODIFIED);
         }
         $request->redirect(null, null, 'submission', $articleId);
     } else {
         $submitForm->display();
     }
 }
开发者ID:master3395,项目名称:CBPPlatform,代码行数:33,代码来源:SubmissionLayoutHandler.inc.php

示例9: NotificationManager

 /**
  * Initiate a new review round and add selected files
  * to it. Also saves the new round to the submission.
  * @param $submission Submission
  * @param $stageId integer One of the WORKFLOW_STAGE_ID_* constants.
  * @param $request Request
  * @param $status integer One of the REVIEW_ROUND_STATUS_* constants.
  * @return $newRound integer The round number of the new review round.
  */
 function _initiateReviewRound($submission, $stageId, $request, $status = null)
 {
     // If we already have review round for this stage,
     // we create a new round after the last one.
     $reviewRoundDao = DAORegistry::getDAO('ReviewRoundDAO');
     /* @var $reviewRoundDao ReviewRoundDAO */
     $lastReviewRound = $reviewRoundDao->getLastReviewRoundBySubmissionId($submission->getId(), $stageId);
     if ($lastReviewRound) {
         $newRound = $lastReviewRound->getRound() + 1;
     } else {
         // If we don't have any review round, we create the first one.
         $newRound = 1;
     }
     // Create a new review round.
     $reviewRound = $reviewRoundDao->build($submission->getId(), $stageId, $newRound, $status);
     // Check for a notification already in place for the current review round.
     $notificationDao = DAORegistry::getDAO('NotificationDAO');
     $notificationFactory = $notificationDao->getByAssoc(ASSOC_TYPE_REVIEW_ROUND, $reviewRound->getId(), null, NOTIFICATION_TYPE_REVIEW_ROUND_STATUS, $submission->getContextId());
     // Create round status notification if there is no notification already.
     if ($notificationFactory->wasEmpty()) {
         $notificationMgr = new NotificationManager();
         $notificationMgr->createNotification($request, null, NOTIFICATION_TYPE_REVIEW_ROUND_STATUS, $submission->getContextId(), ASSOC_TYPE_REVIEW_ROUND, $reviewRound->getId(), NOTIFICATION_LEVEL_NORMAL);
     }
     // Add the selected files to the new round.
     $submissionFileDao = DAORegistry::getDAO('SubmissionFileDAO');
     /* @var $submissionFileDao SubmissionFileDAO */
     // Bring in the SUBMISSION_FILE_* constants.
     import('lib.pkp.classes.submission.SubmissionFile');
     // Bring in the Manager (we need it).
     import('lib.pkp.classes.file.SubmissionFileManager');
     $submissionFileManager = new SubmissionFileManager($submission->getContextId(), $submission->getId());
     foreach (array('selectedFiles', 'selectedAttachments') as $userVar) {
         $selectedFiles = $this->getData($userVar);
         if (is_array($selectedFiles)) {
             foreach ($selectedFiles as $fileId) {
                 // Retrieve the file last revision number.
                 $revisionNumber = $submissionFileDao->getLatestRevisionNumber($fileId);
                 list($newFileId, $newRevision) = $submissionFileManager->copyFileToFileStage($fileId, $revisionNumber, SUBMISSION_FILE_REVIEW_FILE, null, true);
                 $submissionFileDao->assignRevisionToReviewRound($newFileId, $newRevision, $reviewRound);
             }
         }
     }
     return $newRound;
 }
开发者ID:selwyntcy,项目名称:pkp-lib,代码行数:53,代码来源:EditorDecisionForm.inc.php

示例10: saveComment

 /**
  * Save comment.
  * @param $commentId int
  */
 function saveComment($article, &$comment, $emailComment)
 {
     if (!HookRegistry::call('Action::saveComment', array(&$article, &$comment, &$emailComment))) {
         import('classes.submission.form.comment.EditCommentForm');
         $commentForm = new EditCommentForm($article, $comment);
         $commentForm->readInputData();
         if ($commentForm->validate()) {
             $commentForm->execute();
             // Send a notification to associated users
             import('lib.pkp.classes.notification.NotificationManager');
             $notificationManager = new NotificationManager();
             $notificationUsers = $article->getAssociatedUserIds(true, false);
             foreach ($notificationUsers as $userRole) {
                 $url = Request::url(null, $userRole['role'], 'submissionReview', $article->getId(), null, 'editorDecision');
                 $notificationManager->createNotification($userRole['id'], 'notification.type.submissionComment', $article->getLocalizedTitle(), $url, 1, NOTIFICATION_TYPE_SUBMISSION_COMMENT);
             }
             if ($emailComment) {
                 $commentForm->email($commentForm->emailHelper());
             }
         } else {
             $commentForm->display();
         }
     }
 }
开发者ID:master3395,项目名称:CBPPlatform,代码行数:28,代码来源:Action.inc.php

示例11: publishIssue

 /**
  * Publish issue
  * @param $args array
  * @param $request Request
  */
 function publishIssue($args, $request)
 {
     $issueId = (int) array_shift($args);
     $this->validate($issueId);
     $issue =& $this->issue;
     $journal =& $request->getJournal();
     $journalId = $journal->getId();
     if (!$issue->getPublished()) {
         // Set the status of any attendant queued articles to STATUS_PUBLISHED.
         $publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
         $articleDao =& DAORegistry::getDAO('ArticleDAO');
         $publishedArticles =& $publishedArticleDao->getPublishedArticles($issueId);
         foreach ($publishedArticles as $publishedArticle) {
             $article =& $articleDao->getArticle($publishedArticle->getId());
             if ($article && $article->getStatus() == STATUS_QUEUED) {
                 $article->setStatus(STATUS_PUBLISHED);
                 $article->stampStatusModified();
                 $articleDao->updateArticle($article);
             }
             // delete article tombstone
             $tombstoneDao =& DAORegistry::getDAO('DataObjectTombstoneDAO');
             $tombstoneDao->deleteByDataObjectId($article->getId());
             unset($article);
         }
     }
     $issue->setCurrent(1);
     $issue->setPublished(1);
     $issue->setDatePublished(Core::getCurrentDate());
     // If subscriptions with delayed open access are enabled then
     // update open access date according to open access delay policy
     if ($journal->getSetting('publishingMode') == PUBLISHING_MODE_SUBSCRIPTION && $journal->getSetting('enableDelayedOpenAccess')) {
         $delayDuration = $journal->getSetting('delayedOpenAccessDuration');
         $delayYears = (int) floor($delayDuration / 12);
         $delayMonths = (int) fmod($delayDuration, 12);
         $curYear = date('Y');
         $curMonth = date('n');
         $curDay = date('j');
         $delayOpenAccessYear = $curYear + $delayYears + (int) floor(($curMonth + $delayMonths) / 12);
         $delayOpenAccessMonth = (int) fmod($curMonth + $delayMonths, 12);
         $issue->setAccessStatus(ISSUE_ACCESS_SUBSCRIPTION);
         $issue->setOpenAccessDate(date('Y-m-d H:i:s', mktime(0, 0, 0, $delayOpenAccessMonth, $curDay, $delayOpenAccessYear)));
     }
     $issueDao =& DAORegistry::getDAO('IssueDAO');
     $issueDao->updateCurrentIssue($journalId, $issue);
     // Send a notification to associated users
     import('classes.notification.NotificationManager');
     $notificationManager = new NotificationManager();
     $roleDao =& DAORegistry::getDAO('RoleDAO');
     $notificationUsers = array();
     $allUsers = $roleDao->getUsersByJournalId($journalId);
     while (!$allUsers->eof()) {
         $user =& $allUsers->next();
         $notificationUsers[] = array('id' => $user->getId());
         unset($user);
     }
     foreach ($notificationUsers as $userRole) {
         $notificationManager->createNotification($request, $userRole['id'], NOTIFICATION_TYPE_PUBLISHED_ISSUE, $journalId);
     }
     $notificationManager->sendToMailingList($request, $notificationManager->createNotification($request, UNSUBSCRIBED_USER_NOTIFICATION, NOTIFICATION_TYPE_PUBLISHED_ISSUE, $journalId));
     $request->redirect(null, null, 'issueToc', $issue->getId());
 }
开发者ID:reconciler,项目名称:ojs,代码行数:66,代码来源:IssueManagementHandler.inc.php

示例12: NotificationManager

 /**
  * Create a notification if none exists.
  * @param $request PKPRequest
  * @param $submissionId int
  * @param $userId int
  * @param $notificationType int NOTIFICATION_TYPE_
  * @param $contextId int
  */
 function _createNotification($request, $submissionId, $userId, $notificationType, $contextId)
 {
     $notificationDao = DAORegistry::getDAO('NotificationDAO');
     /* @var $notificationDao NotificationDAO */
     $notificationFactory = $notificationDao->getByAssoc(ASSOC_TYPE_SUBMISSION, $submissionId, $userId, $notificationType, $contextId);
     if ($notificationFactory->wasEmpty()) {
         $notificationMgr = new NotificationManager();
         $notificationMgr->createNotification($request, $userId, $notificationType, $contextId, ASSOC_TYPE_SUBMISSION, $submissionId, NOTIFICATION_LEVEL_NORMAL, null, true);
     }
 }
开发者ID:jprk,项目名称:pkp-lib,代码行数:18,代码来源:EditingProductionStatusNotificationManager.inc.php

示例13: postCopyeditComment

 /**
  * Post copyedit comment.
  * @param $article object
  */
 function postCopyeditComment($article, $emailComment, $request)
 {
     if (!HookRegistry::call('CopyeditorAction::postCopyeditComment', array(&$article, &$emailComment))) {
         import('classes.submission.form.comment.CopyeditCommentForm');
         $commentForm = new CopyeditCommentForm($article, ROLE_ID_COPYEDITOR);
         $commentForm->readInputData();
         if ($commentForm->validate()) {
             $commentForm->execute();
             // Send a notification to associated users
             import('lib.pkp.classes.notification.NotificationManager');
             $notificationManager = new NotificationManager();
             $notificationUsers = $article->getAssociatedUserIds(true, false);
             foreach ($notificationUsers as $userRole) {
                 $url = $request->url(null, $userRole['role'], 'submissionEditing', $article->getId(), null, 'coypedit');
                 $notificationManager->createNotification($userRole['id'], 'notification.type.copyeditComment', $article->getLocalizedTitle(), $url, 1, NOTIFICATION_TYPE_COPYEDIT_COMMENT);
             }
             if ($emailComment) {
                 $commentForm->email($request);
             }
         } else {
             $commentForm->display();
             return false;
         }
         return true;
     }
 }
开发者ID:ramonsodoma,项目名称:ojs,代码行数:30,代码来源:CopyeditorAction.inc.php

示例14: saveGalley

 /**
  * Save changes to a galley.
  * @param $args array ($articleId, $galleyId)
  */
 function saveGalley($args)
 {
     $articleId = isset($args[0]) ? (int) $args[0] : 0;
     $galleyId = isset($args[1]) ? (int) $args[1] : 0;
     $this->validate($articleId, SECTION_EDITOR_ACCESS_EDIT);
     $this->setupTemplate(true, $articleId, 'editing');
     $submission =& $this->submission;
     import('classes.submission.form.ArticleGalleyForm');
     $submitForm = new ArticleGalleyForm($articleId, $galleyId);
     $submitForm->readInputData();
     if ($submitForm->validate()) {
         $submitForm->execute();
         // Send a notification to associated users
         import('lib.pkp.classes.notification.NotificationManager');
         $notificationManager = new NotificationManager();
         $articleDao =& DAORegistry::getDAO('ArticleDAO');
         $article =& $articleDao->getArticle($articleId);
         $notificationUsers = $article->getAssociatedUserIds(true, false);
         foreach ($notificationUsers as $userRole) {
             $url = Request::url(null, $userRole['role'], 'submissionEditing', $article->getId(), null, 'layout');
             $notificationManager->createNotification($userRole['id'], 'notification.type.galleyModified', $article->getLocalizedTitle(), $url, 1, NOTIFICATION_TYPE_GALLEY_MODIFIED);
         }
         if (Request::getUserVar('uploadImage')) {
             $submitForm->uploadImage();
             Request::redirect(null, null, 'editGalley', array($articleId, $galleyId));
         } else {
             if (($deleteImage = Request::getUserVar('deleteImage')) && count($deleteImage) == 1) {
                 list($imageId) = array_keys($deleteImage);
                 $submitForm->deleteImage($imageId);
                 Request::redirect(null, null, 'editGalley', array($articleId, $galleyId));
             }
         }
         Request::redirect(null, null, 'submissionEditing', $articleId);
     } else {
         $submitForm->display();
     }
 }
开发者ID:master3395,项目名称:CBPPlatform,代码行数:41,代码来源:SubmissionEditHandler.inc.php

示例15: saveReviewFormResponse

 /**
  * Save review form response.
  * @param $reviewId int
  * @param $reviewFormId int
  */
 function saveReviewFormResponse($reviewId, $reviewFormId)
 {
     if (!HookRegistry::call('ReviewerAction::saveReviewFormResponse', array($reviewId, $reviewFormId))) {
         import('submission.form.ReviewFormResponseForm');
         $reviewForm = new ReviewFormResponseForm($reviewId, $reviewFormId);
         $reviewForm->readInputData();
         if ($reviewForm->validate()) {
             $reviewForm->execute();
             // Send a notification to associated users
             import('notification.NotificationManager');
             $notificationManager = new NotificationManager();
             $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
             $reviewAssignment = $reviewAssignmentDao->getReviewAssignmentById($reviewId);
             $paperId = $reviewAssignment->getPaperId();
             $paperDao =& DAORegistry::getDAO('PaperDAO');
             $paper =& $paperDao->getPaper($paperId);
             $notificationUsers = $paper->getAssociatedUserIds();
             foreach ($notificationUsers as $userRole) {
                 $url = Request::url(null, null, $userRole['role'], 'submissionReview', $paper->getId(), null, 'peerReview');
                 $notificationManager->createNotification($userRole['id'], 'notification.type.reviewerFormComment', $paper->getLocalizedTitle(), $url, 1, NOTIFICATION_TYPE_REVIEWER_FORM_COMMENT);
             }
         } else {
             $reviewForm->display();
             return false;
         }
         return true;
     }
 }
开发者ID:jmacgreg,项目名称:ocs,代码行数:33,代码来源:ReviewerAction.inc.php


注:本文中的NotificationManager::createNotification方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。