forked from pkp/pkp-lib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6453a59
commit a530c90
Showing
14 changed files
with
520 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
/** | ||
* @file classes/form/validation/FormValidatorDateCompare.php | ||
* | ||
* Copyright (c) 2014-2021 Simon Fraser University | ||
* Copyright (c) 2000-2021 John Willinsky | ||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING. | ||
* | ||
* @class FormValidatorDateCompare | ||
* | ||
* @ingroup form_validation | ||
* | ||
* @see FormValidator | ||
* | ||
* @brief Form validation to validation comparison rule for a date field | ||
*/ | ||
|
||
namespace PKP\form\validation; | ||
|
||
use PKP\validation\ValidatorDateConparison; | ||
use Carbon\Carbon; | ||
use DateTimeInterface; | ||
|
||
class FormValidatorDateCompare extends FormValidator | ||
{ | ||
/** | ||
* Constructor. | ||
* | ||
* @param \PKP\form\Form $form the associated form | ||
* @param string $field the name of the associated field | ||
* @param DateTimeInterface|Carbon $comparingDate the comparing date | ||
* @param string $comparingRule the comparing rule e.g. equal/greater/lesser/... | ||
* @param string $type the type of check, either "required" or "optional" | ||
* @param string $message the error message for validation failures (i18n key) | ||
*/ | ||
public function __construct(&$form, $field, $comparingDate, $comparingRule, $type = 'optional', $message = 'email.invalid') | ||
{ | ||
$validator = new ValidatorDateConparison($comparingDate, $comparingRule); | ||
parent::__construct($form, $field, $type, $message, $validator); | ||
} | ||
} | ||
|
||
if (!PKP_STRICT_MODE) { | ||
class_alias('\PKP\form\validation\FormValidatorDateCompare', '\FormValidatorDateCompare'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
classes/migration/upgrade/v3_5_0/I5885_RenameReviewRemainderSettingsName.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php | ||
|
||
/** | ||
* @file classes/migration/upgrade/v3_5_0/I5885_RenameReviewRemainderSettingsName.php | ||
* | ||
* Copyright (c) 2014-2024 Simon Fraser University | ||
* Copyright (c) 2000-2024 John Willinsky | ||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING. | ||
* | ||
* @class I5885_RenameReviewRemainderColumns | ||
* | ||
* @brief Rename the review remainder settings name | ||
*/ | ||
|
||
namespace PKP\migration\upgrade\v3_5_0; | ||
|
||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\DB; | ||
use Illuminate\Support\Facades\Schema; | ||
use PKP\migration\Migration; | ||
|
||
abstract class I5885_RenameReviewRemainderSettingsName extends Migration | ||
{ | ||
abstract protected function getContextSettingsTable(): string; | ||
|
||
/** | ||
* Run the migration. | ||
*/ | ||
public function up(): void | ||
{ | ||
DB::table($this->getContextSettingsTable()) | ||
->select(['setting_name']) | ||
->where('setting_name', 'numDaysBeforeInviteReminder') | ||
->update([ | ||
'setting_name' => 'numDaysAfterReviewResponseReminderDue' | ||
]); | ||
|
||
DB::table($this->getContextSettingsTable()) | ||
->select(['setting_name']) | ||
->where('setting_name', 'numDaysBeforeSubmitReminder') | ||
->update([ | ||
'setting_name' => 'numDaysAfterReviewSubmitReminderDue' | ||
]); | ||
} | ||
|
||
/** | ||
* Reverse the migration | ||
*/ | ||
public function down(): void | ||
{ | ||
DB::table($this->getContextSettingsTable()) | ||
->select(['setting_name']) | ||
->where('setting_name', 'numDaysAfterReviewResponseReminderDue') | ||
->update([ | ||
'setting_name' => 'numDaysBeforeInviteReminder' | ||
]); | ||
|
||
DB::table($this->getContextSettingsTable()) | ||
->select(['setting_name']) | ||
->where('setting_name', 'numDaysAfterReviewSubmitReminderDue') | ||
->update([ | ||
'setting_name' => 'numDaysBeforeSubmitReminder' | ||
]); | ||
} | ||
} |
Oops, something went wrong.