-
Notifications
You must be signed in to change notification settings - Fork 5
feat: make DOI optional for manual entry in citation form #1373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1b54c49
be929d9
544b591
0c5b6dd
a7d4b34
91022a6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -242,6 +242,42 @@ public function process() | |||||||||||||||||||||||||||||||||||||||||||||||||||
| array_push($studiesValidation, $studyReport); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Validate citations | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| $citations = $project->citations; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| $citationsValidation = []; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| $citationsStatus = true; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| foreach ($citations as $citation) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| $citationReport = [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'name' => $citation->title ?? 'Untitled', | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'id' => $citation->id, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Check if DOI is present | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| $hasDoi = is_string($citation->doi) && trim($citation->doi) !== ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| if ($hasDoi) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| $citationReport['doi'] = 'true|required'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| $citationReport['doi'] = 'false|required'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| $citationsStatus = false; // Citation validation failed | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| $citationReport['status'] = $hasDoi; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| array_push($citationsValidation, $citationReport); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Set overall citations validation status and store detailed report | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| if ($citationsStatus) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| $report['project']['citations'] = 'true|required'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| $report['project']['citations'] = 'false|required'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| $status = false; // Propagate to project status | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Store detailed citations validation data separately | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| $report['project']['citations_detail'] = $citationsValidation; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+270
to
+279
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Set overall citations validation status and store detailed report | |
| if ($citationsStatus) { | |
| $report['project']['citations'] = 'true|required'; | |
| } else { | |
| $report['project']['citations'] = 'false|required'; | |
| $status = false; // Propagate to project status | |
| } | |
| // Store detailed citations validation data separately | |
| $report['project']['citations_detail'] = $citationsValidation; | |
| // Set overall DOI-specific citations validation status without overwriting base citations validation | |
| if (count($citations) === 0) { | |
| $report['project']['citations_doi'] = 'false|required'; | |
| $status = false; | |
| } else { | |
| if ($citationsStatus) { | |
| $report['project']['citations_doi'] = 'true|required'; | |
| } else { | |
| $report['project']['citations_doi'] = 'false|required'; | |
| $status = false; // Propagate to project status | |
| } | |
| } | |
| // Store detailed DOI-specific citations validation data separately | |
| $report['project']['citations_doi_detail'] = $citationsValidation; |
Uh oh!
There was an error while loading. Please reload this page.