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 3293 | Differences between
and this patch

Collapse All | Expand All

(-)ojs2/classes/article/Article.inc.php:1.34 (-1 / +73 lines)
 Lines 11-17    Link Here 
11
 *
11
 *
12
 * Article class.
12
 * Article class.
13
 *
13
 *
14
 * $Id: Article.inc.php,v 1.34 2008/06/17 23:22:24 asmecher Exp $
14
 * $Id: Article.inc.php,v 1.35 2008/06/18 19:52:59 michael Exp $
15
 */
15
 */
16
16
17
// Submission status constants
17
// Submission status constants
 Lines 32-37    Link Here 
32
define ('AUTHOR_TOC_HIDE', 1);
32
define ('AUTHOR_TOC_HIDE', 1);
33
define ('AUTHOR_TOC_SHOW', 2);
33
define ('AUTHOR_TOC_SHOW', 2);
34
34
35
// Article RT comments
36
define ('COMMENTS_SECTION_DEFAULT', 0);
37
define ('COMMENTS_DISABLE', 1);
38
define ('COMMENTS_ENABLE', 2);
39
35
class Article extends DataObject {
40
class Article extends DataObject {
36
41
37
	/** @var array Authors of this article */
42
	/** @var array Authors of this article */
 Lines 964-969    Link Here 
964
	function setHideAuthor($hideAuthor) {
969
	function setHideAuthor($hideAuthor) {
965
		return $this->setData('hideAuthor', $hideAuthor);
970
		return $this->setData('hideAuthor', $hideAuthor);
966
	}
971
	}
972
973
	/**
974
	 * Return article RT comments status.
975
	 * @return int 
976
	 */
977
	function getCommentsStatus() {
978
		return $this->getData('commentsStatus');
979
	}
980
981
	/**
982
	 * Set article RT comments status.
983
	 * @param $commentsStatus boolean
984
	 */
985
	function setCommentsStatus($commentsStatus) {
986
		return $this->setData('commentsStatus', $commentsStatus);
987
	}
988
989
	/**
990
	 * Return locale string corresponding to RT comments status.
991
	 * @return string
992
	 */
993
	function getCommentsStatusString() {
994
		switch ($this->getCommentsStatus()) {
995
			case COMMENTS_DISABLE:
996
				return 'article.comments.disable';
997
			case COMMENTS_ENABLE:
998
				return 'article.comments.enable';
999
			default:
1000
				return 'article.comments.sectionDefault';
1001
		}
1002
	}
1003
1004
	/**
1005
	 * Return boolean indicating if article RT comments should be enabled.
1006
	 * Checks both the section and article comments status. Article status
1007
	 * overrides section status.
1008
	 * @return int 
1009
	 */
1010
	function getEnableComments() {
1011
		switch ($this->getCommentsStatus()) {
1012
			case COMMENTS_DISABLE:
1013
				return false;
1014
			case COMMENTS_ENABLE:
1015
				return true;
1016
			case COMMENTS_SECTION_DEFAULT:
1017
				$sectionDao =& DAORegistry::getDAO('SectionDAO');
1018
				$section =& $sectionDao->getSection($this->getSectionId(), $this->getJournalId());
1019
				if ($section->getDisableComments()) {
1020
					return false;
1021
				} else {
1022
					return true;
1023
				}
1024
		}
1025
	}
1026
1027
	/**
1028
	 * Get an associative array matching RT comments status codes with locale strings.
1029
	 * @return array comments status => localeString
1030
	 */
1031
	function &getCommentsStatusOptions() {
1032
		static $commentsStatusOptions = array(
1033
			COMMENTS_SECTION_DEFAULT => 'article.comments.sectionDefault',
1034
			COMMENTS_DISABLE => 'article.comments.disable',
1035
			COMMENTS_ENABLE => 'article.comments.enable'
1036
		);
1037
		return $commentsStatusOptions;
1038
	}
967
}
1039
}
968
1040
969
?>
1041
?>
(-)ojs2/classes/article/ArticleDAO.inc.php:1.50 (-5 / +9 lines)
 Lines 12-18    Link Here 
12
 * Class for Article DAO.
12
 * Class for Article DAO.
13
 * Operations for retrieving and modifying Article objects.
13
 * Operations for retrieving and modifying Article objects.
14
 *
14
 *
15
 * $Id: ArticleDAO.inc.php,v 1.50 2008/06/11 18:54:54 asmecher Exp $
15
 * $Id: ArticleDAO.inc.php,v 1.51 2008/06/18 19:52:59 michael Exp $
16
 */
16
 */
17
17
18
import('article.Article');
18
import('article.Article');
 Lines 136-141    Link Here 
136
		$article->setPages($row['pages']);
136
		$article->setPages($row['pages']);
137
		$article->setFastTracked($row['fast_tracked']);
137
		$article->setFastTracked($row['fast_tracked']);
138
		$article->setHideAuthor($row['hide_author']);
138
		$article->setHideAuthor($row['hide_author']);
139
		$article->setCommentsStatus($row['comments_status']);
139
		
140
		
140
141
141
		$article->setAuthors($this->authorDao->getAuthorsByArticle($row['article_id']));
142
		$article->setAuthors($this->authorDao->getAuthorsByArticle($row['article_id']));
 Lines 154-162    Link Here 
154
		$article->stampModified();
155
		$article->stampModified();
