classes/paper/Paper.inc.php

Go to the documentation of this file.
00001 <?php
00002 
00021 // $Id$
00022 
00023 
00024 // Submission status constants
00025 define('STATUS_ARCHIVED', 0);
00026 define('STATUS_QUEUED', 1);
00027 define('STATUS_PUBLISHED', 3);
00028 define('STATUS_DECLINED', 4);
00029 
00030 // AuthorSubmission::getSubmissionStatus will return one of these in place of QUEUED:
00031 define ('STATUS_QUEUED_UNASSIGNED', 5);
00032 define ('STATUS_QUEUED_REVIEW', 6);
00033 define ('STATUS_QUEUED_EDITING', 7);
00034 define ('STATUS_INCOMPLETE', 8);
00035 
00036 define ('REVIEW_STAGE_ABSTRACT', 1);
00037 define ('REVIEW_STAGE_PRESENTATION', 2);
00038 
00039 /* These constants are used as search fields for the various submission lists */
00040 define('SUBMISSION_FIELD_AUTHOR', 1);
00041 define('SUBMISSION_FIELD_DIRECTOR', 2);
00042 define('SUBMISSION_FIELD_TITLE', 3);
00043 define('SUBMISSION_FIELD_REVIEWER', 4);
00044 
00045 define('SUBMISSION_FIELD_DATE_SUBMITTED', 5);
00046 
00047 // Paper RT comments
00048 define ('COMMENTS_TRACK_DEFAULT', 0);
00049 define ('COMMENTS_DISABLE', 1);
00050 define ('COMMENTS_ENABLE', 2);
00051 
00052 import('submission.Submission');
00053 
00054 class Paper extends Submission {
00058    function Paper() {
00059       parent::Submission();
00060    }
00061 
00066    function addAuthor($author) {
00067       if ($author->getPaperId() == null) {
00068          $author->setPaperId($this->getId());
00069       }
00070       parent::addAuthor($author);
00071    }
00072 
00078    function getPaperTitle() {
00079       if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
00080       return $this->getLocalizedTitle();
00081    }
00082 
00088    function getPaperAbstract() {
00089       if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
00090       return $this->getLocalizedAbstract();
00091    }
00092 
00093    //
00094    // Get/set methods
00095    //
00096 
00101    function getPaperId() {
00102       if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
00103       return $this->getId();
00104    }
00105 
00110    function setPaperId($paperId) {
00111       if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
00112       return $this->setId($paperId);
00113    }
00114 
00119    function getSchedConfId() {
00120       return $this->getData('schedConfId');
00121    }
00122 
00127    function setSchedConfId($schedConfId) {
00128       return $this->setData('schedConfId', $schedConfId);
00129    }
00130 
00135    function getTrackId() {
00136       return $this->getData('trackId');
00137    }
00138 
00143    function setTrackId($trackId) {
00144       return $this->setData('trackId', $trackId);
00145    }
00146 
00151    function getTrackTitle() {
00152       return $this->getData('trackTitle');
00153    }
00154 
00159    function setTrackTitle($trackTitle) {
00160       return $this->setData('trackTitle', $trackTitle);
00161    }
00162 
00167    function getTrackAbbrev() {
00168       return $this->getData('trackAbbrev');
00169    }
00170 
00175    function setTrackAbbrev($trackAbbrev) {
00176       return $this->setData('trackAbbrev', $trackAbbrev);
00177    }
00178 
00185    function getPaperDiscipline() {
00186       if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
00187       return $this->getLocalizedDiscipline();
00188    }
00189 
00196    function getPaperSubjectClass() {
00197       if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
00198       return $this->getLocalizedSubjectClass();
00199    }
00200 
00206    function getPaperSubject() {
00207       if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
00208       return $this->getLocalizedSubject();
00209    }
00210 
00216    function getPaperCoverageGeo() {
00217       if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
00218       return $this->getLocalizedCoverageGeo();
00219    }
00220 
00226    function getPaperCoverageChron() {
00227       if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
00228       return $this->getLocalizedCoverageChron();
00229    }
00230 
00236    function getPaperCoverageSample() {
00237       if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
00238       return $this->getLocalizedCoverageSample();
00239    }
00240 
00246    function getPaperType() {
00247       if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
00248       return $this->getLocalizedType();
00249    }
00250 
00256    function getPaperSponsor() {
00257       if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
00258       return $this->getLocalizedSponsor();
00259    }
00260 
00265    function getCommentsToDirector() {
00266       return $this->getData('commentsToDirector');
00267    }
00268 
00273    function setCommentsToDirector($commentsToDirector) {
00274       return $this->setData('commentsToDirector', $commentsToDirector);
00275    }
00276 
00281    function getDateToPresentations() {
00282       return $this->getData('dateToPresentations');
00283    }
00284 
00289    function setDateToPresentations($dateToPresentations) {
00290       return $this->setData('dateToPresentations', $dateToPresentations);
00291    }
00292 
00297    function getDateToArchive() {
00298       return $this->getData('dateToArchive');
00299    }
00300 
00305    function setDateToArchive($dateToArchive) {
00306       return $this->setData('dateToArchive', $dateToArchive);
00307    }
00308 
00312    function stampDateToArchive() {
00313       return $this->setDateToArchive(Core::getCurrentDate());
00314    }
00315 
00319    function stampDateToPresentations() {
00320       return $this->setDateToPresentations(Core::getCurrentDate());
00321    }
00322 
00327    function getDateReminded() {
00328       return $this->getData('dateReminded');
00329    }
00330 
00335    function setDateReminded($dateReminded) {
00336       return $this->setData('dateReminded', $dateReminded);
00337    }
00338 
00343    function getStartTime() {
00344       return $this->getData('startTime');
00345    }
00346 
00351    function setStartTime($startTime) {
00352       return $this->setData('startTime', $startTime);
00353    }
00354 
00359    function getEndTime() {
00360       return $this->getData('endTime');
00361    }
00362 
00367    function setEndTime($endTime) {
00368       return $this->setData('endTime', $endTime);
00369    }
00370 
00375    function getCurrentStage() {
00376       return $this->getData('currentStage');
00377    }
00378 
00383    function setCurrentStage($currentStage) {
00384       return $this->setData('currentStage', $currentStage);
00385    }
00386 
00391    function getReviewMode() {
00392       return $this->getData('reviewMode');
00393    }
00394 
00399    function setReviewMode($reviewMode) {
00400       return $this->setData('reviewMode', $reviewMode);
00401    }
00402 
00407    function getLayoutFileId() {
00408       return $this->getData('layoutFileId');
00409    }
00410 
00415    function setLayoutFileId($layoutFileId) {
00416       return $this->setData('layoutFileId', $layoutFileId);
00417    }
00418 
00423    function getDirectorFileId() {
00424       return $this->getData('directorFileId');
00425    }
00426 
00431    function setDirectorFileId($directorFileId) {
00432       return $this->setData('directorFileId', $directorFileId);
00433    }
00434 
00439    function getCommentsStatusString() {
00440       switch ($this->getCommentsStatus()) {
00441          case COMMENTS_DISABLE:
00442             return 'paper.comments.disable';
00443          case COMMENTS_ENABLE:
00444             return 'paper.comments.enable';
00445          default:
00446             return 'paper.comments.trackDefault';
00447       }
00448    }
00449 
00456    function getEnableComments() {
00457       switch ($this->getCommentsStatus()) {
00458          case COMMENTS_DISABLE:
00459             return false;
00460          case COMMENTS_ENABLE:
00461             return true;
00462          case COMMENTS_TRACK_DEFAULT:
00463             $trackDao =& DAORegistry::getDAO('TrackDAO');
00464             $track =& $trackDao->getTrack($this->getTrackId(), $this->getSchedConfId());
00465             if ($track->getDisableComments()) {
00466                return false;
00467             } else {
00468                return true;
00469             }
00470       }
00471    }
00472 
00477    function &getCommentsStatusOptions() {
00478       static $commentsStatusOptions = array(
00479          COMMENTS_TRACK_DEFAULT => 'paper.comments.trackDefault',
00480          COMMENTS_DISABLE => 'paper.comments.disable',
00481          COMMENTS_ENABLE => 'paper.comments.enable'
00482       );
00483       return $commentsStatusOptions;
00484    }
00485 
00494    function getAssociatedUserIds($authors = true, $reviewers = true, $trackDirectors = true, $directors = true) {
00495       $paperId = $this->getId();
00496 
00497       $userIds = array();
00498 
00499       if($authors) {
00500          $userId = $this->getUserId();
00501          if ($userId) $userIds[] = array('id' => $userId, 'role' => 'author');
00502       }
00503 
00504       if($reviewers) {
00505          $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
00506          $reviewAssignments =& $reviewAssignmentDao->getReviewAssignmentsByPaperId($paperId);
00507          foreach ($reviewAssignments as $reviewAssignment) {
00508             $userId = $reviewAssignment->getReviewerId();
00509             if ($userId) $userIds[] = array('id' => $userId, 'role' => 'reviewer');
00510             unset($reviewAssignment);
00511          }
00512       }
00513 
00514       $editAssignmentDao =& DAORegistry::getDAO('EditAssignmentDAO');
00515 
00516       if($trackDirectors) {
00517          $editAssignments =& $editAssignmentDao->getTrackDirectorAssignmentsByPaperId($paperId);
00518          while ($editAssignment =& $editAssignments->next()) {
00519             $userId = $editAssignment->getDirectorId();
00520             if ($userId) $userIds[] = array('id' => $userId, 'role' => 'trackDirector');
00521             unset($editAssignment);
00522          }
00523       }
00524 
00525       if($directors) {
00526          $editAssignments =& $editAssignmentDao->getDirectorAssignmentsByPaperId($paperId);
00527          while ($editAssignment =& $editAssignments->next()) {
00528             $userId = $editAssignment->getDirectorId();
00529             if ($userId) $userIds[] = array('id' =>  $userId, 'role' => 'director');
00530          }
00531       }
00532 
00533       return $userIds;
00534    }
00535 }
00536 
00537 ?>

Generated on 25 Jul 2013 for Open Conference Systems by  doxygen 1.4.7