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

Collapse All | Expand All

(-)classes/submission/editor/EditorSubmissionDAO.inc.php (-10 / +10 lines)
 Lines 294-301    Link Here 
294
				LEFT JOIN edit_assignments ea ON (a.article_id = ea.article_id)
294
				LEFT JOIN edit_assignments ea ON (a.article_id = ea.article_id)
295
				LEFT JOIN edit_assignments ea2 ON (a.article_id = ea2.article_id AND ea.edit_id < ea2.edit_id)
295
				LEFT JOIN edit_assignments ea2 ON (a.article_id = ea2.article_id AND ea.edit_id < ea2.edit_id)
296
				LEFT JOIN edit_decisions edec ON (a.article_id = edec.article_id)
296
				LEFT JOIN edit_decisions edec ON (a.article_id = edec.article_id)
297
				LEFT JOIN edit_decisions edec2 ON (a.article_id = edec2.article_id AND edec.date_decided < edec2.date_decided)
297
				LEFT JOIN edit_decisions edec2 ON (a.article_id = edec2.article_id AND edec.edit_decision_id < edec2.edit_decision_id)
298
			WHERE	edec2.date_decided IS NULL
298
			WHERE	edec2.edit_decision_id IS NULL
299
				AND ea2.edit_id IS NULL
299
				AND ea2.edit_id IS NULL
300
				AND a.journal_id = ?
300
				AND a.journal_id = ?
301
				AND a.submission_progress = 0' .
301
				AND a.submission_progress = 0' .
 Lines 385-391    Link Here 
385
			$journalId, $sectionId, $editorId,
385
			$journalId, $sectionId, $editorId,
386
			$searchField, $searchMatch, $search,
386
			$searchField, $searchMatch, $search,
387
			$dateField, $dateFrom, $dateTo,
387
			$dateField, $dateFrom, $dateTo,
388
			'a.status = ' . STATUS_QUEUED . ' AND ea.edit_id IS NOT NULL AND edec.decision <> ' . SUBMISSION_EDITOR_DECISION_ACCEPT,
388
			'a.status = ' . STATUS_QUEUED . ' AND ea.edit_id IS NOT NULL AND (edec.decision IS NULL OR edec.decision <> ' . SUBMISSION_EDITOR_DECISION_ACCEPT . ')',
389
			$rangeInfo, $sortBy, $sortDirection
389
			$rangeInfo, $sortBy, $sortDirection
390
		);
390
		);
391
		$returner = new DAOResultFactory($result, $this, '_returnEditorSubmissionFromRow');
391
		$returner = new DAOResultFactory($result, $this, '_returnEditorSubmissionFromRow');
 Lines 482-495    Link Here 
482
				LEFT JOIN edit_assignments e ON (a.article_id = e.article_id)
482
				LEFT JOIN edit_assignments e ON (a.article_id = e.article_id)
483
				LEFT JOIN edit_assignments e2 ON (a.article_id = e2.article_id AND e.edit_id < e2.edit_id)
483
				LEFT JOIN edit_assignments e2 ON (a.article_id = e2.article_id AND e.edit_id < e2.edit_id)
484
				LEFT JOIN edit_decisions d ON (a.article_id = d.article_id)
484
				LEFT JOIN edit_decisions d ON (a.article_id = d.article_id)
485
				LEFT JOIN edit_decisions d2 ON (a.article_id = d2.article_id AND d.date_decided < d2.date_decided)
485
				LEFT JOIN edit_decisions d2 ON (a.article_id = d2.article_id AND d.edit_decision_id < d2.edit_decision_id)
486
			WHERE	a.journal_id = ?
486
			WHERE	a.journal_id = ?
487
				AND a.submission_progress = 0
487
				AND a.submission_progress = 0
488
				AND a.status = ' . STATUS_QUEUED . '
488
				AND a.status = ' . STATUS_QUEUED . '
489
				AND e2.edit_id IS NULL
489
				AND e2.edit_id IS NULL
490
				AND e.edit_id IS NOT NULL
490
				AND e.edit_id IS NOT NULL
491
				AND d2.date_decided IS NULL
491
				AND d2.edit_decision_id IS NULL
492
				AND d.decision <> ' . SUBMISSION_EDITOR_DECISION_ACCEPT,
492
				AND (d.decision IS NULL OR d.decision <> ' . SUBMISSION_EDITOR_DECISION_ACCEPT . ')',
493
			array((int) $journalId)
493
			array((int) $journalId)
494
		);
494
		);
495
		$submissionsCount[1] = $result->Fields('review_count');
495
		$submissionsCount[1] = $result->Fields('review_count');
 Lines 506-518    Link Here 
506
				LEFT JOIN edit_assignments e ON (a.article_id = e.article_id)
506
				LEFT JOIN edit_assignments e ON (a.article_id = e.article_id)
507
				LEFT JOIN edit_assignments e2 ON (a.article_id = e2.article_id AND e.edit_id < e2.edit_id)
