Skip to content

Commit

Permalink
[OJS][main] #9887 Invitation API Support (pkp#4297)
Browse files Browse the repository at this point in the history
* pkp/pkp-lib#9887 API Support

* pkp/pkp-lib#9887 Redesigning Invitations

* pkp/pkp-lib#9887 Add ChangeProfileEmail Invitation

* pkp/pkp-lib#9887 Remove unnecessary PKP classname prefixes

* pkp/pkp-lib#9887 Fix copyright dates for new code

* pkp/pkp-lib#9887 Add email template on upgrade

* pkp/pkp-lib#9887 Don't put hash method into function name

* pkp/pkp-lib#9887 Submodule update ##asmecher/i9887##

---------

Co-authored-by: Dimitris Efstathiou <[email protected]>
  • Loading branch information
asmecher and defstat authored Jun 4, 2024
1 parent 39843f2 commit bdcf224
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 5 deletions.
21 changes: 21 additions & 0 deletions api/v1/invitations/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

/**
* @defgroup api_v1_invitations Invitations API requests
*/

/**
* @file api/v1/invitations/index.php
*
* Copyright (c) 2024 Simon Fraser University
* Copyright (c) 2024 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @ingroup api_v1_invitations
*
* @brief Handle API requests for invitations.
*/

use PKP\API\v1\invitations\InvitationController;

return new \PKP\handler\APIHandler(new InvitationController());
1 change: 1 addition & 0 deletions dbscripts/xml/upgrade.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@

<upgrade minversion="3.1.0.0" maxversion="3.4.9.9">
<migration class="PKP\migration\upgrade\v3_5_0\PreflightCheckMigration" fallback="3.4.9.9" />
<migration class="PKP\migration\upgrade\v3_5_0\InstallEmailTemplates"/>
<migration class="PKP\migration\upgrade\v3_5_0\I9197_MigrateAccessKeys"/>
<migration class="PKP\migration\upgrade\v3_5_0\I9253_SiteAnnouncements"/>
<migration class="PKP\migration\upgrade\v3_5_0\I9262_Highlights"/>
Expand Down
2 changes: 1 addition & 1 deletion lib/pkp
Submodule pkp updated 50 files
+246 −0 api/v1/invitations/InvitationController.php
+2 −0 api/v1/submissions/PKPSubmissionController.php
+94 −0 classes/core/InvitationServiceProvider.php
+7 −7 classes/core/PKPContainer.php
+1 −1 classes/facades/Repo.php
+30 −0 classes/invitation/core/CreateInvitationController.php
+287 −0 classes/invitation/core/Invitation.php
+34 −0 classes/invitation/core/InvitationActionRedirectController.php
+53 −0 classes/invitation/core/InvitationFactory.php
+30 −0 classes/invitation/core/ReceiveInvitationController.php
+21 −0 classes/invitation/core/contracts/IApiHandleable.php
+21 −0 classes/invitation/core/contracts/IBackofficeHandleable.php
+22 −0 classes/invitation/core/contracts/IMailableUrlUpdateable.php
+21 −0 classes/invitation/core/enums/InvitationAction.php
+5 −6 classes/invitation/core/enums/InvitationStatus.php
+29 −0 classes/invitation/core/traits/HasMailable.php
+42 −0 classes/invitation/core/traits/ShouldValidate.php
+0 −255 classes/invitation/invitations/BaseInvitation.php
+142 −0 classes/invitation/invitations/ChangeProfileEmailInvite.php
+46 −87 classes/invitation/invitations/RegistrationAccessInvite.php
+97 −77 classes/invitation/invitations/ReviewerAccessInvite.php
+91 −0 classes/invitation/invitations/handlers/ChangeProfileEmailInviteRedirectController.php
+104 −0 classes/invitation/invitations/handlers/RegistrationAccessInviteRedirectController.php
+93 −0 classes/invitation/invitations/handlers/ReviewerAccessInviteRedirectController.php
+54 −36 classes/invitation/models/InvitationModel.php
+0 −63 classes/invitation/repositories/BaseRepository.php
+0 −192 classes/invitation/repositories/Invitation.php
+65 −0 classes/invitation/repositories/Repository.php
+58 −0 classes/mail/mailables/ChangeProfileEmailInvitationNotify.php
+8 −7 classes/mail/traits/OneClickReviewerAccess.php
+6 −9 classes/migration/install/InvitationsMigration.php
+12 −14 classes/migration/upgrade/v3_5_0/I9197_MigrateAccessKeys.php
+120 −0 classes/migration/upgrade/v3_5_0/InstallEmailTemplates.php
+4 −6 classes/observers/listeners/ValidateRegisteredEmail.php
+64 −0 classes/security/authorization/internal/SubmissionCompletePolicy.php
+7 −6 classes/submission/action/EditorAction.php
+7 −6 classes/task/ReviewReminder.php
+1 −0 classes/template/PKPTemplateManager.php
+12 −1 classes/user/form/BaseProfileForm.php
+43 −3 classes/user/form/ContactForm.php
+15 −1 controllers/tab/user/ProfileTabHandler.php
+3 −9 jobs/invitations/RemoveExpiredInvitationsJob.php
+13 −0 locale/en/emails.po
+8 −0 locale/en/user.po
+42 −8 pages/invitation/PKPInvitationHandler.php
+1 −1 pages/invitation/index.php
+1 −1 pages/login/LoginHandler.php
+3 −4 pages/user/RegistrationHandler.php
+2 −0 pages/workflow/PKPWorkflowHandler.php
+8 −1 templates/user/contactForm.tpl
7 changes: 3 additions & 4 deletions pages/reviewer/ReviewerHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,11 @@ public function authorize($request, &$args, $roleAssignments)
if ($context->getData('reviewerAccessKeysEnabled')) {
$accessKeyCode = $request->getUserVar('key');
if ($accessKeyCode) {
$keyHash = md5($accessKeyCode);

$invitation = Repo::invitation()->getBOByKeyHash($keyHash);
$invitation = Repo::invitation()
->getByKey($accessKeyCode);

if (isset($invitation)) {
$invitation->acceptHandle();
$invitation->acceptHandle($request);
}
}
}
Expand Down
1 change: 1 addition & 0 deletions registry/emailTemplates.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,5 @@
<email key="SUBMISSION_SAVED_FOR_LATER" name="mailable.submissionSavedForLater.name" subject="emails.submissionSavedForLater.subject" body="emails.submissionSavedForLater.body"/>
<email key="SUBMISSION_NEEDS_EDITOR" name="mailable.submissionNeedsEditor.name" subject="emails.submissionNeedsEditor.subject" body="emails.submissionNeedsEditor.body"/>
<email key="PAYMENT_REQUEST_NOTIFICATION" name="mailable.paymentRequest.name" subject="emails.paymentRequestNotification.subject" body="emails.paymentRequestNotification.body"/>
<email key="CHANGE_EMAIL" name="mailable.changeProfileEmailInvitationNotify.name" subject="emails.changeProfileEmailInvitationNotify.subject" body="emails.changeProfileEmailInvitationNotify.body"/>
</emails>

0 comments on commit bdcf224

Please sign in to comment.