Skip to content

Commit

Permalink
Merge branch 'addOJSVersionField-936' into 'main'
Browse files Browse the repository at this point in the history
Adds OJS Version column.

See merge request softwares-pkp/plugins_ojs/carinianaPreservation!11
  • Loading branch information
YvesLepidus committed Feb 5, 2025
2 parents 9d3aea3 + fa046ae commit e4d17b9
Show file tree
Hide file tree
Showing 14 changed files with 39 additions and 19 deletions.
2 changes: 1 addition & 1 deletion CarinianaPreservationPlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @file plugins/generic/carinianaPreservation/CarinianaPreservationPlugin.inc.php
*
* Copyright (c) 2023 Lepidus Tecnologia
* Copyright (c) 2023-2025 Lepidus Tecnologia
* Distributed under the GNU GPL v3. For full terms see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt.
*
* @class CarinianaPreservationPlugin
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ O plugin Preservação Cariniana tem o intuito de facilitar o processo de preser
* Anos disponíveis
* Volumes das edições
* Notas e Comentários
* Versão do OJS

Além destas informações, também é enviado o Termo de Responsabilidade e Autorização para preservação na rede Cariniana, preenchido pelos responsáveis pelo periódico.

Expand Down Expand Up @@ -57,4 +58,4 @@ Caso algum dos dados necessários para a submissão não tenha sido preenchido n
## Licença
__Esse plugin é licenciado através da Licença Pública Geral GNU v3.0__

__Copyright (c) 2023 Lepidus Tecnologia__
__Copyright (c) 2023-2025 Lepidus Tecnologia__
8 changes: 6 additions & 2 deletions classes/PreservedJournal.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class PreservedJournal
private $availableYears;
private $issuesVolumes;
private $notesAndComments;
private $ojsVersion;

public function __construct(
string $publisherOrInstitution,
Expand All @@ -21,7 +22,8 @@ public function __construct(
string $journalPath,
string $availableYears,
?string $issuesVolumes,
string $notesAndComments
string $notesAndComments,
string $ojsVersion
) {
$this->publisherOrInstitution = $publisherOrInstitution;
$this->title = $title;
Expand All @@ -32,6 +34,7 @@ public function __construct(
$this->availableYears = $availableYears;
$this->issuesVolumes = $issuesVolumes;
$this->notesAndComments = $notesAndComments;
$this->ojsVersion = $ojsVersion;
}

public function asRecord(): array
Expand All @@ -45,7 +48,8 @@ public function asRecord(): array
$this->journalPath,
$this->availableYears,
$this->issuesVolumes,
$this->notesAndComments
$this->notesAndComments,
$this->ojsVersion
];
}
}
5 changes: 4 additions & 1 deletion classes/PreservedJournalFactory.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public function buildPreservedJournal($journal, $baseUrl, $notesAndComments, $lo
$journalPath = $journal->getData('urlPath');
$availableYears = $this->getAvailableYears($journal);
$issuesVolumes = $this->getIssuesVolumes($journal);
$versionDao = DAORegistry::getDAO('VersionDAO'); /* @var $versionDao VersionDAO */
$ojsVersion = $versionDao->getCurrentVersion();

return new PreservedJournal(
$publisherOrInstitution,
Expand All @@ -23,7 +25,8 @@ public function buildPreservedJournal($journal, $baseUrl, $notesAndComments, $lo
$journalPath,
$availableYears,
$issuesVolumes,
$notesAndComments
$notesAndComments,
$ojsVersion->getVersionString()
);
}

Expand Down
3 changes: 2 additions & 1 deletion classes/PreservedJournalSpreadsheet.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ private function getHeaders(): array
__("plugins.generic.carinianaPreservation.headers.journalPath"),
__("plugins.generic.carinianaPreservation.headers.availableYears"),
__("plugins.generic.carinianaPreservation.headers.issuesVolumes"),
__("plugins.generic.carinianaPreservation.headers.notesAndComments")
__("plugins.generic.carinianaPreservation.headers.notesAndComments"),
__("admin.systemVersion")
];
}

