classes/notification/Notification.inc.php

Go to the documentation of this file.
00001 <?php
00002 
00015 // $Id$
00016 
00017 
00019 define('NOTIFICATION_TYPE_DIRECTOR_DECISION_COMMENT',       0x1000001);
00020 define('NOTIFICATION_TYPE_GALLEY_MODIFIED',        0x1000002);
00021 define('NOTIFICATION_TYPE_METADATA_MODIFIED',         0x1000003);
00022 define('NOTIFICATION_TYPE_NEW_ANNOUNCEMENT',          0x1000004);
00023 define('NOTIFICATION_TYPE_PAPER_SUBMITTED',        0x1000005);
00024 define('NOTIFICATION_TYPE_REVIEWER_COMMENT',          0x1000006);
00025 define('NOTIFICATION_TYPE_REVIEWER_FORM_COMMENT',     0x1000007);
00026 define('NOTIFICATION_TYPE_SUBMISSION_COMMENT',        0x1000008);
00027 define('NOTIFICATION_TYPE_SUPP_FILE_MODIFIED',        0x1000009);
00028 define('NOTIFICATION_TYPE_USER_COMMENT',        0x1000010);
00029 
00030 import('notification.PKPNotification');
00031 import('notification.NotificationDAO');
00032 
00033 class Notification extends PKPNotification {
00034 
00038    function Notification() {
00039       parent::PKPNotification();
00040    }
00041 
00046    function getIconLocation() {
00047       $baseUrl = Request::getBaseUrl() . '/lib/pkp/templates/images/icons/';
00048       switch ($this->getAssocType()) {
00049          case NOTIFICATION_TYPE_PAPER_SUBMITTED:
00050             return $baseUrl . 'page_new.gif';
00051             break;
00052          case NOTIFICATION_TYPE_SUPP_FILE_MODIFIED:
00053          case NOTIFICATION_TYPE_SUPP_FILE_ADDED:
00054             return $baseUrl . 'page_attachment.gif';
00055             break;
00056          case NOTIFICATION_TYPE_METADATA_MODIFIED:
00057          case NOTIFICATION_TYPE_GALLEY_MODIFIED:
00058             return $baseUrl . 'edit.gif';
00059             break;
00060          case NOTIFICATION_TYPE_SUBMISSION_COMMENT:
00061          case NOTIFICATION_TYPE_REVIEWER_COMMENT:
00062          case NOTIFICATION_TYPE_REVIEWER_FORM_COMMENT:
00063          case NOTIFICATION_TYPE_DIRECTOR_DECISION_COMMENT:
00064          case NOTIFICATION_TYPE_USER_COMMENT:
00065             return $baseUrl . 'comment_new.gif';
00066             break;
00067          case NOTIFICATION_TYPE_NEW_ANNOUNCEMENT:
00068             return $baseUrl . 'note_new.gif';
00069             break;
00070          default:
00071             return $baseUrl . 'page_alert.gif';
00072       }
00073    }
00074 
00081    function sendMailingListEmail($email, $password, $template) {
00082       import('mail.MailTemplate');
00083       $conference = Request::getConference();
00084       $site = Request::getSite();
00085 
00086       $params = array(
00087          'password' => $password,
00088          'siteTitle' => $conference->getConferenceTitle(),
00089          'unsubscribeLink' => Request::url(null, null, 'notification', 'unsubscribeMailList')
00090       );
00091 
00092       if ($template == 'NOTIFICATION_MAILLIST_WELCOME') {
00093          $keyHash = md5($password);
00094          $confirmLink = Request::url(null, null, 'notification', 'confirmMailListSubscription', array($keyHash, $email));
00095          $params["confirmLink"] = $confirmLink;
00096       }
00097 
00098       $mail = new MailTemplate($template);
00099       $mail->setFrom($site->getLocalizedContactEmail(), $site->getLocalizedContactName());
00100       $mail->assignParams($params);
00101       $mail->addRecipient($email);
00102       $mail->send();
00103    }
00104 
00109    function getSubscriptionSettings() {
00110       $conference = Request::getConference();
00111       import('payment.ocs.OCSPaymentManager');
00112       $paymentManager =& OCSPaymentManager::getManager();
00113 
00114       $settings = array(
00115          'allowRegReviewer' => $conference->getSetting('allowRegReviewer'),
00116          'allowRegAuthor' => $conference->getSetting('allowRegAuthor')
00117       );
00118 
00119       return $settings;
00120    }
00121 }
00122 
00123 ?>

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