155
		$this->update(
156
		$this->update(
156
			sprintf('INSERT INTO articles
157
			sprintf('INSERT INTO articles
157
				(user_id, journal_id, section_id, language, comments_to_ed, date_submitted, date_status_modified, last_modified, status, submission_progress, current_round, submission_file_id, revised_file_id, review_file_id, editor_file_id, copyedit_file_id, pages, fast_tracked, hide_author)
158
				(user_id, journal_id, section_id, language, comments_to_ed, date_submitted, date_status_modified, last_modified, status, submission_progress, current_round, submission_file_id, revised_file_id, review_file_id, editor_file_id, copyedit_file_id, pages, fast_tracked, hide_author, comments_status)
158
				VALUES
159
				VALUES
159
				(?, ?, ?, ?, ?, %s, %s, %s, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)',
160
				(?, ?, ?, ?, ?, %s, %s, %s, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)',
160
				$this->datetimeToDB($article->getDateSubmitted()), $this->datetimeToDB($article->getDateStatusModified()), $this->datetimeToDB($article->getLastModified())),
161
				$this->datetimeToDB($article->getDateSubmitted()), $this->datetimeToDB($article->getDateStatusModified()), $this->datetimeToDB($article->getLastModified())),
161
			array(
162
			array(
162
				$article->getUserId(),
163
				$article->getUserId(),
 Lines 174-180    Link Here 
174
				$article->getCopyeditFileId(),
175
				$article->getCopyeditFileId(),
175
				$article->getPages(),
176
				$article->getPages(),
176
				$article->getFastTracked()?1:0,
177
				$article->getFastTracked()?1:0,
177
				$article->getHideAuthor() === null ? 0 : $article->getHideAuthor()
178
				$article->getHideAuthor() === null ? 0 : $article->getHideAuthor(),
179
				$article->getCommentsStatus() === null ? 0 : $article->getCommentsStatus()
178
			)
180
			)
179
		);
181
		);
180
182
 Lines 217-223    Link Here 
217
					copyedit_file_id = ?,
219
					copyedit_file_id = ?,
218
					pages = ?,
220
					pages = ?,
219
					fast_tracked = ?,
221
					fast_tracked = ?,
220
					hide_author = ?
222
					hide_author = ?,
223
					comments_status = ?
221
				WHERE article_id = ?',
224
				WHERE article_id = ?',
222
				$this->datetimeToDB($article->getDateSubmitted()), $this->datetimeToDB($article->getDateStatusModified()), $this->datetimeToDB($article->getLastModified())),
225
				$this->datetimeToDB($article->getDateSubmitted()), $this->datetimeToDB($article->getDateStatusModified()), $this->datetimeToDB($article->getLastModified())),
223
			array(
226
			array(
 Lines 236-241    Link Here 
236
				$article->getPages(),
239
				$article->getPages(),
237
				$article->getFastTracked(),
240
				$article->getFastTracked(),
238
				$article->getHideAuthor(),
241
				$article->getHideAuthor(),
242
				$article->getCommentsStatus(),
239
				$article->getArticleId()
243
				$article->getArticleId()
240
			)
244
			)
241
		);
245
		);
(-)ojs2/classes/journal/Section.inc.php:1.20 (-1 / +17 lines)
 Lines 12-18    Link Here 
12
 * Section class.
12
 * Section class.
13
 * Describes basic section properties.
13
 * Describes basic section properties.
14
 *
14
 *
15
 * $Id: Section.inc.php,v 1.20 2008/06/13 23:59:44 michael Exp $
15
 * $Id: Section.inc.php,v 1.21 2008/06/18 19:52:59 michael Exp $
16
 */
16
 */
17
17
18
class Section extends DataObject {
18
class Section extends DataObject {
 Lines 267-272    Link Here 
267
	}
267
	}
268
268
269
	/**
269
	/**
270
	 * Return boolean indicating if RT comments should be disabled.
271
	 * @return boolean
272
	 */
273
	function getDisableComments() {
274
		return $this->getData('disableComments');
275
	}
276
277
	/**
278
	 * Set if RT comments should be disabled.
279
	 * @param $disableComments boolean
280
	 */
281
	function setDisableComments($disableComments) {
282
		return $this->setData('disableComments', $disableComments);
283
	}
284
285
	/**
270
	 * Get localized section policy.
286
	 * Get localized section policy.
271
	 * @return string
287
	 * @return string
272
	 */
288
	 */
(-)ojs2/classes/journal/SectionDAO.inc.php:1.46 (-5 / +9 lines)
 Lines 12-18    Link Here 
12
 * Class for section DAO.
12
 * Class for section DAO.
13
 * Operations for retrieving and modifying Section objects.
13
 * Operations for retrieving and modifying Section objects.
14
 *
14
 *
15
 * $Id: SectionDAO.inc.php,v 1.46 2008/06/13 23:59:44 michael Exp $
15
 * $Id: SectionDAO.inc.php,v 1.47 2008/06/18 19:52:59 michael Exp $
16
 */
16
 */
17
17
18
import ('journal.Section');
18
import ('journal.Section');
 Lines 142-147    Link Here 
142
		$section->setHideTitle($row['hide_title']);
142
		$section->setHideTitle($row['hide_title']);
143
		$section->setHideAuthor($row['hide_author']);
143
		$section->setHideAuthor($row['hide_author']);
144
		$section->setHideAbout($row['hide_about']);
144
		$section->setHideAbout($row['hide_about']);
145
		$section->setDisableComments($row['disable_comments']);
145
146
146
		$this->getDataObjectSettings('section_settings', 'section_id', $row['section_id'], $section);
147
		$this->getDataObjectSettings('section_settings', 'section_id', $row['section_id'], $section);
147
148
 Lines 175-183    Link Here 
