Open Journal Systems  3.3.0
PKPNotificationOperationManager Class Reference
Inheritance diagram for PKPNotificationOperationManager:
INotificationInfoProvider NotificationManagerDelegate PKPNotificationManager AnnouncementNotificationManager EditorAssignmentNotificationManager EditorDecisionNotificationManager EditorialReportNotificationManager PendingRevisionsNotificationManager PKPApproveSubmissionNotificationManager PKPEditingProductionStatusNotificationManager QueryNotificationManager SubmissionNotificationManager NotificationManager

Public Member Functions

 createNotification ($request, $userId=null, $notificationType, $contextId=null, $assocType=null, $assocId=null, $level=NOTIFICATION_LEVEL_NORMAL, $params=null, $suppressEmail=false, callable $mailConfigurator=null)
 
 createTrivialNotification ($userId, $notificationType=NOTIFICATION_TYPE_SUCCESS, $params=null)
 
 deleteTrivialNotifications ($notifications)
 
 formatToGeneralNotification ($request, $notifications)
 
 formatToInPlaceNotification ($request, $notifications)
 
 getFormattedNotificationsForUser ($request, $userId, $level=NOTIFICATION_LEVEL_NORMAL, $contextId=null, $rangeInfo=null, $notificationTemplate='notification/notification.tpl')
 
 getIconClass ($notification)
 
 getNotificationContents ($request, $notification)
 
 getNotificationMessage ($request, $notification)
 
 getNotificationTitle ($notification)
 
 getNotificationUrl ($request, $notification)
 
 getParamsForCurrentLocale ($params)
 
 getStyleClass ($notification)
 
 isVisibleToAllUsers ($notificationType, $assocType, $assocId)
 

Protected Member Functions

 fetchLinkActionNotificationContent ($linkAction, $request)
 
 getMailTemplate ($emailKey=null)
 
 getUserBlockedEmailedNotifications ($userId, $contextId)
 
 getUserBlockedNotifications ($userId, $contextId)
 
 sendNotificationEmail ($request, $notification, ?int $contextId, callable $mailConfigurator=null)
 

Detailed Description

Base class for notification manager that implements basic notification operations and default notifications info. Subclasses can implement specific information.

See also
NotificationDAO
Notification

Definition at line 23 of file PKPNotificationOperationManager.inc.php.

Member Function Documentation

◆ createNotification()

PKPNotificationOperationManager::createNotification (   $request,
  $userId = null,
  $notificationType,
  $contextId = null,
  $assocType = null,
  $assocId = null,
  $level = NOTIFICATION_LEVEL_NORMAL,
  $params = null,
  $suppressEmail = false,
callable  $mailConfigurator = null 
)

Create a new notification with the specified arguments and insert into DB

Parameters
$requestPKPRequest
$userIdint (optional)
$notificationTypeint
$contextIdint
$assocTypeint
$assocIdint
$levelint
$paramsarray
$suppressEmailboolean Whether or not to suppress the notification email.
$mailConfiguratorcallable Enables the customization of the Notification email
Returns
Notification object

Reimplemented in NotificationManagerDelegate.

Definition at line 150 of file PKPNotificationOperationManager.inc.php.

References DAORegistry\getDAO(), getUserBlockedEmailedNotifications(), getUserBlockedNotifications(), and sendNotificationEmail().

◆ createTrivialNotification()

PKPNotificationOperationManager::createTrivialNotification (   $userId,
  $notificationType = NOTIFICATION_TYPE_SUCCESS,
  $params = null 
)

Create a new notification with the specified arguments and insert into DB This is a static method

Parameters
$userIdint
$notificationTypeint
$paramsarray
Returns
Notification object

Definition at line 193 of file PKPNotificationOperationManager.inc.php.

References DAORegistry\getDAO().

Referenced by PKPManageFileApiHandler\deleteFile(), InformationCenterHandler\deleteNote(), PKPToolsHandler\resetPermissions(), SubmissionInformationCenterHandler\saveNote(), FileInformationCenterHandler\saveNote(), and ManageReviewFilesGridHandler\updateReviewFiles().

◆ deleteTrivialNotifications()

PKPNotificationOperationManager::deleteTrivialNotifications (   $notifications)

Deletes trivial notifications from database.

Parameters
array$notifications

Definition at line 217 of file PKPNotificationOperationManager.inc.php.

References DAORegistry\getDAO().

◆ fetchLinkActionNotificationContent()

PKPNotificationOperationManager::fetchLinkActionNotificationContent (   $linkAction,
  $request 
)
protected

Get a notification content with a link action.

Parameters
$linkActionLinkAction
$requestRequest
Returns
string

Definition at line 304 of file PKPNotificationOperationManager.inc.php.

References PKPTemplateManager\getManager().

Referenced by PendingRevisionsNotificationManager\getNotificationContents().

◆ formatToGeneralNotification()

PKPNotificationOperationManager::formatToGeneralNotification (   $request,
  $notifications 
)

General notification data formating.

Parameters
$requestPKPRequest
array$notifications
Returns
array

Definition at line 233 of file PKPNotificationOperationManager.inc.php.

References getIconClass(), getNotificationContents(), getNotificationTitle(), and getStyleClass().

◆ formatToInPlaceNotification()

PKPNotificationOperationManager::formatToInPlaceNotification (   $request,
  $notifications 
)

In place notification data formating.

