We are moving to Git Issues for bug tracking in future releases. During transition, content will be in both tools. If you'd like to file a new bug, please create an issue.

View | Details | Raw Unified | Return to bug 5543 | Differences between
and this patch

Collapse All | Expand All

(-)a/classes/author/form/submit/AuthorSubmitStep1Form.inc.php (-10 / +43 lines)
 Lines 30-35   class AuthorSubmitStep1Form extends AuthorSubmitForm { Link Here 
30
		// Validation checks for this form
30
		// Validation checks for this form
31
		$this->addCheck(new FormValidator($this, 'sectionId', 'required', 'author.submit.form.sectionRequired'));
31
		$this->addCheck(new FormValidator($this, 'sectionId', 'required', 'author.submit.form.sectionRequired'));
32
		$this->addCheck(new FormValidatorCustom($this, 'sectionId', 'required', 'author.submit.form.sectionRequired', array(DAORegistry::getDAO('SectionDAO'), 'sectionExists'), array($journal->getId())));
32
		$this->addCheck(new FormValidatorCustom($this, 'sectionId', 'required', 'author.submit.form.sectionRequired', array(DAORegistry::getDAO('SectionDAO'), 'sectionExists'), array($journal->getId())));
33
		$this->addCheck(new FormValidatorInSet($this, 'locale', 'required', 'author.submit.form.localeRequired', $journal->getSetting('supportedSubmissionLocales')));
33
	}
34
	}