Expand Down
2 changes: 1 addition & 1 deletion classes/form/CarinianaPreservationSettingsForm.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @file CarinianaPreservationSettingsForm.inc.php
*
* Copyright (c) 2023 Lepidus Tecnologia
* Copyright (c) 2023-2025 Lepidus Tecnologia
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @class CarinianaPreservationSettingsForm
Expand Down
2 changes: 1 addition & 1 deletion classes/form/PreservationSubmissionForm.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @file PreservationSubmissionForm.inc.php
*
* Copyright (c) 2023 Lepidus Tecnologia
* Copyright (c) 2023-2025 Lepidus Tecnologia
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @class PreservationSubmissionForm
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* @file plugins/generic/carinianaPreservation/index.php
*
* Copyright (c) 2023 Lepidus Tecnologia
* Copyright (c) 2023-2025 Lepidus Tecnologia
* Distributed under the GNU GPL v3. For full terms see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt.
*
* @ingroup plugins_generic_carinianaPreservation
Expand Down
2 changes: 1 addition & 1 deletion templates/preservationSubmission.tpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{**
* templates/preservationSubmission.tpl
*
* Copyright (c) 2023 Lepidus Tecnologia
* Copyright (c) 2023-2025 Lepidus Tecnologia
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* Cariniana preservation submission form
Expand Down
2 changes: 1 addition & 1 deletion templates/settingsForm.tpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{**
* templates/settingsForm.tpl
*
* Copyright (c) 2023 Lepidus Tecnologia
* Copyright (c) 2023-2025 Lepidus Tecnologia
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* Cariniana Preservation plugin settings
Expand Down
10 changes: 8 additions & 2 deletions tests/PreservedJournalFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class PreservedJournalFactoryTest extends DatabaseTestCase
private $firstIssueVolume = 1;
private $secondIssueVolume = 2;
private $notesAndComments = 'We are the 18th SciELO journal';
private $ojsVersion;

public function setUp(): void
{
Expand All @@ -30,6 +31,9 @@ public function setUp(): void
$this->preservedJournalFactory = new PreservedJournalFactory();
$this->createTestIssue($this->firstIssueYear, $this->firstIssueVolume);
$this->createTestIssue($this->lastIssueYear, $this->secondIssueVolume);
$versionDao = DAORegistry::getDAO('VersionDAO'); /* @var $versionDao VersionDAO */
$currentVersion = $versionDao->getCurrentVersion();
$this->ojsVersion = $currentVersion->getVersionString();
}

protected function getAffectedTables()
Expand Down Expand Up @@ -75,7 +79,8 @@ public function testFactoryBuildsPreservedJournal(): void
'scielojournal18',
'2018; 2022',
'1; 2',
'We are the 18th SciELO journal'
'We are the 18th SciELO journal',
$this->ojsVersion
];
$this->assertEquals($expectedRecord, $preservedJournal->asRecord());
}
Expand All @@ -93,7 +98,8 @@ public function testFactoryBuildsPreservedJournalWithEmptyNotesAndComments(): vo
'scielojournal18',
'2018; 2022',
'1; 2',
''
'',
$this->ojsVersion
];
$this->assertEquals($expectedRecord, $preservedJournal->asRecord());
}
Expand Down
6 changes: 4 additions & 2 deletions tests/PreservedJournalSpreadsheetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ public function setUp(): void
'scielojournal18',
'2018; 2022',
'1; 2; 12; 18',
'We are the 18th SciELO journal'
'We are the 18th SciELO journal',
'3.3.0.20'
)
];

Expand Down Expand Up @@ -61,6 +62,7 @@ public function testGeneratedSpreadsheetHasHeaders(): void
__("plugins.generic.carinianaPreservation.headers.availableYears"),
__("plugins.generic.carinianaPreservation.headers.issuesVolumes"),
__("plugins.generic.carinianaPreservation.headers.notesAndComments"),
__("admin.systemVersion")
];

$firstRow = $worksheet->toArray()[0];
Expand All @@ -73,7 +75,7 @@ public function testGeneratedSpreadsheetHasJournals(): void
$this->spreadsheet->createSpreadsheet($this->filePath);
$worksheet = $this->getWorksheet();

$expectedJournalData = ['SciELO', 'SciELO Journal n18', '1234-1234', '0101-1010', 'https://scielo-journal-18.com.br/', 'scielojournal18', '2018; 2022', '1; 2; 12; 18', 'We are the 18th SciELO journal'];
$expectedJournalData = ['SciELO', 'SciELO Journal n18', '1234-1234', '0101-1010', 'https://scielo-journal-18.com.br/', 'scielojournal18', '2018; 2022', '1; 2; 12; 18', 'We are the 18th SciELO journal', '3.3.0.20'];
$secondRow = $worksheet->toArray()[1];

$this->assertEquals($expectedJournalData, $secondRow);
Expand Down
5 changes: 4 additions & 1 deletion tests/PreservedJournalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class PreservedJournalTest extends TestCase
private $availableYears = '2018; 2022';
private $notesAndComments = 'We are the 18th SciELO journal';
private $issuesVolumes = '1; 2; 12; 18';
private $ojsVersion = '3.3.0.20';

public function setUp(): void
{
Expand All @@ -30,6 +31,7 @@ public function setUp(): void
$this->availableYears,
$this->issuesVolumes,
$this->notesAndComments,
$this->ojsVersion,
);
}

Expand All @@ -44,7 +46,8 @@ public function testJournalRecord(): void
'scielojournal18',
'2018; 2022',
'1; 2; 12; 18',
'We are the 18th SciELO journal'
'We are the 18th SciELO journal',
'3.3.0.20'
];
$this->assertEquals($expectedRecord, $this->preservedJournal->asRecord());
}
Expand Down
6 changes: 3 additions & 3 deletions version.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<!--
*
* Copyright (c) 2023 Lepidus Tecnologia
* Copyright (c) 2023-2025 Lepidus Tecnologia
* Distributed under the GNU GPL v3. For full terms see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt.
*
-->
Expand All @@ -12,7 +12,7 @@
<application>carinianaPreservation</application>
<type>plugins.generic</type>
<lazy-load>0</lazy-load>
<release>1.4.1.2</release>
<date>2024-11-13</date>
<release>1.4.1.3</release>
<date>2025-02-05</date>
<class>CarinianaPreservationPlugin</class>
</version>

0 comments on commit e4d17b9

Please sign in to comment.