Open Journal Systems  3.0.0
 All Classes Namespaces Functions Variables Groups Pages
ReviewReportDAO.inc.php
1 <?php
2 
17 import('lib.pkp.classes.submission.SubmissionComment');
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 submission_id,
32  comments,
33  author_id
34  FROM submission_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.submission_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 submissions a ON r.submission_id = a.submission_id
62  LEFT JOIN submission_settings asl ON (a.submission_id=asl.submission_id AND asl.locale=? AND asl.setting_name=?)
63  LEFT JOIN submission_settings aspl ON (a.submission_id=aspl.submission_id AND aspl.locale=a.locale AND aspl.setting_name=?),
64  users u
65  WHERE u.user_id=r.reviewer_id AND a.context_id= ?
66  ORDER BY article',
67  array(
68  $locale, // Article title
69  'title',
70  'title',
71  (int) $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:30
& retrieve($sql, $params=false, $callHooks=true)
Definition: DAO.inc.php:84
Wrapper around ADORecordSet providing &quot;factory&quot; features for generating objects from DAOs...
static getPrimaryLocale()
getReviewReport($journalId)
Review report DAO.
static getLocale()