34
35
35
	/**
36
	/**
 Lines 44-54   class AuthorSubmitStep1Form extends AuthorSubmitForm { Link Here 
44
		// Get sections for this journal
45
		// Get sections for this journal
45
		$sectionDao =& DAORegistry::getDAO('SectionDAO');
46
		$sectionDao =& DAORegistry::getDAO('SectionDAO');
46
47
47
		// If this user is a section editor or an editor, they are allowed
48
		// If this user is a section editor or an editor, they are
48
		// to submit to sections flagged as "editor-only" for submissions.
49
		// allowed to submit to sections flagged as "editor-only" for
49
		// Otherwise, display only sections they are allowed to submit to.
50
		// submissions. Otherwise, display only sections they are
51
		// allowed to submit to.
50
		$roleDao =& DAORegistry::getDAO('RoleDAO');
52
		$roleDao =& DAORegistry::getDAO('RoleDAO');
51
		$isEditor = $roleDao->roleExists($journal->getId(), $user->getId(), ROLE_ID_EDITOR) || $roleDao->roleExists($journal->getId(), $user->getId(), ROLE_ID_SECTION_EDITOR);
53
		$isEditor = $roleDao->roleExists($journal->getId(), $user->getId(), ROLE_ID_EDITOR) || $roleDao->roleExists($journal->getId(), $user->getId(), ROLE_ID_SECTION_EDITOR);
54
		$templateMgr->assign('sectionOptions', array('0' => Locale::translate('author.submit.selectSection')) + $sectionDao->getSectionTitles($journal->getId(), !$isEditor));
52
55
53
		// Set up required Payment Related Information
56
		// Set up required Payment Related Information
54
		import('classes.payment.ojs.OJSPaymentManager');
57
		import('classes.payment.ojs.OJSPaymentManager');
 Lines 58-73   class AuthorSubmitStep1Form extends AuthorSubmitForm { Link Here 
58
			$completedPaymentDAO =& DAORegistry::getDAO('OJSCompletedPaymentDAO');
61
			$completedPaymentDAO =& DAORegistry::getDAO('OJSCompletedPaymentDAO');
59
			$articleId = $this->articleId;
62
			$articleId = $this->articleId;
60
63
61
			if ( $paymentManager->submissionEnabled() ) {
64
			if ($paymentManager->submissionEnabled()) {
62
				$templateMgr->assign_by_ref('submissionPayment', $completedPaymentDAO->getSubmissionCompletedPayment ( $journal->getId(), $articleId ));
65
				$templateMgr->assign_by_ref('submissionPayment', $completedPaymentDAO->getSubmissionCompletedPayment ($journal->getId(), $articleId));
63
			}
66
			}
64
67
65
			if ( $paymentManager->fastTrackEnabled()  ) {
68
			if ($paymentManager->fastTrackEnabled()) {
66
				$templateMgr->assign_by_ref('fastTrackPayment', $completedPaymentDAO->getFastTrackCompletedPayment ( $journal->getId(), $articleId ));
69
				$templateMgr->assign_by_ref('fastTrackPayment', $completedPaymentDAO->getFastTrackCompletedPayment ($journal->getId(), $articleId));
67
			}
70
			}
68
		}
71
		}
69
72
70
		$templateMgr->assign('sectionOptions', array('0' => Locale::translate('author.submit.selectSection')) + $sectionDao->getSectionTitles($journal->getId(), !$isEditor));
73
		// Provide available submission languages. (Convert the array
74
		// of locale symbolic names xx_XX into an associative array
75
		// of symbolic names => readable names.)
76
		$templateMgr->assign(
77
			'supportedSubmissionLocaleNames',
78
			array_flip(array_intersect(
79
				array_flip(Locale::getAllLocales()),
80
				$journal->getSetting('supportedSubmissionLocales')
81
			))
82
		);
83
71
		parent::display();
84
		parent::display();
72
	}
85
	}
73
86
 Lines 78-85   class AuthorSubmitStep1Form extends AuthorSubmitForm { Link Here 
78
		if (isset($this->article)) {
91
		if (isset($this->article)) {
79
			$this->_data = array(
92
			$this->_data = array(
80
				'sectionId' => $this->article->getSectionId(),
93
				'sectionId' => $this->article->getSectionId(),
94
				'locale' => $this->article->getLocale(),
81
				'commentsToEditor' => $this->article->getCommentsToEditor()
95
				'commentsToEditor' => $this->article->getCommentsToEditor()
82
			);
96
			);
97
		} else {
98
			$journal =& Request::getJournal();
99
			$supportedSubmissionLocales = $journal->getSetting('supportedSubmissionLocales');
100
			// Try these locales in order until we find one that's
101
			// supported to use as a default.
102
			$tryLocales = array(
103
				$this->getFormLocale(), // Current form locale
104
				Locale::getLocale(), // Current UI locale
105
				$journal->getPrimaryLocale(), // Journal locale
106
				$supportedSubmissionLocales[array_shift(array_keys($supportedSubmissionLocales))] // Fallback: first one on the list
107
			);
108
			$this->_data = array();
109
			foreach ($tryLocales as $locale) {
110
				if (in_array($locale, $supportedSubmissionLocales)) {
111
					// Found a default to use
112
					$this->_data['locale'] = $locale;
113
					break;
114
				}
115
			}
83
		}
116
		}
84
	}
117
	}
85
118
 Lines 87-93   class AuthorSubmitStep1Form extends AuthorSubmitForm { Link Here 
87
	 * Assign form data to user-submitted data.
120
	 * Assign form data to user-submitted data.
88
	 */
121
	 */
89
	function readInputData() {
122
	function readInputData() {
90
		$this->readUserVars(array('submissionChecklist', 'copyrightNoticeAgree', 'sectionId', 'commentsToEditor'));
123
		$this->readUserVars(array('locale', 'submissionChecklist', 'copyrightNoticeAgree', 'sectionId', 'commentsToEditor'));
91
	}
124
	}
