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  $locale = AppLocale::getLocale();
28 
29  $result = $this->retrieve(
30  'SELECT submission_id,
31  comments,
32  author_id
33  FROM submission_comments
34  WHERE comment_type = ?',
35  array(
36  COMMENT_TYPE_PEER_REVIEW
37  )
38  );
39  import('lib.pkp.classes.db.DBRowIterator');
40  $commentsReturner = new DBRowIterator($result);
41 
42  $result = $this->retrieve(
43  'SELECT r.round AS round,
44  COALESCE(asl.setting_value, aspl.setting_value) AS article,
45  a.submission_id AS articleId,
46  u.user_id AS reviewerId,
47  u.username AS reviewer,
48  u.first_name AS firstName,
49  u.middle_name AS middleName,
50  u.last_name AS lastName,
51  r.date_assigned AS dateAssigned,
52  r.date_notified AS dateNotified,
53  r.date_confirmed AS dateConfirmed,
54  r.date_completed AS dateCompleted,
55  r.date_reminded AS dateReminded,
56  (r.declined=1) AS declined,
57  (r.cancelled=1) AS cancelled,
58  r.recommendation AS recommendation
59  FROM review_assignments r
60  LEFT JOIN submissions a ON r.submission_id = a.submission_id
61  LEFT JOIN submission_settings asl ON (a.submission_id=asl.submission_id AND asl.locale=? AND asl.setting_name=?)
62  LEFT JOIN submission_settings aspl ON (a.submission_id=aspl.submission_id AND aspl.locale=a.locale AND aspl.setting_name=?),
63  users u
64  WHERE u.user_id=r.reviewer_id AND a.context_id= ?
65  ORDER BY article',
66  array(
67  $locale, // Article title
68  'title',
69  'title',
70  (int) $journalId
71  )
72  );
73  $reviewsReturner = new DBRowIterator($result);
74 
75  return array($commentsReturner, $reviewsReturner);
76  }
77 }
78 
79 ?>
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...
getReviewReport($journalId)
Review report DAO.
static getLocale()