Skip to content

Commit

Permalink
fix for IQSS#10251 - sync terms popup required code
Browse files Browse the repository at this point in the history
  • Loading branch information
qqmyers authored and haarli committed Mar 7, 2024
1 parent c82252b commit 68dd3f6
Showing 1 changed file with 4 additions and 26 deletions.
30 changes: 4 additions & 26 deletions src/main/java/edu/harvard/iq/dataverse/util/FileUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -1199,34 +1199,12 @@ public static boolean isGuestbookPopupRequired(DatasetVersion datasetVersion) {
}

public static boolean isTermsPopupRequired(DatasetVersion datasetVersion) {

if (datasetVersion == null) {
logger.fine("TermsPopup not required because datasetVersion is null.");
return false;
}
//0. if version is draft then Popup "not required"
if (!datasetVersion.isReleased()) {
logger.fine("TermsPopup not required because datasetVersion has not been released.");
Boolean answer = popupDueToStateOrTerms(datasetVersion);
if(answer == null) {
logger.fine("TermsPopup is not required.");
return false;
}
// 1. License and Terms of Use:
if (datasetVersion.getTermsOfUseAndAccess() != null) {
if (!License.CC0.equals(datasetVersion.getTermsOfUseAndAccess().getLicense())
&& !(datasetVersion.getTermsOfUseAndAccess().getTermsOfUse() == null
|| datasetVersion.getTermsOfUseAndAccess().getTermsOfUse().equals(""))) {
logger.fine("TermsPopup required because of license or terms of use.");
return true;
}

// 2. Terms of Access:
if (!(datasetVersion.getTermsOfUseAndAccess().getTermsOfAccess() == null) && !datasetVersion.getTermsOfUseAndAccess().getTermsOfAccess().equals("")) {
logger.fine("TermsPopup required because of terms of access.");
return true;
}
}

logger.fine("TermsPopup is not required.");
return false;
return answer;
}

/**
Expand Down

0 comments on commit 68dd3f6

Please sign in to comment.