diff --git a/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java b/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java index 0641039e433..7ac97aedf69 100644 --- a/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java +++ b/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java @@ -4276,6 +4276,36 @@ public void processPublishButton() { } } } + + public void processArchiveButton() { + if (session.getUser().isSuperuser()) { + if (dataset.isReleased()) { + PrimeFaces.current().executeScript("PF('archiveDataset').show()"); + } + + if (!dataset.isReleased()) { + if (dataset.getOwner().isReleased()) { + PrimeFaces.current().executeScript("PF('archiveDataset').show()"); + return; + } + if (!dataset.getOwner().isReleased()) { + if (canPublishDataverse()) { + if (dataset.getOwner().getOwner() == null + || (dataset.getOwner().getOwner() != null && dataset.getOwner().getOwner().isReleased())) { + PrimeFaces.current().executeScript("PF('archiveDataset').show()"); + return; + } + if ((dataset.getOwner().getOwner() != null && !dataset.getOwner().getOwner().isReleased())) { + PrimeFaces.current().executeScript("PF('maynotPublishParent').show()"); + } + + } else { + PrimeFaces.current().executeScript("PF('mayNotRelease').show()"); + } + } + } + } + } public boolean releaseDraftPopup(){ return dataset.isReleased(); diff --git a/src/main/java/propertyFiles/Bundle.properties b/src/main/java/propertyFiles/Bundle.properties index f1c18be22df..09011a9d4d2 100644 --- a/src/main/java/propertyFiles/Bundle.properties +++ b/src/main/java/propertyFiles/Bundle.properties @@ -1465,6 +1465,7 @@ metrics.citations.dialog.header=Dataset Citations metrics.citations.dialog.help=Citations for this dataset are retrieved from Crossref via DataCite using Make Data Count standards. For more information about dataset metrics, please refer to the User Guide. metrics.citations.dialog.empty=Sorry, no citations were found. dataset.publish.btn=Publish +dataset.archive.btn=Archive dataset.publish.header=Publish Dataset dataset.rejectBtn=Return to Author dataset.submitBtn=Submit for Review diff --git a/src/main/webapp/dataset.xhtml b/src/main/webapp/dataset.xhtml index 34c6d3dcbea..17c4e39659f 100644 --- a/src/main/webapp/dataset.xhtml +++ b/src/main/webapp/dataset.xhtml @@ -345,6 +345,14 @@ #{bundle['dataset.publish.btn']} +