/** * Save the email editing form * @param $args array * @param $request PKPRequest * @return string Serialized JSON object */ function updatePreparedEmail($args, $request) { $journal = $request->getJournal(); $emailKey = $request->getUserVar('emailKey'); import('lib.pkp.controllers.grid.settings.preparedEmails.form.PreparedEmailForm'); $preparedEmailForm = new PreparedEmailForm($emailKey, $journal); $preparedEmailForm->readInputData(); if ($preparedEmailForm->validate()) { $preparedEmailForm->execute(); // Create notification. $notificationMgr = new NotificationManager(); $user = $request->getUser(); $notificationMgr->createTrivialNotification($user->getId()); // Let the calling grid reload itself return DAO::getDataChangedEvent($emailKey); } else { $json = new JSONMessage(false); return $json->getString(); } }
/** * Save the email editing form * @param $args array * @param $request PKPRequest * @return string Serialized JSON object */ function updatePreparedEmail($args, &$request) { $press =& Request::getPress(); $emailKey = $request->getUserVar('emailKey'); import('controllers.grid.settings.preparedEmails.form.PreparedEmailForm'); $preparedEmailForm = new PreparedEmailForm($emailKey, $press); $preparedEmailForm->readInputData(); if ($preparedEmailForm->validate()) { $preparedEmailForm->execute(); // Let the calling grid reload itself return DAO::getDataChangedEvent($emailKey); } else { $json = new JSON(false); return $json->getString(); } }