175
	function insertSection(&$section) {
176
	function insertSection(&$section) {
176
		$this->update(
177
		$this->update(
177
			'INSERT INTO sections
178
			'INSERT INTO sections
178
				(journal_id, seq, meta_indexed, meta_reviewed, abstracts_not_required, editor_restricted, hide_title, hide_author, hide_about)
179
				(journal_id, seq, meta_indexed, meta_reviewed, abstracts_not_required, editor_restricted, hide_title, hide_author, hide_about, disable_comments)
179
				VALUES
180
				VALUES
180
				(?, ?, ?, ?, ?, ?, ?, ?, ?)',
181
				(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)',
181
			array(
182
			array(
182
				$section->getJournalId(),
183
				$section->getJournalId(),
183
				$section->getSequence() == null ? 0 : $section->getSequence(),
184
				$section->getSequence() == null ? 0 : $section->getSequence(),
 Lines 187-193    Link Here 
187
				$section->getEditorRestricted() ? 1 : 0,
188
				$section->getEditorRestricted() ? 1 : 0,
188
				$section->getHideTitle() ? 1 : 0,
189
				$section->getHideTitle() ? 1 : 0,
189
				$section->getHideAuthor() ? 1 : 0,
190
				$section->getHideAuthor() ? 1 : 0,
190
				$section->getHideAbout() ? 1 : 0
191
				$section->getHideAbout() ? 1 : 0,
192
				$section->getDisableComments() ? 1 : 0
191
			)
193
			)
192
		);
194
		);
193
195
 Lines 211-217    Link Here 
211
					editor_restricted = ?,
213
					editor_restricted = ?,
212
					hide_title = ?,
214
					hide_title = ?,
213
					hide_author = ?,
215
					hide_author = ?,
214
					hide_about = ?
216
					hide_about = ?,
217
					disable_comments = ?
215
				WHERE section_id = ?',
218
				WHERE section_id = ?',
216
			array(
219
			array(
217
				$section->getSequence(),
220
				$section->getSequence(),
 Lines 222-227    Link Here 
222
				$section->getHideTitle(),
225
				$section->getHideTitle(),
223
				$section->getHideAuthor(),
226
				$section->getHideAuthor(),
224
				$section->getHideAbout(),
227
				$section->getHideAbout(),
228
				$section->getDisableComments(),
225
				$section->getSectionId()
229
				$section->getSectionId()
226
			)
230
			)
227
		);
231
		);
(-)ojs2/classes/manager/form/SectionForm.inc.php:1.33 (-2 / +6 lines)
 Lines 11-17    Link Here 
11
 *
11
 *
12
 * Form for creating and modifying journal sections.
12
 * Form for creating and modifying journal sections.
13
 *
13
 *
14
 * $Id: SectionForm.inc.php,v 1.33 2008/06/13 23:59:44 michael Exp $
14
 * $Id: SectionForm.inc.php,v 1.34 2008/06/18 19:52:59 michael Exp $
15
 */
15
 */
16
16
17
import('form.Form');
17
import('form.Form');
 Lines 97-104    Link Here 
97
	 * Display the form.
97
	 * Display the form.
98
	 */
98
	 */
99
	function display() {
99
	function display() {
100
		$journal =& Request::getJournal();
100
		$templateMgr = &TemplateManager::getManager();
101
		$templateMgr = &TemplateManager::getManager();
101
		$templateMgr->assign('sectionId', $this->sectionId);
102
		$templateMgr->assign('sectionId', $this->sectionId);
103
		$templateMgr->assign('commentsEnabled', $journal->getSetting('enableComments'));
102
		$templateMgr->assign('helpTopicId','journal.managementPages.sections');
104
		$templateMgr->assign('helpTopicId','journal.managementPages.sections');
103
		parent::display();
105
		parent::display();
104
	}
106
	}
 Lines 127-132    Link Here 
127
					'hideTitle' => $section->getHideTitle(),
129
					'hideTitle' => $section->getHideTitle(),
128
					'hideAuthor' => $section->getHideAuthor(),
130
					'hideAuthor' => $section->getHideAuthor(),
129
					'hideAbout' => $section->getHideAbout(),
131
					'hideAbout' => $section->getHideAbout(),
132
					'disableComments' => $section->getDisableComments(),
130
					'policy' => $section->getPolicy(null), // Localized
133
					'policy' => $section->getPolicy(null), // Localized
131
					'assignedEditors' => $sectionEditorsDao->getEditorsBySectionId($journal->getJournalId(), $this->sectionId),
134
					'assignedEditors' => $sectionEditorsDao->getEditorsBySectionId($journal->getJournalId(), $this->sectionId),
132
					'unassignedEditors' => $sectionEditorsDao->getEditorsNotInSection($journal->getJournalId(), $this->sectionId)
135
					'unassignedEditors' => $sectionEditorsDao->getEditorsNotInSection($journal->getJournalId(), $this->sectionId)
 Lines 139-145    Link Here 
139
	 * Assign form data to user-submitted data.
142
	 * Assign form data to user-submitted data.
140
	 */
143
	 */
