Skip to content

Commit

Permalink
Merge branch 'main' into preprod
Browse files Browse the repository at this point in the history
  • Loading branch information
devletech committed Jan 14, 2025
2 parents 3aa4197 + 3724653 commit 4deb233
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed
### Security
-->
### added
- Script to auto-declaration of conflicts of interest.

## Unreleased
### Added
- New script to auto-declare conflicts of interest for journals activating the feature with an important backlog of articles

## v1.0.47 - 2025-01-08
### Added
Expand Down
17 changes: 17 additions & 0 deletions scripts/AutoDeclarationCOI.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ public function run(): void
$this->addIfNotExists($managersCanReportConflict, $tmpUsers);
$this->addIfNotExists($editors, $tmpUsers);

$owner = $paper->getUid();

if(array_key_exists($owner, $tmpUsers)){
unset($tmpUsers[$owner]); // exp. @see DMTCS #8
$ignored[] = ['paperId' => $paper->getPaperid(), 'uid' => $owner];
}

/** @var Episciences_User $user */
foreach ($tmpUsers as $user) {
$this->logger->info('Current User:');
Expand Down Expand Up @@ -240,6 +247,16 @@ public function run(): void
$this->logger->info(sprintf('Number of rows to insert in table %s: %s', T_LOGS, count($logValues)));
$this->logger->info(sprintf('Dump generated: %s/%s', getcwd(), $conflictFileName));
$this->logger->info(sprintf('Dump generated: %s/%s', getcwd(), $paperLogsFileName));

if (isset($ignored)) {
try {
$this->logger->info('Ignored users cannot manage their own submissions:');
$this->logger->info(json_encode($ignored, JSON_THROW_ON_ERROR));
} catch (JsonException $e) {
$this->logger->critical($e->getMessage());
}
}

}

/**
Expand Down

0 comments on commit 4deb233

Please sign in to comment.