507
				LEFT JOIN edit_assignments e2 ON (a.article_id = e2.article_id AND e.edit_id < e2.edit_id)
508
				LEFT JOIN edit_decisions d ON (a.article_id = d.article_id)
508
				LEFT JOIN edit_decisions d ON (a.article_id = d.article_id)
509
				LEFT JOIN edit_decisions d2 ON (a.article_id = d2.article_id AND d.date_decided < d2.date_decided)
509
				LEFT JOIN edit_decisions d2 ON (a.article_id = d2.article_id AND d.edit_decision_id < d2.edit_decision_id)
510
			WHERE	a.journal_id = ?
510
			WHERE	a.journal_id = ?
511
				AND a.submission_progress = 0
511
				AND a.submission_progress = 0
512
				AND a.status = ' . STATUS_QUEUED . '
512
				AND a.status = ' . STATUS_QUEUED . '
513
				AND e2.edit_id IS NULL
513
				AND e2.edit_id IS NULL
514
				AND e.edit_id IS NOT NULL
514
				AND e.edit_id IS NOT NULL
515
				AND d2.date_decided IS NULL
515
				AND d2.edit_decision_id IS NULL
516
				AND d.decision = ' . SUBMISSION_EDITOR_DECISION_ACCEPT,
516
				AND d.decision = ' . SUBMISSION_EDITOR_DECISION_ACCEPT,
517
			array((int) $journalId)
517
			array((int) $journalId)
518
		);
518
		);
 Lines 536-546    Link Here 
536
536
537
		if ($round == null) {
537
		if ($round == null) {
538
			$result =& $this->retrieve(
538
			$result =& $this->retrieve(
539
				'SELECT edit_decision_id, editor_id, decision, date_decided FROM edit_decisions WHERE article_id = ? ORDER BY date_decided ASC', $articleId
539
				'SELECT edit_decision_id, editor_id, decision, date_decided FROM edit_decisions WHERE article_id = ? ORDER BY edit_decision_id ASC', $articleId
540
			);
540
			);
541
		} else {
541
		} else {
542
			$result =& $this->retrieve(
542
			$result =& $this->retrieve(
543
				'SELECT edit_decision_id, editor_id, decision, date_decided FROM edit_decisions WHERE article_id = ? AND round = ? ORDER BY date_decided ASC',
543
				'SELECT edit_decision_id, editor_id, decision, date_decided FROM edit_decisions WHERE article_id = ? AND round = ? ORDER BY edit_decision_id ASC',
544
				array($articleId, $round)
544
				array($articleId, $round)
545
			);
545
			);
546
		}
546
		}
(-)classes/submission/sectionEditor/SectionEditorSubmissionDAO.inc.php (-10 / +10 lines)
 Lines 470-480    Link Here 
470
				LEFT JOIN article_settings atpl ON (atpl.article_id = a.article_id AND atpl.setting_name = ? AND atpl.locale = ?)
470
				LEFT JOIN article_settings atpl ON (atpl.article_id = a.article_id AND atpl.setting_name = ? AND atpl.locale = ?)
471
				LEFT JOIN article_settings atl ON (a.article_id = atl.article_id AND atl.setting_name = ? AND atl.locale = ?)
471
				LEFT JOIN article_settings atl ON (a.article_id = atl.article_id AND atl.setting_name = ? AND atl.locale = ?)
472
				LEFT JOIN edit_decisions edec ON (a.article_id = edec.article_id)
472
				LEFT JOIN edit_decisions edec ON (a.article_id = edec.article_id)
473
				LEFT JOIN edit_decisions edec2 ON (a.article_id = edec2.article_id AND edec.date_decided < edec2.date_decided)
473
				LEFT JOIN edit_decisions edec2 ON (a.article_id = edec2.article_id AND edec.edit_decision_id < edec2.edit_decision_id)
474
			WHERE	a.journal_id = ?
474
			WHERE	a.journal_id = ?
475
				AND e.editor_id = ?
475
				AND e.editor_id = ?
476
				AND a.submission_progress = 0' . (!empty($additionalWhereSql)?" AND ($additionalWhereSql)":'') . '
476
				AND a.submission_progress = 0' . (!empty($additionalWhereSql)?" AND ($additionalWhereSql)":'') . '
477
				AND edec2.date_decided IS NULL';
477
				AND edec2.edit_decision_id IS NULL';
478
478
479
		if ($sectionId) {
479
		if ($sectionId) {
480
			$params[] = $sectionId;
480
			$params[] = $sectionId;
 Lines 507-513    Link Here 
507
			$sectionEditorId, $journalId, $sectionId,
507
			$sectionEditorId, $journalId, $sectionId,
508
			$searchField, $searchMatch, $search,
508
			$searchField, $searchMatch, $search,
509
			$dateField, $dateFrom, $dateTo,
509
			$dateField, $dateFrom, $dateTo,
510
			'a.status = ' . STATUS_QUEUED . ' AND e.can_review = 1 AND edec.decision <> ' . SUBMISSION_EDITOR_DECISION_ACCEPT,
510
			'a.status = ' . STATUS_QUEUED . ' AND e.can_review = 1 AND (edec.decision IS NULL OR edec.decision <> ' . SUBMISSION_EDITOR_DECISION_ACCEPT . ')',
511
			$rangeInfo, $sortBy, $sortDirection
511
			$rangeInfo, $sortBy, $sortDirection
512
		);
512
		);
