00001 <?php
00002
00016
00017
00018
00019 import('article.Article');
00020
00021 class SectionEditorSubmission extends Article {
00022
00024 var $reviewAssignments;
00025
00027 var $removedReviewAssignments;
00028
00030 var $editorDecisions;
00031
00033 var $editorFileRevisions;
00034
00036 var $authorFileRevisions;
00037
00039 var $copyeditFileRevisions;
00040
00044 function SectionEditorSubmission() {
00045 parent::Article();
00046 $this->reviewAssignments = array();
00047 $this->removedReviewAssignments = array();
00048 }
00049
00054 function addReviewAssignment($reviewAssignment) {
00055 if ($reviewAssignment->getArticleId() == null) {
00056 $reviewAssignment->setArticleId($this->getArticleId());
00057 }
00058
00059 if (isset($this->reviewAssignments[$reviewAssignment->getRound()])) {
00060 $roundReviewAssignments = $this->reviewAssignments[$reviewAssignment->getRound()];
00061 } else {
00062 $roundReviewAssignments = Array();
00063 }
00064 array_push($roundReviewAssignments, $reviewAssignment);
00065
00066 return $this->reviewAssignments[$reviewAssignment->getRound()] = $roundReviewAssignments;
00067 }
00068
00074 function addDecision($editorDecision, $round) {
00075 if (isset($this->editorDecisions[$round]) && is_array($this->editorDecisions[$round])) {
00076 array_push($this->editorDecisions[$round], $editorDecision);
00077 }
00078 else $this->editorDecisions[$round] = Array($editorDecision);
00079 }
00080
00086 function removeReviewAssignment($reviewId) {
00087 $found = false;
00088
00089 if ($reviewId != 0) {
00090
00091 $reviewAssignments = array();
00092 $empty = array();
00093 for ($i=1, $outerCount=count($this->reviewAssignments); $i <= $outerCount; $i++) {
00094 $roundReviewAssignments = $this->reviewAssignments[$i];
00095 for ($j=0, $innerCount=count($roundReviewAssignments); $j < $innerCount; $j++) {
00096 if ($roundReviewAssignments[$j]->getReviewId() == $reviewId) {
00097 array_push($this->removedReviewAssignments, $reviewId);
00098 $found = true;
00099 } else {
00100 array_push($reviewAssignments, $roundReviewAssignments[$j]);
00101 }
00102 }
00103 $this->reviewAssignments[$i] = $reviewAssignments;
00104 $reviewAssignments = $empty;
00105 }
00106 }
00107 return $found;
00108 }
00109
00114 function updateReviewAssignment($reviewAssignment) {
00115 $reviewAssignments = array();
00116 $roundReviewAssignments = $this->reviewAssignments[$reviewAssignment->getRound()];
00117 for ($i=0, $count=count($roundReviewAssignments); $i < $count; $i++) {
00118 if ($roundReviewAssignments[$i]->getReviewId() == $reviewAssignment->getReviewId()) {
00119 array_push($reviewAssignments, $reviewAssignment);
00120 } else {
00121 array_push($reviewAssignments, $roundReviewAssignments[$i]);
00122 }
00123 }
00124 $this->reviewAssignments[$reviewAssignment->getRound()] = $reviewAssignments;
00125 }
00126
00137 function getSubmissionStatus() {
00138 $status = $this->getStatus();
00139 if ($status == STATUS_ARCHIVED || $status == STATUS_PUBLISHED ||
00140 $status == STATUS_DECLINED) return $status;
00141
00142
00143 if ($this->getSubmissionProgress()) return (STATUS_INCOMPLETE);
00144
00145
00146 $editAssignments = $this->getEditAssignments();
00147 if (empty($editAssignments))
00148 return (STATUS_QUEUED_UNASSIGNED);
00149
00150 $decisions = $this->getDecisions();
00151 $decision = array_pop($decisions);
00152 if (!empty($decision)) {
00153 $latestDecision = array_pop($decision);
00154 if ($latestDecision['decision'] == SUBMISSION_EDITOR_DECISION_ACCEPT) {
00155 return STATUS_QUEUED_EDITING;
00156 }
00157 }
00158 return STATUS_QUEUED_REVIEW;
00159 }
00160
00169 function &getEditAssignments() {
00170 $editAssignments = &$this->getData('editAssignments');
00171 return $editAssignments;
00172 }
00173
00178 function setEditAssignments($editAssignments) {
00179 return $this->setData('editAssignments', $editAssignments);
00180 }
00181
00182
00183
00184
00185
00190 function &getReviewAssignments($round = null) {
00191 if ($round == null) {
00192 return $this->reviewAssignments;
00193 } else {
00194 return $this->reviewAssignments[$round];
00195 }
00196 }
00197
00202 function setReviewAssignments($reviewAssignments, $round) {
00203 return $this->reviewAssignments[$round] = $reviewAssignments;
00204 }
00205
00210 function &getRemovedReviewAssignments() {
00211 return $this->removedReviewAssignments;
00212 }
00213
00214
00215
00216
00217
00222 function getDecisions($round = null) {
00223 if ($round == null) {
00224 return $this->editorDecisions;
00225 } else {
00226 if (isset($this->editorDecisions[$round])) return $this->editorDecisions[$round];
00227 else return null;
00228 }
00229 }
00230
00236 function setDecisions($editorDecisions, $round) {
00237 return $this->editorDecisions[$round] = $editorDecisions;
00238 }
00239
00240
00241
00242
00243
00248 function &getSubmissionFile() {
00249 $returner =& $this->getData('submissionFile');
00250 return $returner;
00251 }
00252
00257 function setSubmissionFile($submissionFile) {
00258 return $this->setData('submissionFile', $submissionFile);
00259 }
00260
00265 function &getRevisedFile() {
00266 $returner =& $this->getData('revisedFile');
00267 return $returner;
00268 }
00269
00274 function setRevisedFile($revisedFile) {
00275 return $this->setData('revisedFile', $revisedFile);
00276 }
00277
00282 function &getSuppFiles() {
00283 $returner =& $this->getData('suppFiles');
00284 return $returner;
00285 }
00286
00291 function setSuppFiles($suppFiles) {
00292 return $this->setData('suppFiles', $suppFiles);
00293 }
00294
00299 function &getReviewFile() {
00300 $returner =& $this->getData('reviewFile');
00301 return $returner;
00302 }
00303
00308 function setReviewFile($reviewFile) {
00309 return $this->setData('reviewFile', $reviewFile);
00310 }
00311
00316 function getCopyeditFileRevisions() {
00317 return $this->copyeditFileRevisions;
00318 }
00319
00324 function setCopyeditFileRevisions($copyeditFileRevisions) {
00325 return $this->copyeditFileRevisions = $copyeditFileRevisions;
00326 }
00327
00332 function getEditorFileRevisions($round = null) {
00333 if ($round == null) {
00334 return $this->editorFileRevisions;
00335 } else {
00336 return $this->editorFileRevisions[$round];
00337 }
00338 }
00339
00344 function setEditorFileRevisions($editorFileRevisions, $round) {
00345 return $this->editorFileRevisions[$round] = $editorFileRevisions;
00346 }
00347
00352 function getAuthorFileRevisions($round = null) {
00353 if ($round == null) {
00354 return $this->authorFileRevisions;
00355 } else {
00356 return $this->authorFileRevisions[$round];
00357 }
00358 }
00359
00364 function setAuthorFileRevisions($authorFileRevisions, $round) {
00365 return $this->authorFileRevisions[$round] = $authorFileRevisions;
00366 }
00367
00372 function &getEditorFile() {
00373 $returner =& $this->getData('editorFile');
00374 return $returner;
00375 }
00376
00381 function setEditorFile($editorFile) {
00382 return $this->setData('editorFile', $editorFile);
00383 }
00384
00389 function &getCopyeditFile() {
00390 $returner =& $this->getData('copyeditFile');
00391 return $returner;
00392 }
00393
00394
00399 function setCopyeditFile($copyeditFile) {
00400 return $this->setData('copyeditFile', $copyeditFile);
00401 }
00402
00407 function &getInitialCopyeditFile() {
00408 $returner =& $this->getData('initialCopyeditFile');
00409 return $returner;
00410 }
00411
00412
00417 function setInitialCopyeditFile($initialCopyeditFile) {
00418 return $this->setData('initialCopyeditFile', $initialCopyeditFile);
00419 }
00420
00425 function &getEditorAuthorCopyeditFile() {
00426 $returner =& $this->getData('editorAuthorCopyeditFile');
00427 return $returner;
00428 }
00429
00430
00435 function setEditorAuthorCopyeditFile($editorAuthorCopyeditFile) {
00436 return $this->setData('editorAuthorCopyeditFile', $editorAuthorCopyeditFile);
00437 }
00438
00443 function &getFinalCopyeditFile() {
00444 $returner =& $this->getData('finalCopyeditFile');
00445 return $returner;
00446 }
00447
00448
00453 function setFinalCopyeditFile($finalCopyeditFile) {
00454 return $this->setData('finalCopyeditFile', $finalCopyeditFile);
00455 }
00456
00457
00458
00459
00460
00461
00466 function getReviewRevision() {
00467 return $this->getData('reviewRevision');
00468 }
00469
00474 function setReviewRevision($reviewRevision) {
00475 return $this->setData('reviewRevision', $reviewRevision);
00476 }
00477
00478
00479
00480
00481
00486 function getMostRecentEditorDecisionComment() {
00487 return $this->getData('mostRecentEditorDecisionComment');
00488 }
00489
00494 function setMostRecentEditorDecisionComment($mostRecentEditorDecisionComment) {
00495 return $this->setData('mostRecentEditorDecisionComment', $mostRecentEditorDecisionComment);
00496 }
00497
00502 function getMostRecentCopyeditComment() {
00503 return $this->getData('mostRecentCopyeditComment');
00504 }
00505
00510 function setMostRecentCopyeditComment($mostRecentCopyeditComment) {
00511 return $this->setData('mostRecentCopyeditComment', $mostRecentCopyeditComment);
00512 }
00513
00518 function getMostRecentLayoutComment() {
00519 return $this->getData('mostRecentLayoutComment');
00520 }
00521
00526 function setMostRecentLayoutComment($mostRecentLayoutComment) {
00527 return $this->setData('mostRecentLayoutComment', $mostRecentLayoutComment);
00528 }
00529
00534 function getMostRecentProofreadComment() {
00535 return $this->getData('mostRecentProofreadComment');
00536 }
00537
00542 function setMostRecentProofreadComment($mostRecentProofreadComment) {
00543 return $this->setData('mostRecentProofreadComment', $mostRecentProofreadComment);
00544 }
00545
00546
00547
00548
00549
00554 function getCopyedId() {
00555 return $this->getData('copyedId');
00556 }
00557
00562 function setCopyedId($copyedId) {
00563 return $this->setData('copyedId', $copyedId);
00564 }
00565
00570 function getCopyeditorId() {
00571 return $this->getData('copyeditorId');
00572 }
00573
00578 function setCopyeditorId($copyeditorId) {
00579 return $this->setData('copyeditorId', $copyeditorId);
00580 }
00581
00586 function &getCopyeditor() {
00587 $copyEditor = &$this->getData('copyeditor');
00588 return $copyEditor;
00589 }
00590
00595 function setCopyeditor($copyeditor) {
00596 return $this->setData('copyeditor', $copyeditor);
00597 }
00598
00603 function getCopyeditorDateNotified() {
00604 return $this->getData('copyeditorDateNotified');
00605 }
00606
00611 function setCopyeditorDateNotified($copyeditorDateNotified) {
00612 return $this->setData('copyeditorDateNotified', $copyeditorDateNotified);
00613 }
00614
00619 function getCopyeditorDateUnderway() {
00620 return $this->getData('copyeditorDateUnderway');
00621 }
00622
00627 function setCopyeditorDateUnderway($copyeditorDateUnderway) {
00628 return $this->setData('copyeditorDateUnderway', $copyeditorDateUnderway);
00629 }
00630
00635 function getCopyeditorDateCompleted() {
00636 return $this->getData('copyeditorDateCompleted');
00637 }
00638
00643 function setCopyeditorDateCompleted($copyeditorDateCompleted) {
00644 return $this->setData('copyeditorDateCompleted', $copyeditorDateCompleted);
00645 }
00646
00651 function getCopyeditorDateAcknowledged() {
00652 return $this->getData('copyeditorDateAcknowledged');
00653 }
00654
00659 function setCopyeditorDateAcknowledged($copyeditorDateAcknowledged) {
00660 return $this->setData('copyeditorDateAcknowledged', $copyeditorDateAcknowledged);
00661 }
00662
00667 function getCopyeditorDateAuthorNotified() {
00668 return $this->getData('copyeditorDateAuthorNotified');
00669 }
00670
00675 function setCopyeditorDateAuthorNotified($copyeditorDateAuthorNotified) {
00676 return $this->setData('copyeditorDateAuthorNotified', $copyeditorDateAuthorNotified);
00677 }
00678
00683 function getCopyeditorDateAuthorUnderway() {
00684 return $this->getData('copyeditorDateAuthorUnderway');
00685 }
00686
00691 function setCopyeditorDateAuthorUnderway($copyeditorDateAuthorUnderway) {
00692 return $this->setData('copyeditorDateAuthorUnderway', $copyeditorDateAuthorUnderway);
00693 }
00694
00699 function getCopyeditorDateAuthorCompleted() {
00700 return $this->getData('copyeditorDateAuthorCompleted');
00701 }
00702
00707 function setCopyeditorDateAuthorCompleted($copyeditorDateAuthorCompleted) {
00708 return $this->setData('copyeditorDateAuthorCompleted', $copyeditorDateAuthorCompleted);
00709 }
00710
00715 function getCopyeditorDateAuthorAcknowledged() {
00716 return $this->getData('copyeditorDateAuthorAcknowledged');
00717 }
00718
00723 function setCopyeditorDateAuthorAcknowledged($copyeditorDateAuthorAcknowledged) {
00724 return $this->setData('copyeditorDateAuthorAcknowledged', $copyeditorDateAuthorAcknowledged);
00725 }
00726
00731 function getCopyeditorDateFinalNotified() {
00732 return $this->getData('copyeditorDateFinalNotified');
00733 }
00734
00739 function setCopyeditorDateFinalNotified($copyeditorDateFinalNotified) {
00740 return $this->setData('copyeditorDateFinalNotified', $copyeditorDateFinalNotified);
00741 }
00742
00747 function getCopyeditorDateFinalUnderway() {
00748 return $this->getData('copyeditorDateFinalUnderway');
00749 }
00750
00755 function setCopyeditorDateFinalUnderway($copyeditorDateFinalUnderway) {
00756 return $this->setData('copyeditorDateFinalUnderway', $copyeditorDateFinalUnderway);
00757 }
00758
00763 function getCopyeditorDateFinalCompleted() {
00764 return $this->getData('copyeditorDateFinalCompleted');
00765 }
00766
00771 function setCopyeditorDateFinalCompleted($copyeditorDateFinalCompleted) {
00772 return $this->setData('copyeditorDateFinalCompleted', $copyeditorDateFinalCompleted);
00773 }
00774
00779 function getCopyeditorDateFinalAcknowledged() {
00780 return $this->getData('copyeditorDateFinalAcknowledged');
00781 }
00782
00787 function setCopyeditorDateFinalAcknowledged($copyeditorDateFinalAcknowledged) {
00788 return $this->setData('copyeditorDateFinalAcknowledged', $copyeditorDateFinalAcknowledged);
00789 }
00790
00795 function getCopyeditorInitialRevision() {
00796 return $this->getData('copyeditorInitialRevision');
00797 }
00798
00803 function setCopyeditorInitialRevision($copyeditorInitialRevision) {
00804 return $this->setData('copyeditorInitialRevision', $copyeditorInitialRevision);
00805 }
00806
00811 function getCopyeditorEditorAuthorRevision() {
00812 return $this->getData('copyeditorEditorAuthorRevision');
00813 }
00814
00819 function setCopyeditorEditorAuthorRevision($copyeditorEditorAuthorRevision) {
00820 return $this->setData('copyeditorEditorAuthorRevision', $copyeditorEditorAuthorRevision);
00821 }
00822
00827 function getCopyeditorFinalRevision() {
00828 return $this->getData('copyeditorFinalRevision');
00829 }
00830
00835 function setCopyeditorFinalRevision($copyeditorFinalRevision) {
00836 return $this->setData('copyeditorFinalRevision', $copyeditorFinalRevision);
00837 }
00838
00843 function &getLayoutAssignment() {
00844 $layoutAssignment = &$this->getData('layoutAssignment');
00845 return $layoutAssignment;
00846 }
00847
00852 function setLayoutAssignment(&$layoutAssignment) {
00853 return $this->setData('layoutAssignment', $layoutAssignment);
00854 }
00855
00860 function &getGalleys() {
00861 $galleys = &$this->getData('galleys');
00862 return $galleys;
00863 }
00864
00869 function setGalleys(&$galleys) {
00870 return $this->setData('galleys', $galleys);
00871 }
00872
00877 function &getProofAssignment() {
00878 $proofAssignment = &$this->getData('proofAssignment');
00879 return $proofAssignment;
00880 }
00881
00886 function setProofAssignment($proofAssignment) {
00887 return $this->setData('proofAssignment', $proofAssignment);
00888 }
00889
00895 function &getEditorDecisionOptions() {
00896 static $editorDecisionOptions = array(
00897 '' => 'common.chooseOne',
00898 SUBMISSION_EDITOR_DECISION_ACCEPT => 'editor.article.decision.accept',
00899 SUBMISSION_EDITOR_DECISION_PENDING_REVISIONS => 'editor.article.decision.pendingRevisions',
00900 SUBMISSION_EDITOR_DECISION_RESUBMIT => 'editor.article.decision.resubmit',
00901 SUBMISSION_EDITOR_DECISION_DECLINE => 'editor.article.decision.decline'
00902 );
00903 return $editorDecisionOptions;
00904 }
00905
00910 function getHighlightClass() {
00911 $highlightClass = 'highlight';
00912 $overdueSeconds = 60 * 60 * 24 * 14;
00913
00914
00915 if ($this->getStatus() != STATUS_QUEUED) return null;
00916
00917
00918 $editAssignments = $this->getEditAssignments();
00919 if (empty($editAssignments)) return $highlightClass;
00920
00921 $journal =& Request::getJournal();
00922
00923 if (!$journal || $journal->getJournalId() != $this->getJournalId()) return null;
00924
00925
00926 $inEditing = false;
00927 $decisionsEmpty = true;
00928 $lastDecisionDate = null;
00929 $decisions = $this->getDecisions();
00930 $decision = array_pop($decisions);
00931 if (!empty($decision)) {
00932 $latestDecision = array_pop($decision);
00933 if (is_array($latestDecision)) {
00934 if ($latestDecision['decision'] == SUBMISSION_EDITOR_DECISION_ACCEPT) $inEditing = true;
00935 $decisionsEmpty = false;
00936 $lastDecisionDate = strtotime($latestDecision['dateDecided']);
00937 }
00938 }
00939
00940 if ($inEditing) {
00941
00942
00943
00944
00945
00946
00947
00948 $dateCopyeditorNotified = $this->getCopyeditorDateNotified() ?
00949 strtotime($this->getCopyeditorDateNotified()) : 0;
00950 $dateCopyeditorUnderway = $this->getCopyeditorDateUnderway() ?
00951 strtotime($this->getCopyeditorDateUnderway()) : 0;
00952 $dateCopyeditorCompleted = $this->getCopyeditorDateCompleted() ?
00953 strtotime($this->getCopyeditorDateCompleted()) : 0;
00954 $dateCopyeditorAcknowledged = $this->getCopyeditorDateAcknowledged() ?
00955 strtotime($this->getCopyeditorDateAcknowledged()) : 0;
00956 $dateLastCopyeditor = max($dateCopyeditorNotified, $dateCopyeditorUnderway);
00957
00958
00959 if (!$dateCopyeditorNotified) return $highlightClass;
00960
00961
00962 if ( $dateLastCopyeditor &&
00963 !$dateCopyeditorCompleted &&
00964 $dateLastCopyeditor + $overdueSeconds < time()
00965 ) return $highlightClass;
00966
00967
00968 if ($dateCopyeditorCompleted && !$dateCopyeditorAcknowledged) return $highlightClass;
00969
00970
00971 $dateCopyeditorAuthorNotified = $this->getCopyeditorDateAuthorNotified() ?
00972 strtotime($this->getCopyeditorDateAuthorNotified()) : 0;
00973 $dateCopyeditorAuthorUnderway = $this->getCopyeditorDateAuthorUnderway() ?
00974 strtotime($this->getCopyeditorDateAuthorUnderway()) : 0;
00975 $dateCopyeditorAuthorCompleted = $this->getCopyeditorDateAuthorCompleted() ?
00976 strtotime($this->getCopyeditorDateAuthorCompleted()) : 0;
00977 $dateCopyeditorAuthorAcknowledged = $this->getCopyeditorDateAuthorAcknowledged() ?
00978 strtotime($this->getCopyeditorDateAuthorAcknowledged()) : 0;
00979 $dateLastCopyeditorAuthor = max($dateCopyeditorAuthorNotified, $dateCopyeditorAuthorUnderway);
00980
00981
00982 if ($dateCopyeditorAcknowledged && !$dateCopyeditorAuthorNotified) return $highlightClass;
00983
00984
00985 if ($dateCopyeditorAuthorCompleted && !$dateCopyeditorAuthorAcknowledged) return $highlightClass;
00986
00987
00988 if ( $dateLastCopyeditorAuthor &&
00989 !$dateCopyeditorAuthorCompleted &&
00990 $dateLastCopyeditorAuthor + $overdueSeconds < time()
00991 ) return $highlightClass;
00992
00993
00994 $dateCopyeditorFinalNotified = $this->getCopyeditorDateFinalNotified() ?
00995 strtotime($this->getCopyeditorDateFinalNotified()) : 0;
00996 $dateCopyeditorFinalUnderway = $this->getCopyeditorDateFinalUnderway() ?
00997 strtotime($this->getCopyeditorDateFinalUnderway()) : 0;
00998 $dateCopyeditorFinalCompleted = $this->getCopyeditorDateFinalCompleted() ?
00999 strtotime($this->getCopyeditorDateFinalCompleted()) : 0;
01000 $dateLastCopyeditorFinal = max($dateCopyeditorFinalNotified, $dateCopyeditorUnderway);
01001
01002
01003 if ($dateCopyeditorAuthorAcknowledged && !$dateCopyeditorFinalNotified) return $highlightClass;
01004
01005
01006 if ( $dateLastCopyeditorFinal &&
01007 !$dateCopyeditorFinalCompleted &&
01008 $dateLastCopyeditorFinal + $overdueSeconds < time()
01009 ) return $highlightClass;
01010
01011
01012 if ($dateCopyeditorFinalCompleted && !$dateCopyeditorFinalAcknowledged) return $highlightClass;
01013
01014
01015 $layoutAssignment =& $this->getLayoutAssignment();
01016
01017 $dateLayoutNotified = $layoutAssignment->getDateNotified() ?
01018 strtotime($layoutAssignment->getDateNotified()) : 0;
01019 $dateLayoutUnderway = $layoutAssignment->getDateUnderway() ?
01020 strtotime($layoutAssignment->getDateUnderway()) : 0;
01021 $dateLayoutCompleted = $layoutAssignment->getDateCompleted() ?
01022 strtotime($layoutAssignment->getDateCompleted()) : 0;
01023 $dateLayoutAcknowledged = $layoutAssignment->getDateAcknowledged() ?
01024 strtotime($layoutAssignment->getDateAcknowledged()) : 0;
01025 $dateLastLayout = max($dateLayoutNotified, $dateLayoutUnderway);
01026
01027
01028 if ($dateLastCopyeditorFinal && !$dateLayoutNotified) return $highlightClass;
01029
01030
01031 if ( $dateLastLayout &&
01032 !$dateLayoutCompleted &&
01033 $dateLastLayout + $overdueSeconds < time()
01034 ) return $highlightClass;
01035
01036
01037 if ($dateLayoutCompleted && !$dateLayoutAcknowledged) return $highlightClass;
01038
01039
01040 $proofAssignment =& $this->getProofAssignment();
01041
01042
01043 $dateAuthorNotified = $proofAssignment->getDateAuthorNotified() ?
01044 strtotime($proofAssignment->getDateAuthorNotified()) : 0;
01045 $dateAuthorUnderway = $proofAssignment->getDateAuthorUnderway() ?
01046 strtotime($proofAssignment->getDateAuthorUnderway()) : 0;
01047 $dateAuthorCompleted = $proofAssignment->getDateAuthorCompleted() ?
01048 strtotime($proofAssignment->getDateAuthorCompleted()) : 0;
01049 $dateAuthorAcknowledged = $proofAssignment->getDateAuthorAcknowledged() ?
01050 strtotime($proofAssignment->getDateAuthorAcknowledged()) : 0;
01051 $dateLastAuthor = max($dateAuthorNotified, $dateAuthorUnderway);
01052
01053
01054 if ($dateLayoutAcknowledged && !$dateAuthorNotified) return $highlightClass;
01055
01056
01057 if ( $dateLastAuthor &&
01058 !$dateAuthorCompleted &&
01059 $dateLastAuthor + $overdueSeconds < time()
01060 ) return $highlightClass;
01061
01062
01063 if ($dateAuthorCompleted && !$dateAuthorAcknowledged) return $highlightClass;
01064
01065
01066 $dateProofreaderNotified = $proofAssignment->getDateProofreaderNotified() ?
01067 strtotime($proofAssignment->getDateProofreaderNotified()) : 0;
01068 $dateProofreaderUnderway = $proofAssignment->getDateProofreaderUnderway() ?
01069 strtotime($proofAssignment->getDateProofreaderUnderway()) : 0;
01070 $dateProofreaderCompleted = $proofAssignment->getDateProofreaderCompleted() ?
01071 strtotime($proofAssignment->getDateProofreaderCompleted()) : 0;
01072 $dateProofreaderAcknowledged = $proofAssignment->getDateProofreaderAcknowledged() ?
01073 strtotime($proofAssignment->getDateProofreaderAcknowledged()) : 0;
01074 $dateLastProofreader = max($dateProofreaderNotified, $dateProofreaderUnderway);
01075
01076
01077 if ($dateAuthorAcknowledged && !$dateProofreaderNotified) return $highlightClass;
01078
01079
01080 if ($dateProofreaderCompleted && !$dateProofreaderAcknowledged) return $highlightClass;
01081
01082
01083 if ( $dateLastProofreader &&
01084 !$dateProofreaderCompleted &&
01085 $dateLastProofreader + $overdueSeconds < time()
01086 ) return $highlightClass;
01087
01088
01089 $dateLayoutEditorNotified = $proofAssignment->getDateLayoutEditorNotified() ?
01090 strtotime($proofAssignment->getDateLayoutEditorNotified()) : 0;
01091 $dateLayoutEditorUnderway = $proofAssignment->getDateLayoutEditorUnderway() ?
01092 strtotime($proofAssignment->getDateLayoutEditorUnderway()) : 0;
01093 $dateLayoutEditorCompleted = $proofAssignment->getDateLayoutEditorCompleted() ?
01094 strtotime($proofAssignment->getDateLayoutEditorCompleted()) : 0;
01095 $dateLastLayoutEditor = max($dateLayoutEditorNotified, $dateCopyeditorUnderway);
01096
01097
01098 if ($dateProofreaderAcknowledged && !$dateLayoutEditorNotified) return $highlightClass;
01099
01100
01101 if ( $dateLastLayoutEditor &&
01102 !$dateLayoutEditorCompleted &&
01103 $dateLastLayoutEditor + $overdueSeconds < time()
01104 ) return $highlightClass;
01105
01106
01107 if ($dateLayoutEditorCompleted && !$dateLayoutEditorAcknowledged) return $highlightClass;
01108 } else {
01109
01110
01111
01112 $reviewAssignments =& $this->getReviewAssignments($this->getCurrentRound());
01113 if (is_array($reviewAssignments) && !empty($reviewAssignments)) {
01114 $allReviewsComplete = true;
01115 foreach ($reviewAssignments as $i => $junk) {
01116 $reviewAssignment =& $reviewAssignments[$i];
01117
01118
01119 if ($reviewAssignment->getDateNotified() === null) return $highlightClass;
01120
01121
01122 if (!$reviewAssignment->getCancelled() && !$reviewAssignment->getDeclined()) {
01123 if (!$reviewAssignment->getDateCompleted()) $allReviewsComplete = false;
01124
01125 $dateReminded = $reviewAssignment->getDateReminded() ?
01126 strtotime($reviewAssignment->getDateReminded()) : 0;
01127 $dateNotified = $reviewAssignment->getDateNotified() ?
01128 strtotime($reviewAssignment->getDateNotified()) : 0;
01129 $dateConfirmed = $reviewAssignment->getDateConfirmed() ?
01130 strtotime($reviewAssignment->getDateConfirmed()) : 0;
01131
01132
01133 if ( !$reviewAssignment->getDateCompleted() &&
01134 !$dateConfirmed &&
01135 !$journal->getSetting('remindForInvite') &&
01136 max($dateReminded, $dateNotified) + $overdueSeconds < time()
01137 ) return $highlightClass;
01138
01139
01140 if ( !$reviewAssignment->getDateCompleted() &&
01141 $dateConfirmed &&
01142 !$journal->getSetting('remindForSubmit') &&
01143 max($dateReminded, $dateConfirmed) + $overdueSeconds < time()
01144 ) return $highlightClass;
01145 }
01146
01147 unset($reviewAssignment);
01148 }
01149
01150 if ($allReviewsComplete && $decisionsEmpty) return $highlightClass;
01151
01152
01153
01154 $comment = $this->getMostRecentEditorDecisionComment();
01155 $commentDate = $comment ? strtotime($comment->getDatePosted()) : 0;
01156 $authorFileRevisions = $this->getAuthorFileRevisions($this->getCurrentRound());
01157 $authorFileDate = null;
01158 if (is_array($authorFileRevisions) && !empty($authorFileRevisions)) {
01159 $authorFile = array_pop($authorFileRevisions);
01160 $authorFileDate = strtotime($authorFile->getDateUploaded());
01161 }
01162 if ( ($lastDecisionDate || $commentDate) &&
01163 $authorFileDate &&
01164 $authorFileDate > max($lastDecisionDate, $commentDate)
01165 ) return $highlightClass;
01166 }
01167 }
01168 return null;
01169 }
01170 }
01171
01172 ?>