141
	function readInputData() {
144
	function readInputData() {
142
		$this->readUserVars(array('title', 'abbrev', 'policy', 'identifyType', 'metaIndexed', 'metaReviewed', 'abstractsNotRequired', 'editorRestriction', 'hideTitle', 'hideAuthor', 'hideAbout'));
145
		$this->readUserVars(array('title', 'abbrev', 'policy', 'identifyType', 'metaIndexed', 'metaReviewed', 'abstractsNotRequired', 'editorRestriction', 'hideTitle', 'hideAuthor', 'hideAbout', 'disableComments'));
143
		$assignedEditorIds = Request::getUserVar('assignedEditorIds');
146
		$assignedEditorIds = Request::getUserVar('assignedEditorIds');
144
		if (empty($assignedEditorIds)) $assignedEditorIds = array();
147
		if (empty($assignedEditorIds)) $assignedEditorIds = array();
145
		elseif (!is_array($assignedEditorIds)) $assignedEditorIds = array($assignedEditorIds);
148
		elseif (!is_array($assignedEditorIds)) $assignedEditorIds = array($assignedEditorIds);
 Lines 198-203    Link Here 
198
		$section->setHideTitle($this->getData('hideTitle') ? 1 : 0);
201
		$section->setHideTitle($this->getData('hideTitle') ? 1 : 0);
199
		$section->setHideAuthor($this->getData('hideAuthor') ? 1 : 0);
202
		$section->setHideAuthor($this->getData('hideAuthor') ? 1 : 0);
200
		$section->setHideAbout($this->getData('hideAbout') ? 1 : 0);
203
		$section->setHideAbout($this->getData('hideAbout') ? 1 : 0);
204
		$section->setDisableComments($this->getData('disableComments') ? 1 : 0);
201
		$section->setPolicy($this->getData('policy'), null); // Localized
205
		$section->setPolicy($this->getData('policy'), null); // Localized
202
206
203
		if ($section->getSectionId() != null) {
207
		if ($section->getSectionId() != null) {
(-)ojs2/classes/submission/sectionEditor/SectionEditorAction.inc.php:1.161 (-1 / +14 lines)
 Lines 11-17    Link Here 
11
 *
11
 *
12
 * SectionEditorAction class.
12
 * SectionEditorAction class.
13
 *
13
 *
14
 * $Id: SectionEditorAction.inc.php,v 1.161 2008/06/11 20:57:32 asmecher Exp $
14
 * $Id: SectionEditorAction.inc.php,v 1.162 2008/06/18 19:52:59 michael Exp $
15
 */
15
 */
16
16
17
import('submission.common.Action');
17
import('submission.common.Action');
 Lines 1344-1349    Link Here 
1344
		$submissionDao->updateSectionEditorSubmission($submission);
1344
		$submissionDao->updateSectionEditorSubmission($submission);
1345
	}
1345
	}
1346
1346
1347
	/**
1348
	 * Changes the submission RT comments status.
1349
	 * @param $submission object
1350
	 * @param $commentsStatus int
1351
	 */
1352
	function updateCommentsStatus($submission, $commentsStatus) {
1353
		if (HookRegistry::call('SectionEditorAction::updateCommentsStatus', array(&$submission, &$commentsStatus))) return;
1354
1355
		$submissionDao = &DAORegistry::getDAO('SectionEditorSubmissionDAO');
1356
		$submission->setCommentsStatus($commentsStatus); // FIXME validate this?
1357
		$submissionDao->updateSectionEditorSubmission($submission);
1358
	}
1359
1347
	//
1360
	//
1348
	// Layout Editing
1361
	// Layout Editing
1349
	//
1362
	//
(-)ojs2/classes/submission/sectionEditor/SectionEditorSubmissionDAO.inc.php:1.90 (-1 / +2 lines)
 Lines 12-18    Link Here 
12
 * Class for SectionEditorSubmission DAO.
12
 * Class for SectionEditorSubmission DAO.
13
 * Operations for retrieving and modifying SectionEditorSubmission objects.
13
 * Operations for retrieving and modifying SectionEditorSubmission objects.
14
 *
14
 *
15
 * $Id: SectionEditorSubmissionDAO.inc.php,v 1.90 2008/06/11 18:54:57 asmecher Exp $
15
 * $Id: SectionEditorSubmissionDAO.inc.php,v 1.91 2008/06/18 19:52:59 michael Exp $
16
 */
16
 */
17
17
18
import('submission.sectionEditor.SectionEditorSubmission');
18
import('submission.sectionEditor.SectionEditorSubmission');
 Lines 342-347    Link Here 
342
			$article->setCopyeditFileId($sectionEditorSubmission->getCopyeditFileId());
342
			$article->setCopyeditFileId($sectionEditorSubmission->getCopyeditFileId());
343
			$article->setDateStatusModified($sectionEditorSubmission->getDateStatusModified());
343
			$article->setDateStatusModified($sectionEditorSubmission->getDateStatusModified());
344
			$article->setLastModified($sectionEditorSubmission->getLastModified());
344
			$article->setLastModified($sectionEditorSubmission->getLastModified());
345
			$article->setCommentsStatus($sectionEditorSubmission->getCommentsStatus());
345
346
346
			$this->articleDao->updateArticle($article);
347
			$this->articleDao->updateArticle($article);
347
		}
348
		}
(-)ojs2/dbscripts/xml/ojs_schema.xml:1.160 (-1 / +9 lines)
 Lines 9-15    Link Here 
9
  *
9
  *
10
  * OJS database schema in XML.
10
  * OJS database schema in XML.
11
  *
11
  *
12
  * $Id: ojs_schema.xml,v 1.160 2008/06/17 23:13:42 asmecher Exp $
12
  * $Id: ojs_schema.xml,v 1.161 2008/06/18 19:52:59 michael Exp $
13
  -->
13
  -->
14
14
15
<schema version="0.2">
15
<schema version="0.2">
 Lines 610-615    Link Here 
610
			<NOTNULL/>
610
			<NOTNULL/>
611
			<DEFAULT VALUE="0"/>
611
			<DEFAULT VALUE="0"/>
612
		</field>
612
		</field>