Parameters
$requestPKPRequest
$notificationsarray
Returns
array

Definition at line 254 of file PKPNotificationOperationManager.inc.php.

References PKPTemplateManager\getManager().

◆ getFormattedNotificationsForUser()

PKPNotificationOperationManager::getFormattedNotificationsForUser (   $request,
  $userId,
  $level = NOTIFICATION_LEVEL_NORMAL,
  $contextId = null,
  $rangeInfo = null,
  $notificationTemplate = 'notification/notification.tpl' 
)

Construct a set of notifications and return them as a formatted string

Parameters
$requestPKPRequest
$userIdint
$levelint optional
$contextIdint optional
$rangeInfoobject optional
$notificationTemplatestring optional Template to use for constructing an individual notification for display
Returns
object DAOResultFactory containing matching Notification objects

Definition at line 92 of file PKPNotificationOperationManager.inc.php.

References DAORegistry\getDAO().

◆ getIconClass()

PKPNotificationOperationManager::getIconClass (   $notification)

Get the notification icon class.

Parameters
$notificationNotification
Returns
string

Reimplemented from INotificationInfoProvider.

Reimplemented in PKPNotificationManager, EditorialReportNotificationManager, NotificationManager, SubmissionNotificationManager, and AnnouncementNotificationManager.

Definition at line 67 of file PKPNotificationOperationManager.inc.php.

Referenced by formatToGeneralNotification().

◆ getMailTemplate()

PKPNotificationOperationManager::getMailTemplate (   $emailKey = null)
protected

Get a template mail instance.

Parameters
$emailKeystring
Returns
MailTemplate
See also
MailTemplate

Reimplemented in EditorialReportNotificationManager, and AnnouncementNotificationManager.

Definition at line 293 of file PKPNotificationOperationManager.inc.php.

Referenced by sendNotificationEmail().

◆ getNotificationContents()

PKPNotificationOperationManager::getNotificationContents (   $request,
  $notification 
)

Provide the notification message as default content. Get the notification contents. Content is anything that's more than text, like presenting link actions inside fetched template files.

Parameters
$requestPKPRequest
$notificationNotification
Returns
string

Reimplemented from INotificationInfoProvider.

Reimplemented in EditorialReportNotificationManager, PKPNotificationManager, QueryNotificationManager, PendingRevisionsNotificationManager, and AnnouncementNotificationManager.

Definition at line 46 of file PKPNotificationOperationManager.inc.php.

References getNotificationMessage().

Referenced by formatToGeneralNotification(), and sendNotificationEmail().

◆ getNotificationMessage()

PKPNotificationOperationManager::getNotificationMessage (   $request,
  $notification 
)

◆ getNotificationTitle()

PKPNotificationOperationManager::getNotificationTitle (   $notification)

◆ getNotificationUrl()

◆ getParamsForCurrentLocale()

PKPNotificationOperationManager::getParamsForCurrentLocale (   $params)

Iterate through the localized params for a notification's locale key. For each parameter, return (in preferred order) a value for the user's current locale, a param for the journal's default locale, or the first value (in case the value is not localized)

Parameters
$paramsarray
Returns
array

Definition at line 107 of file PKPNotificationOperationManager.inc.php.

References AppLocale\getLocale(), AppLocale\getPrimaryLocale(), and AppLocale\getSupportedLocales().

◆ getStyleClass()

◆ getUserBlockedEmailedNotifications()

PKPNotificationOperationManager::getUserBlockedEmailedNotifications (   $userId,
  $contextId 
)
protected

Get set of notification types user will also be notified by email.

Returns
array

Definition at line 282 of file PKPNotificationOperationManager.inc.php.

References DAORegistry\getDAO().

Referenced by createNotification().

◆ getUserBlockedNotifications()

PKPNotificationOperationManager::getUserBlockedNotifications (   $userId,
  $contextId 
)
protected

Get set of notifications types user does not want to be notified of.

Parameters
$userIdint The notification user
$contextIdint
Returns
array

Definition at line 273 of file PKPNotificationOperationManager.inc.php.

References DAORegistry\getDAO().

Referenced by createNotification().

◆ isVisibleToAllUsers()

PKPNotificationOperationManager::isVisibleToAllUsers (   $notificationType,
  $assocType,
  $assocId 
)

Whether any notification with the passed notification type is visible to all users or not.

Parameters
$notificationTypeint
$assocTypeint ASSOC_TYPE_...
$assocIdint
Returns
boolean

Reimplemented from INotificationInfoProvider.

Reimplemented in PKPNotificationManager, EditorAssignmentNotificationManager, and PKPApproveSubmissionNotificationManager.

Definition at line 74 of file PKPNotificationOperationManager.inc.php.

◆ sendNotificationEmail()

PKPNotificationOperationManager::sendNotificationEmail (   $request,
  $notification,
?int  $contextId,
callable  $mailConfigurator = null 
)
protected

Send an email to a user regarding the notification

Parameters
$requestPKPRequest
$notificationobject Notification
$contextId?int Context ID
$mailConfiguratorcallable If specified, must return a MailTemplate instance. A ready MailTemplate object will be provided as argument

Definition at line 374 of file PKPNotificationOperationManager.inc.php.

References Application\getContextDAO(), DAORegistry\getDAO(), getMailTemplate(), getNotificationContents(), getNotificationUrl(), and AppLocale\requireComponents().

Referenced by createNotification().


The documentation for this class was generated from the following file: