Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkp/pkp-lib#5540 Add date format configuration to journal settings #858

Merged
merged 5 commits into from
Aug 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion classes/components/forms/publication/PublishForm.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,23 @@ class PublishForm extends FormComponent {
/** @var Publication The publication being published */
public $publication;

/** @var \Context */
public $submissionContext;

/**
* Constructor
*
* @param $action string URL to submit the form to
* @param $publication Publication The publication to change settings for
* @param $submissionContext \Context journal or press
* @param $requirementErrors array A list of pre-publication requirements that are not met.
*/
public function __construct($action, $publication, $requirementErrors) {
public function __construct($action, $publication, $submissionContext, $requirementErrors) {
$this->action = $action;
$this->successMessage = __('publication.publish.success');
$this->errors = $requirementErrors;
$this->publication = $publication;
$this->submissionContext = $submissionContext;

// Set separate messages and buttons if publication requirements have passed
if (empty($requirementErrors)) {
Expand Down
2 changes: 1 addition & 1 deletion classes/publicationFormat/PublicationDate.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function isFreeText() {
*/
function getReadableDates() {
$format = $this->dateFormats[$this->getDateFormat()];
$dateFormatShort = Config::getVar('general', 'date_format_short');
$dateFormatShort = \Application::get()->getRequest()->getContext()->getLocalizedDateFormatShort();

if ($this->isHijriCalendar()) {
$format = preg_replace('/\s*\(H\)/i', '', $format);
Expand Down
3 changes: 1 addition & 2 deletions config.TEMPLATE.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
time_zone = "UTC"

; Short and long date formats
date_format_trunc = "%m-%d"
date_format_short = "%Y-%m-%d"
date_format_long = "%B %e, %Y"
datetime_format_short = "%Y-%m-%d %I:%M %p"
Expand Down Expand Up @@ -506,6 +505,6 @@
log_web_service_info = Off

; declare a cainfo path if a certificate other than PHP's default should be used for curl calls.
; This setting overrides the 'curl.cainfo' parameter of the php.ini configuration file.
; This setting overrides the 'curl.cainfo' parameter of the php.ini configuration file.
[curl]
; cainfo = ""
2 changes: 1 addition & 1 deletion lib/pkp
Submodule pkp updated 50 files
+152 −0 classes/components/forms/context/PKPDateTimeForm.inc.php
+95 −0 classes/context/Context.inc.php
+21 −17 classes/form/FormBuilderVocabulary.inc.php
+2 −2 classes/services/PKPStatsService.inc.php
+4 −2 classes/services/PKPSubmissionService.inc.php
+1 −1 classes/submission/action/EditorAction.inc.php
+2 −2 classes/submission/reviewer/ReviewerAction.inc.php
+1 −1 classes/task/ReviewReminder.inc.php
+20 −7 classes/template/PKPTemplateManager.inc.php
+1 −1 controllers/grid/eventLog/SubmissionEventLogGridHandler.inc.php
+2 −2 controllers/grid/files/FileDateGridColumn.inc.php
+4 −2 controllers/grid/queries/QueriesGridCellProvider.inc.php
+2 −1 controllers/grid/queries/QueryNotesGridCellProvider.inc.php
+1 −1 controllers/grid/users/reviewer/form/ReviewReminderForm.inc.php
+1 −1 controllers/modals/publish/PublishHandler.inc.php
+2 −2 locale/cs_CZ/common.po
+27 −0 locale/en_US/manager.po
+11 −5 locale/fi_FI/admin.po
+62 −10 locale/fi_FI/editor.po
+145 −5 locale/fi_FI/manager.po
+11 −6 locale/fi_FI/reader.po
+11 −5 locale/fi_FI/reviewer.po
+33 −5 locale/fi_FI/submission.po
+2 −2 locale/ro_RO/common.po
+3 −3 locale/ro_RO/manager.po
+4 −4 locale/ro_RO/submission.po
+27 −0 locale/uk_UA/manager.po
+367 −1 locale/vi_VN/admin.po
+144 −1 locale/vi_VN/api.po
+2,017 −1 locale/vi_VN/common.po
+137 −1 locale/vi_VN/default.po
+501 −1 locale/vi_VN/editor.po
+661 −2 locale/vi_VN/manager.po
+9 −9 locale/vi_VN/reader.po
+2,201 −1 locale/vi_VN/submission.po
+508 −1 locale/vi_VN/user.po
+601 −2 locale/zh_CN/manager.po
+2 −0 pages/management/ManagementHandler.inc.php
+3 −3 plugins/generic/acron/locale/vi_VN/locale.po
+2 −0 plugins/generic/usageEvent/locale/fr_FR/locale.po
+2 −0 plugins/metadata/dc11/locale/fr_FR/locale.po
+36 −1 schemas/context.json
+1 −1 templates/common/userDetails.tpl
+1 −1 templates/controllers/grid/users/reviewer/form/createReviewerForm.tpl
+1 −1 templates/form/textInput.tpl
+6 −0 templates/management/website.tpl
+1 −1 templates/user/contactForm.tpl
+0 −1 tests/classes/config/ConfigTest.php
+0 −1 tests/config/config.TEMPLATE.mysql.inc.php
+0 −1 tests/config/config.TEMPLATE.pgsql.inc.php
2 changes: 1 addition & 1 deletion lib/ui-library
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"chart.js": "^2.9.3",
"clone-deep": "^4.0.1",
"debounce": "^1.2.0",
"moment": "^2.27.0",
"tinymce": "^4.9.11",
"v-tooltip": "^2.0.2",
"vue": "^2.6.11",
Expand Down
2 changes: 1 addition & 1 deletion templates/frontend/pages/index.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
</a>
</h4>
<div class="date">
{$announcement->getDatePosted()}
{$announcement->getDatePosted()|date_format:$dateFormatShort}
</div>
</article>
{/if}
Expand Down