本文整理汇总了PHP中DAO::getDataChangedEvent方法的典型用法代码示例。如果您正苦于以下问题:PHP DAO::getDataChangedEvent方法的具体用法?PHP DAO::getDataChangedEvent怎么用?PHP DAO::getDataChangedEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DAO
的用法示例。
在下文中一共展示了DAO::getDataChangedEvent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteFile
/**
* Delete a file or revision
* @param $args array
* @param $request Request
* @return string a serialized JSON object
*/
function deleteFile($args, &$request)
{
// FIXME: authorize!
$fileId = (int) $request->getUserVar('fileId');
$success = false;
if ($fileId) {
// Delete all revisions or only one?
$revision = $request->getUserVar('revision') ? (int) $request->getUserVar('revision') : null;
// Delete the file/revision but only when it belongs to the authorized monograph
// and to the right file stage.
$monograph =& $this->getMonograph();
$submissionFileDao =& DAORegistry::getDAO('SubmissionFileDAO');
/* @var $submissionFileDao SubmissionFileDAO */
if ($revision) {
$success = (bool) $submissionFileDao->deleteRevisionById($fileId, $revision, $this->getFileStage(), $monograph->getId());
} else {
$success = (bool) $submissionFileDao->deleteAllRevisionsById($fileId, $this->getFileStage(), $monograph->getId());
}
}
if ($success) {
return DAO::getDataChangedEvent($fileId);
} else {
$json = new JSON(false);
return $json->getString();
}
}
示例2: updateIdentifiers
/**
* Update proof submission file pub ids.
* @param $args array
* @param $request PKPRequest
* @return JSONMessage JSON object
*/
function updateIdentifiers($args, $request)
{
$submissionFile = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION_FILE);
$stageId = $request->getUserVar('stageId');
import('lib.pkp.controllers.tab.pubIds.form.PKPPublicIdentifiersForm');
$form = new PKPPublicIdentifiersForm($submissionFile, $stageId);
$form->readInputData();
if ($form->validate($request)) {
$form->execute($request);
return DAO::getDataChangedEvent($submissionFile->getId());
} else {
return new JSONMessage(true, $form->fetch($request));
}
}
示例3: updateFinalDraftFiles
/**
* Save 'manage final draft files' form
* @param $args array
* @param $request PKPRequest
* @return JSONMessage JSON object
*/
function updateFinalDraftFiles($args, $request)
{
$submission = $this->getSubmission();
import('lib.pkp.controllers.grid.files.final.form.ManageFinalDraftFilesForm');
$manageFinalDraftFilesForm = new ManageFinalDraftFilesForm($submission->getId());
$manageFinalDraftFilesForm->readInputData();
if ($manageFinalDraftFilesForm->validate()) {
$manageFinalDraftFilesForm->execute($args, $request, $this->getGridCategoryDataElements($request, $this->getStageId()));
// Let the calling grid reload itself
return DAO::getDataChangedEvent();
} else {
return new JSONMessage(false);
}
}
示例4: updateProofFiles
/**
* Save 'manage proof files' form
* @param $args array
* @param $request PKPRequest
* @return JSONMessage JSON object
*/
function updateProofFiles($args, $request)
{
$submission = $this->getSubmission();
$representation = $this->getAuthorizedContextObject(ASSOC_TYPE_REPRESENTATION);
import('lib.pkp.controllers.grid.files.proof.form.ManageProofFilesForm');
$manageProofFilesForm = new ManageProofFilesForm($submission->getId(), $representation->getId());
$manageProofFilesForm->readInputData();
if ($manageProofFilesForm->validate()) {
$manageProofFilesForm->execute($args, $request, $this->getGridCategoryDataElements($request, $this->getStageId()), SUBMISSION_FILE_PROOF);
// Let the calling grid reload itself
return DAO::getDataChangedEvent();
} else {
return new JSONMessage(false);
}
}
示例5: approveCopyedit
/**
* Approve/disapprove the copyediting file, changing its visibility.
* @param $args array
* @param $request PKPRequest
* @return JSONMessage JSON object
*/
function approveCopyedit($args, $request)
{
$submissionFile = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION_FILE);
$submission = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION);
if ($submissionFile->getViewable()) {
// No longer expose the file to be sent to next stage.
$submissionFile->setViewable(false);
} else {
// Expose the file.
$submissionFile->setViewable(true);
}
$submissionFileDao = DAORegistry::getDAO('SubmissionFileDAO');
$submissionFileDao->updateObject($submissionFile);
return DAO::getDataChangedEvent($submissionFile->getId());
}
示例6: updateReviewFiles
/**
* Save 'manage review files' form
* @param $args array
* @param $request PKPRequest
* @return string Serialized JSON object
*/
function updateReviewFiles($args, &$request)
{
$monograph =& $this->getMonograph();
import('controllers.grid.files.review.form.ManageReviewFilesForm');
$manageReviewFilesForm = new ManageReviewFilesForm($monograph->getId(), $this->getRequestArg('reviewType'), $this->getRequestArg('round'));
$manageReviewFilesForm->readInputData();
if ($manageReviewFilesForm->validate()) {
$manageReviewFilesForm->execute($args, $request);
// Let the calling grid reload itself
return DAO::getDataChangedEvent();
} else {
$json = new JSON(false);
return $json->getString();
}
}
示例7: updateQueryNoteFiles
/**
* Save 'manage query files' form
* @param $args array
* @param $request PKPRequest
* @return JSONMessage JSON object
*/
function updateQueryNoteFiles($args, $request)
{
$submission = $this->getSubmission();
$query = $this->getAuthorizedContextObject(ASSOC_TYPE_QUERY);
import('lib.pkp.controllers.grid.files.query.form.ManageQueryNoteFilesForm');
$manageQueryNoteFilesForm = new ManageQueryNoteFilesForm($submission->getId(), $query->getId(), $request->getUserVar('noteId'));
$manageQueryNoteFilesForm->readInputData();
if ($manageQueryNoteFilesForm->validate()) {
$manageQueryNoteFilesForm->execute($args, $request, $this->getGridCategoryDataElements($request, $this->getStageId()));
// Let the calling grid reload itself
return DAO::getDataChangedEvent();
} else {
return new JSONMessage(false);
}
}
示例8: updateCopyeditFiles
/**
* Save 'manage copyedited files' form
* @param $args array
* @param $request PKPRequest
* @return JSONMessage JSON object
*/
function updateCopyeditFiles($args, $request)
{
$submission = $this->getSubmission();
import('lib.pkp.controllers.grid.files.copyedit.form.ManageCopyeditFilesForm');
$manageCopyeditFilesForm = new ManageCopyeditFilesForm($submission->getId());
$manageCopyeditFilesForm->readInputData();
if ($manageCopyeditFilesForm->validate()) {
$manageCopyeditFilesForm->execute($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());
// Let the calling grid reload itself
return DAO::getDataChangedEvent();
} else {
return new JSONMessage(false);
}
}
示例9: updateReviewFiles
/**
* Save 'manage review files' form.
* @param $args array
* @param $request PKPRequest
* @return JSONMessage JSON object
*/
function updateReviewFiles($args, $request)
{
$submission = $this->getSubmission();
import('lib.pkp.controllers.grid.files.review.form.ManageReviewFilesForm');
$manageReviewFilesForm = new ManageReviewFilesForm($submission->getId(), $this->getRequestArg('stageId'), $this->getRequestArg('reviewRoundId'));
$manageReviewFilesForm->readInputData();
if ($manageReviewFilesForm->validate()) {
$dataProvider = $this->getDataProvider();
$manageReviewFilesForm->execute($args, $request, $this->getGridCategoryDataElements($request, $this->getStageId()));
$this->setupTemplate($request);
$user = $request->getUser();
NotificationManager::createTrivialNotification($user->getId(), NOTIFICATION_TYPE_SUCCESS, array('contents' => __('notification.updatedReviewFiles')));
// Let the calling grid reload itself
return DAO::getDataChangedEvent();
} else {
return new JSONMessage(false);
}
}
示例10: deleteMedia
/**
* Delete a media entry
* @param $args array
* @param $request PKPRequest
* @return JSONMessage JSON object
*/
function deleteMedia($args, $request)
{
// Identify the object to be deleted
$socialMediaId = (int) $request->getUserVar('socialMediaId');
$context = $this->getContext();
$socialMediaDao = DAORegistry::getDAO('SocialMediaDAO');
$socialMedia = $socialMediaDao->getById($socialMediaId, $context->getId());
if (isset($socialMedia)) {
$result = $socialMediaDao->deleteObject($socialMedia);
if ($result) {
$currentUser = $request->getUser();
$notificationMgr = new NotificationManager();
$notificationMgr->createTrivialNotification($currentUser->getId(), NOTIFICATION_TYPE_SUCCESS, array('contents' => __('notification.removedSocialMedia')));
return DAO::getDataChangedEvent();
} else {
return new JSONMessage(false, __('manager.setup.errorDeletingItem'));
}
} else {
fatalError('Social Media not in current context context.');
}
}
示例11: reloadLocalizedDefaultSettings
/**
* Reload the default localized settings for the journal
* @param $args array
* @param $request object
*/
function reloadLocalizedDefaultSettings($args, $request)
{
// make sure the locale is valid
$locale = $request->getUserVar('localeToLoad');
if (!AppLocale::isLocaleValid($locale)) {
$json = new JSONMessage(false);
return $json->getString();
}
$journal = $request->getJournal();
$journalSettingsDao = DAORegistry::getDAO('JournalSettingsDAO');
$journalSettingsDao->reloadLocalizedDefaultSettings($journal->getId(), 'registry/journalSettings.xml', array('indexUrl' => $request->getIndexUrl(), 'journalPath' => $journal->getData('path'), 'primaryLocale' => $journal->getPrimaryLocale(), 'journalName' => $journal->getName($journal->getPrimaryLocale())), $locale);
// also reload the user group localizable data
$userGroupDao = DAORegistry::getDAO('UserGroupDAO');
$userGroupDao->installLocale($locale, $journal->getId());
return DAO::getDataChangedEvent();
}
示例12: enableLinkAction
/**
* Returns a data changd event to re-enable the link action. Refactored out of
* recordDownload since library files do not have downloads recorded and are in a
* different context.
* @param $args aray
* @param $request Request
* @return JSONMessage JSON object
*/
function enableLinkAction($args, $request)
{
return DAO::getDataChangedEvent();
}
示例13: removeArticle
/**
* Remove an article from the issue.
* @param $args array
* @param $request PKPRequest
* @return JSONMessage JSON object
*/
function removeArticle($args, $request)
{
$journal = $request->getJournal();
$articleId = (int) $request->getUserVar('articleId');
$issue = $this->getAuthorizedContextObject(ASSOC_TYPE_ISSUE);
$issueDao = DAORegistry::getDAO('IssueDAO');
$publishedArticleDao = DAORegistry::getDAO('PublishedArticleDAO');
$article = $publishedArticleDao->getPublishedArticleByArticleId($articleId);
import('classes.article.ArticleTombstoneManager');
$articleTombstoneManager = new ArticleTombstoneManager();
if ($article && $article->getIssueId() == $issue->getId()) {
if ($issue->getPublished()) {
$articleTombstoneManager->insertArticleTombstone($article, $journal);
}
$article->setStatus(STATUS_QUEUED);
$article->stampStatusModified();
// If the article is the only one in the section, delete the section from custom issue ordering
$sectionId = $article->getSectionId();
$publishedArticleArray = $publishedArticleDao->getPublishedArticlesBySectionId($sectionId, $issue->getId());
if (sizeof($publishedArticleArray) == 1) {
$sectionDao = DAORegistry::getDAO('SectionDAO');
$sectionDao->deleteCustomSection($issue->getId(), $sectionId);
}
$publishedArticleDao->deletePublishedArticleByArticleId($articleId);
$publishedArticleDao->resequencePublishedArticles($article->getSectionId(), $issue->getId());
return DAO::getDataChangedEvent();
}
// If we've fallen through, it must be a badly-specified article
return new JSONMessage(false);
}
示例14: updateUserGroup
/**
* Update user group data on database and grid.
* @param $args array
* @param $request PKPRequest
*/
function updateUserGroup($args, &$request)
{
$userGroupForm = $this->_getUserGroupForm($request);
$userGroupForm->readInputData();
if ($userGroupForm->validate()) {
$userGroupForm->execute($request);
return DAO::getDataChangedEvent($userGroupForm->getUserGroupId());
} else {
$json = new JSON(false);
return $json->getString();
}
}
示例15: signOffFile
/**
* Sign off the given file revision.
* @param $args array
* @param $request Request
*/
function signOffFile($args, $request)
{
// Retrieve the file to be signed off.
$fileId = (int) $request->getUserVar('fileId');
// Make sure that the file revision is in the grid.
$submissionFiles = $this->getGridDataElements($request);
if (!isset($submissionFiles[$fileId])) {
fatalError('Invalid file id!');
}
assert(isset($submissionFiles[$fileId]['submissionFile']));
$submissionFile = $submissionFiles[$fileId]['submissionFile'];
assert(is_a($submissionFile, 'SubmissionFile'));
// Retrieve the user.
$user = $request->getUser();
// Insert or update the sign off corresponding
// to this file revision.
$signoffDao = DAORegistry::getDAO('SignoffDAO');
/* @var $signoffDao SignoffDAO */
$signoff = $signoffDao->build($this->getSymbolic(), ASSOC_TYPE_SUBMISSION_FILE, $submissionFile->getFileId(), $user->getId());
$signoff->setDateCompleted(Core::getCurrentDate());
$signoffDao->updateObject($signoff);
$this->setupTemplate($request);
NotificationManager::createTrivialNotification($user->getId(), NOTIFICATION_TYPE_SUCCESS, array('contents' => __('notification.signedFile')));
return DAO::getDataChangedEvent($fileId);
}