Skip to content

Commit

Permalink
pkp/pkp-lib#10132 add checkbox for validation in Onix export plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
kaitlinnewson committed Jul 10, 2024
1 parent 3cba7d2 commit 4ffb463
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/pkp
Submodule pkp updated 44 files
+7 −7 classes/scheduledTask/ScheduledTaskHelper.inc.php
+1 −1 classes/services/PKPFileService.inc.php
+5 −1 controllers/grid/settings/roles/form/UserGroupForm.inc.php
+8 −2 controllers/grid/settings/user/form/UserForm.inc.php
+2 −2 cypress/tests/integration/Filenames.spec.js
+3 −0 locale/ar_IQ/manager.po
+3 −0 locale/bs_BA/manager.po
+3 −0 locale/ca_ES/manager.po
+3 −0 locale/cs_CZ/manager.po
+3 −0 locale/da_DK/manager.po
+3 −0 locale/de_DE/manager.po
+3 −0 locale/el_GR/manager.po
+3 −0 locale/en_US/manager.po
+3 −0 locale/es_ES/manager.po
+3 −0 locale/eu_ES/manager.po
+3 −0 locale/fa_IR/manager.po
+3 −0 locale/fi_FI/manager.po
+3 −0 locale/fr_CA/manager.po
+3 −0 locale/fr_FR/manager.po
+20 −0 locale/hi_IN/manager.po
+3 −0 locale/hr_HR/manager.po
+3 −0 locale/hu_HU/manager.po
+3 −0 locale/id_ID/manager.po
+3 −0 locale/is_IS/manager.po
+3 −0 locale/it_IT/manager.po
+3 −0 locale/ku_IQ/manager.po
+3 −0 locale/mk_MK/manager.po
+3 −0 locale/nb_NO/manager.po
+3 −0 locale/nl_NL/manager.po
+3 −0 locale/pl_PL/manager.po
+3 −0 locale/pt_BR/manager.po
+3 −0 locale/pt_PT/manager.po
+3 −0 locale/ro_RO/manager.po
+3 −0 locale/ru_RU/manager.po
+16 −0 locale/sk_SK/manager.po
+3 −0 locale/sl_SI/manager.po
+3 −0 locale/sr_RS@cyrillic/manager.po
+3 −0 locale/sr_RS@latin/manager.po
+3 −0 locale/sv_SE/manager.po
+3 −0 locale/tr_TR/manager.po
+3 −0 locale/uk_UA/manager.po
+3 −0 locale/vi_VN/manager.po
+3 −0 locale/zh_CN/manager.po
+3 −0 locale/zh_TW/manager.po
15 changes: 10 additions & 5 deletions plugins/importexport/onix30/Onix30ExportPlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,22 @@ function display($args, $request) {
$json = new JSONMessage(true);
$json->setEvent('addTab', array(
'title' => __('plugins.importexport.native.results'),
'url' => $request->url(null, null, null, array('plugin', $this->getName(), 'export'), array('selectedSubmissions' => $request->getUserVar('selectedSubmissions'), 'csrfToken' => $request->getSession()->getCSRFToken())),
'url' => $request->url(null, null, null, array('plugin', $this->getName(), 'export'), array('selectedSubmissions' => $request->getUserVar('selectedSubmissions'), 'validation' => $request->getUserVar('validation'), 'csrfToken' => $request->getSession()->getCSRFToken())),
));
header('Content-Type: application/json');
return $json->getString();
case 'export':
$onixDeployment = new Onix30ExportDeployment($context, $user);

$noValidation = !$request->getUserVar('validation');

$exportXml = $this->exportSubmissions(
(array) $request->getUserVar('selectedSubmissions'),
$context,
$user,
$onixDeployment
);
$onixDeployment,
$noValidation
);

$problems = $onixDeployment->getWarningsAndErrors();
$foundErrors = $onixDeployment->isProcessFailed();
Expand Down Expand Up @@ -180,7 +183,7 @@ function display($args, $request) {
* @param $onixDeployment Onix30ExportDeployment
* @return string XML contents representing the supplied submission IDs.
*/
function exportSubmissions($submissionIds, $context, $user, $onixDeployment) {
function exportSubmissions($submissionIds, $context, $user, $onixDeployment, $noValidation) {
import('lib.pkp.classes.metadata.MetadataTypeDescription');

$submissionDao = DAORegistry::getDAO('SubmissionDAO'); /* @var $submissionDao SubmissionDAO */
Expand All @@ -190,6 +193,8 @@ function exportSubmissions($submissionIds, $context, $user, $onixDeployment) {
assert(count($nativeExportFilters) == 1); // Assert only a single serialization filter
$exportFilter = array_shift($nativeExportFilters);

if ($noValidation) $exportFilter->setNoValidation($noValidation);

$exportFilter->setDeployment($onixDeployment);
$submissions = array();
foreach ($submissionIds as $submissionId) {
Expand All @@ -216,7 +221,7 @@ function exportSubmissions($submissionIds, $context, $user, $onixDeployment) {
}

/**
* Create file given it's name and content
* Create file given its name and content
*
* @param string $filename
* @param ?DateTime $fileContent
Expand Down
3 changes: 3 additions & 0 deletions plugins/importexport/onix30/templates/index.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
</div>
</template>
</submissions-list-panel>
{fbvFormSection list="true"}
{fbvElement type="checkbox" id="validation" label="plugins.importexport.common.validation" checked=$validation|default:true}
{/fbvFormSection}
{fbvFormSection}
<pkp-button :disabled="!components.submissions.itemsMax" @click="toggleSelectAll">
<template v-if="components.submissions.itemsMax && selectedSubmissions.length >= components.submissions.itemsMax">
Expand Down

0 comments on commit 4ffb463

Please sign in to comment.