92
125
93
	/**
126
	/**
 Lines 113-119   class AuthorSubmitStep1Form extends AuthorSubmitForm { Link Here 
113
			$user =& Request::getUser();
146
			$user =& Request::getUser();
114
147
115
			$this->article = new Article();
148
			$this->article = new Article();
116
			$this->article->setLocale(Locale::getLocale()); // FIXME in bug #5543
149
			$this->article->setLocale($this->getData('locale'));
117
			$this->article->setUserId($user->getId());
150
			$this->article->setUserId($user->getId());
118
			$this->article->setJournalId($journal->getId());
151
			$this->article->setJournalId($journal->getId());
119
			$this->article->setSectionId($this->getData('sectionId'));
152
			$this->article->setSectionId($this->getData('sectionId'));
(-)a/classes/manager/form/LanguageSettingsForm.inc.php (-4 / +6 lines)
 Lines 33-38   class LanguageSettingsForm extends Form { Link Here 
33
33
34
		$this->settings = array(
34
		$this->settings = array(
35
			'supportedLocales' => 'object',
35
			'supportedLocales' => 'object',
36
			'supportedSubmissionLocales' => 'object',
36
			'supportedFormLocales' => 'object'
37
			'supportedFormLocales' => 'object'
37
		);
38
		);
38
39
 Lines 69-75   class LanguageSettingsForm extends Form { Link Here 
69
70
70
		$this->setData('primaryLocale', $journal->getPrimaryLocale());
71
		$this->setData('primaryLocale', $journal->getPrimaryLocale());
71
72
72
		foreach (array('supportedFormLocales', 'supportedLocales') as $name) {
73
		foreach (array('supportedFormLocales', 'supportedSubmissionLocales', 'supportedLocales') as $name) {
73
			if ($this->getData($name) == null || !is_array($this->getData($name))) {
74
			if ($this->getData($name) == null || !is_array($this->getData($name))) {
74
				$this->setData($name, array());
75
				$this->setData($name, array());
75
			}
76
			}
 Lines 84-90   class LanguageSettingsForm extends Form { Link Here 
84
		$vars[] = 'primaryLocale';
85
		$vars[] = 'primaryLocale';
85
		$this->readUserVars($vars);
86
		$this->readUserVars($vars);
86
87
87
		foreach (array('supportedFormLocales', 'supportedLocales') as $name) {
88
		foreach (array('supportedFormLocales', 'supportedSubmissionLocales', 'supportedLocales') as $name) {
88
			if ($this->getData($name) == null || !is_array($this->getData($name))) {
89
			if ($this->getData($name) == null || !is_array($this->getData($name))) {
89
				$this->setData($name, array());
90
				$this->setData($name, array());
90
			}
91
			}
 Lines 99-105   class LanguageSettingsForm extends Form { Link Here 
99
		$settingsDao =& DAORegistry::getDAO('JournalSettingsDAO');
100
		$settingsDao =& DAORegistry::getDAO('JournalSettingsDAO');
100
101
101
		// Verify additional locales
102
		// Verify additional locales
102
		foreach (array('supportedLocales', 'supportedFormLocales') as $name) {
103
		foreach (array('supportedLocales', 'supportedSubmissionLocales', 'supportedFormLocales') as $name) {
103
			$$name = array();
104
			$$name = array();
104
			foreach ($this->getData($name) as $locale) {
105
			foreach ($this->getData($name) as $locale) {
105
				if (Locale::isLocaleValid($locale) && in_array($locale, $this->availableLocales)) {
106
				if (Locale::isLocaleValid($locale) && in_array($locale, $this->availableLocales)) {
 Lines 112-124   class LanguageSettingsForm extends Form { Link Here 
112
113
113
		// Make sure at least the primary locale is chosen as available
114
		// Make sure at least the primary locale is chosen as available
114
		if ($primaryLocale != null && !empty($primaryLocale)) {
115
		if ($primaryLocale != null && !empty($primaryLocale)) {
115
			foreach (array('supportedLocales', 'supportedFormLocales') as $name) {
116
			foreach (array('supportedLocales', 'supportedSubmissionLocales', 'supportedFormLocales') as $name) {
116
				if (!in_array($primaryLocale, $$name)) {
117
				if (!in_array($primaryLocale, $$name)) {
117
					array_push($$name, $primaryLocale);
118
					array_push($$name, $primaryLocale);
118
				}
119
				}
119
			}
120
			}
120
		}
121
		}
121
		$this->setData('supportedLocales', $supportedLocales);
122
		$this->setData('supportedLocales', $supportedLocales);
123
		$this->setData('supportedSubmissionLocales', $supportedSubmissionLocales);
122
		$this->setData('supportedFormLocales', $supportedFormLocales);
124
		$this->setData('supportedFormLocales', $supportedFormLocales);
123
125
124
		foreach ($this->_data as $name => $value) {
126
		foreach ($this->_data as $name => $value) {
(-)a/dbscripts/xml/upgrade/2.3.2_update.xml (+4 lines)
 Lines 40-44    Link Here 
40
		<query driver="postgres7">
40
		<query driver="postgres7">
41
			UPDATE articles SET locale = j.primary_locale FROM journals j WHERE articles.journal_id = j.journal_id
41
			UPDATE articles SET locale = j.primary_locale FROM journals j WHERE articles.journal_id = j.journal_id
42
		</query>
42
		</query>
43
		<!-- Use the current set of form locales as a default for supported submission locales -->
44
		<query>
45
			INSERT INTO journal_settings (journal_id, locale, setting_name, setting_value, setting_type) SELECT journal_id, locale, 'supportedSubmissionLocales', setting_value, setting_type FROM journal_settings WHERE setting_name = 'supportedFormLocales'
46
		</query>
43
	</sql>
47
	</sql>
44
</data>
48
</data>
(-)a/locale/en_US/author.xml (+3 lines)
 Lines 51-56    Link Here 
51
	<message key="author.submit.journalSection">Journal Section</message>
51
	<message key="author.submit.journalSection">Journal Section</message>
52
	<message key="author.submit.journalSectionDescription"><![CDATA[Select the appropriate section for this submission (see Sections and Policies in <a href="{$aboutUrl}" target="_new">About</a> the Journal).]]></message>
52
	<message key="author.submit.journalSectionDescription"><![CDATA[Select the appropriate section for this submission (see Sections and Policies in <a href="{$aboutUrl}" target="_new">About</a> the Journal).]]></message>
53
	<message key="author.submit.selectSection">Please select a section...</message>
53
	<message key="author.submit.selectSection">Please select a section...</message>
54
	<message key="author.submit.submissionLocale">Submission Language</message>
55
	<message key="author.submit.submissionLocaleDescription">This journal accepts submissions in several languages. Choose the primary language of the submission from the pulldown below.</message>
54
	<message key="author.submit.submissionChecklist">Submission Checklist</message>
56
	<message key="author.submit.submissionChecklist">Submission Checklist</message>
55
	<message key="author.submit.submissionChecklistDescription">Indicate that this submission is ready to be considered by this journal by checking off the following (comments to the editor can be added below).</message>
57
	<message key="author.submit.submissionChecklistDescription">Indicate that this submission is ready to be considered by this journal by checking off the following (comments to the editor can be added below).</message>
56
	<message key="author.submit.verifyChecklist">You must make sure all items in the submission checklist are satisfied before continuing.</message>
58
	<message key="author.submit.verifyChecklist">You must make sure all items in the submission checklist are satisfied before continuing.</message>
 Lines 59-64    Link Here 
59
	<message key="author.submit.commentsForEditor">Comments for the Editor</message>
61
	<message key="author.submit.commentsForEditor">Comments for the Editor</message>
60
	<message key="author.submit.comments">Enter text (optional)</message>
62
	<message key="author.submit.comments">Enter text (optional)</message>
61
	<message key="author.submit.form.sectionRequired">Please select an appropriate journal section for this submission.</message>
63
	<message key="author.submit.form.sectionRequired">Please select an appropriate journal section for this submission.</message>
64
	<message key="author.submit.form.localeRequired">Please select a submission language.</message>
62
	<message key="author.submit.privacyStatement">Journal's Privacy Statement</message>
65
	<message key="author.submit.privacyStatement">Journal's Privacy Statement</message>
63
	<message key="author.submit.reorderInstructions">Reorder authors to appear in the order they will be listed on publication.</message>
66
	<message key="author.submit.reorderInstructions">Reorder authors to appear in the order they will be listed on publication.</message>
64
	<message key="author.submit.reorder">Reorder author's name</message>
67
	<message key="author.submit.reorder">Reorder author's name</message>
(-)a/locale/en_US/manager.xml (-1 / +2 lines)
 Lines 24-32    Link Here 
24
	<message key="manager.groups.noneCreated">No editorial team positions have been created.</message>
24
	<message key="manager.groups.noneCreated">No editorial team positions have been created.</message>
25
	<message key="manager.journalManagement">Journal Management</message>
25
	<message key="manager.journalManagement">Journal Management</message>
26
	<message key="manager.language.ui">UI</message>
26
	<message key="manager.language.ui">UI</message>
27
	<message key="manager.language.submissions">Submissions</message>
27
	<message key="manager.language.forms">Forms</message>
28
	<message key="manager.language.forms">Forms</message>
28
	<message key="manager.language.confirmDefaultSettingsOverwrite">This will replace any locale-specific journal settings you had for this locale</message>
29
	<message key="manager.language.confirmDefaultSettingsOverwrite">This will replace any locale-specific journal settings you had for this locale</message>
29
	<message key="manager.language.reloadLocalizedDefaultSettings">Reload locale-specific default settings</message>
30
	<message key="manager.language.reloadLocalizedDefaultSettings">Reload defaults</message>
30
	<message key="manager.languages.languageInstructions"><![CDATA[OJS can be made available to users in any of several supported languages. As well, OJS can operate as a multilingual system, providing users with an ability to toggle between languages on each page, and allowing certain data to be entered in several additional languages.<br /><br/>If a language supported by OJS is not listed below, ask your site administrator to install the language from the site administration interface. For instructions on adding support for new languages, please consult the OJS documentation.]]></message>
31
	<message key="manager.languages.languageInstructions"><![CDATA[OJS can be made available to users in any of several supported languages. As well, OJS can operate as a multilingual system, providing users with an ability to toggle between languages on each page, and allowing certain data to be entered in several additional languages.<br /><br/>If a language supported by OJS is not listed below, ask your site administrator to install the language from the site administration interface. For instructions on adding support for new languages, please consult the OJS documentation.]]></message>
31
	<message key="manager.languages.noneAvailable">Sorry, no additional languages are available. Contact your site administrator if you wish to use additional languages with this journal.</message>
32
	<message key="manager.languages.noneAvailable">Sorry, no additional languages are available. Contact your site administrator if you wish to use additional languages with this journal.</message>
32
	<message key="manager.languages.primaryLocaleInstructions">This will be the default language for the journal site.</message>
33
	<message key="manager.languages.primaryLocaleInstructions">This will be the default language for the journal site.</message>
(-)a/templates/author/submit/step1.tpl (-6 / +28 lines)
 Lines 21-33    Link Here 
21
21
22
<div class="separator"></div>
22
<div class="separator"></div>
23
23
24
<form name="submit" method="post" action="{url op="saveSubmit" path=$submitStep}" onsubmit="return checkSubmissionChecklist()">
25
{include file="common/formErrors.tpl"}
26
{if $articleId}<input type="hidden" name="articleId" value="{$articleId|escape}" />{/if}
27
24
{if count($sectionOptions) <= 1}
28
{if count($sectionOptions) <= 1}
25
	<p>{translate key="author.submit.notAccepting"}</p>
29
	<p>{translate key="author.submit.notAccepting"}</p>
26
{else}
30
{else}
27
31
28
<form name="submit" method="post" action="{url op="saveSubmit" path=$submitStep}" onsubmit="return checkSubmissionChecklist()">
29
{include file="common/formErrors.tpl"}
30
31
{if count($sectionOptions) == 2}
32
{if count($sectionOptions) == 2}
32
	{* If there's only one section, force it and skip the section parts
33
	{* If there's only one section, force it and skip the section parts
33
	   of the interface. *}
34
	   of the interface. *}
 Lines 42-50    Link Here 
42
{url|assign:"url" page="about"}
43
{url|assign:"url" page="about"}
43
<p>{translate key="author.submit.journalSectionDescription" aboutUrl=$url}</p>
44
<p>{translate key="author.submit.journalSectionDescription" aboutUrl=$url}</p>
44
45
45
{if $articleId}
46
	<input type="hidden" name="articleId" value="{$articleId|escape}" />
47
{/if}
48
<input type="hidden" name="submissionChecklist" value="1" />
46
<input type="hidden" name="submissionChecklist" value="1" />
49
47
50
<table class="data" width="100%">
48
<table class="data" width="100%">
 Lines 60-65    Link Here 
60
58
61
{/if}{* if count($sectionOptions) == 2 *}
59
{/if}{* if count($sectionOptions) == 2 *}
62
60
61
{if count($supportedSubmissionLocaleNames) == 1}
62
	{* There is only one supported submission locale; choose it invisibly *}
63
	{foreach from=$supportedSubmissionLocaleNames item=locale}
64
		<input type="hidden" name="locale" value="{$locale|escape}" />
65
	{/foreach}
66
{else}
67
	{* There are several submission locales available; allow choice *}
68
	<div id="submissionLocale">
69
70
	<h3>{translate key="author.submit.submissionLocale"}</h3>
71
	<p>{translate key="author.submit.submissionLocaleDescription"}</p>
72
73
	<table class="data" width="100%">
74
		<tr valign="top">	
75
			<td width="20%" class="label">{fieldLabel name="locale" required="true" key="article.language"}</td>
76
			<td width="80%" class="value"><select name="locale" id="locale" size="1" class="selectMenu">{html_options options=$supportedSubmissionLocaleNames selected=$locale}</select></td>
77
		</tr>
78
	</table>
79
80
	<div class="separator"></div>
81
82
	</div>{* submissionLocale *}
83
{/if}{* count($supportedSubmissionLocaleNames) == 1 *}
84
63
<script type="text/javascript">
85
<script type="text/javascript">
64
{literal}
86
{literal}
65
<!--
87
<!--
(-)a/templates/manager/languageSettings.tpl (+2 lines)
 Lines 39-44    Link Here 
39
		<tr valign="top">
39
		<tr valign="top">
40
			<td width="20%">&nbsp;</td>
40
			<td width="20%">&nbsp;</td>
41
			<td align="center" width="10%">{translate key="manager.language.ui"}</td>
41
			<td align="center" width="10%">{translate key="manager.language.ui"}</td>
42
			<td align="center" width="20%">{translate key="manager.language.submissions"}</td>
42
			<td align="center" width="10%">{translate key="manager.language.forms"}</td>
43
			<td align="center" width="10%">{translate key="manager.language.forms"}</td>
43
			<td width="60%">&nbsp;</td>
44
			<td width="60%">&nbsp;</td>
44
		</tr>
45
		</tr>
 Lines 46-51    Link Here 
46
			<tr>
47
			<tr>
47
				<td>{$localeName|escape}</td>
48
				<td>{$localeName|escape}</td>
48
				<td align="center"><input type="checkbox" name="supportedLocales[]" value="{$localeKey|escape}"{if in_array($localeKey, $supportedLocales)} checked="checked"{/if}/></td>
49
				<td align="center"><input type="checkbox" name="supportedLocales[]" value="{$localeKey|escape}"{if in_array($localeKey, $supportedLocales)} checked="checked"{/if}/></td>
50
				<td align="center"><input type="checkbox" name="supportedSubmissionLocales[]" value="{$localeKey|escape}"{if in_array($localeKey, $supportedSubmissionLocales)} checked="checked"{/if}/></td>
49
				<td align="center"><input type="checkbox" name="supportedFormLocales[]" value="{$localeKey|escape}"{if in_array($localeKey, $supportedFormLocales)} checked="checked"{/if}/></td>
51
				<td align="center"><input type="checkbox" name="supportedFormLocales[]" value="{$localeKey|escape}"{if in_array($localeKey, $supportedFormLocales)} checked="checked"{/if}/></td>
50
				<td><a href="{url op="reloadLocalizedDefaultSettings" localeToLoad=$localeKey}" onclick="return confirm('{translate|escape:"jsparam" key="manager.language.confirmDefaultSettingsOverwrite"}')" class="action">{translate key="manager.language.reloadLocalizedDefaultSettings"}</a></td>
52
				<td><a href="{url op="reloadLocalizedDefaultSettings" localeToLoad=$localeKey}" onclick="return confirm('{translate|escape:"jsparam" key="manager.language.confirmDefaultSettingsOverwrite"}')" class="action">{translate key="manager.language.reloadLocalizedDefaultSettings"}</a></td>
51
			</tr>
53
			</tr>

Return to bug 5543