/classes/submission/reviewAssignment/PKPReviewAssignment.inc.php

https://github.com/ojsde/pkp-lib · PHP · 673 lines · 258 code · 87 blank · 328 comment · 1 complexity · 49f4b8d5cd1701a8e8012d468633d729 MD5 · raw file

  1. <?php
  2. /**
  3. * @file classes/submission/reviewAssignment/PKPReviewAssignment.inc.php
  4. *
  5. * Copyright (c) 2000-2012 John Willinsky
  6. * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
  7. *
  8. * @class PKPReviewAssignment
  9. * @ingroup submission
  10. * @see ReviewAssignmentDAO
  11. *
  12. * @brief Describes review assignment properties (abstracted for PKP library).
  13. */
  14. define('SUBMISSION_REVIEWER_RECOMMENDATION_ACCEPT', 1);
  15. define('SUBMISSION_REVIEWER_RECOMMENDATION_PENDING_REVISIONS', 2);
  16. define('SUBMISSION_REVIEWER_RECOMMENDATION_RESUBMIT_HERE', 3);
  17. define('SUBMISSION_REVIEWER_RECOMMENDATION_RESUBMIT_ELSEWHERE', 4);
  18. define('SUBMISSION_REVIEWER_RECOMMENDATION_DECLINE', 5);
  19. define('SUBMISSION_REVIEWER_RECOMMENDATION_SEE_COMMENTS', 6);
  20. define('SUBMISSION_REVIEWER_RATING_VERY_GOOD', 5);
  21. define('SUBMISSION_REVIEWER_RATING_GOOD', 4);
  22. define('SUBMISSION_REVIEWER_RATING_AVERAGE', 3);
  23. define('SUBMISSION_REVIEWER_RATING_POOR', 2);
  24. define('SUBMISSION_REVIEWER_RATING_VERY_POOR', 1);
  25. define('SUBMISSION_REVIEW_METHOD_BLIND', 1);
  26. define('SUBMISSION_REVIEW_METHOD_DOUBLEBLIND', 2);
  27. define('SUBMISSION_REVIEW_METHOD_OPEN', 3);
  28. define('REVIEW_ASSIGNMENT_NOT_UNCONSIDERED', 0);
  29. define('REVIEW_ASSIGNMENT_UNCONSIDERED', 1);
  30. define('REVIEW_ASSIGNMENT_UNCONSIDERED_READ', 2);
  31. class PKPReviewAssignment extends DataObject {
  32. /** @var array The revisions of the reviewer file */
  33. var $reviewerFileRevisions;
  34. /**
  35. * Constructor.
  36. */
  37. function PKPReviewAssignment() {
  38. parent::DataObject();
  39. }
  40. //
  41. // Get/set methods
  42. //
  43. /**
  44. * Get ID of review assignment's submission.
  45. * @return int
  46. */
  47. function getSubmissionId() {
  48. return $this->getData('submissionId');
  49. }
  50. /**
  51. * Set ID of review assignment's submission
  52. * @param $submissionId int
  53. */
  54. function setSubmissionId($submissionId) {
  55. return $this->setData('submissionId', $submissionId);
  56. }
  57. /**
  58. * Get ID of reviewer.
  59. * @return int
  60. */
  61. function getReviewerId() {
  62. return $this->getData('reviewerId');
  63. }
  64. /**
  65. * Set ID of reviewer.
  66. * @param $reviewerId int
  67. */
  68. function setReviewerId($reviewerId) {
  69. return $this->setData('reviewerId', $reviewerId);
  70. }
  71. /**
  72. * Get full name of reviewer.
  73. * @return string
  74. */
  75. function getReviewerFullName() {
  76. return $this->getData('reviewerFullName');
  77. }
  78. /**
  79. * Set full name of reviewer.
  80. * @param $reviewerFullName string
  81. */
  82. function setReviewerFullName($reviewerFullName) {
  83. return $this->setData('reviewerFullName', $reviewerFullName);
  84. }
  85. /**
  86. * Get reviewer comments.
  87. * @return string
  88. */
  89. function getComments() {
  90. return $this->getData('comments');
  91. }
  92. /**
  93. * Set reviewer comments.
  94. * @param $comments string
  95. */
  96. function setComments($comments) {
  97. return $this->setData('comments', $comments);
  98. }
  99. /**
  100. * Get competing interests.
  101. * @return string
  102. */
  103. function getCompetingInterests() {
  104. return $this->getData('competingInterests');
  105. }
  106. /**
  107. * Set competing interests.
  108. * @param $competingInterests string
  109. */
  110. function setCompetingInterests($competingInterests) {
  111. return $this->setData('competingInterests', $competingInterests);
  112. }
  113. /**
  114. * Get the workflow stage id.
  115. * @return int
  116. */
  117. function getStageId() {
  118. return $this->getData('stageId');
  119. }
  120. /**
  121. * Set the workflow stage id.
  122. * @param $stageId int
  123. */
  124. function setStageId($stageId) {
  125. return $this->setData('stageId', $stageId);
  126. }
  127. /**
  128. * Get the method of the review (open, blind, or double-blind).
  129. * @return int
  130. */
  131. function getReviewMethod() {
  132. return $this->getData('reviewMethod');
  133. }
  134. /**
  135. * Set the type of review.
  136. * @param $method int
  137. */
  138. function setReviewMethod($method) {
  139. return $this->setData('reviewMethod', $method);
  140. }
  141. /**
  142. * Get review round id.
  143. * @return int
  144. */
  145. function getReviewRoundId() {
  146. return $this->getData('reviewRoundId');
  147. }
  148. /**
  149. * Set review round id.
  150. * @param $reviewRoundId int
  151. */
  152. function setReviewRoundId($reviewRoundId) {
  153. $this->setData('reviewRoundId', $reviewRoundId);
  154. }
  155. /**
  156. * Get regret message.
  157. * @return string
  158. */
  159. function getRegretMessage() {
  160. return $this->getData('regretMessage');
  161. }
  162. /**
  163. * Set regret message.
  164. * @param $regretMessage string
  165. */
  166. function setRegretMessage($regretMessage) {
  167. return $this->setData('regretMessage', $regretMessage);
  168. }
  169. /**
  170. * Get reviewer recommendation.
  171. * @return string
  172. */
  173. function getRecommendation() {
  174. return $this->getData('recommendation');
  175. }
  176. /**
  177. * Set reviewer recommendation.
  178. * @param $recommendation string
  179. */
  180. function setRecommendation($recommendation) {
  181. return $this->setData('recommendation', $recommendation);
  182. }
  183. /**
  184. * Get unconsidered state.
  185. * @return int
  186. */
  187. function getUnconsidered() {
  188. return $this->getData('unconsidered');
  189. }
  190. /**
  191. * Set unconsidered state.
  192. * @param $unconsidered int
  193. */
  194. function setUnconsidered($unconsidered) {
  195. return $this->setData('unconsidered', $unconsidered);
  196. }
  197. /**
  198. * Get the date the reviewer was rated.
  199. * @return string
  200. */
  201. function getDateRated() {
  202. return $this->getData('dateRated');
  203. }
  204. /**
  205. * Set the date the reviewer was rated.
  206. * @param $dateRated string
  207. */
  208. function setDateRated($dateRated) {
  209. return $this->setData('dateRated', $dateRated);
  210. }
  211. /**
  212. * Get the date of the last modification.
  213. * @return date
  214. */
  215. function getLastModified() {
  216. return $this->getData('lastModified');
  217. }
  218. /**
  219. * Set the date of the last modification.
  220. * @param $dateModified date
  221. */
  222. function setLastModified($dateModified) {
  223. return $this->setData('lastModified', $dateModified);
  224. }
  225. /**
  226. * Stamp the date of the last modification to the current time.
  227. */
  228. function stampModified() {
  229. return $this->setLastModified(Core::getCurrentDate());
  230. }
  231. /**
  232. * Get the reviewer's assigned date.
  233. * @return string
  234. */
  235. function getDateAssigned() {
  236. return $this->getData('dateAssigned');
  237. }
  238. /**
  239. * Set the reviewer's assigned date.
  240. * @param $dateAssigned string
  241. */
  242. function setDateAssigned($dateAssigned) {
  243. return $this->setData('dateAssigned', $dateAssigned);
  244. }
  245. /**
  246. * Get the reviewer's notified date.
  247. * @return string
  248. */
  249. function getDateNotified() {
  250. return $this->getData('dateNotified');
  251. }
  252. /**
  253. * Set the reviewer's notified date.
  254. * @param $dateNotified string
  255. */
  256. function setDateNotified($dateNotified) {
  257. return $this->setData('dateNotified', $dateNotified);
  258. }
  259. /**
  260. * Get the reviewer's confirmed date.
  261. * @return string
  262. */
  263. function getDateConfirmed() {
  264. return $this->getData('dateConfirmed');
  265. }
  266. /**
  267. * Set the reviewer's confirmed date.
  268. * @param $dateConfirmed string
  269. */
  270. function setDateConfirmed($dateConfirmed) {
  271. return $this->setData('dateConfirmed', $dateConfirmed);
  272. }
  273. /**
  274. * Get the reviewer's completed date.
  275. * @return string
  276. */
  277. function getDateCompleted() {
  278. return $this->getData('dateCompleted');
  279. }
  280. /**
  281. * Set the reviewer's completed date.
  282. * @param $dateCompleted string
  283. */
  284. function setDateCompleted($dateCompleted) {
  285. return $this->setData('dateCompleted', $dateCompleted);
  286. }
  287. /**
  288. * Get the reviewer's acknowledged date.
  289. * @return string
  290. */
  291. function getDateAcknowledged() {
  292. return $this->getData('dateAcknowledged');
  293. }
  294. /**
  295. * Set the reviewer's acknowledged date.
  296. * @param $dateAcknowledged string
  297. */
  298. function setDateAcknowledged($dateAcknowledged) {
  299. return $this->setData('dateAcknowledged', $dateAcknowledged);
  300. }
  301. /**
  302. * Get the reviewer's last reminder date.
  303. * @return string
  304. */
  305. function getDateReminded() {
  306. return $this->getData('dateReminded');
  307. }
  308. /**
  309. * Set the reviewer's last reminder date.
  310. * @param $dateReminded string
  311. */
  312. function setDateReminded($dateReminded) {
  313. return $this->setData('dateReminded', $dateReminded);
  314. }
  315. /**
  316. * Get the reviewer's due date.
  317. * @return string
  318. */
  319. function getDateDue() {
  320. return $this->getData('dateDue');
  321. }
  322. /**
  323. * Set the reviewer's due date.
  324. * @param $dateDue string
  325. */
  326. function setDateDue($dateDue) {
  327. return $this->setData('dateDue', $dateDue);
  328. }
  329. /**
  330. * Get the reviewer's response due date.
  331. * @return string
  332. */
  333. function getDateResponseDue() {
  334. return $this->getData('dateResponseDue');
  335. }
  336. /**
  337. * Set the reviewer's response due date.
  338. * @param $dateResponseDue string
  339. */
  340. function setDateResponseDue($dateResponseDue) {
  341. return $this->setData('dateResponseDue', $dateResponseDue);
  342. }
  343. /**
  344. * Get the declined value.
  345. * @return boolean
  346. */
  347. function getDeclined() {
  348. return $this->getData('declined');
  349. }
  350. /**
  351. * Set the reviewer's declined value.
  352. * @param $declined boolean
  353. */
  354. function setDeclined($declined) {
  355. return $this->setData('declined', $declined);
  356. }
  357. /**
  358. * Get the replaced value.
  359. * @return boolean
  360. */
  361. function getReplaced() {
  362. return $this->getData('replaced');
  363. }
  364. /**
  365. * Set the reviewer's replaced value.
  366. * @param $replaced boolean
  367. */
  368. function setReplaced($replaced) {
  369. return $this->setData('replaced', $replaced);
  370. }
  371. /**
  372. * Get a boolean indicating whether or not the last reminder was automatic.
  373. * @return boolean
  374. */
  375. function getReminderWasAutomatic() {
  376. return $this->getData('reminderWasAutomatic')==1?1:0;
  377. }
  378. /**
  379. * Set the boolean indicating whether or not the last reminder was automatic.
  380. * @param $wasAutomatic boolean
  381. */
  382. function setReminderWasAutomatic($wasAutomatic) {
  383. return $this->setData('reminderWasAutomatic', $wasAutomatic);
  384. }
  385. /**
  386. * Get the cancelled value.
  387. * @return boolean
  388. */
  389. function getCancelled() {
  390. return $this->getData('cancelled');
  391. }
  392. /**
  393. * Set the reviewer's cancelled value.
  394. * @param $cancelled boolean
  395. */
  396. function setCancelled($cancelled) {
  397. return $this->setData('cancelled', $cancelled);
  398. }
  399. /**
  400. * Get reviewer file id.
  401. * @return int
  402. */
  403. function getReviewerFileId() {
  404. return $this->getData('reviewerFileId');
  405. }
  406. /**
  407. * Set reviewer file id.
  408. * @param $reviewerFileId int
  409. */
  410. function setReviewerFileId($reviewerFileId) {
  411. return $this->setData('reviewerFileId', $reviewerFileId);
  412. }
  413. /**
  414. * Get reviewer file viewable.
  415. * @return boolean
  416. */
  417. function getReviewerFileViewable() {
  418. return $this->getData('reviewerFileViewable');
  419. }
  420. /**
  421. * Set reviewer file viewable.
  422. * @param $reviewerFileViewable boolean
  423. */
  424. function setReviewerFileViewable($reviewerFileViewable) {
  425. return $this->setData('reviewerFileViewable', $reviewerFileViewable);
  426. }
  427. /**
  428. * Get quality.
  429. * @return int
  430. */
  431. function getQuality() {
  432. return $this->getData('quality');
  433. }
  434. /**
  435. * Set quality.
  436. * @param $quality int
  437. */
  438. function setQuality($quality) {
  439. return $this->setData('quality', $quality);
  440. }
  441. /**
  442. * Get round.
  443. * @return int
  444. */
  445. function getRound() {
  446. return $this->getData('round');
  447. }
  448. /**
  449. * Set round.
  450. * @param $round int
  451. */
  452. function setRound($round) {
  453. return $this->setData('round', $round);
  454. }
  455. /**
  456. * Get review file id.
  457. * @return int
  458. */
  459. function getReviewFileId() {
  460. return $this->getData('reviewFileId');
  461. }
  462. /**
  463. * Set review file id.
  464. * @param $reviewFileId int
  465. */
  466. function setReviewFileId($reviewFileId) {
  467. return $this->setData('reviewFileId', $reviewFileId);
  468. }
  469. /**
  470. * Get review file.
  471. * @return object
  472. */
  473. function &getReviewFile() {
  474. $returner =& $this->getData('reviewFile');
  475. return $returner;
  476. }
  477. /**
  478. * Set review file.
  479. * @param $reviewFile object
  480. */
  481. function setReviewFile($reviewFile) {
  482. return $this->setData('reviewFile', $reviewFile);
  483. }
  484. /**
  485. * Get review revision.
  486. * @return int
  487. */
  488. function getReviewRevision() {
  489. return $this->getData('reviewRevision');
  490. }
  491. /**
  492. * Set review revision.
  493. * @param $reviewRevision int
  494. */
  495. function setReviewRevision($reviewRevision) {
  496. return $this->setData('reviewRevision', $reviewRevision);
  497. }
  498. /**
  499. * Get review form id.
  500. * @return int
  501. */
  502. function getReviewFormId() {
  503. return $this->getData('reviewFormId');
  504. }
  505. /**
  506. * Set review form id.
  507. * @param $reviewFormId int
  508. */
  509. function setReviewFormId($reviewFormId) {
  510. return $this->setData('reviewFormId', $reviewFormId);
  511. }
  512. //
  513. // Files
  514. //
  515. /**
  516. * Get reviewer file.
  517. * @return ArticleFile
  518. */
  519. function &getReviewerFile() {
  520. $returner =& $this->getData('reviewerFile');
  521. return $returner;
  522. }
  523. /**
  524. * Set reviewer file.
  525. * @param $reviewFile ArticleFile
  526. */
  527. function setReviewerFile($reviewerFile) {
  528. return $this->setData('reviewerFile', $reviewerFile);
  529. }
  530. /**
  531. * Get all reviewer file revisions.
  532. * @return array ArticleFiles
  533. */
  534. function getReviewerFileRevisions() {
  535. return $this->reviewerFileRevisions;
  536. }
  537. /**
  538. * Set all reviewer file revisions.
  539. * @param $reviewerFileRevisions array ArticleFiles
  540. */
  541. function setReviewerFileRevisions($reviewerFileRevisions) {
  542. return $this->reviewerFileRevisions = $reviewerFileRevisions;
  543. }
  544. /**
  545. * Get supplementary files for this article.
  546. * @return array SuppFiles
  547. */
  548. function &getSuppFiles() {
  549. $returner =& $this->getData('suppFiles');
  550. return $returner;
  551. }
  552. /**
  553. * Set supplementary file for this article.
  554. * @param $suppFiles array SuppFiles
  555. */
  556. function setSuppFiles($suppFiles) {
  557. return $this->setData('suppFiles', $suppFiles);
  558. }
  559. /**
  560. * Get number of weeks until review is due (or number of weeks overdue).
  561. * @return int
  562. */
  563. function getWeeksDue() {
  564. $dateDue = $this->getDateDue();
  565. if ($dateDue === null) return null;
  566. return round((strtotime($dateDue) - time()) / (86400 * 7.0));
  567. }
  568. //
  569. // Comments
  570. //
  571. /**
  572. * Get most recent peer review comment.
  573. * @return ArticleComment
  574. */
  575. function getMostRecentPeerReviewComment() {
  576. return $this->getData('peerReviewComment');
  577. }
  578. /**
  579. * Set most recent peer review comment.
  580. * @param $peerReviewComment ArticleComment
  581. */
  582. function setMostRecentPeerReviewComment($peerReviewComment) {
  583. return $this->setData('peerReviewComment', $peerReviewComment);
  584. }
  585. }
  586. ?>