diff --git a/api/v1/_payments/PKPBackendPaymentsSettingsHandler.inc.php b/api/v1/_payments/PKPBackendPaymentsSettingsHandler.inc.php new file mode 100644 index 00000000000..e70ea24582c --- /dev/null +++ b/api/v1/_payments/PKPBackendPaymentsSettingsHandler.inc.php @@ -0,0 +1,112 @@ +_endpoints = array_merge_recursive($this->_endpoints, array( + 'PUT' => array( + array( + 'pattern' => $rootPattern, + 'handler' => array($this, 'edit'), + 'roles' => array( + ROLE_ID_SITE_ADMIN, + ROLE_ID_MANAGER, + ), + ), + ), + )); + parent::__construct(); + } + + /** + * @copydoc PKPHandler::authorize + */ + public function authorize($request, &$args, $roleAssignments) { + import('lib.pkp.classes.security.authorization.PolicySet'); + $rolePolicy = new PolicySet(COMBINING_PERMIT_OVERRIDES); + + import('lib.pkp.classes.security.authorization.RoleBasedHandlerOperationPolicy'); + foreach ($roleAssignments as $role => $operations) { + $rolePolicy->addPolicy(new RoleBasedHandlerOperationPolicy($request, $role, $operations)); + } + $this->addPolicy($rolePolicy); + + return parent::authorize($request, $args, $roleAssignments); + } + + /** + * Receive requests to edit the payments form + * + * @param $slimRequest Request Slim request object + * @param $response Response object + * + * @return Response + */ + public function edit($slimRequest, $response, $args) { + $request = $this->getRequest(); + $context = $request->getContext(); + $params = $slimRequest->getParsedBody(); + $contextService = Services::get('context'); + + // Process query params to format incoming data as needed + foreach ($slimRequest->getParsedBody() as $param => $val) { + switch ($param) { + case 'paymentsEnabled': + $params[$param] = $val === 'true'; + break; + case 'currency': + $params[$param] = (string) $val; + break; + } + } + + if (isset($params['currency'])) { + $errors = $contextService->validate( + VALIDATE_ACTION_EDIT, + ['currency' => $params['currency']], + $context->getSupportedLocales(), + $context->getPrimaryLocale() + ); + if (!empty($errors)) { + return $response->withStatus(400)->withJson($errors); + } + } + + $paymentPlugins = PluginRegistry::loadCategory('paymethod', true); + $errors = []; + foreach ($paymentPlugins as $paymentPlugin) { + $errors = array_merge( + $errors, + $paymentPlugin->saveSettings($params, $slimRequest, $request) + ); + } + if (!empty($errors)) { + return $response->withStatus(400)->withJson($errors); + } + + $context = $contextService->get($context->getId()); + $context = $contextService->edit($context, $params, $request); + + return $response->withJson($params); + } +} diff --git a/api/v1/users/PKPUserHandler.inc.php b/api/v1/users/PKPUserHandler.inc.php index 0488416a4f7..fe31fb0c498 100644 --- a/api/v1/users/PKPUserHandler.inc.php +++ b/api/v1/users/PKPUserHandler.inc.php @@ -218,7 +218,6 @@ private function _buildListRequestParams($slimRequest) { case 'assignedToSubmissionStage': case 'assignedToSubmission': - case 'assignedToSection': $returnParams[$param] = (int) $val; break; diff --git a/classes/components/forms/Field.inc.php b/classes/components/forms/Field.inc.php index 354d69ba4ac..210adb05c98 100644 --- a/classes/components/forms/Field.inc.php +++ b/classes/components/forms/Field.inc.php @@ -1,6 +1,6 @@ method = $context ? 'PUT' : 'POST'; $this->addField(new FieldText('name', [ - 'label' => __('manager.setup.journalTitle'), + 'label' => __('manager.setup.contextTitle'), 'isRequired' => true, 'isMultilingual' => true, 'value' => $context ? $context->getData('name') : null, ])) ->addField(new FieldText('acronym', [ - 'label' => __('manager.setup.journalInitials'), + 'label' => __('manager.setup.contextInitials'), 'size' => 'small', 'isRequired' => true, 'isMultilingual' => true, @@ -55,7 +55,7 @@ public function __construct($action, $successMessage, $locales, $baseUrl, $conte 'value' => $context ? $context->getData('acronym') : null, ])) ->addField(new FieldRichTextarea('description', [ - 'label' => __('admin.journals.journalDescription'), + 'label' => __('admin.contexts.contextDescription'), 'isMultilingual' => true, 'value' => $context ? $context->getData('description') : null, ])) diff --git a/classes/components/forms/context/PKPEmailSetupForm.inc.php b/classes/components/forms/context/PKPEmailSetupForm.inc.php index 42377ed3e60..f8c6ef98c8b 100644 --- a/classes/components/forms/context/PKPEmailSetupForm.inc.php +++ b/classes/components/forms/context/PKPEmailSetupForm.inc.php @@ -1,6 +1,6 @@ $licenseUrlOptions, 'value' => $context->getData('licenseUrl'), ])) - ->addField(new FieldOptions('copyrightYearBasis', [ - 'label' => __('submission.copyrightYear'), - 'description' => __('manager.distribution.copyrightYearBasis.description'), - 'type' => 'radio', - 'options' => [ - ['value' => 'issue', 'label' => __('manager.distribution.copyrightYearBasis.issue')], - ['value' => 'submission', 'label' => __('manager.distribution.copyrightYearBasis.submission')], - ], - 'value' => $context->getData('copyrightYearBasis'), - ])) ->addField(new FieldRichTextarea('licenseTerms', [ 'label' => __('manager.distribution.licenseTerms'), 'tooltip' => __('manager.distribution.licenseTerms.description'), diff --git a/classes/components/forms/context/PKPListsForm.inc.php b/classes/components/forms/context/PKPListsForm.inc.php index 9ab0d8b30fd..2d7d77a053e 100644 --- a/classes/components/forms/context/PKPListsForm.inc.php +++ b/classes/components/forms/context/PKPListsForm.inc.php @@ -1,6 +1,6 @@ __('manager.setup.identity'), ]) ->addField(new FieldText('name', [ - 'label' => __('manager.setup.contextName'), + 'label' => __('manager.setup.contextTitle'), 'size' => 'large', 'isRequired' => true, 'isMultilingual' => true, @@ -50,7 +50,7 @@ public function __construct($action, $locales, $context) { 'value' => $context->getData('name'), ])) ->addField(new FieldText('acronym', [ - 'label' => __('manager.setup.journalInitials'), + 'label' => __('manager.setup.contextInitials'), 'size' => 'small', 'isRequired' => true, 'isMultilingual' => true, @@ -63,7 +63,7 @@ public function __construct($action, $locales, $context) { 'description' => __('manager.setup.keyInfo.description'), ]) ->addField(new FieldRichTextarea('description', [ - 'label' => __('manager.setup.journalSummary'), + 'label' => __('manager.setup.contextSummary'), 'isMultilingual' => true, 'groupId' => 'keyInfo', 'value' => $context->getData('description'), @@ -77,10 +77,10 @@ public function __construct($action, $locales, $context) { ->addGroup([ 'id' => 'about', 'label' => __('common.description'), - 'description' => __('manager.setup.journalAbout.description'), + 'description' => __('manager.setup.contextAbout.description'), ]) ->addField(new FieldRichTextarea('about', [ - 'label' => __('manager.setup.journalAbout'), + 'label' => __('manager.setup.contextAbout'), 'isMultilingual' => true, 'size' => 'large', 'groupId' => 'about', diff --git a/classes/components/forms/context/PKPMetadataSettingsForm.inc.php b/classes/components/forms/context/PKPMetadataSettingsForm.inc.php index c8c1e5c01bf..46d90ccf106 100644 --- a/classes/components/forms/context/PKPMetadataSettingsForm.inc.php +++ b/classes/components/forms/context/PKPMetadataSettingsForm.inc.php @@ -1,6 +1,6 @@ action = $action; + $this->successMessage = __('manager.payment.success'); + $this->locales = $locales; + + $currencyDao = \DAORegistry::getDAO('CurrencyDAO'); + $currencies = []; + foreach ($currencyDao->getCurrencies() as $currency) { + $currencies[] = [ + 'value' => $currency->getCodeAlpha(), + 'label' => $currency->getName(), + ]; + } + + // Ensure payment method plugins can hook in + \PluginRegistry::loadCategory('paymethod', true); + + $this->addGroup([ + 'id' => 'setup', + 'label' => __('navigation.setup'), + ]) + ->addField(new FieldOptions('paymentsEnabled', [ + 'label' => __('common.enable'), + 'options' => [ + ['value' => true, 'label' => __('manager.payment.options.enablePayments')] + ], + 'value' => (bool) $context->getData('paymentsEnabled'), + 'groupId' => 'setup', + ])) + ->addField(new FieldSelect('currency', [ + 'label' => __('manager.paymentMethod.currency'), + 'options' => $currencies, + 'showWhen' => 'paymentsEnabled', + 'value' => $context->getData('currency'), + 'groupId' => 'setup', + ])); + } +} diff --git a/classes/components/forms/context/PKPPrivacyForm.inc.php b/classes/components/forms/context/PKPPrivacyForm.inc.php index 5d3bc9600cb..dd522a9c6fb 100644 --- a/classes/components/forms/context/PKPPrivacyForm.inc.php +++ b/classes/components/forms/context/PKPPrivacyForm.inc.php @@ -1,6 +1,6 @@ addField(new FieldHTML('reviewRemindersDisabled', [ 'label' => __('manager.setup.reviewOptions.automatedReminders'), - 'value' => __('manager.setup.reviewOptions.automatedRemindersDisabled'), + 'description' => __('manager.setup.reviewOptions.automatedRemindersDisabled'), ])); } } diff --git a/classes/components/forms/context/PKPSearchIndexingForm.inc.php b/classes/components/forms/context/PKPSearchIndexingForm.inc.php index 69fa9bb51ca..8e8d2bd15af 100644 --- a/classes/components/forms/context/PKPSearchIndexingForm.inc.php +++ b/classes/components/forms/context/PKPSearchIndexingForm.inc.php @@ -1,6 +1,6 @@ action = $action; - $this->successMessage = __('manager.setup.contact.success'); + $this->successMessage = __('manager.setup.userAccess.success'); $this->addField(new FieldOptions('restrictSiteAccess', [ 'label' => __('manager.setup.siteAccess.view'), diff --git a/classes/components/listPanels/submissions/PKPSubmissionsListPanel.inc.php b/classes/components/listPanels/submissions/PKPSubmissionsListPanel.inc.php index 7c1ca0162e5..2dff9ca8c9b 100644 --- a/classes/components/listPanels/submissions/PKPSubmissionsListPanel.inc.php +++ b/classes/components/listPanels/submissions/PKPSubmissionsListPanel.inc.php @@ -236,11 +236,4 @@ protected function _getItemsParams() { $this->_getParams ); } - - /** - * Get an array of workflow stages supported by the current app - * - * @return array - */ - abstract function getWorkflowStages(); } diff --git a/classes/controllers/grid/feature/OrderListbuilderItemsFeature.inc.php b/classes/controllers/grid/feature/OrderListbuilderItemsFeature.inc.php new file mode 100644 index 00000000000..396122d7e74 --- /dev/null +++ b/classes/controllers/grid/feature/OrderListbuilderItemsFeature.inc.php @@ -0,0 +1,38 @@ +setError(INSTALLER_ERROR_GENERAL, 'installer.unsupportedPhpError'); return false; } -} + /* + * Migrate site locale settings to a serialized array in the database + */ + function migrateSiteLocales() { + $siteDao = DAORegistry::getDAO('SiteDAO'); + + $result = $siteDao->retrieve('SELECT installed_locales, supported_locales FROM site'); + + $set = $params = []; + $row = $result->GetRowAssoc(false); + $type = 'array'; + foreach ($row as $column => $value) { + if (!empty($value)) { + $set[] = $column . ' = ?'; + $params[] = $siteDao->convertToDB(explode(':', $value), $type); + } + } + $siteDao->update('UPDATE site SET ' . join(',', $set), $params); + + $result->Close(); + + return true; + } + /** + * Migrate active sidebar blocks from plugin_settings to journal_settings + * + * @return boolean + */ + function migrateSidebarBlocks() { + + $siteDao = DAORegistry::getDAO('SiteDAO'); + $site = $siteDao->getSite(); + + $plugins = PluginRegistry::loadCategory('blocks'); + if (empty($plugins)) { + return true; + } + + // Sanitize plugin names for use in sql IN(). + $sanitizedPluginNames = array_map(function($name) { + return '"' . preg_replace("/[^A-Za-z0-9]/", '', $name) . '"'; + }, array_keys($plugins)); + + $pluginSettingsDao = DAORegistry::getDAO('PluginSettingsDAO'); + $result = $pluginSettingsDao->retrieve( + 'SELECT plugin_name, context_id, setting_value FROM plugin_settings WHERE plugin_name IN (' . join(',', $sanitizedPluginNames) . ') AND setting_name="context";' + ); + + $sidebarSettings = []; + while (!$result->EOF) { + $row = $result->getRowAssoc(false); + if ($row['setting_value'] != BLOCK_CONTEXT_SIDEBAR) { + $result->MoveNext(); + } + $seq = $pluginSettingsDao->getSetting($row['context_id'], $row['plugin_name'], 'seq'); + if (!isset($sidebarSettings[$row['context_id']])) { + $sidebarSettings[$row['context_id']] = []; + } + $sidebarSettings[$row['context_id']][(int) $seq] = $row['plugin_name']; + $result->MoveNext(); + } + $result->Close(); + + foreach ($sidebarSettings as $contextId => $contextSetting) { + // Order by sequence + ksort($contextSetting); + $contextSetting = array_values($contextSetting); + if ($contextId) { + $contextDao = Application::getContextDAO(); + $context = $contextDao->getById($contextId); + $context->setData('sidebar', $contextSetting); + $contextDao->updateObject($context); + } else { + $siteDao = DAORegistry::getDAO('SiteDAO'); + $site = $siteDao->getSite(); + $site->setData('sidebar', $contextSetting); + $siteDao->updateObject($site); + } + } + + $pluginSettingsDao->update('DELETE FROM plugin_settings WHERE plugin_name IN (' . join(',', $sanitizedPluginNames ) . ') AND (setting_name="context" OR setting_name="seq");'); + + return true; + } + + /** + * Migrate the metadata settings in the database to use a single row with one + * of the new constants + */ + function migrateMetadataSettings() { + $contextDao = Application::getContextDao(); + + $metadataSettings = [ + 'coverage', + 'languages', + 'rights', + 'source', + 'subjects', + 'type', + 'disciplines', + 'keywords', + 'agencies', + 'citations', + ]; + + $result = $contextDao->retrieve('SELECT ' . $contextDao->primaryKeyColumn . ' from ' . $contextDao->tableName); + $contextIds = []; + while (!$result->EOF) { + $row = $result->getRowAssoc(false); + $contextIds[] = $row[$contextDao->primaryKeyColumn]; + $result->MoveNext(); + } + $result->Close(); + + foreach ($metadataSettings as $metadataSetting) { + foreach ($contextIds as $contextId) { + $result = $contextDao->retrieve(' + SELECT * FROM ' . $contextDao->settingsTableName . ' WHERE + ' . $contextDao->primaryKeyColumn . ' = ? + AND ( + setting_name = ? + OR setting_name = ? + OR setting_name = ? + ) + ', + [ + $contextId, + $metadataSetting . 'EnabledWorkflow', + $metadataSetting . 'EnabledSubmission', + $metadataSetting . 'Required', + ] + ); + $value = METADATA_DISABLE; + while (!$result->EOF) { + $row = $result->getRowAssoc(false); + if ($row['setting_name'] === $metadataSetting . 'Required' && $row['setting_value']) { + $value = METADATA_REQUIRE; + } elseif ($row['setting_name'] === $metadataSetting . 'EnabledSubmission' && $row['setting_value'] && $value !== METADATA_REQUIRE) { + $value = METADATA_REQUEST; + } elseif ($row['setting_name'] === $metadataSetting . 'EnabledWorkflow' && $row['setting_value'] && $value !== METADATA_REQUEST && $value !== METADATA_REQUIRED) { + $value = METADATA_ENABLE; + } + $result->MoveNext(); + } + $result->Close(); + + if ($value !== METADATA_DISABLE) { + $contextDao->update(' + INSERT INTO ' . $contextDao->settingsTableName . ' SET + ' . $contextDao->primaryKeyColumn . ' = ?, + locale = ?, + setting_name = ?, + setting_value = ? + ', + [ + $contextId, + '', + $metadataSetting, + $value, + ] + ); + } + + $contextDao->update(' + DELETE FROM ' . $contextDao->settingsTableName . ' WHERE + ' . $contextDao->primaryKeyColumn . ' = ? + AND ( + setting_name = ? + OR setting_name = ? + OR setting_name = ? + ) + ', + [ + $contextId, + $metadataSetting . 'EnabledWorkflow', + $metadataSetting . 'EnabledSubmission', + $metadataSetting . 'Required', + ] + ); + } + } + + return true; + } +} diff --git a/classes/metadata/DateStringNormalizerFilter.inc.php b/classes/metadata/DateStringNormalizerFilter.inc.php deleted file mode 100644 index 8cc51f3f31b..00000000000 --- a/classes/metadata/DateStringNormalizerFilter.inc.php +++ /dev/null @@ -1,82 +0,0 @@ -setDisplayName('Date String Normalizer'); - - parent::__construct('primitive::string', 'validator::date()'); - } - - - // - // Implement abstract methods from Filter - // - /** - * Normalize incoming date string. - * @see Filter::process() - * @param $input string - * @return string - */ - function &process(&$input) { - // FIXME: We have to i18nize this when expanding citation parsing to other languages - static $monthNames = array( - 'Jan' => '01', 'Feb' => '02', 'Mar' => '03', 'Apr' => '04', 'May' => '05', 'Jun' => '06', - 'Jul' => '07', 'Aug' => '08', 'Sep' => '09', 'Oct' => '10', 'Nov' => '11', 'Dec' => '12' - ); - - $dateExpressions = array( - '/(?P\d{4})-(?P\d{2})-(?P\d{2})/', - '/(?P\d{4})(\s|-)*(?P[a-z]\w+)?(\s|-)*(?P\d+)?/i' - ); - $normalizedDate = null; - foreach($dateExpressions as $dateExpression) { - if (PKPString::regexp_match_get($dateExpression, $input, $parsedDate) ){ - if (isset($parsedDate['year'])) { - $normalizedDate = $parsedDate['year']; - - $month = ''; - if (isset($parsedDate['monthName'])) { - $monthName = substr($parsedDate['monthName'], 0, 3); - if (isset($monthNames[$monthName])) { - // Convert the month name to a two digit numeric month representation. - $month = $monthNames[$monthName]; - } - } - - if (isset($parsedDate['month'])) { - // Convert month to a two digit representation. - $month = str_pad($parsedDate['month'], 2, '0', STR_PAD_LEFT); - } - - if (!empty($month)) { - $normalizedDate .= '-'.$month; - if (isset($parsedDate['day'])) $normalizedDate .= '-'.str_pad($parsedDate['day'], 2, '0', STR_PAD_LEFT); - } - } - if (!empty($normalizedDate)) break; - } - } - - return $normalizedDate; - } -} diff --git a/classes/services/PKPContextService.inc.php b/classes/services/PKPContextService.inc.php index 1e114511b5a..0bf2746db5e 100644 --- a/classes/services/PKPContextService.inc.php +++ b/classes/services/PKPContextService.inc.php @@ -310,10 +310,9 @@ public function add($context, $request) { // Specify values needed to render default locale strings $localeParams = array( 'indexUrl' => $request->getIndexUrl(), - 'journalPath' => $context->getData('path'), 'primaryLocale' => $context->getData('primaryLocale'), - 'journalName' => $context->getData('name', $context->getPrimaryLocale()), 'contextName' => $context->getData('name', $context->getPrimaryLocale()), + 'contextPath' => $context->getData('path'), 'contextUrl' => $request->getDispatcher()->url( $request, ROUTE_PAGE, @@ -432,6 +431,8 @@ public function edit($context, $params, $request) { * @copydoc \PKP\Services\EntityProperties\EntityWriteInterface::delete() */ public function delete($context) { + \HookRegistry::call('Context::delete::before', array($context)); + $contextDao = Application::getContextDao(); $contextDao->deleteObject($context); @@ -443,10 +444,10 @@ public function delete($context) { $genreDao->deleteByContextId($context->getId()); $announcementDao = \DAORegistry::getDAO('AnnouncementDAO'); - $announcementDao->deleteByAssoc(ASSOC_TYPE_JOURNAL, $context->getId()); + $announcementDao->deleteByAssoc($context->getAssocType(), $context->getId()); $announcementTypeDao = \DAORegistry::getDAO('AnnouncementTypeDAO'); - $announcementTypeDao->deleteByAssoc(ASSOC_TYPE_JOURNAL, $context->getId()); + $announcementTypeDao->deleteByAssoc($context->getAssocType(), $context->getId()); $emailTemplateDao = \DAORegistry::getDAO('EmailTemplateDAO'); $emailTemplateDao->deleteEmailTemplatesByContext($context->getId()); @@ -455,7 +456,7 @@ public function delete($context) { $pluginSettingsDao->deleteByContextId($context->getId()); $reviewFormDao = \DAORegistry::getDAO('ReviewFormDAO'); - $reviewFormDao->deleteByAssoc(ASSOC_TYPE_JOURNAL, $context->getId()); + $reviewFormDao->deleteByAssoc($context->getAssocType(), $context->getId()); $navigationMenuDao = \DAORegistry::getDAO('NavigationMenuDAO'); $navigationMenuDao->deleteByContextId($context->getId()); diff --git a/classes/services/PKPUserService.inc.php b/classes/services/PKPUserService.inc.php index c23a0c195ad..6c35453978f 100644 --- a/classes/services/PKPUserService.inc.php +++ b/classes/services/PKPUserService.inc.php @@ -22,7 +22,7 @@ use \PKP\Services\interfaces\EntityPropertyInterface; use \PKP\Services\interfaces\EntityReadInterface; use \PKP\Services\traits\EntityReadTrait; -use \PKP\Services\QueryBuilders\PKPUserQueryBuilder; +use \APP\Services\QueryBuilders\UserQueryBuilder; class PKPUserService implements EntityPropertyInterface, EntityReadInterface { use EntityReadTrait; @@ -46,7 +46,6 @@ public function get($userId) { * @option string roleIds * @option int assignedToSubmission * @option int assignedToSubmissionStage - * @option int assignedToSection * @option array includeUsers * @option array excludeUsers * @option string status @@ -95,7 +94,6 @@ private function _getQueryBuilder($args = array()) { 'roleIds' => null, 'assignedToSubmission' => null, 'assignedToSubmissionStage' => null, - 'assignedToSection' => null, 'includeUsers' => null, 'excludeUsers' => null, 'status' => 'active', @@ -106,13 +104,12 @@ private function _getQueryBuilder($args = array()) { $args = array_merge($defaultArgs, $args); - $userListQB = new PKPUserQueryBuilder(); + $userListQB = new UserQueryBuilder(); $userListQB ->filterByContext($args['contextId']) ->orderBy($args['orderBy'], $args['orderDirection']) ->filterByRoleIds($args['roleIds']) ->assignedToSubmission($args['assignedToSubmission'], $args['assignedToSubmissionStage']) - ->assignedToSection($args['assignedToSection']) ->includeUsers($args['includeUsers']) ->excludeUsers($args['excludeUsers']) ->filterByStatus($args['status']) diff --git a/classes/services/queryBuilders/PKPUserQueryBuilder.inc.php b/classes/services/queryBuilders/PKPUserQueryBuilder.inc.php index d4e6596ec3f..d0a482fdc61 100644 --- a/classes/services/queryBuilders/PKPUserQueryBuilder.inc.php +++ b/classes/services/queryBuilders/PKPUserQueryBuilder.inc.php @@ -42,9 +42,6 @@ class PKPUserQueryBuilder extends BaseQueryBuilder { /** @var int submission stage ID */ protected $assignedToSubmissionStageId = null; - /** @var int section ID */ - protected $assignedToSectionId = null; - /** @var array user IDs */ protected $includeUsers = null; @@ -149,18 +146,6 @@ public function assignedToSubmission($submissionId, $submissionStage) { return $this; } - /** - * Limit results to users assigned as editors to this section - * - * @param $sectionId int - * - * @return \PKP\Services\QueryBuilders\PKPUserQueryBuilder - */ - public function assignedToSection($sectionId) { - $this->assignedToSectionId = $sectionId; - return $this; - } - /** * Include selected users * @@ -384,18 +369,6 @@ public function get() { } } - // assigned to section - if (!is_null($this->assignedToSectionId)) { - $sectionId = $this->assignedToSectionId; - - $q->leftJoin('section_editors as se', function($table) use ($sectionId) { - $table->on('u.user_id', '=', 'se.user_id'); - $table->on('se.section_id', '=', Capsule::raw((int) $sectionId)); - }); - - $q->whereNotNull('se.section_id'); - } - // search phrase if (!empty($this->searchPhrase)) { $words = explode(' ', $this->searchPhrase); diff --git a/classes/submission/reviewer/form/ReviewerReviewStep1Form.inc.php b/classes/submission/reviewer/form/ReviewerReviewStep1Form.inc.php index cf30f8527c7..f88646acfaf 100644 --- a/classes/submission/reviewer/form/ReviewerReviewStep1Form.inc.php +++ b/classes/submission/reviewer/form/ReviewerReviewStep1Form.inc.php @@ -24,7 +24,7 @@ class ReviewerReviewStep1Form extends ReviewerReviewForm { function __construct($request, $reviewerSubmission, $reviewAssignment) { parent::__construct($request, $reviewerSubmission, $reviewAssignment, 1); $context = $request->getContext(); - if (!$reviewAssignment->getDateConfirmed() && $context->getSetting('privacyStatement')) { + if (!$reviewAssignment->getDateConfirmed() && $context->getData('privacyStatement')) { $this->addCheck(new FormValidator($this, 'privacyConsent', 'required', 'user.profile.form.privacyConsentRequired')); } } @@ -49,13 +49,13 @@ function fetch($request, $template = null, $display = false) { $context = $request->getContext(); // Add submission parameters. - $submission = $this->getReviewerSubmission(); - $templateMgr->assign('completedSteps', $submission->getStatus()); - $templateMgr->assign('competingInterestsText', $submission->getCompetingInterests()); + $reviewerSubmission = $this->getReviewerSubmission(); + $templateMgr->assign('completedSteps', $reviewerSubmission->getStatus()); + $templateMgr->assign('reviewerCompetingInterests', $reviewerSubmission->getCompetingInterests()); // Add review assignment. $reviewAssignmentDao = DAORegistry::getDAO('ReviewAssignmentDAO'); - $reviewAssignment = $reviewAssignmentDao->getById($submission->getReviewId()); + $reviewAssignment = $reviewAssignmentDao->getById($reviewerSubmission->getReviewId()); $templateMgr->assign(array( 'reviewAssignment' => $reviewAssignment, 'reviewRoundId' => $reviewAssignment->getReviewRoundId(), @@ -112,7 +112,7 @@ function fetch($request, $template = null, $display = false) { * @see Form::readInputData() */ function readInputData() { - $this->readUserVars(array('competingInterestOption', 'competingInterestsText', 'privacyConsent')); + $this->readUserVars(array('competingInterestOption', 'reviewerCompetingInterests', 'privacyConsent')); } /** @@ -123,7 +123,7 @@ function execute() { // Set competing interests. if ($this->getData('competingInterestOption') == 'hasCompetingInterests') { - $reviewerSubmission->setCompetingInterests($this->request->getUserVar('competingInterestsText')); + $reviewerSubmission->setCompetingInterests($this->request->getUserVar('reviewerCompetingInterests')); } else { $reviewerSubmission->setCompetingInterests(null); } @@ -143,5 +143,3 @@ function execute() { parent::execute(); } } - - diff --git a/classes/validation/ValidatorDate.inc.php b/classes/validation/ValidatorDate.inc.php deleted file mode 100644 index 22a8b0634eb..00000000000 --- a/classes/validation/ValidatorDate.inc.php +++ /dev/null @@ -1,32 +0,0 @@ - $value], - ['value' => ['required', 'date']] - ); - - return $validator->passes(); - } -} diff --git a/controllers/grid/admin/context/ContextGridHandler.inc.php b/controllers/grid/admin/context/ContextGridHandler.inc.php index ccd5874a4e6..aac785ee902 100644 --- a/controllers/grid/admin/context/ContextGridHandler.inc.php +++ b/controllers/grid/admin/context/ContextGridHandler.inc.php @@ -67,22 +67,35 @@ function initialize($request, $args = null) { // Grid actions. $router = $request->getRouter(); - import('lib.pkp.classes.linkAction.request.AjaxModal'); - $this->addAction( - new LinkAction( - 'createContext', - new AjaxModal( - $router->url($request, null, null, 'createContext', null, null), + // Only show the add context button if the application allows another + // context to be created + $includeAddContext = true; + if (!Application::getAllowMultipleContexts()) { + $user = $request->getUser(); + $contexts = Application::getContextDAO()->getAvailable($user ? $user->getId() : null); + if ($contexts && $contexts->getCount() > 0) { + $includeAddContext = false; + } + } + + if ($includeAddContext) { + import('lib.pkp.classes.linkAction.request.AjaxModal'); + $this->addAction( + new LinkAction( + 'createContext', + new AjaxModal( + $router->url($request, null, null, 'createContext', null, null), + __('admin.contexts.create'), + 'modal_add_item', + true, + 'context', + ['editContext'] + ), __('admin.contexts.create'), - 'modal_add_item', - true, - 'context', - ['editContext'] - ), - __('admin.contexts.create'), - 'add_item' - ) - ); + 'add_item' + ) + ); + } // // Grid columns. @@ -183,6 +196,90 @@ function createContext($args, $request) { return $this->editContext($args, $request); } + /** + * Edit an existing context. + * @param $args array + * @param $request PKPRequest + * @return JSONMessage JSON object + */ + function editContext($args, $request) { + import('classes.core.Services'); + $contextService = Services::get('context'); + $context = null; + + if ($request->getUserVar('rowId')) { + $context = $contextService->get((int) $request->getUserVar('rowId')); + if (!$context) { + return new JSONMessage(false); + } + } + + $dispatcher = $request->getDispatcher(); + if ($context) { + $apiUrl = $dispatcher->url($request, ROUTE_API, $context->getPath(), 'contexts/' . $context->getId()); + $successMessage = __('admin.contexts.form.edit.success'); + $supportedLocales = $context->getSupportedFormLocales(); + } else { + $apiUrl = $dispatcher->url($request, ROUTE_API, CONTEXT_ID_ALL, 'contexts'); + $successMessage = __('admin.contexts.form.create.success'); + $supportedLocales = $request->getSite()->getSupportedLocales(); + } + + $localeNames = AppLocale::getAllLocales(); + $locales = array_map(function($localeKey) use ($localeNames) { + return ['key' => $localeKey, 'label' => $localeNames[$localeKey]]; + }, $supportedLocales); + + $contextForm = new \APP\components\forms\context\ContextForm($apiUrl, $successMessage, $locales, $request->getBaseUrl(), $context); + $contextFormConfig = $contextForm->getConfig(); + + // Pass the URL to the context settings wizard so that the AddContextForm + // component can redirect to it when a new context is added. + if (!$context) { + $contextFormConfig['editContextUrl'] = $request->getDispatcher()->url($request, ROUTE_PAGE, 'index', 'admin', 'wizard', '__id__'); + } + + $containerData = [ + 'forms' => [ + FORM_CONTEXT => $contextFormConfig, + ], + ]; + + $templateMgr = TemplateManager::getManager($request); + $templateMgr->assign([ + 'containerData' => $containerData, + 'isAddingNewContext' => !$context, + ]); + + return new JSONMessage(true, $templateMgr->fetch('admin/editContext.tpl')); + } + + /** + * Delete a context. + * @param $args array + * @param $request PKPRequest + * @return JSONMessage JSON object + */ + function deleteContext($args, $request) { + + if (!$request->checkCSRF()) { + return new JSONMessage(false); + } + + import('classes.core.Services'); + $contextService = Services::get('context'); + + $context = $contextService->get((int) $request->getUserVar('rowId')); + + if (!$context) { + return new JSONMessage(false); + } + + $contextService->delete($context); + + return DAO::getDataChangedEvent($context->getId()); + } + /** * Display users management grid for the given context. * @param $args array diff --git a/controllers/grid/admin/context/ContextGridRow.inc.php b/controllers/grid/admin/context/ContextGridRow.inc.php index b737c8c9af1..8cd3c64e0f2 100644 --- a/controllers/grid/admin/context/ContextGridRow.inc.php +++ b/controllers/grid/admin/context/ContextGridRow.inc.php @@ -14,6 +14,7 @@ */ import('lib.pkp.classes.controllers.grid.GridRow'); +import('lib.pkp.classes.linkAction.request.AjaxModal'); import('lib.pkp.classes.linkAction.request.RemoteActionConfirmationModal'); class ContextGridRow extends GridRow { diff --git a/controllers/grid/settings/preparedEmails/PreparedEmailsGridHandler.inc.php b/controllers/grid/settings/preparedEmails/PreparedEmailsGridHandler.inc.php index c3be4162a03..2190c5e9d72 100644 --- a/controllers/grid/settings/preparedEmails/PreparedEmailsGridHandler.inc.php +++ b/controllers/grid/settings/preparedEmails/PreparedEmailsGridHandler.inc.php @@ -240,7 +240,7 @@ function disableEmail($args, $request) { if ($emailTemplate->getAssocId() == null) { $emailTemplate->setAssocId($context->getId()); - $emailTemplate->setAssocType(ASSOC_TYPE_JOURNAL); + $emailTemplate->setAssocType($context->getAssocType()); } if ($emailTemplate->getEmailId() != null) { @@ -305,5 +305,3 @@ function deleteCustomEmail($args, $request) { return new JSONMessage(false); } } - - diff --git a/controllers/grid/settings/reviewForms/form/ReviewFormElements.inc.php b/controllers/grid/settings/reviewForms/form/ReviewFormElements.inc.php index a3823722a7f..758155eacd2 100644 --- a/controllers/grid/settings/reviewForms/form/ReviewFormElements.inc.php +++ b/controllers/grid/settings/reviewForms/form/ReviewFormElements.inc.php @@ -9,7 +9,7 @@ * @class ReviewFormElements * @ingroup controllers_grid_settings_reviewForms_form * - * @brief Form for manager to edit review form elements. + * @brief Form for manager to edit review form elements. */ import('lib.pkp.classes.db.DBDataXMLParser'); @@ -23,7 +23,7 @@ class ReviewFormElements extends Form { /** * Constructor. * @param $template string - * @param $reviewFormId + * @param $reviewFormId */ function __construct($reviewFormId) { parent::__construct('manager/reviewForms/reviewFormElements.tpl'); @@ -54,7 +54,7 @@ function initData() { if (isset($this->reviewFormId)) { // Get review form $reviewFormDao = DAORegistry::getDAO('ReviewFormDAO'); - $reviewForm = $reviewFormDao->getById($this->reviewFormId, ASSOC_TYPE_JOURNAL, $this->contextId); + $reviewForm = $reviewFormDao->getById($this->reviewFormId, Application::getContextAssocType(), $this->contextId); // Get review form elements $reviewFormElementDao = DAORegistry::getDAO('ReviewFormElementDAO'); @@ -66,5 +66,3 @@ function initData() { } } } - - diff --git a/controllers/grid/settings/sections/form/PKPSectionForm.inc.php b/controllers/grid/settings/sections/form/PKPSectionForm.inc.php index 18e3472147a..a6c8222d29d 100644 --- a/controllers/grid/settings/sections/form/PKPSectionForm.inc.php +++ b/controllers/grid/settings/sections/form/PKPSectionForm.inc.php @@ -82,6 +82,7 @@ function setSectionId($sectionId) { public function _getAssignedSubEditorIds($sectionId, $contextId) { import('classes.core.Services'); $subEditors = Services::get('user')->getMany(array( + 'contextId' => $contextId, 'roleIds' => ROLE_ID_SUB_EDITOR, 'assignedToSection' => $sectionId, )); diff --git a/controllers/tab/publicationEntry/form/CitationsForm.inc.php b/controllers/tab/publicationEntry/form/CitationsForm.inc.php index 8e5357284a3..f2e915219fc 100644 --- a/controllers/tab/publicationEntry/form/CitationsForm.inc.php +++ b/controllers/tab/publicationEntry/form/CitationsForm.inc.php @@ -108,7 +108,7 @@ function fetch($request, $template = null, $display = false) { 'stageId' => $this->getStageId(), 'tabPos' => $this->getTabPosition(), 'formParams' => $this->getFormParams(), - 'citationsRequired' => $context->getData('citationsRequired'), + 'citationsRequired' => $context->getData('citations') === METADATA_REQUIRE, 'parsedCitations' => $parsedCitations, )); return parent::fetch($request, $template, $display); diff --git a/js/classes/features/OrderListbuilderItemsFeature.js b/js/classes/features/OrderListbuilderItemsFeature.js new file mode 100644 index 00000000000..6e26217f36a --- /dev/null +++ b/js/classes/features/OrderListbuilderItemsFeature.js @@ -0,0 +1,221 @@ +/** + * @file js/classes/features/OrderListbuilderItemsFeature.js + * + * Copyright (c) 2014-2018 Simon Fraser University + * Copyright (c) 2000-2018 John Willinsky + * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING. + * + * @class OrderListbuilderItemsFeature + * @ingroup js_classes_features + * + * @brief Feature for ordering grid items. + */ +(function($) { + + + /** + * @constructor + * @inheritDoc + * @extends $.pkp.classes.features.OrderItemsFeature + */ + $.pkp.classes.features.OrderListbuilderItemsFeature = + function(gridHandler, options) { + this.parent(gridHandler, options); + }; + $.pkp.classes.Helper.inherits( + $.pkp.classes.features.OrderListbuilderItemsFeature, + $.pkp.classes.features.OrderItemsFeature); + + + // + // Extended methods from OrderItemsFeature. + // + /** + * @inheritDoc + */ + $.pkp.classes.features.OrderListbuilderItemsFeature.prototype.addFeatureHtml = + function($gridElement, options) { + + var $itemSequenceInput, $gridRows, index, limit, $gridRow, + $itemSequenceInputClone; + + this.parent('addFeatureHtml', $gridElement, options); + + $itemSequenceInput = this.getSequenceInput_(); + $gridRows = this.gridHandler.getRows(); + for (index = 0, limit = $gridRows.length; index < limit; index++) { + $gridRow = $($gridRows[index]); + $itemSequenceInputClone = $itemSequenceInput.clone(); + + $('td.first_column', $gridRow).append($itemSequenceInputClone); + } + }; + + + /** + * Set up the sortable plugin. + */ + $.pkp.classes.features.OrderListbuilderItemsFeature.prototype. + setupSortablePlugin = function() { + this.applySortPlgOnElements( + this.getGridHtmlElement(), 'tr.orderable', null); + }; + + + // + // Extended methods from ToggleableOrderItemsFeature. + // + /** + * @inheritDoc + */ + $.pkp.classes.features.OrderListbuilderItemsFeature.prototype.init = + function() { + this.parent('init'); + this.toggleItemsDragMode(); + }; + + + /** + * @inheritDoc + */ + $.pkp.classes.features.OrderListbuilderItemsFeature.prototype.toggleState = + function(isOrdering) { + this.parent('toggleState', isOrdering); + this.toggleContentHandlers_(); + }; + + + /** + * @inheritDoc + */ + $.pkp.classes.features.OrderListbuilderItemsFeature.prototype.storeRowOrder = + function(index, $row) { + var seq = index + 1, + $orderableInput = $row.find('.itemSequence'), + $modifiedInput; + + $orderableInput.attr('value', seq); + $modifiedInput = $row.find('.isModified'); + $modifiedInput.attr('value', 1); + }; + + + /** + * @inheritDoc + */ + $.pkp.classes.features.OrderListbuilderItemsFeature.prototype.saveOrderHandler = + function() { + this.parent('saveOrderHandler'); + this.toggleState(false); + + return false; + }; + + + /** + * @inheritDoc + */ + $.pkp.classes.features.OrderListbuilderItemsFeature.prototype. + updateOrderCallback = function(contextElement, event, ui) { + + var $rows; + this.parent('updateOrderCallback'); + $rows = this.gridHandler.getRows(); + this.storeOrder($rows); + }; + + + /** + * @inheritDoc + */ + $.pkp.classes.features.OrderListbuilderItemsFeature.prototype. + clickOrderHandler = function() { + var $selects = $('select:visible', this.getGridHtmlElement()), + index, limit; + if ($selects.length > 0) { + for (index = 0, limit = $selects.length; index < limit; index++) { + this.gridHandler.saveRow($($selects[index]).parents('.gridRow')); + } + } + + return /** @type {boolean} */ (this.parent('clickOrderHandler')); + }; + + + // + // Implemented Feature template hook methods. + // + /** + * @inheritDoc + */ + $.pkp.classes.features.OrderListbuilderItemsFeature.prototype.addElement = + function($newElement) { + this.parent('addElement', $newElement); + this.formatAndStoreNewRow_($newElement); + return false; + }; + + + /** + * @inheritDoc + */ + $.pkp.classes.features.OrderListbuilderItemsFeature.prototype.replaceElement = + function($newContent) { + this.parent('replaceElement', $newContent); + this.formatAndStoreNewRow_($newContent); + return false; + }; + + + // + // Private helper methods. + // + /** + * Get the sequence input html element. + * @private + * @return {jQueryObject} Sequence input. + */ + $.pkp.classes.features.OrderListbuilderItemsFeature.prototype. + getSequenceInput_ = function() { + return $(''); + }; + + + /** + * Enable/disable row content handlers. + * @private + */ + $.pkp.classes.features.OrderListbuilderItemsFeature.prototype. + toggleContentHandlers_ = function() { + var $rows = this.gridHandler.getRows(), + index, limit, $row; + for (index = 0, limit = $rows.length; index < limit; index++) { + $row = $($rows[index]); + if (this.isOrdering) { + $row.find('.gridCellDisplay').unbind('click'); + } else { + this.gridHandler.attachContentHandlers_($row); + } + } + }; + + + /** + * Format and store new row. + * @private + * @param {jQueryObject} $row The new row element. + */ + $.pkp.classes.features.OrderListbuilderItemsFeature.prototype. + formatAndStoreNewRow_ = function($row) { + + var $rows; + + $row.children().after(this.getSequenceInput_()); + $rows = this.gridHandler.getRows(); + this.storeOrder($rows); + }; + + +/** @param {jQuery} $ jQuery closure. */ +}(jQuery)); diff --git a/locale/ar_IQ/manager.xml b/locale/ar_IQ/manager.xml index 3d9759f84fa..2e6eb5ad861 100644 --- a/locale/ar_IQ/manager.xml +++ b/locale/ar_IQ/manager.xml @@ -350,9 +350,6 @@ حُفِظت إعدادات اللغة. تم تعديل المستخدم. - - الفهرسة - المدفوعات طرائق الدفع @@ -454,7 +451,6 @@ مربع نص ذو سطر واحد يمكن معاينته (من قبل المؤلفين) إنشاء نموذج تحكيم جديد - عبارة بيان المصالح المتضاربة للمحكم طالب المحكم بعبارة تتعلق بالمصالح المتضاربة خلال عملية التحكيم المناظر. رابط إلى موقع يصف الرخصة، لو توافر ذلك. diff --git a/locale/ca_ES/manager.xml b/locale/ca_ES/manager.xml index ade284df04c..98aad6bc332 100644 --- a/locale/ca_ES/manager.xml +++ b/locale/ca_ES/manager.xml @@ -300,9 +300,6 @@ S'han desat els paràmetres de configuració regional. Editat per l'usuari/ària - - Indexació - Pagaments Mètodes de pagament diff --git a/locale/cs_CZ/manager.xml b/locale/cs_CZ/manager.xml index 873855ed273..5e7c5f3fd58 100644 --- a/locale/cs_CZ/manager.xml +++ b/locale/cs_CZ/manager.xml @@ -241,7 +241,6 @@ Zahrnuto do zprávy pro autora Viditelné (pro autory). Vytvořit nový formulář pro recenzenty - Vyjádření ke konfliktu zájmů recenzentů Požadovat vyjádření ke konfliktu zájmů pro recenzenty. Váš {$contextObjectName} je nakonfigurován tak, aby zaznamenal více než jednu metriku přístupů. Statistika přístupů se zobrazí v několika kontextech. Existují případy, kdy může být použita pouze jedna statistika přístupů, např. při zobrazení uspořádaného seznamu nejčastěji čtených příspěvků nebo při hodnocení. @@ -336,7 +335,6 @@ výsledků vyhledávání. Zvolte jednu z nakonfigurovaných metrik jako výchoz Zprávy Ostatní Uživatel byl upraven. - Indexování. Platby Metoda platby Nebyla vybrána žádná metoda platby diff --git a/locale/da_DK/manager.xml b/locale/da_DK/manager.xml index 62451f95bed..c67f03edac7 100644 --- a/locale/da_DK/manager.xml +++ b/locale/da_DK/manager.xml @@ -235,14 +235,12 @@ Send aldrig rykker Konkurrerende interesser Bedømmelsestidsfrister - Erklæring om konkurrerende interesser Anmod om en erklæring om konkurrerende interesser under bedømmelsesprocessen. Marketing Tilladelser Rapporter Andet Distributionsindstillinger - Indeksering Betaling Valuta Betalingsmåde diff --git a/locale/de_DE/manager.xml b/locale/de_DE/manager.xml index 255458d2a7b..322a8291356 100644 --- a/locale/de_DE/manager.xml +++ b/locale/de_DE/manager.xml @@ -350,9 +350,6 @@ Einstellungen zur Regionaleinstellung gespeichert. Benutzer/in bearbeitet. - - Indizierung - Zahlungen Zahlungsmethoden @@ -455,7 +452,6 @@ Einzeiliges Textfeld Sichtbar (für Autor/innen) Ein neues Begutachtungsformular anlegen - Erklärung von Gutachter/in zu möglicherweise bestehenden Interessenkonflikten Während der Begutachtung die Angabe einer Erklärung zu möglicherweise bestehenden Interessenkonflikten verlangen. URL zum Lizenztext, sofern verfügbar. diff --git a/locale/en_US/manager.xml b/locale/en_US/manager.xml index b351c86750e..2e227dadacf 100644 --- a/locale/en_US/manager.xml +++ b/locale/en_US/manager.xml @@ -221,6 +221,7 @@ Anything entered here will appear on your homepage. Advanced The appearance settings have been updated. + The contact details for this press have been updated. Copyright Notice Require authors to agree to the following copyright notice as part of the submission process. Author Guidelines @@ -275,6 +276,7 @@ Theme New themes may be installed from the Plugins tab at the top of this page. The theme you selected is not installed or enabled. + The user access details for this press have been updated. Site Access Options {$count} ({$percentage}%) {$numTotal} ({$numNew} new) @@ -369,7 +371,6 @@ User edited. - Indexing License The licensing details have been updated. Other license URL @@ -480,7 +481,6 @@ Single line text box Viewable (for authors) Create a new Review Form - Reviewer Competing Interest statement Request a Competing Interest statement during the peer review. URL to a webpage describing the license, if available. diff --git a/locale/es_ES/manager.xml b/locale/es_ES/manager.xml index 56bd8124b02..83e055d9999 100644 --- a/locale/es_ES/manager.xml +++ b/locale/es_ES/manager.xml @@ -286,9 +286,6 @@ Opciones de configuración regional guardadas. Usuario/a editado. - - Indexación - Pagos Formas de pago @@ -438,7 +435,6 @@ Caja de texto de una sola línea Visible (para autores) Crea un nuevo formulario de revisión - Declaración de conflictos de interés de los revisores Solicita una declaración de conflictos de interés durante una revisión por pares. URL a la página web que describa la licencia, si está disponible. Formulario de envío diff --git a/locale/fa_IR/manager.xml b/locale/fa_IR/manager.xml index befb7a8789d..a435885d525 100644 --- a/locale/fa_IR/manager.xml +++ b/locale/fa_IR/manager.xml @@ -372,8 +372,6 @@ زبان {$locale} بارگذاری مجدد شد. تنظیمات زبان ذخیره شد. کاربر ویرایش شد. - - نمایه کردن شیوه‌ی پرداخت شیوه‌های پرداخت @@ -466,7 +464,6 @@ جعبه متن یک سطری قابل مشاهده (برای نویسندگان) ایجاد یک فرم داوری جدید - بیانیه تضاد منافع درخواست بیانیه تضاد منافع رقابتی به ازای هر داوری آدرس صفحه وبی که این مجوز را شرح می‌دهد (در صورت وجود) اضافه کنید فرم ارسال مقاله diff --git a/locale/fi_FI/manager.xml b/locale/fi_FI/manager.xml index 02b3d0fb364..ca95992a52a 100644 --- a/locale/fi_FI/manager.xml +++ b/locale/fi_FI/manager.xml @@ -342,9 +342,6 @@ Kielialueiden asetukset tallennettu. Käyttäjää muokattu. - - Indeksointi - Maksut Maksutavat @@ -439,8 +436,6 @@ Yhden rivin tekstikenttä Nähtävissä (kirjoittajille) Luo uusi arviointilomake - Arvioijien sidonnaisuuksista ilmoittaminen - Pyydä ilmoittamaan sidonnaisuuksista vertaisarvioinnin aikana. URL-osoite verkkosivulle, jossa kerrotaan lisenssistä (mikäli saatavilla). diff --git a/locale/fr_CA/manager.xml b/locale/fr_CA/manager.xml index fb80a973792..2e60a0aa61f 100644 --- a/locale/fr_CA/manager.xml +++ b/locale/fr_CA/manager.xml @@ -339,7 +339,6 @@ Il arrive parfois qu'une seule statistique d'utilisation doit être utilisée, p Le paramètre régional {$locale} a été rechargé. Les paramètres du paramètre régional ont été sauvegardés. Utilisateur modifié - Indexation Paiements Méthodes de paiement Veuillez choisir à partir de la liste des méthodes de paiement disponibles. La zone ci-dessous s'actualisera en conséquence. @@ -480,7 +479,6 @@ Il arrive parfois qu'une seule statistique d'utilisation doit être utilisée, p Sommaire Inclus dans le message à l'auteur Créer un nouveau formulaire d'évaluation - Déclaration de conflit d'intérêts de l'évaluateur Demander une déclaration de conflit d'intérêts de l'évaluateur URL de la page décrivant la licence, si disponible. Formulaire de soumission diff --git a/locale/fr_FR/manager.xml b/locale/fr_FR/manager.xml index af06cb98f3e..db85ee0a05e 100644 --- a/locale/fr_FR/manager.xml +++ b/locale/fr_FR/manager.xml @@ -291,7 +291,6 @@ Il arrive parfois qu'une seule statistique d'utilisation doit être utilisée, p Le paramètre régional {$locale} a été rechargé. Les paramètres du paramètre régional ont été sauvegardés. Utilisateur modifié - Indexation Paiements Méthodes de paiement Veuillez choisir à partir de la liste des méthodes de paiement disponibles. La zone ci-dessous s'actualisera en conséquence. @@ -432,7 +431,6 @@ Il arrive parfois qu'une seule statistique d'utilisation doit être utilisée, p Sommaire Inclus dans le message à l'auteur Créer un nouveau formulaire d'évaluation - Déclaration de conflit d'intérêts du rapporteur Demander une déclaration de conflit d'intérêts du rapporteur URL de la page décrivant la licence, si disponible. Formulaire de soumission diff --git a/locale/it_IT/manager.xml b/locale/it_IT/manager.xml index f2d194cfe2f..3fbd216fca7 100644 --- a/locale/it_IT/manager.xml +++ b/locale/it_IT/manager.xml @@ -262,7 +262,6 @@ Richiedi una dichiarazione su eventuali conflitti di interessi durante la peer review Form per le proposte Carica un nuovo plugin - Indicizzazione Un file di immagine è richiesto. Per favore controlla di aver scelto e caricato un file Revisione Correzione editoriale @@ -430,7 +429,6 @@ Includilo in um messaggio all'autore Visibile (per gli autori) Crea un nuovo form di revisione - Dichiarazione sul conflitto di interessi del revisore URL verso una pagina web che descrive la licenza, se disponibile. Errrori di validazione: Avvisi ricevuti: @@ -451,7 +449,7 @@ L'utente importato "{$username}" non ha password. Controlla il tuo formato XML. L'utente non è stato importato. La password dell'utente importato "{$username}" non può essere importata. Una nuova password è stata mandata all'utente via mail. L'utente è stato importato. L'utente da importare "{$username}" ha una password di tipo plaintext non valida. L'utente non è stato importato. - + Titolo Path Menu di navigazione diff --git a/locale/nb_NO/manager.xml b/locale/nb_NO/manager.xml index 03d9219c285..04bf1571aeb 100644 --- a/locale/nb_NO/manager.xml +++ b/locale/nb_NO/manager.xml @@ -275,7 +275,6 @@ Favicon Synlig (for forfattere) Lag et nytt vurderingsskjema - Fagfellers erklæring om interessekonflikter Krev en erklæring om interessekonflikter i løpet av fagfellevurderingen. URL til en nettside som beskriver lisensen, om mulig. Innsendingsskjema @@ -354,7 +353,6 @@ {$locale} lokalinnstillinger lastet inn på nytt. Lokalinnstillinger lagret. Redigert av bruker. - Indeksering Betalinger Betalingsmåter Betalingsmåte er ikke valgt diff --git a/locale/pl_PL/manager.xml b/locale/pl_PL/manager.xml index ca278d9dcad..dd6f0f35f93 100644 --- a/locale/pl_PL/manager.xml +++ b/locale/pl_PL/manager.xml @@ -343,7 +343,6 @@ Język {$locale} przeładowany. Ustawienia językowe zapisane. Edycja zakończona sukcesem. - Indeksowanie Płatności Metody płatności Nie wybrano metod płatności @@ -430,7 +429,6 @@ Obszar tekstowy (krótki) Możliwe do wyświetlenia (dla autorów) Utwórz nowy formularz recenzji - Oświadczenie o braku konfliktu interesów Podczas recenzji poproś o oświadczenie o braku konfliktu interesów. Link do strony z treścią licencji, jeśli jest dostępna. Formularz przesyłania diff --git a/locale/pt_BR/manager.xml b/locale/pt_BR/manager.xml index 2145b4e8528..dc91c7b06aa 100644 --- a/locale/pt_BR/manager.xml +++ b/locale/pt_BR/manager.xml @@ -298,7 +298,6 @@ Há casos em que uma única estatística de uso devem ser utilizada, por exemplo Idioma {$locale} recarregado. Configurações de idioma salvas. Usuário editado. - Indexação Pagamentos Métodos de Pagamento Nenhum método de pagamento selecionado @@ -379,7 +378,6 @@ Há casos em que uma única estatística de uso devem ser utilizada, por exemplo Caixa de texto de uma linha Visível (para autores) Criar Novo Formulário de Avaliação - Declaração de Conflito de Interesses para Avaliadores Requisitar uma declaração de Conflito de Interesses durante a avaliação por pares. Display the copyright statement with content (advisable for asserting an author-held copyright). diff --git a/locale/pt_PT/manager.xml b/locale/pt_PT/manager.xml index 1826b3bd9be..62389d284c9 100644 --- a/locale/pt_PT/manager.xml +++ b/locale/pt_PT/manager.xml @@ -234,7 +234,6 @@ Visível (para autores) Criar um novo Formulário de Revisão Uploader desconhecido {$param} - Declaração Interesses Concorrentes do Revisor Solicitar uma Declaração Interesses Concorrentes durante a revisão por pares. URL para uma página da Web que descreve a licença, se disponível. Formulário Submissão @@ -391,7 +390,6 @@ {$locale} idioma recarregado. Configurações do idioma guardadas. Utilizador editado. - Indexação Pagamentos Métodos Pagamento Não foi seleccionado nenhum método de pagamento diff --git a/locale/ru_RU/manager.xml b/locale/ru_RU/manager.xml index 6b2d03648da..2c728f46128 100644 --- a/locale/ru_RU/manager.xml +++ b/locale/ru_RU/manager.xml @@ -351,9 +351,6 @@ Настройки языка сохранены. Пользователь отредактирован. - - Индексирование - Платежи Методы платежей @@ -456,7 +453,6 @@ Поле для ввода одной строки Видимый (для авторов) Создать новую форму рецензии - Декларация о конфликте интересов рецензента Запросить Декларацию о конфликте интересов во время рецензирования. URL-адрес веб-страницы, описывающей лицензию (если она доступна). diff --git a/locale/sl_SI/manager.xml b/locale/sl_SI/manager.xml index 65209bcb238..0f63bc990fb 100644 --- a/locale/sl_SI/manager.xml +++ b/locale/sl_SI/manager.xml @@ -360,9 +360,6 @@ Nastavitve jezika so shranjene. Uporabnik je spremenjen. - - Indeksiranje - Plačila Načini plačila @@ -464,7 +461,6 @@ Enovrstično tekstovno polje Vidno (za avtorje) Ustvari nov recenzijski obrazec - Izjava recenzenta o navzkrižju interesov Zahtevaj izjavo o navzkrižju interesov pri recenziji. URL povezava do spletne strani, ki opisuje licenco (če je na voljo). diff --git a/locale/sr_RS@cyrillic/manager.xml b/locale/sr_RS@cyrillic/manager.xml index 43397c3c99e..c71cf00bd6f 100644 --- a/locale/sr_RS@cyrillic/manager.xml +++ b/locale/sr_RS@cyrillic/manager.xml @@ -317,7 +317,6 @@ Подешавања локализације су сачувана. {$locale} локализација је обрисана. Корисник је уређен. - Индексирање Плаћање Методи плаћања Нема одабраних метода плаћања @@ -385,7 +384,6 @@ Текст кутија за један ред текста Видљиво (за ауторе) Направи нови рецензентски образац - Изјава о рецензентском сукобу интереса Форма за пријаву Грешке при потврђивању Захтевајте Изјаву о сукобу интереса у току рецензије. diff --git a/locale/sr_RS@latin/manager.xml b/locale/sr_RS@latin/manager.xml index 98fc0759b58..aade75e2ae4 100644 --- a/locale/sr_RS@latin/manager.xml +++ b/locale/sr_RS@latin/manager.xml @@ -317,7 +317,6 @@ Podešavanja lokalizacije su sačuvana. {$locale} lokalizacija je obrisana. Korisnik je uređen. - Indeksiranje Plaćanje Metodi plaćanja Nema odabranih metoda plaćanja @@ -385,7 +384,6 @@ Tekst kutija za jedan red teksta Vidljivo (za autore) Napravi novi recenzentski obrazac - Izjava o recenzentskom sukobu interesa Forma za prijavu Greške pri potvrđivanju Zahtevajte Izjavu o sukobu interesa u toku recenzije. diff --git a/locale/sv_SE/manager.xml b/locale/sv_SE/manager.xml index a94a08d962d..a5c4a446b5a 100644 --- a/locale/sv_SE/manager.xml +++ b/locale/sv_SE/manager.xml @@ -350,9 +350,6 @@ Språk/region-inställningar sparade. Användare ändrades. - - Indexering - Betalningar Betalningsmetoder @@ -454,7 +451,6 @@ Textruta, en rad Synlig (för författare) Skapa nytt granskningsformulär - Granskares redovisning av intressekonflikter Begär redovisning av intressekonflikter vid sakkunniggranskning. URL till webbsida som beskriver licensen, om en sådan finns tillgänglig. diff --git a/locale/tr_TR/manager.xml b/locale/tr_TR/manager.xml index 5f6ed2991bf..1b6bf0911f9 100644 --- a/locale/tr_TR/manager.xml +++ b/locale/tr_TR/manager.xml @@ -328,7 +328,6 @@ {$locale} dili yeniden yüklendi. Dil ayarları kaydedildi. Kullanıcı düzenlendi. - İndeksleniyor Ödemeler Ödeme Yöntemleri Ödeme yöntemi seçilmedi @@ -405,7 +404,6 @@ İş Akışı Ayarları Dağıtım Dağıtım Ayarları - Hakem Çıkar Çatışması Bildirimi Bu makalenin değerlendirilmesi sırasında bir Çıkar Çatışması bildirimi isteyin. Varsa, lisansı açıklayan bir web sayfasının URL'si. Geçici dosya {$dest}, {$source} kaynağıdan oluşturulamadı diff --git a/locale/uk_UA/manager.xml b/locale/uk_UA/manager.xml index f624435a2a9..0203fdb0fbf 100644 --- a/locale/uk_UA/manager.xml +++ b/locale/uk_UA/manager.xml @@ -349,9 +349,6 @@ Налаштування мови збережені. Користувача відредаговано. - - Індексування - Платежі Способи оплати @@ -453,7 +450,6 @@ Текстове поле з одним рядком Видимий (для авторів) Створити нову форму рецензії - Заява про конфлікт інтересів рецензента Запит на заяву про конфлікт інтерсів під час рецензування. URL-адреса веб-сторінки, що описує ліцензію, якщо така є. diff --git a/pages/about/AboutSiteHandler.inc.php b/pages/about/AboutSiteHandler.inc.php index 06176289599..6ddda1443f5 100644 --- a/pages/about/AboutSiteHandler.inc.php +++ b/pages/about/AboutSiteHandler.inc.php @@ -56,7 +56,7 @@ function privacy($args, $request) { $context = $request->getContext(); $enableSiteWidePrivacyStatement = Config::getVar('general', 'sitewide_privacy_statement'); if (!$enableSiteWidePrivacyStatement && $context) { - $privacyStatement = $context->getLocalizedSetting('privacyStatement'); + $privacyStatement = $context->getLocalizedData('privacyStatement'); } else { $privacyStatement = $request->getSite()->getLocalizedSetting('privacyStatement'); } diff --git a/pages/admin/AdminHandler.inc.php b/pages/admin/AdminHandler.inc.php index 3366d23fb3e..e17eef1ff52 100644 --- a/pages/admin/AdminHandler.inc.php +++ b/pages/admin/AdminHandler.inc.php @@ -88,6 +88,11 @@ function settings($args, $request) { $site = $request->getSite(); $dispatcher = $request->getDispatcher(); + // No admin settings when the app doesn't support multiple contexts + if (!Application::getAllowMultipleContexts()) { + $dispatcher->handle404(); + } + $apiUrl = $dispatcher->url($request, ROUTE_API, CONTEXT_ID_ALL, 'site'); $themeApiUrl = $dispatcher->url($request, ROUTE_API, CONTEXT_ID_ALL, 'site/theme'); $temporaryFileApiUrl = $dispatcher->url($request, ROUTE_API, CONTEXT_ID_ALL, 'temporaryFiles'); diff --git a/pages/management/ManagementHandler.inc.php b/pages/management/ManagementHandler.inc.php index dcc56ee400b..bc97a6be41c 100644 --- a/pages/management/ManagementHandler.inc.php +++ b/pages/management/ManagementHandler.inc.php @@ -155,7 +155,7 @@ function website($args, $request) { }, $supportedFormLocales); $announcementSettingsForm = new \PKP\components\forms\context\PKPAnnouncementSettingsForm($contextApiUrl, $locales, $context); - $appearanceAdvancedForm = new \PKP\components\forms\context\PKPAppearanceAdvancedForm($contextApiUrl, $locales, $context, $baseUrl, $temporaryFileApiUrl); + $appearanceAdvancedForm = new \APP\components\forms\context\AppearanceAdvancedForm($contextApiUrl, $locales, $context, $baseUrl, $temporaryFileApiUrl); $appearanceSetupForm = new \APP\components\forms\context\AppearanceSetupForm($contextApiUrl, $locales, $context, $baseUrl, $temporaryFileApiUrl); $informationForm = new \PKP\components\forms\context\PKPInformationForm($contextApiUrl, $locales, $context); $listsForm = new \PKP\components\forms\context\PKPListsForm($contextApiUrl, $locales, $context); @@ -241,8 +241,6 @@ function distribution($args, $request) { $dispatcher = $request->getDispatcher(); $apiUrl = $dispatcher->url($request, ROUTE_API, $context->getPath(), 'contexts/' . $context->getId()); - $lockssUrl = $router->url($request, $context->getPath(), 'gateway', 'lockss'); - $clockssUrl = $router->url($request, $context->getPath(), 'gateway', 'clockss'); $sitemapUrl = $router->url($request, $context->getPath(), 'sitemap'); $paymentsUrl = $dispatcher->url($request, ROUTE_API, $context->getPath(), '_payments'); @@ -252,15 +250,15 @@ function distribution($args, $request) { return ['key' => $localeKey, 'label' => $localeNames[$localeKey]]; }, $supportedFormLocales); - $licenseForm = new \PKP\components\forms\context\PKPLicenseForm($apiUrl, $locales, $context); + $licenseForm = new \APP\components\forms\context\LicenseForm($apiUrl, $locales, $context); $searchIndexingForm = new \PKP\components\forms\context\PKPSearchIndexingForm($apiUrl, $locales, $context, $sitemapUrl); - $accessForm = new \APP\components\forms\context\AccessForm($apiUrl, $locales, $context); + $paymentSettingsForm = new \PKP\components\forms\context\PKPPaymentSettingsForm($paymentsUrl, $locales, $context); $settingsData = [ 'forms' => [ FORM_LICENSE => $licenseForm->getConfig(), FORM_SEARCH_INDEXING => $searchIndexingForm->getConfig(), - FORM_ACCESS => $accessForm->getConfig(), + FORM_PAYMENT_SETTINGS => $paymentSettingsForm->getConfig(), ], ]; $templateMgr->assign('settingsData', $settingsData); diff --git a/schemas/context.json b/schemas/context.json index 263f82ab6db..9476e2ae59d 100644 --- a/schemas/context.json +++ b/schemas/context.json @@ -126,18 +126,19 @@ "nullable" ] }, - "copyrightYearBasis": { + "coverage": { "type": "string", + "description": "Enable coverage metadata. `0` is disabled. `enable` will make it available in the workflow. `request` will allow an author to enter a value during submission. `require` will require that the author enter a value during submission.", "validation": [ - "nullable" + "nullable", + "in:0,enable,request,require" ] }, - "coverage": { + "currency": { "type": "string", - "description": "Enable coverage metadata. `0` is disabled. `enable` will make it available in the workflow. `request` will allow an author to enter a value during submission. `require` will require that the author enter a value during submission.", "validation": [ "nullable", - "" + "currency" ] }, "customHeaders": { @@ -192,7 +193,7 @@ }, "emailSignature": { "type": "string", - "defaultLocaleKey": "default.journalSettings.emailSignature", + "defaultLocaleKey": "default.contextSettings.emailSignature", "validation": [ "nullable" ] @@ -303,7 +304,7 @@ }, "keywords": { "type": "string", - "default": 2, + "default": "enable", "description": "Enable keywords metadata. `0` is disabled. `enable` will make it available in the workflow. `request` will allow an author to enter a value during submission. `require` will require that the author enter a value during submission.", "validation": [ "nullable", @@ -326,13 +327,6 @@ "nullable" ] }, - "licenseTerms": { - "type": "string", - "multilingual": true, - "validation": [ - "nullable" - ] - }, "licenseUrl": { "type": "string", "validation": [ @@ -385,6 +379,7 @@ }, "numWeeksPerResponse": { "type": "integer", + "default": 4, "validation": [ "nullable", "min:0" @@ -401,7 +396,7 @@ "openAccessPolicy": { "type": "string", "multilingual": true, - "defaultLocaleKey": "default.journalSettings.openAccessPolicy", + "defaultLocaleKey": "default.contextSettings.openAccessPolicy", "validation": [ "nullable" ] @@ -451,6 +446,12 @@ ], "apiSummary": true }, + "paymentsEnabled": { + "type": "boolean", + "validation": [ + "nullable" + ] + }, "primaryLocale": { "type": "string", "validation": [ @@ -460,24 +461,11 @@ "privacyStatement": { "type": "string", "multilingual": true, - "defaultLocaleKey": "default.journalSettings.privacyStatement", + "defaultLocaleKey": "default.contextSettings.privacyStatement", "validation": [ "nullable" ] }, - "publisherInstitution": { - "type": "string", - "validation": [ - "nullable" - ] - }, - "publishingMode": { - "type": "integer", - "validation": [ - "nullable", - "in:0,1,2" - ] - }, "rateReviewerOnQuality": { "type": "boolean", "validation": [ @@ -510,12 +498,6 @@ "nullable" ] }, - "reviewerCompetingInterestsRequired": { - "type": "boolean", - "validation": [ - "nullable" - ] - }, "reviewGuidelines": { "type": "string", "multilingual": true, @@ -610,31 +592,31 @@ { "order": 1, "content": { - "defaultLocaleKey": "default.journalSettings.checklist.notPreviouslyPublished" + "defaultLocaleKey": "default.contextSettings.checklist.notPreviouslyPublished" } }, { "order": 2, "content": { - "defaultLocaleKey": "default.journalSettings.checklist.fileFormat" + "defaultLocaleKey": "default.contextSettings.checklist.fileFormat" } }, { "order": 3, "content": { - "defaultLocaleKey": "default.journalSettings.checklist.addressesLinked" + "defaultLocaleKey": "default.contextSettings.checklist.addressesLinked" } }, { "order": 4, "content": { - "defaultLocaleKey": "default.journalSettings.checklist.submissionAppearance" + "defaultLocaleKey": "default.contextSettings.checklist.submissionAppearance" } }, { "order": 5, "content": { - "defaultLocaleKey": "default.journalSettings.checklist.bibliographicRequirements" + "defaultLocaleKey": "default.contextSettings.checklist.bibliographicRequirements" } } ] diff --git a/templates/controllers/grid/languages/installLanguageForm.tpl b/templates/controllers/grid/languages/installLanguageForm.tpl index 9b391f2279e..56bc684cab7 100644 --- a/templates/controllers/grid/languages/installLanguageForm.tpl +++ b/templates/controllers/grid/languages/installLanguageForm.tpl @@ -46,6 +46,6 @@ {/fbvFormArea} {if not empty($notInstalledLocales)} - {fbvFormButtons id="mastheadFormSubmit" submitText="common.save"} + {fbvFormButtons id="installLanguageFormSubmit" submitText="common.save"} {/if} diff --git a/templates/controllers/grid/plugins/form/uploadPluginForm.tpl b/templates/controllers/grid/plugins/form/uploadPluginForm.tpl index 825ba5b6376..5ef80966509 100644 --- a/templates/controllers/grid/plugins/form/uploadPluginForm.tpl +++ b/templates/controllers/grid/plugins/form/uploadPluginForm.tpl @@ -39,6 +39,6 @@ {/fbvFormSection} {/fbvFormArea} - {fbvFormButtons id="mastheadFormSubmit" submitText="common.save"} + {fbvFormButtons id="uploadPluginFormSubmit" submitText="common.save"}

{translate key="common.requiredField"}

diff --git a/templates/frontend/components/registrationFormContexts.tpl b/templates/frontend/components/registrationFormContexts.tpl index 53caa7d09d4..bd5258301ca 100644 --- a/templates/frontend/components/registrationFormContexts.tpl +++ b/templates/frontend/components/registrationFormContexts.tpl @@ -66,7 +66,7 @@ {/foreach} {* Require the user to agree to the terms of the context's privacy policy *} - {if !$enableSiteWidePrivacyStatement && $context->getSetting('privacyStatement')} + {if !$enableSiteWidePrivacyStatement && $context->getData('privacyStatement')}