/** * @copydoc PKPNotificationManager::getNotificationMessage() */ public function getNotificationMessage($request, $notification) { switch ($notification->getType()) { case NOTIFICATION_TYPE_FORMAT_NEEDS_APPROVED_SUBMISSION: assert($notification->getAssocType() == ASSOC_TYPE_SUBMISSION && is_numeric($notification->getAssocId())); return __('notification.type.formatNeedsApprovedSubmission'); case NOTIFICATION_TYPE_VISIT_CATALOG: assert($notification->getAssocType() == ASSOC_TYPE_SUBMISSION && is_numeric($notification->getAssocId())); return __('notification.type.visitCatalog'); } return parent::getNotificationMessage($request, $notification); }
/** * Construct the contents for the notification based on its type and associated object * @param $request PKPRequest * @param $notification Notification * @return string */ function getNotificationMessage($request, $notification) { // Allow hooks to override default behavior $message = null; HookRegistry::call('NotificationManager::getNotificationMessage', array(&$notification, &$message)); if ($message) { return $message; } switch ($notification->getType()) { case NOTIFICATION_TYPE_PUBLISHED_ISSUE: return __('notification.type.issuePublished'); case NOTIFICATION_TYPE_GIFT_REDEEM_STATUS_SUCCESS: return __('gifts.giftRedeemed'); case NOTIFICATION_TYPE_GIFT_REDEEM_STATUS_ERROR_NO_GIFT_TO_REDEEM: return __('gifts.noGiftToRedeem'); case NOTIFICATION_TYPE_GIFT_REDEEM_STATUS_ERROR_GIFT_ALREADY_REDEEMED: return __('gifts.giftAlreadyRedeemed'); case NOTIFICATION_TYPE_GIFT_REDEEM_STATUS_ERROR_GIFT_INVALID: return __('gifts.giftNotValid'); case NOTIFICATION_TYPE_GIFT_REDEEM_STATUS_ERROR_SUBSCRIPTION_TYPE_INVALID: return __('gifts.subscriptionTypeNotValid'); case NOTIFICATION_TYPE_GIFT_REDEEM_STATUS_ERROR_SUBSCRIPTION_NON_EXPIRING: return __('gifts.subscriptionNonExpiring'); case NOTIFICATION_TYPE_BOOK_REQUESTED: return __('plugins.generic.booksForReview.notification.bookRequested'); case NOTIFICATION_TYPE_BOOK_CREATED: return __('plugins.generic.booksForReview.notification.bookCreated'); case NOTIFICATION_TYPE_BOOK_UPDATED: return __('plugins.generic.booksForReview.notification.bookUpdated'); case NOTIFICATION_TYPE_BOOK_DELETED: return __('plugins.generic.booksForReview.notification.bookDeleted'); case NOTIFICATION_TYPE_BOOK_MAILED: return __('plugins.generic.booksForReview.notification.bookMailed'); case NOTIFICATION_TYPE_BOOK_SETTINGS_SAVED: return __('plugins.generic.booksForReview.notification.settingsSaved'); case NOTIFICATION_TYPE_BOOK_SUBMISSION_ASSIGNED: return __('plugins.generic.booksForReview.notification.submissionAssigned'); case NOTIFICATION_TYPE_BOOK_AUTHOR_ASSIGNED: return __('plugins.generic.booksForReview.notification.authorAssigned'); case NOTIFICATION_TYPE_BOOK_AUTHOR_DENIED: return __('plugins.generic.booksForReview.notification.authorDenied'); case NOTIFICATION_TYPE_BOOK_AUTHOR_REMOVED: return __('plugins.generic.booksForReview.notification.authorRemoved'); default: return parent::getNotificationMessage($request, $notification); } }