613
		<field name="disable_comments" type="I1">
614
			<NOTNULL/>
615
			<DEFAULT VALUE="0"/>
616
		</field>
613
		<descr>Journal sections.</descr>
617
		<descr>Journal sections.</descr>
614
		<index name="sections_journal_id">
618
		<index name="sections_journal_id">
615
			<col>journal_id</col>
619
			<col>journal_id</col>
 Lines 874-879    Link Here 
874
			<NOTNULL/>
878
			<NOTNULL/>
875
			<DEFAULT VALUE="0"/>
879
			<DEFAULT VALUE="0"/>
876
		</field>
880
		</field>
881
		<field name="comments_status" type="I1">
882
			<NOTNULL/>
883
			<DEFAULT VALUE="0"/>
884
		</field>
877
		<descr>Journal articles.</descr>
885
		<descr>Journal articles.</descr>
878
		<index name="articles_user_id">
886
		<index name="articles_user_id">
879
			<col>user_id</col>
887
			<col>user_id</col>
(-)ojs2/dbscripts/xml/upgrade/2.2.1_update.xml:1.7 (-1 / +20 lines)
 Lines 9-15    Link Here 
9
  *
9
  *
10
  * 2.2.1 database updates XML file.
10
  * 2.2.1 database updates XML file.
11
  *
11
  *
12
  * $Id: 2.2.1_update.xml,v 1.7 2008/06/17 19:36:56 michael Exp $
12
  * $Id: 2.2.1_update.xml,v 1.8 2008/06/18 19:52:59 michael Exp $
13
  -->
13
  -->
14
<data>
14
<data>
15
	<!-- Bug #3289: Allow for suppression of author infomation in ToC -->
15
	<!-- Bug #3289: Allow for suppression of author infomation in ToC -->
 Lines 90-93    Link Here 
90
			ALTER TABLE issues RENAME COLUMN number_new TO number
90
			ALTER TABLE issues RENAME COLUMN number_new TO number
91
		</query>
91
		</query>
92
	</sql>
92
	</sql>
93
94
	<!-- Bug #3293: Enable user comments on a per section/article basis -->
95
	<sql>
96
		<!-- Syntax for MySQL. -->
97
		<query driver="mysql">
98
			ALTER TABLE sections ADD COLUMN disable_comments TINYINT NOT NULL DEFAULT 0
99
		</query>
100
		<query driver="mysql">
101
			ALTER TABLE articles ADD COLUMN comments_status TINYINT NOT NULL DEFAULT 0
102
		</query>
103
104
		<!-- Syntax for PostgreSQL. -->
105
		<query driver="postgres7">
106
			ALTER TABLE sections ADD COLUMN disable_comments SMALLINT NOT NULL DEFAULT 0
107
		</query>
108
		<query driver="postgres7">
109
			ALTER TABLE articles ADD COLUMN comments_status SMALLINT NOT NULL DEFAULT 0
110
		</query>
111
	</sql>
93
</data>
112
</data>
(-)ojs2/locale/en_US/locale.xml:1.600 (-1 / +6 lines)
 Lines 9-15    Link Here 
9
  *
9
  *
10
  * Localization strings for the en_US (U.S. English) locale.
10
  * Localization strings for the en_US (U.S. English) locale.
11
  *
11
  *
12
  * $Id: locale.xml,v 1.600 2008/06/17 23:13:42 asmecher Exp $
12
  * $Id: locale.xml,v 1.601 2008/06/18 19:52:59 michael Exp $
13
  -->
13
  -->
14
 
14
 
15
<locale name="en_US" full_name="U.S. English">
15
<locale name="en_US" full_name="U.S. English">
 Lines 367-372    Link Here 
367
	<message key="article.coverPage.altText">Cover Image</message>
367
	<message key="article.coverPage.altText">Cover Image</message>
368
	<message key="article.accessLogoOpen.altText">Open Access</message>
368
	<message key="article.accessLogoOpen.altText">Open Access</message>
369
	<message key="article.accessLogoRestricted.altText">Restricted Access</message>
369
	<message key="article.accessLogoRestricted.altText">Restricted Access</message>
370
	<message key="article.comments.sectionDefault">Default</message>
371
	<message key="article.comments.disable">Disable</message>
372
	<message key="article.comments.enable">Enable</message>
370
373
371
	<!-- Submission Tracking - Common -->
374
	<!-- Submission Tracking - Common -->
372
	<message key="submission.summary">Summary</message>
375
	<message key="submission.summary">Summary</message>
 Lines 386-391    Link Here 
386
	<message key="submission.addSuppFile">Add a Supplementary File</message>
389
	<message key="submission.addSuppFile">Add a Supplementary File</message>
387
	<message key="submission.submitter">Submitter</message>
390
	<message key="submission.submitter">Submitter</message>
388
	<message key="submission.changeSection">Change to</message>
391
	<message key="submission.changeSection">Change to</message>
392
	<message key="submission.changeComments">Change to</message>
389
	<message key="submission.initiated">Initiated</message>
393
	<message key="submission.initiated">Initiated</message>
390
	<message key="submission.lastModified">Last modified</message>
394
	<message key="submission.lastModified">Last modified</message>
391
	<message key="submission.ask">Ask</message>
395
	<message key="submission.ask">Ask</message>
 Lines 1381-1386    Link Here 
1381
	<message key="manager.sections.hideTocTitle">Omit the title of this section from issues' table of contents.</message>
1385
	<message key="manager.sections.hideTocTitle">Omit the title of this section from issues' table of contents.</message>
