@@ -69,17 +69,21 @@ function updateCopyeditFiles($args, $request) {
$this->getGridCategoryDataElements($request, $this->getStageId())
);

$notificationMgr = new NotificationManager();
$notificationMgr->updateNotification(
$request,
array(
NOTIFICATION_TYPE_ASSIGN_COPYEDITOR,
NOTIFICATION_TYPE_AWAITING_COPYEDITS,
),
null,
ASSOC_TYPE_SUBMISSION,
$submission->getId()
);
if ($submission->getStageId() == WORKFLOW_STAGE_ID_EDITING ||
$submission->getStageId() == WORKFLOW_STAGE_ID_PRODUCTION) {

$notificationMgr = new NotificationManager();
$notificationMgr->updateNotification(
$request,
array(
NOTIFICATION_TYPE_ASSIGN_COPYEDITOR,
NOTIFICATION_TYPE_AWAITING_COPYEDITS,
),
null,
ASSOC_TYPE_SUBMISSION,
$submission->getId()
);
}

// Let the calling grid reload itself
return DAO::getDataChangedEvent();
@@ -320,20 +320,24 @@ function deleteQuery($args, $request) {
$notificationDao = DAORegistry::getDAO('NotificationDAO');
$notificationDao->deleteByAssoc(ASSOC_TYPE_QUERY, $query->getId());

// Update submission notifications
$notificationMgr = new NotificationManager();
$notificationMgr->updateNotification(
$request,
array(
NOTIFICATION_TYPE_ASSIGN_COPYEDITOR,
NOTIFICATION_TYPE_AWAITING_COPYEDITS,
NOTIFICATION_TYPE_ASSIGN_PRODUCTIONUSER,
NOTIFICATION_TYPE_AWAITING_REPRESENTATIONS,
),
null,
ASSOC_TYPE_SUBMISSION,
$this->getAssocId()
);
if ($this->getStageId() == WORKFLOW_STAGE_ID_EDITING ||
$this->getStageId() == WORKFLOW_STAGE_ID_PRODUCTION) {

// Update submission notifications
$notificationMgr = new NotificationManager();
$notificationMgr->updateNotification(
$request,
array(
NOTIFICATION_TYPE_ASSIGN_COPYEDITOR,
NOTIFICATION_TYPE_AWAITING_COPYEDITS,
NOTIFICATION_TYPE_ASSIGN_PRODUCTIONUSER,
NOTIFICATION_TYPE_AWAITING_REPRESENTATIONS,
),
null,
ASSOC_TYPE_SUBMISSION,
$this->getAssocId()
);
}

return DAO::getDataChangedEvent($query->getId());
}
@@ -484,21 +488,24 @@ function updateQuery($args, $request) {
if ($queryForm->validate()) {
$queryForm->execute($request);

// Update submission notifications
$notificationMgr = new NotificationManager();
$notificationMgr->updateNotification(
$request,
array(
NOTIFICATION_TYPE_ASSIGN_COPYEDITOR,
NOTIFICATION_TYPE_AWAITING_COPYEDITS,
NOTIFICATION_TYPE_ASSIGN_PRODUCTIONUSER,
NOTIFICATION_TYPE_AWAITING_REPRESENTATIONS,
),
null,
ASSOC_TYPE_SUBMISSION,
$this->getAssocId()
);

if ($this->getStageId() == WORKFLOW_STAGE_ID_EDITING ||
$this->getStageId() == WORKFLOW_STAGE_ID_PRODUCTION) {

// Update submission notifications
$notificationMgr = new NotificationManager();
$notificationMgr->updateNotification(
$request,
array(
NOTIFICATION_TYPE_ASSIGN_COPYEDITOR,
NOTIFICATION_TYPE_AWAITING_COPYEDITS,
NOTIFICATION_TYPE_ASSIGN_PRODUCTIONUSER,
NOTIFICATION_TYPE_AWAITING_REPRESENTATIONS,
),
null,
ASSOC_TYPE_SUBMISSION,
$this->getAssocId()
);
}
return DAO::getDataChangedEvent($query->getId());
}
return new JSONMessage(
@@ -353,19 +353,23 @@ function deleteParticipant($args, $request) {
$submission->getId()
);

// Update submission notifications
$notificationMgr->updateNotification(
$request,
array(
NOTIFICATION_TYPE_ASSIGN_COPYEDITOR,
NOTIFICATION_TYPE_AWAITING_COPYEDITS,
NOTIFICATION_TYPE_ASSIGN_PRODUCTIONUSER,
NOTIFICATION_TYPE_AWAITING_REPRESENTATIONS,
),
null,
ASSOC_TYPE_SUBMISSION,
$submission->getId()
);
if ($stageId == WORKFLOW_STAGE_ID_EDITING ||
$stageId == WORKFLOW_STAGE_ID_PRODUCTION) {

// Update submission notifications
$notificationMgr->updateNotification(
$request,
array(
NOTIFICATION_TYPE_ASSIGN_COPYEDITOR,
NOTIFICATION_TYPE_AWAITING_COPYEDITS,
NOTIFICATION_TYPE_ASSIGN_PRODUCTIONUSER,
NOTIFICATION_TYPE_AWAITING_REPRESENTATIONS,
),
null,
ASSOC_TYPE_SUBMISSION,
$submission->getId()
);
}

// Log removal.
$userDao = DAORegistry::getDAO('UserDAO');
@@ -445,20 +449,25 @@ function sendNotification($args, $request) {
// (will clear the form on return)
$this->_logEventAndCreateNotification($request);

// Update submission notifications
$notificationMgr = new NotificationManager();
$notificationMgr->updateNotification(
$request,
array(
NOTIFICATION_TYPE_ASSIGN_COPYEDITOR,
NOTIFICATION_TYPE_AWAITING_COPYEDITS,
NOTIFICATION_TYPE_ASSIGN_PRODUCTIONUSER,
NOTIFICATION_TYPE_AWAITING_REPRESENTATIONS,
),
null,
ASSOC_TYPE_SUBMISSION,
$this->getSubmission()->getId()
);

if ($this->getStageId() == WORKFLOW_STAGE_ID_EDITING ||
$this->getStageId() == WORKFLOW_STAGE_ID_PRODUCTION) {

// Update submission notifications
$notificationMgr = new NotificationManager();
$notificationMgr->updateNotification(
$request,
array(
NOTIFICATION_TYPE_ASSIGN_COPYEDITOR,
NOTIFICATION_TYPE_AWAITING_COPYEDITS,
NOTIFICATION_TYPE_ASSIGN_PRODUCTIONUSER,
NOTIFICATION_TYPE_AWAITING_REPRESENTATIONS,
),
null,
ASSOC_TYPE_SUBMISSION,
$this->getSubmission()->getId()
);
}

return new JSONMessage(true);
} else {
@@ -229,20 +229,23 @@ function sendMessage($userId, $submission, $request) {
$headNote->setContents($email->getBody());
$noteDao->insertObject($headNote);

$notificationMgr = new NotificationManager();
$notificationMgr->updateNotification(
$request,
array(
NOTIFICATION_TYPE_ASSIGN_COPYEDITOR,
NOTIFICATION_TYPE_AWAITING_COPYEDITS,
NOTIFICATION_TYPE_ASSIGN_PRODUCTIONUSER,
NOTIFICATION_TYPE_AWAITING_REPRESENTATIONS,
),
null,
ASSOC_TYPE_SUBMISSION,
$submission->getId()
);

if ($submission->getStageId() == WORKFLOW_STAGE_ID_EDITING ||
$submission->getStageId() == WORKFLOW_STAGE_ID_PRODUCTION) {

$notificationMgr = new NotificationManager();
$notificationMgr->updateNotification(
$request,
array(
NOTIFICATION_TYPE_ASSIGN_COPYEDITOR,
NOTIFICATION_TYPE_AWAITING_COPYEDITS,
NOTIFICATION_TYPE_ASSIGN_PRODUCTIONUSER,
NOTIFICATION_TYPE_AWAITING_REPRESENTATIONS,
),
null,
ASSOC_TYPE_SUBMISSION,
$submission->getId()
);
}
}
}