Open Journal Systems  2.4.3
 All Classes Namespaces Functions Variables Groups Pages
ReviewReportDAO.inc.php
1 <?php
2 
17 import('classes.article.ArticleComment');
18 import('lib.pkp.classes.db.DBRowIterator');
19 
20 class ReviewReportDAO extends DAO {
26  function getReviewReport($journalId) {
27  $primaryLocale = AppLocale::getPrimaryLocale();
28  $locale = AppLocale::getLocale();
29 
30  $result =& $this->retrieve(
31  'SELECT article_id,
32  comments,
33  author_id
34  FROM article_comments
35  WHERE comment_type = ?',
36  array(
37  COMMENT_TYPE_PEER_REVIEW
38  )
39  );
40  import('lib.pkp.classes.db.DBRowIterator');
41  $commentsReturner = new DBRowIterator($result);
42 
43  $result =& $this->retrieve(
44  'SELECT r.round AS round,
45  COALESCE(asl.setting_value, aspl.setting_value) AS article,
46  a.article_id AS articleId,
47  u.user_id AS reviewerId,
48  u.username AS reviewer,
49  u.first_name AS firstName,
50  u.middle_name AS middleName,
51  u.last_name AS lastName,
52  r.date_assigned AS dateAssigned,
53  r.date_notified AS dateNotified,
54  r.date_confirmed AS dateConfirmed,
55  r.date_completed AS dateCompleted,
56  r.date_reminded AS dateReminded,
57  (r.declined=1) AS declined,
58  (r.cancelled=1) AS cancelled,
59  r.recommendation AS recommendation
60  FROM review_assignments r
61  LEFT JOIN articles a ON r.submission_id = a.article_id
62  LEFT JOIN article_settings asl ON (a.article_id=asl.article_id AND asl.locale=? AND asl.setting_name=?)
63  LEFT JOIN article_settings aspl ON (a.article_id=aspl.article_id AND aspl.locale=a.locale AND aspl.setting_name=?),
64  users u
65  WHERE u.user_id=r.reviewer_id AND a.journal_id= ?
66  ORDER BY article',
67  array(
68  $locale, // Article title
69  'title',
70  'title',
71  $journalId
72  )
73  );
74  $reviewsReturner = new DBRowIterator($result);
75 
76  return array($commentsReturner, $reviewsReturner);
77  }
78 }
79 
80 ?>
Operations for retrieving and modifying objects from a database.
Definition: DAO.inc.php:29
& retrieve($sql, $params=false, $callHooks=true)
Definition: DAO.inc.php:83
Wrapper around ADORecordSet providing &quot;factory&quot; features for generating objects from DAOs...
getReviewReport($journalId)
Review report DAO.