1382
	<message key="manager.sections.hideTocAuthor">Omit author names for section items from issues' table of contents.</message>
1386
	<message key="manager.sections.hideTocAuthor">Omit author names for section items from issues' table of contents.</message>
1383
	<message key="manager.sections.hideAbout">Omit this section from About the Journal.</message>
1387
	<message key="manager.sections.hideAbout">Omit this section from About the Journal.</message>
1388
	<message key="manager.sections.disableComments">Disable reader comments for this section.</message>
1384
	<message key="manager.sections.readingTools">Reading Tools</message>
1389
	<message key="manager.sections.readingTools">Reading Tools</message>
1385
	<message key="manager.sections.indexed">Indexed</message>
1390
	<message key="manager.sections.indexed">Indexed</message>
1386
	<message key="manager.sections.reviewed">Peer Reviewed</message>
1391
	<message key="manager.sections.reviewed">Peer Reviewed</message>
(-)ojs2/pages/article/ArticleHandler.inc.php:1.77 (-5 / +8 lines)
 Lines 11-17    Link Here 
11
 *
11
 *
12
 * Handle requests for article functions. 
12
 * Handle requests for article functions. 
13
 *
13
 *
14
 * $Id: ArticleHandler.inc.php,v 1.77 2008/06/11 18:55:07 asmecher Exp $
14
 * $Id: ArticleHandler.inc.php,v 1.78 2008/06/18 19:52:59 michael Exp $
15
 */
15
 */
16
16
17
import('rt.ojs.RTDAO');
17
import('rt.ojs.RTDAO');
 Lines 143-149    Link Here 
143
143
144
		$commentDao = &DAORegistry::getDAO('CommentDAO');
144
		$commentDao = &DAORegistry::getDAO('CommentDAO');
145
		$enableComments = $journal->getSetting('enableComments');
145
		$enableComments = $journal->getSetting('enableComments');
146
		if ($enableComments == COMMENTS_AUTHENTICATED || $enableComments == COMMENTS_UNAUTHENTICATED || $enableComments == COMMENTS_ANONYMOUS) {
146
147
		if (($article->getEnableComments()) && ($enableComments == COMMENTS_AUTHENTICATED || $enableComments == COMMENTS_UNAUTHENTICATED || $enableComments == COMMENTS_ANONYMOUS)) {
147
			$comments = &$commentDao->getRootCommentsByArticleId($article->getArticleId());
148
			$comments = &$commentDao->getRootCommentsByArticleId($article->getArticleId());
148
		}
149
		}
149
150
 Lines 208-217    Link Here 
208
		$templateMgr->assign_by_ref('section', $section);
209
		$templateMgr->assign_by_ref('section', $section);
209
		$templateMgr->assign('articleId', $articleId);
210
		$templateMgr->assign('articleId', $articleId);
210
		$templateMgr->assign('postingAllowed', (
211
		$templateMgr->assign('postingAllowed', (
212
			($article->getEnableComments()) && (
211
			$enableComments == COMMENTS_UNAUTHENTICATED ||
213
			$enableComments == COMMENTS_UNAUTHENTICATED ||
212
			(($enableComments == COMMENTS_AUTHENTICATED ||
214
			(($enableComments == COMMENTS_AUTHENTICATED ||
213
			$enableComments == COMMENTS_ANONYMOUS) &&
215
			$enableComments == COMMENTS_ANONYMOUS) &&
214
			Validation::isLoggedIn())
216
			Validation::isLoggedIn()))
215
		));
217
		));
216
		$templateMgr->assign('galleyId', $galleyId);
218
		$templateMgr->assign('galleyId', $galleyId);
217
		$templateMgr->assign('defineTermsContextId', isset($defineTermsContextId)?$defineTermsContextId:null);
219
		$templateMgr->assign('defineTermsContextId', isset($defineTermsContextId)?$defineTermsContextId:null);
 Lines 265-276    Link Here 
265
267
266
		$enableComments = $journal->getSetting('enableComments');
268
		$enableComments = $journal->getSetting('enableComments');
267
		$templateMgr->assign('postingAllowed', (
269
		$templateMgr->assign('postingAllowed', (
270
			($article->getEnableComments()) && (
268
			$enableComments == COMMENTS_UNAUTHENTICATED ||
271
			$enableComments == COMMENTS_UNAUTHENTICATED ||
269
			(($enableComments == COMMENTS_AUTHENTICATED ||
272
			(($enableComments == COMMENTS_AUTHENTICATED ||
270
			$enableComments == COMMENTS_ANONYMOUS) &&
273
			$enableComments == COMMENTS_ANONYMOUS) &&
271
			Validation::isLoggedIn())
274
			Validation::isLoggedIn()))
272
		));
275
		));
273
		$templateMgr->assign('postingDisabled', $enableComments == COMMENTS_DISABLED);
276
		$templateMgr->assign('postingDisabled', (!$article->getEnableComments() || $enableComments == COMMENTS_DISABLED));
274
277
275
		$templateMgr->assign_by_ref('journalRt', $journalRt);
278
		$templateMgr->assign_by_ref('journalRt', $journalRt);
