本文整理汇总了PHP中Application::getSubmissionDAO方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::getSubmissionDAO方法的具体用法?PHP Application::getSubmissionDAO怎么用?PHP Application::getSubmissionDAO使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Application
的用法示例。
在下文中一共展示了Application::getSubmissionDAO方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* Save changes to submission.
* @param $request PKPRequest
*/
function execute($request)
{
parent::execute($request);
$submission = $this->getSubmission();
$submissionDao = Application::getSubmissionDAO();
$submission->setSectionId($this->getData('sectionId'));
// Copy an uploaded cover file for the article, if there is one.
if ($temporaryFileId = $this->getData('temporaryFileId')) {
$user = $request->getUser();
$temporaryFileDao = DAORegistry::getDAO('TemporaryFileDAO');
$temporaryFile = $temporaryFileDao->getTemporaryFile($temporaryFileId, $user->getId());
import('classes.file.PublicFileManager');
$publicFileManager = new PublicFileManager();
$newFileName = 'article_' . $submission->getId() . '_cover' . $publicFileManager->getImageExtension($temporaryFile->getFileType());
$journal = $request->getJournal();
$publicFileManager->copyJournalFile($journal->getId(), $temporaryFile->getFilePath(), $newFileName);
$submission->setCoverImage($newFileName);
}
$submission->setCoverImageAltText($this->getData('coverImageAltText'));
$submissionDao->updateObject($submission);
if ($submission->getDatePublished()) {
import('classes.search.ArticleSearchIndex');
ArticleSearchIndex::articleMetadataChanged($submission);
}
}
示例2: getSubmissions
/**
* @copydoc SubmissionListGridHandler::getSubmissions()
*/
function getSubmissions($request)
{
// Default implementation fetches all submissions.
$submissionDao = Application::getSubmissionDAO();
$context = $request->getContext();
return $submissionDao->getByStatus(array(STATUS_DECLINED, STATUS_PUBLISHED, STATUS_QUEUED, STATUS_ARCHIVED), null, null, $context ? $context->getId() : null, $this->getGridRangeInfo($request, $this->getId()));
}
示例3: getSubmissions
/**
* @copydoc SubmissionListGridHandler::getSubmissions()
*/
function getSubmissions($request)
{
// Get all contexts that user is enrolled in as manager, series editor
// reviewer or assistant
$user = $request->getUser();
$roleDao = DAORegistry::getDAO('RoleDAO');
$contextDao = Application::getContextDAO();
$contexts = $contextDao->getAll()->toArray();
$accessibleRoles = array(ROLE_ID_MANAGER, ROLE_ID_SUB_EDITOR, ROLE_ID_REVIEWER, ROLE_ID_ASSISTANT);
$accessibleContexts = array();
$stageUserId = null;
$reviewUserId = null;
foreach ($accessibleRoles as $role) {
foreach ($contexts as $context) {
if ($roleDao->userHasRole($context->getId(), $user->getId(), $role)) {
$accessibleContexts[] = $context->getId();
if ($role == ROLE_ID_ASSISTANT) {
$stageUserId = $user->getId();
} elseif ($role == ROLE_ID_REVIEWER) {
$reviewUserId = $user->getId();
}
}
}
}
$accessibleContexts = array_unique($accessibleContexts);
if (count($accessibleContexts) == 1) {
$accessibleContexts = array_pop($accessibleContexts);
}
// Fetch all submissions for contexts the user can access. If the user
// is a reviewer or assistant only show submissions that have been
// assigned to the user
$submissionDao = Application::getSubmissionDAO();
return $submissionDao->getByStatus(array(STATUS_DECLINED, STATUS_PUBLISHED), $stageUserId, $reviewUserId, $accessibleContexts, $this->getGridRangeInfo($request, $this->getId()));
}
示例4: loadData
/**
* @copydoc GridHandler::loadData()
*/
protected function loadData($request, $filter)
{
$submissionDao = Application::getSubmissionDAO();
/* @var $submissionDao SubmissionDAO */
// Determine whether this is a Sub Editor or Manager.
// Managers can access all submissions, Sub Editors
// only assigned submissions.
$user = $request->getUser();
$userId = $user->getId();
// Get all submissions for all contexts that user is
// enrolled in as manager or series editor.
$roleDao = DAORegistry::getDAO('RoleDAO');
$contextDao = Application::getContextDAO();
$contexts = $contextDao->getAll();
$accessibleContexts = array();
while ($context = $contexts->next()) {
$isManager = $roleDao->userHasRole($context->getId(), $userId, ROLE_ID_MANAGER);
$isSubEditor = $roleDao->userHasRole($context->getId(), $userId, ROLE_ID_SUB_EDITOR);
if (!$isManager && !$isSubEditor) {
continue;
}
$accessibleContexts[] = $context->getId();
}
list($search, $column, $stageId) = $this->getFilterValues($filter);
$title = $author = null;
if ($column == 'title') {
$title = $search;
} else {
$author = $search;
}
$rangeInfo = $this->getGridRangeInfo($request, $this->getId());
return $submissionDao->getBySubEditorId($accessibleContexts, null, false, false, $title, $author, $stageId, $rangeInfo);
}
示例5: initialize
/**
* @copydoc GridRow::initialize()
*/
function initialize($request, $template = null)
{
parent::initialize($request, $template);
// Retrieve the submission id from the request
// These parameters need not be validated as we're just
// passing them along to another request, where they will be
// checked before they're used.
$submissionId = (int) $request->getUserVar('submissionId');
$stageId = (int) $request->getUserVar('stageId');
$round = (int) $request->getUserVar('round');
// Is this a new row or an existing row?
$rowId = $this->getId();
if (!empty($rowId) && is_numeric($rowId)) {
// Only add row actions if this is an existing row
$router = $request->getRouter();
$actionArgs = array('submissionId' => $submissionId, 'reviewAssignmentId' => $rowId, 'stageId' => $stageId, 'round' => $round);
// read or upload a review
$submissionDao = Application::getSubmissionDAO();
$submission = $submissionDao->getById($submissionId);
$this->addAction(new LinkAction('readReview', new AjaxModal($router->url($request, null, null, 'readReview', null, $actionArgs), __('editor.review.reviewDetails') . ': ' . $submission->getLocalizedTitle(), 'modal_information'), __('editor.review.reviewDetails'), 'more_info'));
$this->addAction(new LinkAction('email', new AjaxModal($router->url($request, null, null, 'sendEmail', null, $actionArgs), __('editor.review.emailReviewer'), 'modal_email'), __('editor.review.emailReviewer'), 'notify'));
$this->addAction(new LinkAction('manageAccess', new AjaxModal($router->url($request, null, null, 'editReview', null, $actionArgs), __('editor.submissionReview.editReview'), 'modal_add_file'), __('common.edit'), 'edit'));
$reviewAssignment = $this->getData();
// Only assign this action if the reviewer has not acknowledged yet.
if (!$reviewAssignment->getDateConfirmed()) {
$this->addAction(new LinkAction('unassignReviewer', new AjaxModal($router->url($request, null, null, 'unassignReviewer', null, $actionArgs), __('editor.review.unassignReviewer'), 'modal_delete'), __('editor.review.unassignReviewer'), 'delete'));
}
$this->addAction(new LinkAction('history', new AjaxModal($router->url($request, null, null, 'reviewHistory', null, $actionArgs), __('submission.history'), 'modal_information'), __('submission.history'), 'more_info'));
}
}
示例6: getSubmissions
/**
* @copydoc SubmissionListGridHandler::getSubmissions()
*/
function getSubmissions($request, $userId)
{
$this->setTitle('submission.mySubmissions');
$submissionDao = Application::getSubmissionDAO();
$rangeInfo = $this->getGridRangeInfo($request, $this->getId());
$data = $submissionDao->getUnpublishedByUserId($userId, null, $rangeInfo);
return $data;
}
示例7: execute
/**
* Save changes to submission.
* @param $args array
* @param $request PKPRequest
* @return int the submission ID
*/
function execute($args, $request)
{
parent::execute($args, $request);
// handle category assignment.
ListbuilderHandler::unpack($request, $this->getData('categories'));
$submissionDao = Application::getSubmissionDAO();
$submission = $submissionDao->getById($this->submissionId);
// Send author notification email
import('classes.mail.MonographMailTemplate');
$mail = new MonographMailTemplate($submission, 'SUBMISSION_ACK', null, null, null, false);
$authorMail = new MonographMailTemplate($submission, 'SUBMISSION_ACK_NOT_USER', null, null, null, false);
$context = $request->getContext();
$router = $request->getRouter();
if ($mail->isEnabled()) {
// submission ack emails should be from the contact.
$mail->setReplyTo($this->context->getSetting('contactEmail'), $this->context->getSetting('contactName'));
$authorMail->setReplyTo($this->context->getSetting('contactEmail'), $this->context->getSetting('contactName'));
$user = $request->getUser();
$primaryAuthor = $submission->getPrimaryAuthor();
if (!isset($primaryAuthor)) {
$authors = $submission->getAuthors();
$primaryAuthor = $authors[0];
}
$mail->addRecipient($user->getEmail(), $user->getFullName());
if ($user->getEmail() != $primaryAuthor->getEmail()) {
$authorMail->addRecipient($primaryAuthor->getEmail(), $primaryAuthor->getFullName());
}
if ($context->getSetting('copySubmissionAckPrimaryContact')) {
$authorMail->addBcc($context->getSetting('contactEmail'), $context->getSetting('contactName'));
}
if ($copyAddress = $context->getSetting('copySubmissionAckAddress')) {
$authorMail->addBcc($copyAddress);
}
$assignedAuthors = $submission->getAuthors();
foreach ($assignedAuthors as $author) {
$authorEmail = $author->getEmail();
// only add the author email if they have not already been added as the primary author
// or user creating the submission.
if ($authorEmail != $primaryAuthor->getEmail() && $authorEmail != $user->getEmail()) {
$authorMail->addRecipient($author->getEmail(), $author->getFullName());
}
}
$mail->bccAssignedSeriesEditors($submission->getId(), WORKFLOW_STAGE_ID_SUBMISSION);
$mail->assignParams(array('authorName' => $user->getFullName(), 'authorUsername' => $user->getUsername(), 'editorialContactSignature' => $context->getSetting('contactName') . "\n" . $context->getLocalizedName(), 'submissionUrl' => $router->url($request, null, 'authorDashboard', 'submission', $submission->getId())));
$authorMail->assignParams(array('submitterName' => $user->getFullName(), 'editorialContactSignature' => $context->getSetting('contactName') . "\n" . $context->getLocalizedName()));
$mail->send($request);
$recipients = $authorMail->getRecipients();
if (!empty($recipients)) {
$authorMail->send($request);
}
}
// Log submission.
import('lib.pkp.classes.log.SubmissionLog');
import('classes.log.SubmissionEventLogEntry');
// constants
SubmissionLog::logEvent($request, $submission, SUBMISSION_LOG_SUBMISSION_SUBMIT, 'submission.event.submissionSubmitted');
return $this->submissionId;
}
示例8: getSubmissions
/**
* @copydoc SubmissionListGridHandler::getSubmissions()
*/
function getSubmissions($request)
{
$context = $request->getContext();
$userRoles = $this->getAuthorizedContextObject(ASSOC_TYPE_USER_ROLES);
$canSeeAllSubmissions = in_array(ROLE_ID_MANAGER, $userRoles);
$user = $request->getUser();
$submissionDao = Application::getSubmissionDAO();
return $submissionDao->getByStatus(array(STATUS_DECLINED, STATUS_PUBLISHED), $canSeeAllSubmissions ? null : $user->getId(), $context->getId(), $this->getGridRangeInfo($request, $this->getId()));
}
示例9: resetPermissions
/**
* Reset permissions data assigned to existing submissions.
* @param $args array
* @param $request PKPRequest
* @return JSONMessage JSON response.
*/
function resetPermissions($args, $request)
{
$context = $request->getContext();
$submissionDao = Application::getSubmissionDAO();
$submissionDao->deletePermissions($context->getId());
$notificationManager = new NotificationManager();
$user = $request->getUser();
$notificationManager->createTrivialNotification($user->getId());
return new JSONMessage(true);
}
示例10: IssueEntryPublicationMetadataForm
/**
* Constructor.
* @param $submissionId integer
* @param $userId integer
* @param $stageId integer
* @param $formParams array
*/
function IssueEntryPublicationMetadataForm($submissionId, $userId, $stageId = null, $formParams = null)
{
parent::Form('controllers/tab/issueEntry/form/publicationMetadataFormFields.tpl');
$submissionDao = Application::getSubmissionDAO();
$this->_submission = $submissionDao->getById($submissionId);
$this->_stageId = $stageId;
$this->_formParams = $formParams;
$this->_userId = $userId;
$this->addCheck(new FormValidatorPost($this));
}
示例11: getNotificationUrl
/**
* @copydoc PKPNotificationOperationManager::getNotificationUrl()
*/
function getNotificationUrl($request, $notification)
{
$dispatcher = Application::getDispatcher();
$contextDao = Application::getContextDAO();
$context = $contextDao->getById($notification->getContextId());
$reviewRound = $this->getReviewRound($notification->getAssocId());
$submissionDao = Application::getSubmissionDAO();
$submission = $submissionDao->getById($reviewRound->getSubmissionId());
import('lib.pkp.controllers.grid.submissions.SubmissionsListGridCellProvider');
return SubmissionsListGridCellProvider::getUrlByUserRoles($request, $submission);
}
示例12: loadData
/**
* @copydoc GridHandler::loadData()
*/
protected function loadData($request, $filter)
{
$user = $request->getUser();
$context = $request->getContext();
$userId = $user->getId();
list($search, $column, $stageId) = $this->getFilterValues($filter);
$submissionDao = Application::getSubmissionDAO();
$rangeInfo = $this->getGridRangeInfo($request, $this->getId());
$data = $submissionDao->getUnpublishedByUserId($userId, $context->getId(), $search, $stageId, $rangeInfo);
return $data;
}
开发者ID:relaciones-internacionales-journal,项目名称:pkp-lib,代码行数:14,代码来源:MySubmissionsListGridHandler.inc.php
示例13: execute
/**
* Save changes to submission.
* @param $request PKPRequest
*/
function execute($request)
{
parent::execute($request);
$submission = $this->getSubmission();
$submissionDao = Application::getSubmissionDAO();
$submission->setSectionId($this->getData('sectionId'));
$submissionDao->updateObject($submission);
if ($submission->getDatePublished()) {
import('classes.search.ArticleSearchIndex');
ArticleSearchIndex::articleMetadataChanged($submission);
}
}
示例14: __construct
/**
* Constructor.
* @param $submissionId integer
* @param $userId integer
* @param $stageId integer
* @param $formParams array
*/
function __construct($submissionId, $userId, $stageId = null, $formParams = null)
{
parent::__construct('controllers/tab/issueEntry/form/publicationMetadataFormFields.tpl');
$submissionDao = Application::getSubmissionDAO();
$this->_submission = $submissionDao->getById($submissionId);
$this->_stageId = $stageId;
$this->_formParams = $formParams;
$this->_userId = $userId;
$this->addCheck(new FormValidatorPost($this));
$this->addCheck(new FormValidatorCSRF($this));
$this->addCheck(new FormValidatorURL($this, 'licenseURL', 'optional', 'form.url.invalid'));
}
示例15: execute
/**
* Save changes to submission.
* @param $args array
* @param $request PKPRequest
* @return int the submission ID
*/
function execute($args, $request)
{
// Update submission
$submissionDao = Application::getSubmissionDAO();
$submission = $this->submission;
if ($submission->getSubmissionProgress() <= $this->step) {
$submission->stampStatusModified();
$submission->setSubmissionProgress($this->step + 1);
$submissionDao->updateObject($submission);
}
return $this->submissionId;
}