classes/paper/log/PaperLog.inc.php

Go to the documentation of this file.
00001 <?php
00002 
00015 //$Id$
00016 
00017 class PaperLog {
00018 
00024    function logEventEntry($paperId, &$entry) {
00025       $paperDao =& DAORegistry::getDAO('PaperDAO');
00026       $schedConfId = $paperDao->getPaperSchedConfId($paperId);
00027 
00028       if (!$schedConfId) {
00029          // Invalid paper
00030          return false;
00031       }
00032       $schedConfDao =& DAORegistry::getDAO('SchedConfDAO');
00033       $schedConf =& $schedConfDao->getSchedConf($schedConfId);
00034       $conferenceId = $schedConf->getConferenceId();
00035 
00036       $settingsDao =& DAORegistry::getDAO('ConferenceSettingsDAO');
00037       if (!$settingsDao->getSetting($conferenceId, 'paperEventLog')) {
00038          // Event logging is disabled
00039          return false;
00040       }
00041 
00042       // Add the entry
00043       $entry->setPaperId($paperId);
00044 
00045       if ($entry->getUserId() == null) {
00046          $user =& Request::getUser();
00047          $entry->setUserId($user == null ? 0 : $user->getId());
00048       }
00049 
00050       $logDao =& DAORegistry::getDAO('PaperEventLogDAO');
00051       return $logDao->insertLogEntry($entry);
00052    }
00053 
00063    function logEvent($paperId, $eventType, $assocType = 0, $assocId = 0, $messageKey = null, $messageParams = array()) {
00064       return PaperLog::logEventLevel($paperId, LOG_LEVEL_NOTICE, $eventType, $assocType, $assocId, $messageKey, $messageParams);
00065    }
00066 
00077    function logEventLevel($paperId, $logLevel, $eventType, $assocType = 0, $assocId = 0, $messageKey = null, $messageParams = array()) {
00078       $entry = new PaperEventLogEntry();
00079       $entry->setLogLevel($logLevel);
00080       $entry->setEventType($eventType);
00081       $entry->setAssocType($assocType);
00082       $entry->setAssocId($assocId);
00083 
00084       if (isset($messageKey)) {
00085          $entry->setLogMessage($messageKey, $messageParams);
00086       }
00087 
00088       return PaperLog::logEventEntry($paperId, $entry);
00089    }
00090 
00096    function &getEventLogEntries($paperId, $rangeInfo = null) {
00097       $logDao =& DAORegistry::getDAO('PaperEventLogDAO');
00098       $returner =& $logDao->getPaperLogEntries($paperId, $rangeInfo);
00099       return $returner;
00100    }
00101 
00107    function logEmailEntry($paperId, &$entry) {
00108       $paperDao =& DAORegistry::getDAO('PaperDAO');
00109       $schedConfId = $paperDao->getPaperSchedConfId($paperId);
00110 
00111       $schedConfDao =& DAORegistry::getDAO('SchedConfDAO');
00112       $schedConf =& $schedConfDao->getSchedConf($schedConfId);
00113 
00114       if (!$schedConfId) {
00115          // Invalid paper
00116          return false;
00117       }
00118 
00119       $settingsDao =& DAORegistry::getDAO('ConferenceSettingsDAO');
00120       if (!$settingsDao->getSetting($schedConf->getConferenceId(), 'paperEmailLog')) {
00121          // Email logging is disabled
00122          return false;
00123       }
00124 
00125       // Add the entry
00126       $entry->setPaperId($paperId);
00127 
00128       if ($entry->getSenderId() == null) {
00129          $user =& Request::getUser();
00130          $entry->setSenderId($user == null ? 0 : $user->getId());
00131       }
00132 
00133       $logDao =& DAORegistry::getDAO('PaperEmailLogDAO');
00134       return $logDao->insertLogEntry($entry);
00135    }
00136 
00142    function &getEmailLogEntries($paperId, $rangeInfo = null) {
00143       $logDao =& DAORegistry::getDAO('PaperEmailLogDAO');
00144       $result =& $logDao->getPaperLogEntries($paperId, $rangeInfo);
00145       return $result;
00146    }
00147 
00148 }
00149 
00150 ?>

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