276
		if ($journalRt->getEnabled()) {
279
		if ($journalRt->getEnabled()) {
(-)ojs2/pages/comment/CommentHandler.inc.php:1.25 (-5 / +5 lines)
 Lines 11-17    Link Here 
11
 *
11
 *
12
 * Handle requests for user comments.
12
 * Handle requests for user comments.
13
 *
13
 *
14
 * $Id: CommentHandler.inc.php,v 1.25 2008/06/11 18:55:07 asmecher Exp $
14
 * $Id: CommentHandler.inc.php,v 1.26 2008/06/18 19:53:00 michael Exp $
15
 */
15
 */
16
16
17
import('rt.ojs.RTDAO');
17
import('rt.ojs.RTDAO');
 Lines 137-148    Link Here 
137
		$journalId = $journal->getJournalId();
137
		$journalId = $journal->getJournalId();
138
		$journalSettingsDao = &DAORegistry::getDAO('JournalSettingsDAO');
138
		$journalSettingsDao = &DAORegistry::getDAO('JournalSettingsDAO');
139
139
140
		$publishedArticleDao = &DAORegistry::getDAO('PublishedArticleDAO');
141
		$article = &$publishedArticleDao->getPublishedArticleByArticleId($articleId);
142
140
		// Bring in comment constants
143
		// Bring in comment constants
141
		$commentDao = &DAORegistry::getDAO('CommentDAO');
144
		$commentDao = &DAORegistry::getDAO('CommentDAO');
142
145
143
		$enableComments = $journal->getSetting('enableComments');
146
		$enableComments = $journal->getSetting('enableComments');
144
147
145
		if (!Validation::isLoggedIn() && $journalSettingsDao->getSetting($journalId,'restrictArticleAccess') || ($enableComments != COMMENTS_ANONYMOUS && $enableComments != COMMENTS_AUTHENTICATED && $enableComments != COMMENTS_UNAUTHENTICATED)) {
148
		if ((!Validation::isLoggedIn() && $journalSettingsDao->getSetting($journalId,'restrictArticleAccess')) || (!$article->getEnableComments()) || ($enableComments != COMMENTS_ANONYMOUS && $enableComments != COMMENTS_AUTHENTICATED && $enableComments != COMMENTS_UNAUTHENTICATED)) {
146
			Validation::redirectLogin();
149
			Validation::redirectLogin();
147
		}
150
		}
148
151
 Lines 150-158    Link Here 
150
		$issueDao = &DAORegistry::getDAO('IssueDAO');
153
		$issueDao = &DAORegistry::getDAO('IssueDAO');
151
		$issue = &$issueDao->getIssueByArticleId($articleId);
154
		$issue = &$issueDao->getIssueByArticleId($articleId);
152
155
153
		$publishedArticleDao = &DAORegistry::getDAO('PublishedArticleDAO');
154
		$article = &$publishedArticleDao->getPublishedArticleByArticleId($articleId);
155
156
		if (isset($issue) && isset($article)) {
156
		if (isset($issue) && isset($article)) {
157
			import('issue.IssueAction');
157
			import('issue.IssueAction');
158
			$subscriptionRequired = IssueAction::subscriptionRequired($issue);
158
			$subscriptionRequired = IssueAction::subscriptionRequired($issue);
(-)ojs2/pages/sectionEditor/SectionEditorHandler.inc.php:1.94 (-1 / +5 lines)
 Lines 11-17    Link Here 
11
 *
11
 *
12
 * Handle requests for section editor functions. 
12
 * Handle requests for section editor functions. 
13
 *
13
 *
14
 * $Id: SectionEditorHandler.inc.php,v 1.94 2008/06/11 20:57:32 asmecher Exp $
14
 * $Id: SectionEditorHandler.inc.php,v 1.95 2008/06/18 19:53:00 michael Exp $
15
 */
15
 */
16
16
17
import('submission.sectionEditor.SectionEditorAction');
17
import('submission.sectionEditor.SectionEditorAction');
 Lines 430-435    Link Here 
430
		SubmissionEditHandler::updateSection($args);
430
		SubmissionEditHandler::updateSection($args);
431
	}
431
	}
432
432
433
	function updateCommentsStatus($args) {
434
		import('pages.sectionEditor.SubmissionEditHandler');
435
		SubmissionEditHandler::updateCommentsStatus($args);
436
	}
433
437
434
	//
438
	//
435
	// Layout Editing
439
	// Layout Editing
(-)ojs2/pages/sectionEditor/SubmissionEditHandler.inc.php:1.75 (-1 / +19 lines)
 Lines 11-17    Link Here 
11
 *
11
 *
12
 * Handle requests for submission tracking. 
12
 * Handle requests for submission tracking. 
13
 *
13
 *
14
 * $Id: SubmissionEditHandler.inc.php,v 1.75 2008/06/17 23:13:42 asmecher Exp $
14
 * $Id: SubmissionEditHandler.inc.php,v 1.76 2008/06/18 19:53:00 michael Exp $
15
 */
15
 */
16
16
17
define('SECTION_EDITOR_ACCESS_EDIT', 0x00001);
17
define('SECTION_EDITOR_ACCESS_EDIT', 0x00001);
 Lines 40-45    Link Here 
40
		$sectionDao = &DAORegistry::getDAO('SectionDAO');
40
		$sectionDao = &DAORegistry::getDAO('SectionDAO');
41
		$section = &$sectionDao->getSection($submission->getSectionId());
41
		$section = &$sectionDao->getSection($submission->getSectionId());
42
42
43
		$enableComments = $journal->getSetting('enableComments');
44
43
		$templateMgr = &TemplateManager::getManager();
45
		$templateMgr = &TemplateManager::getManager();
44
46
45
		$templateMgr->assign_by_ref('submission', $submission);
47
		$templateMgr->assign_by_ref('submission', $submission);
 Lines 51-59    Link Here 
51
		$templateMgr->assign_by_ref('journalSettings', $journalSettings);
53
		$templateMgr->assign_by_ref('journalSettings', $journalSettings);
52
		$templateMgr->assign('userId', $user->getUserId());
54
		$templateMgr->assign('userId', $user->getUserId());
53
		$templateMgr->assign('isEditor', $isEditor);
55
		$templateMgr->assign('isEditor', $isEditor);
56
		$templateMgr->assign('enableComments', $enableComments);
54
57
55
		$sectionDao = &DAORegistry::getDAO('SectionDAO');
58
		$sectionDao = &DAORegistry::getDAO('SectionDAO');
56
		$templateMgr->assign_by_ref('sections', $sectionDao->getSectionTitles($journal->getJournalId()));
59
		$templateMgr->assign_by_ref('sections', $sectionDao->getSectionTitles($journal->getJournalId()));
60
		if ($enableComments) {
61
			import('article.Article');
62
			$templateMgr->assign('commentsStatus', $submission->getCommentsStatus());
63
			$templateMgr->assign_by_ref('commentsStatusOptions', Article::getCommentsStatusOptions());
64
		}
57
65
58
		$publishedArticleDao = &DAORegistry::getDAO('PublishedArticleDAO');
66
		$publishedArticleDao = &DAORegistry::getDAO('PublishedArticleDAO');
59
		$publishedArticle = &$publishedArticleDao->getPublishedArticleByArticleId($submission->getArticleId());
67
		$publishedArticle = &$publishedArticleDao->getPublishedArticleByArticleId($submission->getArticleId());
 Lines 1278-1283    Link Here 
1278
		Request::redirect(null, null, 'submission', $articleId);
1286
		Request::redirect(null, null, 'submission', $articleId);
1279
	}
1287
	}
