diff --git a/classes/log/SubmissionEventLogDAO.inc.php b/classes/log/SubmissionEventLogDAO.inc.php index fff1b5e41d9..b80c3d94907 100644 --- a/classes/log/SubmissionEventLogDAO.inc.php +++ b/classes/log/SubmissionEventLogDAO.inc.php @@ -38,9 +38,8 @@ function newDataObject() { * @param $submissionId int * @return DAOResultFactory */ - function &getByMonographId($submissionId) { - $returner =& $this->getByAssoc(ASSOC_TYPE_SUBMISSION, $submissionId); - return $returner; + function getBySubmissionId($submissionId) { + return $this->getByAssoc(ASSOC_TYPE_SUBMISSION, $submissionId); } } diff --git a/classes/monograph/PublishedMonograph.inc.php b/classes/monograph/PublishedMonograph.inc.php index f6af5bece72..9e7ae363a6a 100644 --- a/classes/monograph/PublishedMonograph.inc.php +++ b/classes/monograph/PublishedMonograph.inc.php @@ -126,16 +126,16 @@ function setAudienceRangeExact($audienceRangeExact) { } /** - * Retrieves the assigned publication formats for this mongraph - * @param $onlyApproved boolean whether to fetch only those that are in the catalog. + * Retrieves the assigned publication formats for this submission + * @param $onlyApproved boolean whether to fetch only those that are approved for publication. * @return array PublicationFormat */ function getPublicationFormats($onlyApproved = false) { $publicationFormatDao = DAORegistry::getDAO('PublicationFormatDAO'); if ($onlyApproved) { - $formats = $publicationFormatDao->getApprovedByMonographId($this->getId()); + $formats = $publicationFormatDao->getApprovedBySubmissionId($this->getId()); } else { - $formats = $publicationFormatDao->getByMonographId($this->getId()); + $formats = $publicationFormatDao->getBySubmissionId($this->getId()); } return $formats->toArray(); } diff --git a/classes/publicationFormat/PublicationFormatDAO.inc.php b/classes/publicationFormat/PublicationFormatDAO.inc.php index fae6af38242..ae069d72a26 100644 --- a/classes/publicationFormat/PublicationFormatDAO.inc.php +++ b/classes/publicationFormat/PublicationFormatDAO.inc.php @@ -54,16 +54,16 @@ function getById($publicationFormatId, $monographId = null, $pressId = null) { } /** - * Retrieves a list of publication formats for a published monograph - * @param int $monographId + * Retrieves a list of publication formats for a submission + * @param int $submissionId int * @return DAOResultFactory (PublicationFormat) */ - function getByMonographId($monographId) { + function getBySubmissionId($submissionId) { $result = $this->retrieve( 'SELECT * FROM publication_formats WHERE submission_id = ?', - (int) $monographId + (int) $submissionId ); return new DAOResultFactory($result, $this, '_fromRow'); @@ -88,16 +88,16 @@ function getByPressId($pressId) { } /** - * Retrieves a list of approved publication formats for a published monograph - * @param int $monographId + * Retrieves a list of approved publication formats for a published submission + * @param int $submissionId * @return DAOResultFactory (PublicationFormat) */ - function getApprovedByMonographId($monographId) { + function getApprovedBySubmissionId($submissionId) { $result = $this->retrieve( 'SELECT * FROM publication_formats WHERE submission_id = ? AND is_approved = 1', - (int) $monographId + (int) $submissionId ); return new DAOResultFactory($result, $this, '_fromRow'); diff --git a/controllers/grid/catalogEntry/PublicationFormatGridHandler.inc.php b/controllers/grid/catalogEntry/PublicationFormatGridHandler.inc.php index eb617520c63..dbe81c7b9aa 100644 --- a/controllers/grid/catalogEntry/PublicationFormatGridHandler.inc.php +++ b/controllers/grid/catalogEntry/PublicationFormatGridHandler.inc.php @@ -24,8 +24,8 @@ import('lib.pkp.classes.linkAction.request.AjaxModal'); class PublicationFormatGridHandler extends GridHandler { - /** @var Monograph */ - var $_monograph; + /** @var Submission */ + var $_submission; /** @var boolean */ var $_inCatalogEntryModal; @@ -50,19 +50,19 @@ function PublicationFormatGridHandler() { // Getters/Setters // /** - * Get the monograph associated with this publication format grid. - * @return Monograph + * Get the submission associated with this publication format grid. + * @return Submission */ - function &getMonograph() { - return $this->_monograph; + function getSubmission() { + return $this->_submission; } /** - * Set the Monograph - * @param Monograph + * Set the submission + * @param $submission Submission */ - function setMonograph($monograph) { - $this->_monograph =& $monograph; + function setSubmission($submission) { + $this->_submission = $submission; } /** @@ -101,8 +101,8 @@ function initialize($request) { $this->setInstructions('editor.monograph.production.publicationFormatDescription'); $this->_inCatalogEntryModal = (boolean) $request->getUserVar('inCatalogEntryModal'); - // Retrieve the authorized monograph. - $this->setMonograph($this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH)); + // Retrieve the authorized submission. + $this->setSubmission($this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION)); // Load submission-specific translations AppLocale::requireComponents( @@ -131,8 +131,8 @@ function initialize($request) { ); // Columns - $monograph = $this->getMonograph(); - $cellProvider = new PublicationFormatGridCellProvider($monograph->getId(), $this->getInCatalogEntryModal()); + $submission = $this->getSubmission(); + $cellProvider = new PublicationFormatGridCellProvider($submission->getId(), $this->getInCatalogEntryModal()); $this->addColumn( new GridColumn( 'name', @@ -181,19 +181,19 @@ function initialize($request) { * @return PublicationFormatGridRow */ function getRowInstance() { - return new PublicationFormatGridRow($this->getMonograph()); + return new PublicationFormatGridRow($this->getSubmission()); } /** * Get the arguments that will identify the data in the grid - * In this case, the monograph. + * In this case, the submission. * @return array */ function getRequestArgs() { - $monograph = $this->getMonograph(); + $submission = $this->getSubmission(); return array( - 'submissionId' => $monograph->getId(), + 'submissionId' => $submission->getId(), 'inCatalogEntryModal' => $this->getInCatalogEntryModal() ); } @@ -202,9 +202,9 @@ function getRequestArgs() { * @see GridHandler::loadData */ function loadData($request, $filter = null) { - $monograph = $this->getMonograph(); + $submission = $this->getSubmission(); $publicationFormatDao = DAORegistry::getDAO('PublicationFormatDAO'); - $data = $publicationFormatDao->getByMonographId($monograph->getId()); + $data = $publicationFormatDao->getBySubmissionId($submission->getId()); return $data->toAssociativeArray(); } @@ -226,14 +226,14 @@ function addFormat($args, $request) { function editFormat($args, $request) { // Identify the format to be updated $publicationFormatId = (int) $request->getUserVar('publicationFormatId'); - $monograph = $this->getMonograph(); + $submission = $this->getSubmission(); $publicationFormatDao = DAORegistry::getDAO('PublicationFormatDAO'); $publicationFormat = $publicationFormatDao->getById($publicationFormatId); // Form handling import('controllers.grid.catalogEntry.form.PublicationFormatForm'); - $publicationFormatForm = new PublicationFormatForm($monograph, $publicationFormat); + $publicationFormatForm = new PublicationFormatForm($submission, $publicationFormat); $publicationFormatForm->initData(); $json = new JSONMessage(true, $publicationFormatForm->fetch($request)); @@ -249,14 +249,14 @@ function editFormat($args, $request) { function updateFormat($args, $request) { // Identify the format to be updated $publicationFormatId = (int) $request->getUserVar('publicationFormatId'); - $monograph = $this->getMonograph(); + $submission = $this->getSubmission(); $publicationFormatDao = DAORegistry::getDAO('PublicationFormatDAO'); $publicationFormat = $publicationFormatDao->getById($publicationFormatId); // Form handling import('controllers.grid.catalogEntry.form.PublicationFormatForm'); - $publicationFormatForm = new PublicationFormatForm($monograph, $publicationFormat); + $publicationFormatForm = new PublicationFormatForm($submission, $publicationFormat); $publicationFormatForm->readInputData(); if ($publicationFormatForm->validate()) { $publicationFormatId = $publicationFormatForm->execute($request); @@ -299,12 +299,12 @@ function updateFormat($args, $request) { * @return string Serialized JSON object */ function deleteFormat($args, $request) { - $press = $request->getPress(); + $context = $request->getContext(); $publicationFormatDao = DAORegistry::getDAO('PublicationFormatDAO'); $publicationFormat = $publicationFormatDao->getById( $request->getUserVar('publicationFormatId'), - null, // $pressId - $press->getId() // Make sure to validate the press context + null, // $submissionId + $context->getId() // Make sure to validate the context ); $result = false; if ($publicationFormat) { @@ -315,7 +315,7 @@ function deleteFormat($args, $request) { // Create a tombstone for this publication format. import('classes.publicationFormat.PublicationFormatTombstoneManager'); $publicationFormatTombstoneMgr = new PublicationFormatTombstoneManager(); - $publicationFormatTombstoneMgr->insertTombstoneByPublicationFormat($publicationFormat, $press); + $publicationFormatTombstoneMgr->insertTombstoneByPublicationFormat($publicationFormat, $context); $currentUser = $request->getUser(); $notificationMgr = new NotificationManager(); @@ -324,7 +324,7 @@ function deleteFormat($args, $request) { // log the deletion of the format. import('lib.pkp.classes.log.SubmissionLog'); import('classes.log.SubmissionEventLogEntry'); - SubmissionLog::logEvent($request, $this->getMonograph(), SUBMISSION_LOG_PUBLICATION_FORMAT_REMOVE, 'submission.event.publicationFormatRemoved', array('formatName' => $publicationFormat->getLocalizedName())); + SubmissionLog::logEvent($request, $this->getSubmission(), SUBMISSION_LOG_PUBLICATION_FORMAT_REMOVE, 'submission.event.publicationFormatRemoved', array('formatName' => $publicationFormat->getLocalizedName())); return DAO::getDataChangedEvent(); } else { @@ -341,12 +341,12 @@ function deleteFormat($args, $request) { * @return string Serialized JSON object */ function setAvailable($args, $request) { - $press = $request->getPress(); + $context = $request->getContext(); $publicationFormatDao = DAORegistry::getDAO('PublicationFormatDAO'); $publicationFormat =& $publicationFormatDao->getById( $request->getUserVar('publicationFormatId'), - null, // $monographId - $press->getId() // Make sure to validate the context. + null, // $submissionId + $context->getId() // Make sure to validate the context. ); if ($publicationFormat) { @@ -358,7 +358,7 @@ function setAvailable($args, $request) { import('lib.pkp.classes.log.SubmissionLog'); import('classes.log.SubmissionEventLogEntry'); SubmissionLog::logEvent( - $request, $this->getMonograph(), + $request, $this->getSubmission(), $newAvailableState?SUBMISSION_LOG_PUBLICATION_FORMAT_AVAILABLE:SUBMISSION_LOG_PUBLICATION_FORMAT_UNAVAILABLE, $newAvailableState?'submission.event.publicationFormatMadeAvailable':'submission.event.publicationFormatMadeUnavailable', array('publicationFormatName' => $publicationFormat->getLocalizedName()) @@ -373,7 +373,7 @@ function setAvailable($args, $request) { $publicationFormatTombstoneMgr->deleteTombstonesByPublicationFormats(array($publicationFormat)); } else { // Create a tombstone for this publication format. - $publicationFormatTombstoneMgr->insertTombstoneByPublicationFormat($publicationFormat, $press); + $publicationFormatTombstoneMgr->insertTombstoneByPublicationFormat($publicationFormat, $context); } return DAO::getDataChangedEvent($publicationFormat->getId()); diff --git a/controllers/grid/files/proof/AuthorProofingSignoffFilesCategoryGridDataProvider.inc.php b/controllers/grid/files/proof/AuthorProofingSignoffFilesCategoryGridDataProvider.inc.php index cf086108d5a..ab3e97f2ddc 100644 --- a/controllers/grid/files/proof/AuthorProofingSignoffFilesCategoryGridDataProvider.inc.php +++ b/controllers/grid/files/proof/AuthorProofingSignoffFilesCategoryGridDataProvider.inc.php @@ -58,9 +58,9 @@ function getRequestArgs() { * @see GridDataProvider::loadData() */ function loadData() { - $monograph = $this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH); + $submission = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION); $publicationFormatDao = DAORegistry::getDAO('PublicationFormatDAO'); - $publicationFormatFactory =& $publicationFormatDao->getByMonographId($monograph->getId()); + $publicationFormatFactory = $publicationFormatDao->getBySubmissionId($submission->getId()); return $publicationFormatFactory->toAssociativeArray(); } diff --git a/controllers/modals/submissionMetadata/CatalogEntryHandler.inc.php b/controllers/modals/submissionMetadata/CatalogEntryHandler.inc.php index 67cb54da262..17edfc68341 100644 --- a/controllers/modals/submissionMetadata/CatalogEntryHandler.inc.php +++ b/controllers/modals/submissionMetadata/CatalogEntryHandler.inc.php @@ -67,10 +67,10 @@ function fetch($args, $request) { // load in any publication formats assigned to this published monograph $publicationFormatDao = DAORegistry::getDAO('PublicationFormatDAO'); - $formats =& $publicationFormatDao->getByMonographId($submission->getId()); + $formats = $publicationFormatDao->getBySubmissionId($submission->getId()); $publicationFormats = array(); - while ($publicationFormat =& $formats->next()) { - $publicationFormats[] =& $publicationFormat; + while ($publicationFormat = $formats->next()) { + $publicationFormats[] = $publicationFormat; } $templateMgr->assign_by_ref('publicationFormats', $publicationFormats); @@ -103,7 +103,7 @@ function fetchFormatInfo($args, $request) { $json = new JSONMessage(); $publicationFormatDao = DAORegistry::getDAO('PublicationFormatDAO'); - $formats = $publicationFormatDao->getByMonographId($submission->getId()); + $formats = $publicationFormatDao->getBySubmissionId($submission->getId()); $publicationFormats = array(); while ($format = $formats->next()) { $publicationFormats[$format->getId()] = $format->getLocalizedName(); diff --git a/controllers/modals/submissionMetadata/form/CatalogEntrySubmissionReviewForm.inc.php b/controllers/modals/submissionMetadata/form/CatalogEntrySubmissionReviewForm.inc.php index 4aba915bace..f6b3342a6f8 100644 --- a/controllers/modals/submissionMetadata/form/CatalogEntrySubmissionReviewForm.inc.php +++ b/controllers/modals/submissionMetadata/form/CatalogEntrySubmissionReviewForm.inc.php @@ -56,8 +56,8 @@ function execute($request) { $publicationFormatTombstoneMgr = new PublicationFormatTombstoneManager(); $press = $request->getPress(); $publicationFormatDao = DAORegistry::getDAO('PublicationFormatDAO'); - $publicationFormatFactory =& $publicationFormatDao->getByMonographId($monograph->getId()); - $publicationFormats =& $publicationFormatFactory->toAssociativeArray(); + $publicationFormatFactory = $publicationFormatDao->getBySubmissionId($monograph->getId()); + $publicationFormats = $publicationFormatFactory->toAssociativeArray(); $notificationMgr = new NotificationManager(); if ($this->getData('confirm')) { diff --git a/controllers/tab/catalogEntry/CatalogEntryTabHandler.inc.php b/controllers/tab/catalogEntry/CatalogEntryTabHandler.inc.php index a0ada47ba41..de465e18938 100644 --- a/controllers/tab/catalogEntry/CatalogEntryTabHandler.inc.php +++ b/controllers/tab/catalogEntry/CatalogEntryTabHandler.inc.php @@ -131,10 +131,10 @@ function _getFormFromCurrentTab(&$form, &$notificationKey, $request) { // perform some validation to make sure this format is enabled and assigned to this monograph $publishedMonographDao = DAORegistry::getDAO('PublishedMonographDAO'); $publicationFormatDao = DAORegistry::getDAO('PublicationFormatDAO'); - $publishedMonograph =& $publishedMonographDao->getById($submission->getId()); - $formats =& $publicationFormatDao->getByMonographId($submission->getId()); + $publishedMonograph = $publishedMonographDao->getById($submission->getId()); + $formats = $publicationFormatDao->getBySubmissionId($submission->getId()); $form = null; - while ($format =& $formats->next()) { + while ($format = $formats->next()) { if ($format->getId() == $publicationFormatId) { $form = new CatalogEntryFormatMetadataForm($submission->getId(), $publicationFormatId, $format->getId(), $this->getStageId(), array('displayedInContainer' => true, 'tabPos' => $this->getTabPosition())); $notificationKey = 'notification.savedPublicationFormatMetadata'; diff --git a/pages/workflow/WorkflowHandler.inc.php b/pages/workflow/WorkflowHandler.inc.php index 38323e9b307..8095ba7a5bf 100644 --- a/pages/workflow/WorkflowHandler.inc.php +++ b/pages/workflow/WorkflowHandler.inc.php @@ -71,9 +71,9 @@ function production(&$args, $request) { ); $publicationFormatDao = DAORegistry::getDAO('PublicationFormatDAO'); - $monograph =& $this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH); - $publicationFormats =& $publicationFormatDao->getByMonographId($monograph->getId()); - $templateMgr->assign_by_ref('publicationFormats', $publicationFormats->toAssociativeArray()); + $submission = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION); + $publicationFormats = $publicationFormatDao->getBySubmissionId($submission->getId()); + $templateMgr->assign('publicationFormats', $publicationFormats->toAssociativeArray()); $templateMgr->assign('productionNotificationRequestOptions', $notificationRequestOptions); $templateMgr->display('workflow/production.tpl'); @@ -87,10 +87,10 @@ function production(&$args, $request) { function productionFormatsTab(&$args, $request) { $templateMgr = TemplateManager::getManager($request); $publicationFormatDao = DAORegistry::getDAO('PublicationFormatDAO'); - $monograph =& $this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH); - $publicationFormats =& $publicationFormatDao->getByMonographId($monograph->getId()); - $templateMgr->assign_by_ref('submission', $monograph); - $templateMgr->assign_by_ref('publicationFormats', $publicationFormats->toAssociativeArray()); + $submission = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION); + $publicationFormats = $publicationFormatDao->getBySubmissionId($submission->getId()); + $templateMgr->assign('submission', $submission); + $templateMgr->assign('publicationFormats', $publicationFormats->toAssociativeArray()); $templateMgr->assign('currentFormatTabId', (int) $request->getUserVar('currentFormatTabId')); return $templateMgr->fetchJson('workflow/productionFormatsTab.tpl');