513
		$returner = new DAOResultFactory($result, $this, '_returnSectionEditorSubmissionFromRow');
513
		$returner = new DAOResultFactory($result, $this, '_returnSectionEditorSubmissionFromRow');
 Lines 581-593    Link Here 
581
			FROM	articles a
581
			FROM	articles a
582
				LEFT JOIN edit_assignments e ON (a.article_id = e.article_id)
582
				LEFT JOIN edit_assignments e ON (a.article_id = e.article_id)
583
				LEFT JOIN edit_decisions d ON (a.article_id = d.article_id)
583
				LEFT JOIN edit_decisions d ON (a.article_id = d.article_id)
584
				LEFT JOIN edit_decisions d2 ON (a.article_id = d2.article_id AND d.date_decided < d2.date_decided)
584
				LEFT JOIN edit_decisions d2 ON (a.article_id = d2.article_id AND d.edit_decision_id < d2.edit_decision_id)
585
			WHERE	a.journal_id = ?
585
			WHERE	a.journal_id = ?
586
				AND e.editor_id = ?
586
				AND e.editor_id = ?
587
				AND a.submission_progress = 0
587
				AND a.submission_progress = 0
588
				AND a.status = ' . STATUS_QUEUED . '
588
				AND a.status = ' . STATUS_QUEUED . '
589
				AND d2.date_decided IS NULL
589
				AND d2.edit_decision_id IS NULL
590
				AND d.decision <> ' . SUBMISSION_EDITOR_DECISION_ACCEPT,
590
				AND (d.decision IS NULL OR d.decision <> ' . SUBMISSION_EDITOR_DECISION_ACCEPT . ')',
591
			array((int) $journalId, (int) $sectionEditorId)
591
			array((int) $journalId, (int) $sectionEditorId)
592
		);
592
		);
593
		$submissionsCount[0] = $result->Fields('review_count');
593
		$submissionsCount[0] = $result->Fields('review_count');
 Lines 601-612    Link Here 
601
			FROM	articles a
601
			FROM	articles a
602
				LEFT JOIN edit_assignments e ON (a.article_id = e.article_id)
602
				LEFT JOIN edit_assignments e ON (a.article_id = e.article_id)
603
				LEFT JOIN edit_decisions d ON (a.article_id = d.article_id)
603
				LEFT JOIN edit_decisions d ON (a.article_id = d.article_id)
604
				LEFT JOIN edit_decisions d2 ON (a.article_id = d2.article_id AND d.date_decided < d2.date_decided)
604
				LEFT JOIN edit_decisions d2 ON (a.article_id = d2.article_id AND d.edit_decision_id < d2.edit_decision_id)
605
			WHERE	a.journal_id = ?
605
			WHERE	a.journal_id = ?
606
				AND e.editor_id = ?
606
				AND e.editor_id = ?
607
				AND a.submission_progress = 0
607
				AND a.submission_progress = 0
608
				AND a.status = ' . STATUS_QUEUED . '
608
				AND a.status = ' . STATUS_QUEUED . '
609
				AND d2.date_decided IS NULL
609
				AND d2.edit_decision_id IS NULL
610
				AND d.decision = ' . SUBMISSION_EDITOR_DECISION_ACCEPT,
610
				AND d.decision = ' . SUBMISSION_EDITOR_DECISION_ACCEPT,
611
			array((int) $journalId, (int) $sectionEditorId)
611
			array((int) $journalId, (int) $sectionEditorId)
612
		);
612
		);
 Lines 651-661    Link Here 
651
651
652
		if ($round == null) {
652
		if ($round == null) {
653
			$result =& $this->retrieve(
653
			$result =& $this->retrieve(
654
				'SELECT edit_decision_id, editor_id, decision, date_decided FROM edit_decisions WHERE article_id = ? ORDER BY date_decided ASC', $articleId
654
				'SELECT edit_decision_id, editor_id, decision, date_decided FROM edit_decisions WHERE article_id = ? ORDER BY edit_decision_id ASC', $articleId
655
			);
655
			);
656
		} else {
656
		} else {
657
			$result =& $this->retrieve(
657
			$result =& $this->retrieve(
658
				'SELECT edit_decision_id, editor_id, decision, date_decided FROM edit_decisions WHERE article_id = ? AND round = ? ORDER BY date_decided ASC',
658
				'SELECT edit_decision_id, editor_id, decision, date_decided FROM edit_decisions WHERE article_id = ? AND round = ? ORDER BY edit_decision_id ASC',
659
				array($articleId, $round)
659
				array($articleId, $round)
660
			);
660
			);
661
		}
661
		}

Return to bug 4737