Skip to content

Commit

Permalink
*7402* Filter incomplete submissions from paper report
Browse files Browse the repository at this point in the history
  • Loading branch information
asmecher committed Aug 20, 2012
1 parent e90f75b commit 8291b38
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions plugins/reports/articles/ArticleReportDAO.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,27 +59,30 @@ function getArticleReport($journalId) {
$articlesReturner = new DBRowIterator($result);

$result =& $this->retrieve(
'SELECT MAX(ed.date_decided) AS date,
ed.article_id AS article_id
FROM edit_decisions ed,
'SELECT MAX(d.date_decided) AS date_decided,
d.article_id AS article_id
FROM edit_decisions d,
articles a
WHERE a.journal_id = ? AND
a.submission_progress = 0 AND
a.article_id = ed.article_id
GROUP BY ed.article_id',
array($journalId)
a.article_id = d.article_id
GROUP BY d.article_id',
array((int) $journalId)
);
$decisionDatesIterator = new DBRowIterator($result);
$decisionsReturner = array();
while ($row =& $decisionDatesIterator->next()) {
$result =& $this->retrieve(
'SELECT decision AS decision,
article_id AS article_id
FROM edit_decisions
WHERE date_decided = ? AND
article_id = ?',
'SELECT d.decision AS decision,
d.article_id AS article_id
FROM edit_decisions d,
articles a
WHERE d.date_decided = ? AND
d.article_id = a.article_id AND
a.submission_progress = 0 AND
d.article_id = ?',
array(
$row['date'],
$row['date_decided'],
$row['article_id']
)
);
Expand All @@ -102,7 +105,7 @@ function getArticleReport($journalId) {
COALESCE(aasl.setting_value, aas.setting_value) AS biography,
COALESCE(aaasl.setting_value, aaas.setting_value) AS affiliation
FROM authors aa
LEFT JOIN articles a ON (aa.submission_id = a.article_id)
JOIN articles a ON (aa.submission_id = a.article_id)
LEFT JOIN author_settings aas ON (aa.author_id = aas.author_id AND aas.setting_name = ? AND aas.locale = ?)
LEFT JOIN author_settings aasl ON (aa.author_id = aasl.author_id AND aasl.setting_name = ? AND aasl.locale = ?)
LEFT JOIN author_settings aaas ON (aa.author_id = aaas.author_id AND aaas.setting_name = ? AND aaas.locale = ?)
Expand Down

0 comments on commit 8291b38

Please sign in to comment.