classes/paper/log/PaperEventLogEntry.inc.php

Go to the documentation of this file.
00001 <?php
00002 
00020 //$Id$
00021 
00022 import('log.EventLogConstants');
00023 
00024 // Log entry event types. All types must be defined here
00025 define('PAPER_LOG_DEFAULT', 0);
00026 
00027 // General events             0x10000000
00028 define('PAPER_LOG_ABSTRACT_SUBMIT',       0x10000001);
00029 define('PAPER_LOG_PRESENTATION_SUBMIT',   0x10000002);
00030 define('PAPER_LOG_METADATA_UPDATE',       0x10000003);
00031 define('PAPER_LOG_SUPPFILE_UPDATE',       0x10000004);
00032 define('PAPER_LOG_ISSUE_SCHEDULE',     0x10000005);
00033 define('PAPER_LOG_ISSUE_ASSIGN',       0x10000006);
00034 define('PAPER_LOG_PAPER_PUBLISH',      0x10000007);
00035 define('PAPER_LOG_PAPER_IMPORT',    0x10000008);
00036 define('PAPER_LOG_PAPER_EXPIRE',    0x10000009);
00037 
00038 // Author events           0x20000000
00039 define('PAPER_LOG_AUTHOR_REVISION',       0x20000001);
00040 
00041 // Director events            0x30000000
00042 define('PAPER_LOG_DIRECTOR_ASSIGN',       0x30000001);
00043 define('PAPER_LOG_DIRECTOR_UNASSIGN',     0x30000002);
00044 define('PAPER_LOG_DIRECTOR_DECISION',     0x30000003);
00045 define('PAPER_LOG_DIRECTOR_FILE',      0x30000004);
00046 define('PAPER_LOG_DIRECTOR_ARCHIVE',      0x30000005);
00047 define('PAPER_LOG_DIRECTOR_RESTORE',      0x30000006);
00048 define('PAPER_LOG_DIRECTOR_EXPEDITE',     0x30000007);
00049 define('PAPER_LOG_DIRECTOR_PUBLISH',      0x30000008);
00050 define('PAPER_LOG_DIRECTOR_UNPUBLISH',       0x30000009);
00051 
00052 // Reviewer events            0x40000000
00053 define('PAPER_LOG_REVIEW_ASSIGN',      0x40000001);
00054 define('PAPER_LOG_REVIEW_UNASSIGN',    0x40000002);
00055 define('PAPER_LOG_REVIEW_INITIATE',       0x40000003);
00056 define('PAPER_LOG_REVIEW_CANCEL',      0x40000004);
00057 define('PAPER_LOG_REVIEW_REINITIATE',     0x40000005);
00058 define('PAPER_LOG_REVIEW_ACCEPT',      0x40000006);
00059 define('PAPER_LOG_REVIEW_DECLINE',     0x40000007);
00060 define('PAPER_LOG_REVIEW_REVISION',       0x40000008);
00061 define('PAPER_LOG_REVIEW_RECOMMENDATION',    0x40000009);
00062 define('PAPER_LOG_REVIEW_RATE',     0x40000010);
00063 define('PAPER_LOG_REVIEW_SET_DUE_DATE',   0x40000011);
00064 define('PAPER_LOG_REVIEW_FILE',     0x40000012);
00065 define('PAPER_LOG_REVIEW_CLEAR',       0x40000013);
00066 define('PAPER_LOG_REVIEW_ACCEPT_BY_PROXY',   0x40000014);
00067 define('PAPER_LOG_REVIEW_RECOMMENDATION_BY_PROXY',    0x40000015);
00068 define('PAPER_LOG_REVIEW_FILE_BY_PROXY',  0x40000016);
00069 
00070 // Layout events           0x70000000
00071 define('PAPER_LOG_LAYOUT_SET_FILE',       0x70000001);
00072 define('PAPER_LOG_LAYOUT_GALLEY',      0x70000002);
00073 
00074 class PaperEventLogEntry extends DataObject {
00075 
00079    function PaperEventLogEntry() {
00080       parent::DataObject();
00081    }
00082 
00088    function setLogMessage($key, $params = array()) {
00089       $this->setMessage($key);
00090       $this->setEntryParams($params);
00091    }
00092 
00093 
00094    //
00095    // Get/set methods
00096    //
00097 
00102    function getLogId() {
00103       return $this->getData('logId');
00104    }
00105 
00110    function setLogId($logId) {
00111       return $this->setData('logId', $logId);
00112    }
00113 
00118    function getPaperId() {
00119       return $this->getData('paperId');
00120    }
00121 
00126    function setPaperId($paperId) {
00127       return $this->setData('paperId', $paperId);
00128    }
00129 
00134    function getUserId() {
00135       return $this->getData('userId');
00136    }
00137 
00142    function setUserId($userId) {
00143       return $this->setData('userId', $userId);
00144    }
00145 
00150    function getDateLogged() {
00151       return $this->getData('dateLogged');
00152    }
00153 
00158    function setDateLogged($dateLogged) {
00159       return $this->setData('dateLogged', $dateLogged);
00160    }
00161 
00166    function getIPAddress() {
00167       return $this->getData('ipAddress');
00168    }
00169 
00174    function setIPAddress($ipAddress) {
00175       return $this->setData('ipAddress', $ipAddress);
00176    }
00177 
00182    function getLogLevel() {
00183       return $this->getData('logLevel');
00184    }
00185 
00190    function setLogLevel($logLevel) {
00191       return $this->setData('logLevel', $logLevel);
00192    }
00193 
00198    function getEventType() {
00199       return $this->getData('eventType');
00200    }
00201 
00206    function setEventType($eventType) {
00207       return $this->setData('eventType', $eventType);
00208    }
00209 
00214    function getAssocType() {
00215       return $this->getData('assocType');
00216    }
00217 
00222    function setAssocType($assocType) {
00223       return $this->setData('assocType', $assocType);
00224    }
00225 
00230    function getAssocId() {
00231       return $this->getData('assocId');
00232    }
00233 
00238    function setAssocId($assocId) {
00239       return $this->setData('assocId', $assocId);
00240    }
00241 
00246    function getIsTranslated() {
00247       return $this->getData('isTranslated');
00248    }
00249 
00257    function setIsTranslated($isTranslated) {
00258       return $this->setData('isTranslated', $isTranslated);
00259    }
00260    
00265    function getEntryParams() {
00266       return $this->getData('entryParams');
00267    }
00268    
00273    function getEntryParamsSerialized() {
00274       return serialize($this->getData('entryParams'));
00275    }
00276    
00281    function setEntryParams($entryParams = array()) {
00282       return $this->setData('entryParams', $entryParams);
00283    }
00284 
00289    function getMessage() {
00290       return $this->getData('message');
00291    }
00292 
00297    function setMessage($message) {
00298       return $this->setData('message', $message);
00299    }
00300 
00305    function getLogLevelString() {
00306       switch ($this->getData('logLevel')) {
00307          case LOG_LEVEL_INFO:
00308             return 'event.logLevel.info';
00309          case LOG_LEVEL_NOTICE:
00310             return 'event.logLevel.notice';
00311          case LOG_LEVEL_WARNING:
00312             return 'event.logLevel.warning';
00313          case LOG_LEVEL_ERROR:
00314             return 'event.logLevel.error';
00315          default:
00316             return 'event.logLevel.notice';
00317       }
00318    }
00319 
00324    function getEventTitle() {
00325       switch ($this->getData('eventType')) {
00326          // General events
00327          case PAPER_LOG_ABSTRACT_SUBMIT:
00328             return 'submission.event.general.abstractSubmitted';
00329          case PAPER_LOG_PRESENTATION_SUBMIT:
00330             return 'submission.event.general.presentationSubmitted';
00331          case PAPER_LOG_METADATA_UPDATE:
00332             return 'submission.event.general.metadataUpdated';
00333          case PAPER_LOG_SUPPFILE_UPDATE:
00334             return 'submission.event.general.suppFileUpdated';
00335          case PAPER_LOG_ISSUE_SCHEDULE:
00336             return 'submission.event.general.issueScheduled';
00337          case PAPER_LOG_ISSUE_ASSIGN:
00338             return 'submission.event.general.issueAssigned';
00339          case PAPER_LOG_PAPER_PUBLISH:
00340             return 'submission.event.general.paperPublished';
00341 
00342          // Author events
00343          case PAPER_LOG_AUTHOR_REVISION:
00344             return 'submission.event.author.authorRevision';
00345 
00346          // Director events
00347          case PAPER_LOG_DIRECTOR_ASSIGN:
00348             return 'submission.event.director.directorAssigned';
00349          case PAPER_LOG_DIRECTOR_UNASSIGN:
00350             return 'submission.event.director.directorUnassigned';
00351          case PAPER_LOG_DIRECTOR_DECISION:
00352             return 'submission.event.director.directorDecision';
00353          case PAPER_LOG_DIRECTOR_FILE:
00354             return 'submission.event.director.directorFile';
00355          case PAPER_LOG_DIRECTOR_ARCHIVE:
00356             return 'submission.event.director.submissionArchived';
00357          case PAPER_LOG_DIRECTOR_RESTORE:
00358             return 'submission.event.director.submissionRestored';
00359 
00360          // Reviewer events
00361          case PAPER_LOG_REVIEW_ASSIGN:
00362             return 'submission.event.reviewer.reviewerAssigned';
00363          case PAPER_LOG_REVIEW_UNASSIGN:
00364             return 'submission.event.reviewer.reviewerUnassigned';
00365          case PAPER_LOG_REVIEW_INITIATE:
00366             return 'submission.event.reviewer.reviewInitiated';
00367          case PAPER_LOG_REVIEW_CANCEL:
00368             return 'submission.event.reviewer.reviewCancelled';
00369          case PAPER_LOG_REVIEW_REINITIATE:
00370             return 'submission.event.reviewer.reviewReinitiated';
00371          case PAPER_LOG_REVIEW_ACCEPT_BY_PROXY:
00372             return 'submission.event.reviewer.reviewAcceptedByProxy';
00373          case PAPER_LOG_REVIEW_ACCEPT:
00374             return 'submission.event.reviewer.reviewAccepted';
00375          case PAPER_LOG_REVIEW_DECLINE:
00376             return 'submission.event.reviewer.reviewDeclined';
00377          case PAPER_LOG_REVIEW_REVISION:
00378             return 'submission.event.reviewer.reviewRevision';
00379          case PAPER_LOG_REVIEW_RECOMMENDATION:
00380             return 'submission.event.reviewer.reviewRecommendation';
00381          case PAPER_LOG_REVIEW_RATE:
00382             return 'submission.event.reviewer.reviewerRated';
00383          case PAPER_LOG_REVIEW_SET_DUE_DATE:
00384             return 'submission.event.reviewer.reviewDueDate';
00385          case PAPER_LOG_REVIEW_FILE:
00386             return 'submission.event.reviewer.reviewFile';
00387 
00388          // Layout events
00389          case PAPER_LOG_LAYOUT_GALLEY:
00390             return 'submission.event.layout.layoutGalleyCreated';
00391 
00392          default:
00393             return 'event.general.defaultEvent';
00394       }
00395    }
00396 
00401    function getUserFullName() {
00402       static $userFullName;
00403 
00404       if(!isset($userFullName)) {
00405          $userDao =& DAORegistry::getDAO('UserDAO');
00406          $userFullName = $userDao->getUserFullName($this->getUserId(), true);
00407       }
00408 
00409       return $userFullName ? $userFullName : '';
00410    }
00411 
00416    function getUserEmail() {
00417       static $userEmail;
00418 
00419       if(!isset($userEmail)) {
00420          $userDao =& DAORegistry::getDAO('UserDAO');
00421          $userEmail = $userDao->getUserEmail($this->getUserId(), true);
00422       }
00423 
00424       return $userEmail ? $userEmail : '';
00425    }
00426 
00431    function getAssocTypeString() {
00432       switch ($this->getData('assocType')) {
00433          case LOG_TYPE_AUTHOR:
00434             return 'AUT';
00435          case LOG_TYPE_DIRECTOR:
00436             return 'DIR';
00437          case LOG_TYPE_REVIEW:
00438             return 'REV';
00439          default:
00440             return 'PAP';
00441       }
00442    }
00443 
00448    function getAssocTypeLongString() {
00449       switch ($this->getData('assocType')) {
00450          case LOG_TYPE_AUTHOR:
00451             return 'event.logType.author';
00452          case LOG_TYPE_DIRECTOR:
00453             return 'event.logType.director';
00454          case LOG_TYPE_REVIEW:
00455             return 'event.logType.review';
00456          default:
00457             return 'event.logType.paper';
00458       }
00459    }
00460 
00461 }
00462 
00463 ?>

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