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

https://github.com/davekisly/pkp-lib · PHP · 673 lines · 257 code · 88 blank · 328 comment · 3 complexity · ee7eab8720361e7128b3d8cc58f9d124 MD5 · raw file

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