ocs  2.3.6
About: OCS (Open Conference System) is a Web publishing tool that will create a complete Web presence for your scholarly conference.
  Fossies Dox: ocs-2.3.6.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

Paper.inc.php
Go to the documentation of this file.
1 <?php
2 
21 // $Id$
22 
23 
24 // Submission status constants
25 define('STATUS_ARCHIVED', 0);
26 define('STATUS_QUEUED', 1);
27 define('STATUS_PUBLISHED', 3);
28 define('STATUS_DECLINED', 4);
29 
30 // AuthorSubmission::getSubmissionStatus will return one of these in place of QUEUED:
31 define ('STATUS_QUEUED_UNASSIGNED', 5);
32 define ('STATUS_QUEUED_REVIEW', 6);
33 define ('STATUS_QUEUED_EDITING', 7);
34 define ('STATUS_INCOMPLETE', 8);
35 
36 define ('REVIEW_STAGE_ABSTRACT', 1);
37 define ('REVIEW_STAGE_PRESENTATION', 2);
38 
39 /* These constants are used as search fields for the various submission lists */
40 define('SUBMISSION_FIELD_AUTHOR', 1);
41 define('SUBMISSION_FIELD_DIRECTOR', 2);
42 define('SUBMISSION_FIELD_TITLE', 3);
43 define('SUBMISSION_FIELD_REVIEWER', 4);
44 
45 define('SUBMISSION_FIELD_DATE_SUBMITTED', 5);
46 
47 // Paper RT comments
48 define ('COMMENTS_TRACK_DEFAULT', 0);
49 define ('COMMENTS_DISABLE', 1);
50 define ('COMMENTS_ENABLE', 2);
51 
52 import('submission.Submission');
53 
54 class Paper extends Submission {
58  function Paper() {
59  parent::Submission();
60  }
61 
66  function addAuthor($author) {
67  if ($author->getPaperId() == null) {
68  $author->setPaperId($this->getId());
69  }
70  parent::addAuthor($author);
71  }
72 
78  function getPaperTitle() {
79  if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
80  return $this->getLocalizedTitle();
81  }
82 
88  function getPaperAbstract() {
89  if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
90  return $this->getLocalizedAbstract();
91  }
92 
93  //
94  // Get/set methods
95  //
96 
101  function getPaperId() {
102  if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
103  return $this->getId();
104  }
105 
110  function setPaperId($paperId) {
111  if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
112  return $this->setId($paperId);
113  }
114 
119  function getSchedConfId() {
120  return $this->getData('schedConfId');
121  }
122 
127  function setSchedConfId($schedConfId) {
128  return $this->setData('schedConfId', $schedConfId);
129  }
130 
135  function getTrackId() {
136  return $this->getData('trackId');
137  }
138 
143  function setTrackId($trackId) {
144  return $this->setData('trackId', $trackId);
145  }
146 
151  function getTrackTitle() {
152  return $this->getData('trackTitle');
153  }
154 
159  function setTrackTitle($trackTitle) {
160  return $this->setData('trackTitle', $trackTitle);
161  }
162 
167  function getTrackAbbrev() {
168  return $this->getData('trackAbbrev');
169  }
170 
175  function setTrackAbbrev($trackAbbrev) {
176  return $this->setData('trackAbbrev', $trackAbbrev);
177  }
178 
185  function getPaperDiscipline() {
186  if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
187  return $this->getLocalizedDiscipline();
188  }
189 
196  function getPaperSubjectClass() {
197  if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
198  return $this->getLocalizedSubjectClass();
199  }
200 
206  function getPaperSubject() {
207  if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
208  return $this->getLocalizedSubject();
209  }
210 
216  function getPaperCoverageGeo() {
217  if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
218  return $this->getLocalizedCoverageGeo();
219  }
220 
227  if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
228  return $this->getLocalizedCoverageChron();
229  }
230 
237  if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
238  return $this->getLocalizedCoverageSample();
239  }
240 
246  function getPaperType() {
247  if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
248  return $this->getLocalizedType();
249  }
250 
256  function getPaperSponsor() {
257  if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
258  return $this->getLocalizedSponsor();
259  }
260 
266  return $this->getData('commentsToDirector');
267  }
268 
273  function setCommentsToDirector($commentsToDirector) {
274  return $this->setData('commentsToDirector', $commentsToDirector);
275  }
276 
282  return $this->getData('dateToPresentations');
283  }
284 
289  function setDateToPresentations($dateToPresentations) {
290  return $this->setData('dateToPresentations', $dateToPresentations);
291  }
292 
297  function getDateToArchive() {
298  return $this->getData('dateToArchive');
299  }
300 
305  function setDateToArchive($dateToArchive) {
306  return $this->setData('dateToArchive', $dateToArchive);
307  }
308 
312  function stampDateToArchive() {
313  return $this->setDateToArchive(Core::getCurrentDate());
314  }
315 
321  }
322 
327  function getDateReminded() {
328  return $this->getData('dateReminded');
329  }
330 
335  function setDateReminded($dateReminded) {
336  return $this->setData('dateReminded', $dateReminded);
337  }
338 
343  function getStartTime() {
344  return $this->getData('startTime');
345  }
346 
351  function setStartTime($startTime) {
352  return $this->setData('startTime', $startTime);
353  }
354 
359  function getEndTime() {
360  return $this->getData('endTime');
361  }
362 
367  function setEndTime($endTime) {
368  return $this->setData('endTime', $endTime);
369  }
370 
375  function getCurrentStage() {
376  return $this->getData('currentStage');
377  }
378 
383  function setCurrentStage($currentStage) {
384  return $this->setData('currentStage', $currentStage);
385  }
386 
391  function getReviewMode() {
392  return $this->getData('reviewMode');
393  }
394 
399  function setReviewMode($reviewMode) {
400  return $this->setData('reviewMode', $reviewMode);
401  }
402 
407  function getLayoutFileId() {
408  return $this->getData('layoutFileId');
409  }
410 
415  function setLayoutFileId($layoutFileId) {
416  return $this->setData('layoutFileId', $layoutFileId);
417  }
418 
423  function getDirectorFileId() {
424  return $this->getData('directorFileId');
425  }
426 
431  function setDirectorFileId($directorFileId) {
432  return $this->setData('directorFileId', $directorFileId);
433  }
434 
440  switch ($this->getCommentsStatus()) {
441  case COMMENTS_DISABLE:
442  return 'paper.comments.disable';
443  case COMMENTS_ENABLE:
444  return 'paper.comments.enable';
445  default:
446  return 'paper.comments.trackDefault';
447  }
448  }
449 
456  function getEnableComments() {
457  switch ($this->getCommentsStatus()) {
458  case COMMENTS_DISABLE:
459  return false;
460  case COMMENTS_ENABLE:
461  return true;
463  $trackDao =& DAORegistry::getDAO('TrackDAO');
464  $track =& $trackDao->getTrack($this->getTrackId(), $this->getSchedConfId());
465  if ($track->getDisableComments()) {
466  return false;
467  } else {
468  return true;
469  }
470  }
471  }
472 
478  static $commentsStatusOptions = array(
479  COMMENTS_TRACK_DEFAULT => 'paper.comments.trackDefault',
480  COMMENTS_DISABLE => 'paper.comments.disable',
481  COMMENTS_ENABLE => 'paper.comments.enable'
482  );
483  return $commentsStatusOptions;
484  }
485 
494  function getAssociatedUserIds($authors = true, $reviewers = true, $trackDirectors = true, $directors = true) {
495  $paperId = $this->getId();
496 
497  $userIds = array();
498 
499  if($authors) {
500  $userId = $this->getUserId();
501  if ($userId) $userIds[] = array('id' => $userId, 'role' => 'author');
502  }
503 
504  if($reviewers) {
505  $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
506  $reviewAssignments =& $reviewAssignmentDao->getReviewAssignmentsByPaperId($paperId);
507  foreach ($reviewAssignments as $reviewAssignment) {
508  $userId = $reviewAssignment->getReviewerId();
509  if ($userId) $userIds[] = array('id' => $userId, 'role' => 'reviewer');
510  unset($reviewAssignment);
511  }
512  }
513 
514  $editAssignmentDao =& DAORegistry::getDAO('EditAssignmentDAO');
515 
516  if($trackDirectors) {
517  $editAssignments =& $editAssignmentDao->getTrackDirectorAssignmentsByPaperId($paperId);
518  while ($editAssignment =& $editAssignments->next()) {
519  $userId = $editAssignment->getDirectorId();
520  if ($userId) $userIds[] = array('id' => $userId, 'role' => 'trackDirector');
521  unset($editAssignment);
522  }
523  }
524 
525  if($directors) {
526  $editAssignments =& $editAssignmentDao->getDirectorAssignmentsByPaperId($paperId);
527  while ($editAssignment =& $editAssignments->next()) {
528  $userId = $editAssignment->getDirectorId();
529  if ($userId) $userIds[] = array('id' => $userId, 'role' => 'director');
530  }
531  }
532 
533  return $userIds;
534  }
535 }
536 
537 ?>
Paper\getDateToPresentations
getDateToPresentations()
Definition: Paper.inc.php:281
DataObject\getData
& getData($key, $locale=null)
Definition: DataObject.inc.php:63
Paper\getPaperSubject
getPaperSubject()
Definition: Paper.inc.php:206
Paper\getEndTime
getEndTime()
Definition: Paper.inc.php:359
Paper\getLayoutFileId
getLayoutFileId()
Definition: Paper.inc.php:407
Paper\setDirectorFileId
setDirectorFileId($directorFileId)
Definition: Paper.inc.php:431
Submission\getLocalizedType
getLocalizedType()
Definition: Submission.inc.php:413
Core\getCurrentDate
getCurrentDate($ts=null)
Definition: Core.inc.php:90
Submission
Submission class.
Definition: Submission.inc.php:22
Paper\setEndTime
setEndTime($endTime)
Definition: Paper.inc.php:367
Paper
Paper class.
Definition: Paper.inc.php:54
Paper\setDateToArchive
setDateToArchive($dateToArchive)
Definition: Paper.inc.php:305
Paper\addAuthor
addAuthor($author)
Definition: Paper.inc.php:66
Paper\getPaperCoverageGeo
getPaperCoverageGeo()
Definition: Paper.inc.php:216
Submission\getLocalizedAbstract
getLocalizedAbstract()
Definition: Submission.inc.php:231
Paper\setCommentsToDirector
setCommentsToDirector($commentsToDirector)
Definition: Paper.inc.php:273
Paper\getAssociatedUserIds
getAssociatedUserIds($authors=true, $reviewers=true, $trackDirectors=true, $directors=true)
Definition: Paper.inc.php:494
Submission\getLocalizedDiscipline
getLocalizedDiscipline()
Definition: Submission.inc.php:257
Paper\setLayoutFileId
setLayoutFileId($layoutFileId)
Definition: Paper.inc.php:415
Submission\getUserId
getUserId()
Definition: Submission.inc.php:168
Paper\getStartTime
getStartTime()
Definition: Paper.inc.php:343
Paper\getEnableComments
getEnableComments()
Definition: Paper.inc.php:456
Paper\setTrackId
setTrackId($trackId)
Definition: Paper.inc.php:143
Paper\getDateReminded
getDateReminded()
Definition: Paper.inc.php:327
Paper\getPaperType
getPaperType()
Definition: Paper.inc.php:246
Paper\setStartTime
setStartTime($startTime)
Definition: Paper.inc.php:351
Paper\Paper
Paper()
Definition: Paper.inc.php:58
Paper\setReviewMode
setReviewMode($reviewMode)
Definition: Paper.inc.php:399
Paper\getTrackId
getTrackId()
Definition: Paper.inc.php:135
Paper\setDateToPresentations
setDateToPresentations($dateToPresentations)
Definition: Paper.inc.php:289
Paper\setDateReminded
setDateReminded($dateReminded)
Definition: Paper.inc.php:335
Paper\setCurrentStage
setCurrentStage($currentStage)
Definition: Paper.inc.php:383
Paper\stampDateToPresentations
stampDateToPresentations()
Definition: Paper.inc.php:319
Paper\getCurrentStage
getCurrentStage()
Definition: Paper.inc.php:375
Paper\getPaperDiscipline
getPaperDiscipline()
Definition: Paper.inc.php:185
Paper\getTrackAbbrev
getTrackAbbrev()
Definition: Paper.inc.php:167
COMMENTS_ENABLE
const COMMENTS_ENABLE
Definition: Paper.inc.php:50
Paper\getPaperId
getPaperId()
Definition: Paper.inc.php:101
COMMENTS_TRACK_DEFAULT
const COMMENTS_TRACK_DEFAULT
Definition: Paper.inc.php:48
Submission\getLocalizedSubjectClass
getLocalizedSubjectClass()
Definition: Submission.inc.php:283
Submission\getCommentsStatus
getCommentsStatus()
Definition: Submission.inc.php:878
DAORegistry\getDAO
& getDAO($name, $dbconn=null)
Definition: DAORegistry.inc.php:58
Paper\getSchedConfId
getSchedConfId()
Definition: Paper.inc.php:119
Config\getVar
getVar($section, $key, $default=null)
Definition: Config.inc.php:35
Paper\stampDateToArchive
stampDateToArchive()
Definition: Paper.inc.php:312
Paper\getCommentsStatusOptions
& getCommentsStatusOptions()
Definition: Paper.inc.php:477
Submission\$authors
$authors
Definition: Submission.inc.php:24
Paper\setSchedConfId
setSchedConfId($schedConfId)
Definition: Paper.inc.php:127
Submission\getLocalizedSponsor
getLocalizedSponsor()
Definition: Submission.inc.php:455
COMMENTS_DISABLE
const COMMENTS_DISABLE
Definition: Paper.inc.php:49
Paper\getDateToArchive
getDateToArchive()
Definition: Paper.inc.php:297
Paper\getPaperCoverageSample
getPaperCoverageSample()
Definition: Paper.inc.php:236
Paper\getCommentsStatusString
getCommentsStatusString()
Definition: Paper.inc.php:439
Paper\getReviewMode
getReviewMode()
Definition: Paper.inc.php:391
Paper\getCommentsToDirector
getCommentsToDirector()
Definition: Paper.inc.php:265
DataObject\setId
setId($id)
Definition: DataObject.inc.php:150
Paper\setTrackAbbrev
setTrackAbbrev($trackAbbrev)
Definition: Paper.inc.php:175
DataObject\getId
getId()
Definition: DataObject.inc.php:142
php
config TEMPLATE inc php
Definition: config.inc.php:4
Paper\getTrackTitle
getTrackTitle()
Definition: Paper.inc.php:151
Paper\getPaperSubjectClass
getPaperSubjectClass()
Definition: Paper.inc.php:196
Submission\getLocalizedSubject
getLocalizedSubject()
Definition: Submission.inc.php:309
Paper\setPaperId
setPaperId($paperId)
Definition: Paper.inc.php:110
Paper\getDirectorFileId
getDirectorFileId()
Definition: Paper.inc.php:423
Paper\getPaperTitle
getPaperTitle()
Definition: Paper.inc.php:78
Paper\getPaperCoverageChron
getPaperCoverageChron()
Definition: Paper.inc.php:226
Paper\getPaperSponsor
getPaperSponsor()
Definition: Paper.inc.php:256
DataObject\setData
setData($key, $value, $locale=null)
Definition: DataObject.inc.php:86
Submission\getLocalizedCoverageGeo
getLocalizedCoverageGeo()
Definition: Submission.inc.php:335
Paper\getPaperAbstract
getPaperAbstract()
Definition: Paper.inc.php:88
Submission\getLocalizedCoverageSample
getLocalizedCoverageSample()
Definition: Submission.inc.php:387
Paper\setTrackTitle
setTrackTitle($trackTitle)
Definition: Paper.inc.php:159
Submission\getLocalizedTitle
getLocalizedTitle()
Definition: Submission.inc.php:193
Submission\getLocalizedCoverageChron
getLocalizedCoverageChron()
Definition: Submission.inc.php:361