/** * Send a notification from the notify tab. * @param $args array * @param $request PKPRequest * @return JSONMessage JSON object */ function sendNotification($args, $request) { $this->setupTemplate($request); import('controllers.informationCenter.form.InformationCenterNotifyForm'); $notifyForm = new InformationCenterNotifyForm($this->submissionFile->getFileId(), ASSOC_TYPE_SUBMISSION_FILE); $notifyForm->readInputData($request); if ($notifyForm->validate()) { $noteId = $notifyForm->execute($request); $this->_logEvent($request, SUBMISSION_LOG_MESSAGE_SENT); $user = $request->getUser(); NotificationManager::createTrivialNotification($user->getId(), NOTIFICATION_TYPE_SUCCESS, array('contents' => __('notification.sentNotification'))); // Success--Return a JSON string indicating so (will clear the form on return, and indicate success) return new JSONMessage(true); } else { // Failure--Return a JSON string indicating so return new JSONMessage(false); } }
/** * Send a notification from the notify tab. * @param $args array * @param $request PKPRequest */ function sendNotification($args, &$request) { $itemId = Request::getUserVar('itemId'); $this->setupTemplate(); import('controllers.informationCenter.form.InformationCenterNotifyForm'); $notifyForm = new InformationCenterNotifyForm(ASSOC_TYPE_MONOGRAPH_FILE, $itemId); $notifyForm->readInputData(); if ($notifyForm->validate()) { $noteId = $notifyForm->execute($request); // Success--Return a JSON string indicating so (will clear the form on return, and indicate success) $json = new JSON('true'); } else { // Failure--Return a JSON string indicating so $json = new JSON('false', Locale::translate("informationCenter.notify.warning")); } return $json->getString(); }
/** * Send a notification from the notify tab. * @param $args array * @param $request PKPRequest */ function sendNotification($args, &$request) { $this->setupTemplate(); import('controllers.informationCenter.form.InformationCenterNotifyForm'); $notifyForm = new InformationCenterNotifyForm(ASSOC_TYPE_MONOGRAPH_FILE, $this->monographFile->getItemId()); $notifyForm->readInputData(); if ($notifyForm->validate()) { $noteId = $notifyForm->execute($request); // Success--Return a JSON string indicating so (will clear the form on return, and indicate success) $json = new JSON(true); } else { // Failure--Return a JSON string indicating so $json = new JSON(false, __('informationCenter.notify.warning')); } return $json->getString(); }
/** * Send a notification from the notify tab. * @param $args array * @param $request PKPRequest */ function sendNotification($args, &$request) { // Fetch the monograph to display information about $monograph =& $this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH); $this->setupTemplate(); import('controllers.informationCenter.form.InformationCenterNotifyForm'); $notifyForm = new InformationCenterNotifyForm($monograph->getId(), ASSOC_TYPE_MONOGRAPH); $notifyForm->readInputData(); if ($notifyForm->validate()) { $noteId = $notifyForm->execute($request); // Return a JSON string indicating success // (will clear the form on return) $json = new JSON('true'); } else { // Return a JSON string indicating failure $json = new JSON('false', Locale::translate('informationCenter.notify.warning')); } return $json->getString(); }