1280
1288
1289
	/**
1290
	 * Set RT comments status for article.
1291
	 * @param $args array ($articleId)
1292
	 */
1293
	function updateCommentsStatus($args) {
1294
		$articleId = isset($args[0]) ? (int) $args[0] : 0;
1295
		list($journal, $submission) = SubmissionEditHandler::validate($articleId);		
1296
		SectionEditorAction::updateCommentsStatus($submission, Request::getUserVar('commentsStatus'));
1297
		Request::redirect(null, null, 'submission', $articleId);
1298
	}
1281
1299
1282
	//
1300
	//
1283
	// Layout Editing
1301
	// Layout Editing
(-)ojs2/templates/manager/sections/sectionForm.tpl:1.40 (-1 / +10 lines)
 Lines 6-12    Link Here 
6
 *
6
 *
7
 * Form to create/modify a journal section.
7
 * Form to create/modify a journal section.
8
 *
8
 *
9
 * $Id: sectionForm.tpl,v 1.40 2008/06/17 16:27:38 asmecher Exp $
9
 * $Id: sectionForm.tpl,v 1.41 2008/06/18 19:53:00 michael Exp $
10
 *}
10
 *}
11
{assign var="pageTitle" value="section.section"}
11
{assign var="pageTitle" value="section.section"}
12
{assign var="pageCrumbTitle" value="section.sections"}
12
{assign var="pageCrumbTitle" value="section.sections"}
 Lines 118-123    Link Here 
118
		{fieldLabel name="hideAbout" key="manager.sections.hideAbout"}
118
		{fieldLabel name="hideAbout" key="manager.sections.hideAbout"}
119
	</td>
119
	</td>
120
</tr>
120
</tr>
121
{if $commentsEnabled}
122
<tr valign="top">
123
	<td class="label">{fieldLabel name="disableComments" key="comments.readerComments"}</td>
124
	<td class="value">
125
		<input type="checkbox" name="disableComments" id="disableComments" value="1" {if $disableComments}checked="checked"{/if} />
126
		{fieldLabel name="disableComments" key="manager.sections.disableComments"}
127
	</td>
128
</tr>
129
{/if}
121
</table>
130
</table>
122
<div class="separator"></div>
131
<div class="separator"></div>
123
132
(-)ojs2/templates/sectionEditor/submission/status.tpl:1.19 (-1 / +8 lines)
 Lines 6-12    Link Here 
6
 *
6
 *
7
 * Subtemplate defining the submission status table.
7
 * Subtemplate defining the submission status table.
8
 *
8
 *
9
 * $Id: status.tpl,v 1.19 2008/06/11 18:55:22 asmecher Exp $
9
 * $Id: status.tpl,v 1.20 2008/06/18 19:53:00 michael Exp $
10
 *}
10
 *}
11
<a name="status"></a>
11
<a name="status"></a>
12
<h3>{translate key="common.status"}</h3>
12
<h3>{translate key="common.status"}</h3>
 Lines 40-43    Link Here 
40
		<td class="label">{translate key="submission.lastModified"}</td>
40
		<td class="label">{translate key="submission.lastModified"}</td>
41
		<td colspan="2" class="value">{$submission->getLastModified()|date_format:$dateFormatShort}</td>
41
		<td colspan="2" class="value">{$submission->getLastModified()|date_format:$dateFormatShort}</td>
42
	</tr>
42
	</tr>
43
{if $enableComments}
44
	<tr>
45
		<td class="label">{translate key="comments.readerComments"}</td>
46
		<td class="value">{translate key=$submission->getCommentsStatusString()}</td>
47
		<td class="value"><form action="{url op="updateCommentsStatus" path=$submission->getArticleId()}" method="post">{translate key="submission.changeComments"} <select name="commentsStatus" size="1" class="selectMenu">{html_options_translate options=$commentsStatusOptions selected=$submission->getCommentsStatus()}</select> <input type="submit" value="{translate key="common.record"}" class="button" /></form></td>
48
	</tr>
49
{/if}
43
</table>
50
</table>

Return to bug 3293