From 8326ce5ba04e23651aff2b1e42d78a12f395754a Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Wed, 20 Jul 2011 14:22:48 +0200 Subject: [PATCH] Extended user notification package (work in progress) --- com.woltlab.wcf.notification/coreobject.xml | 8 ++ .../UserNotificationEditor.class.php | 29 ++++++- .../UserNotificationEventEditor.class.php | 2 +- ...UserNotificationObjectTypeEditor.class.php | 2 +- .../UserNotificationRecipient.class.php | 62 ++++++++++++++ .../UserNotificationRecpientList.class.php | 61 +++++++++++++ .../type/UserNotificationTypeEditor.class.php | 2 +- ...uilderUserNotificationObjectType.class.php | 66 ++++++++++++++ ...onEventPackageInstallationPlugin.class.php | 31 ++++++- .../UserNotificationHandler.class.php | 85 +++++++++++++++++++ .../event/UserNotificationEvent.class.php | 66 ++++++++++++++ .../object/UserNotificationObject.class.php | 35 ++++++++ .../type/UserNotificationObjectType.class.php | 31 +++++++ .../type/MailUserNotificationType.class.php | 60 +++++++++++++ .../type/UserNotificationType.class.php | 35 ++++++++ com.woltlab.wcf.notification/install.sql | 4 +- com.woltlab.wcf.notification/package.xml | 7 +- .../userNotificationType.xml | 9 ++ 18 files changed, 586 insertions(+), 9 deletions(-) create mode 100644 com.woltlab.wcf.notification/coreobject.xml create mode 100644 com.woltlab.wcf.notification/files/lib/data/user/notification/recipient/UserNotificationRecipient.class.php create mode 100644 com.woltlab.wcf.notification/files/lib/data/user/notification/recipient/UserNotificationRecpientList.class.php create mode 100644 com.woltlab.wcf.notification/files/lib/system/cache/CacheBuilderUserNotificationObjectType.class.php create mode 100644 com.woltlab.wcf.notification/files/lib/system/user/notification/UserNotificationHandler.class.php create mode 100644 com.woltlab.wcf.notification/files/lib/system/user/notification/event/UserNotificationEvent.class.php create mode 100644 com.woltlab.wcf.notification/files/lib/system/user/notification/object/UserNotificationObject.class.php create mode 100644 com.woltlab.wcf.notification/files/lib/system/user/notification/object/type/UserNotificationObjectType.class.php create mode 100644 com.woltlab.wcf.notification/files/lib/system/user/notification/type/MailUserNotificationType.class.php create mode 100644 com.woltlab.wcf.notification/files/lib/system/user/notification/type/UserNotificationType.class.php create mode 100644 com.woltlab.wcf.notification/userNotificationType.xml diff --git a/com.woltlab.wcf.notification/coreobject.xml b/com.woltlab.wcf.notification/coreobject.xml new file mode 100644 index 0000000000..48890e4427 --- /dev/null +++ b/com.woltlab.wcf.notification/coreobject.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/com.woltlab.wcf.notification/files/lib/data/user/notification/UserNotificationEditor.class.php b/com.woltlab.wcf.notification/files/lib/data/user/notification/UserNotificationEditor.class.php index 56aa391ade..b92e2fe728 100644 --- a/com.woltlab.wcf.notification/files/lib/data/user/notification/UserNotificationEditor.class.php +++ b/com.woltlab.wcf.notification/files/lib/data/user/notification/UserNotificationEditor.class.php @@ -1,6 +1,7 @@ prepareStatement($sql); + foreach ($recipientIDs as $recipientID) { + $statement->execute(array($notification->notificationID, $recipientID)); + } + } + + return $notification; + } } diff --git a/com.woltlab.wcf.notification/files/lib/data/user/notification/event/UserNotificationEventEditor.class.php b/com.woltlab.wcf.notification/files/lib/data/user/notification/event/UserNotificationEventEditor.class.php index 071e0d16a1..218c4c9fff 100644 --- a/com.woltlab.wcf.notification/files/lib/data/user/notification/event/UserNotificationEventEditor.class.php +++ b/com.woltlab.wcf.notification/files/lib/data/user/notification/event/UserNotificationEventEditor.class.php @@ -14,7 +14,7 @@ use wcf\data\DatabaseObjectEditor; */ class UserNotificationEventEditor extends DatabaseObjectEditor { /** - * @see DatabaseObjectEditor::$baseClass + * @see DatabaseObjectDecorator::$baseClass */ protected static $baseClass = 'wcf\data\user\notification\event\UserNotificationEvent'; } diff --git a/com.woltlab.wcf.notification/files/lib/data/user/notification/object/type/UserNotificationObjectTypeEditor.class.php b/com.woltlab.wcf.notification/files/lib/data/user/notification/object/type/UserNotificationObjectTypeEditor.class.php index aef0718da2..9e8cfad828 100644 --- a/com.woltlab.wcf.notification/files/lib/data/user/notification/object/type/UserNotificationObjectTypeEditor.class.php +++ b/com.woltlab.wcf.notification/files/lib/data/user/notification/object/type/UserNotificationObjectTypeEditor.class.php @@ -14,7 +14,7 @@ use wcf\data\DatabaseObjectEditor; */ class UserNotificationObjectTypeEditor extends DatabaseObjectEditor { /** - * @see DatabaseObjectEditor::$baseClass + * @see DatabaseObjectDecorator::$baseClass */ protected static $baseClass = 'wcf\data\user\notification\object\type\UserNotificationObjectType'; } diff --git a/com.woltlab.wcf.notification/files/lib/data/user/notification/recipient/UserNotificationRecipient.class.php b/com.woltlab.wcf.notification/files/lib/data/user/notification/recipient/UserNotificationRecipient.class.php new file mode 100644 index 0000000000..3cead1c0eb --- /dev/null +++ b/com.woltlab.wcf.notification/files/lib/data/user/notification/recipient/UserNotificationRecipient.class.php @@ -0,0 +1,62 @@ + + * @package com.woltlab.wcf.notification + * @subpackage data.user.notification.user + * @category Community Framework + */ +class UserNotificationRecipient extends DatabaseObjectDecorator { + /** + * @see DatabaseObjectDecorator::$baseClass + */ + protected static $baseClass = 'wcf\data\user\User'; + + /** + * Creates a new UserNotificationRecipient object. + * + * @param wcf\data\user\User $object + */ + public function __construct(User $object) { + parent::__construct($object); + + // get notification types + if (!isset($this->object->data['notificationTypes'])) { + $this->object->data['notificationTypes'] = array(); + $sql = "SELECT event_to_user.eventID, notification_type.* + FROM wcf".WCF_N."_user_notification_event_to_user event_to_user + LEFT JOIN wcf".WCF_N."_user_notification_type notification_type + ON (notification_type.notificationTypeID = event_to_user.notificationTypeID) + WHERE event_to_user.userID = ? + AND event_to_user.enabled = ?"; + $statement = WCF::getDB()->prepareStatement($sql); + $statement->execute(array($this->userID, 1)); + while ($row = $statement->fetchArray()) { + $this->object->data['notificationTypes'][$row['eventID']] = new UserNotificationType(null, $row); + } + } + } + + /** + * Returns the enabled notification types for the given event. + * + * @param integer $eventID + * @return array + */ + public function getNotificationTypes($eventID) { + if (isset($this->notificationTypes[$eventID])) { + return $this->notificationTypes[$eventID]; + } + + return array(); + } +} diff --git a/com.woltlab.wcf.notification/files/lib/data/user/notification/recipient/UserNotificationRecpientList.class.php b/com.woltlab.wcf.notification/files/lib/data/user/notification/recipient/UserNotificationRecpientList.class.php new file mode 100644 index 0000000000..d29a8c6591 --- /dev/null +++ b/com.woltlab.wcf.notification/files/lib/data/user/notification/recipient/UserNotificationRecpientList.class.php @@ -0,0 +1,61 @@ + + * @package com.woltlab.wcf.notification + * @subpackage data.user.notification.user + * @category Community Framework + */ +class UserNotificationRecipientList extends UserList { + /** + * @see wcf\data\DatabaseObjectList\DatabaseObjectList::readObjects() + */ + public function readObjects() { + if ($this->objectIDs === null) { + $this->readObjectIDs(); + } + + if (!count($this->objectIDs)) { + return; + } + + // get notification types + $notificationTypes = array(); + $conditionBuilder = new PreparedStatementConditionBuilder(); + $conditionBuilder->add('event_to_user.userID IN (?)', array($this->objectIDs)); + $conditionBuilder->add('event_to_user.enabled = ?', array(1)); + + $sql = "SELECT event_to_user.eventID, event_to_user.userID, notification_type.* + FROM wcf".WCF_N."_user_notification_event_to_user event_to_user + LEFT JOIN wcf".WCF_N."_user_notification_type notification_type + ON (notification_type.notificationTypeID = event_to_user.notificationTypeID) + ".$conditionBuilder->__toString(); + $statement = WCF::getDB()->prepareStatement($sql); + $statement->execute($conditionBuilder->getParameters()); + while ($row = $statement->fetchArray()) { + $notificationTypes[$row['userID']][$row['eventID']] = new UserNotificationType(null, $row); + } + + // get users + $sql = "SELECT ".(!empty($this->sqlSelects) ? $this->sqlSelects.',' : '')." + ".$this->getDatabaseTableAlias().".* + FROM ".$this->getDatabaseTableName()." ".$this->getDatabaseTableAlias()." + ".$this->sqlJoins." + WHERE ".$this->getDatabaseTableAlias().".".$this->getDatabaseTableIndexName()." IN (?".str_repeat(',?', count($this->objectIDs)).") + ".(!empty($this->sqlOrderBy) ? "ORDER BY ".$this->sqlOrderBy : ''); + $statement = WCF::getDB()->prepareStatement($sql); + $statement->execute($this->objectIDs); + while ($row = $statement->fetchArray()) { + $row['notificationTypes'] = (isset($notificationTypes[$row['userID']]) ? $notificationTypes[$row['userID']] : array()); + $this->objects[] = new UserNotificationRecipient(null, $row); + } + } +} diff --git a/com.woltlab.wcf.notification/files/lib/data/user/notification/type/UserNotificationTypeEditor.class.php b/com.woltlab.wcf.notification/files/lib/data/user/notification/type/UserNotificationTypeEditor.class.php index da9f8e43ea..3d4ff66c74 100644 --- a/com.woltlab.wcf.notification/files/lib/data/user/notification/type/UserNotificationTypeEditor.class.php +++ b/com.woltlab.wcf.notification/files/lib/data/user/notification/type/UserNotificationTypeEditor.class.php @@ -14,7 +14,7 @@ use wcf\data\DatabaseObjectEditor; */ class UserNotificationTypeEditor extends DatabaseObjectEditor { /** - * @see DatabaseObjectEditor::$baseClass + * @see DatabaseObjectDecorator::$baseClass */ protected static $baseClass = 'wcf\data\user\notification\type\UserNotificationType'; } diff --git a/com.woltlab.wcf.notification/files/lib/system/cache/CacheBuilderUserNotificationObjectType.class.php b/com.woltlab.wcf.notification/files/lib/system/cache/CacheBuilderUserNotificationObjectType.class.php new file mode 100644 index 0000000000..a7bbaf3a68 --- /dev/null +++ b/com.woltlab.wcf.notification/files/lib/system/cache/CacheBuilderUserNotificationObjectType.class.php @@ -0,0 +1,66 @@ + + * @package com.woltlab.wcf.notification + * @subpackage system.cache + * @category Community Framework + */ +class CacheBuilderUserNotificationObjectType implements CacheBuilder { + /** + * @see CacheBuilder::getData() + */ + public function getData($cacheResource) { + $data = array(); + + // get package id + $tmp = explode('-', $cacheResource['cache']); + $packageID = array_pop($packageID); + + // get object types + $typeIDArray = array(); + $sql = "SELECT object_type.* + FROM wcf".WCF_N."_user_notification_object_type object_type, + wcf".WCF_N."_package_dependency package_dependency + WHERE object_type.packageID = package_dependency.dependency + AND package_dependency.packageID = ? + ORDER BY package_dependency.priority DESC"; + $statement = WCF::getDB()->prepareStatement($sql); + $statement->execute(array($packageID)); + while ($row = $statement->fetchArray()) { + if (!isset($data[$row['objectType']])) { + $data[$row['objectType']] = array( + 'object' => new UserNotificationObjectType(null, $row), + 'events' => array() + ); + } + } + + // get events + $sql = "SELECT event.*, object_type.objectType + FROM wcf".WCF_N."_package_dependency package_dependency, + wcf".WCF_N."_user_notification_event event + LEFT JOIN wcf".WCF_N."_user_notification_object_type object_type + ON (object_type.objectTypeID = event.objectTypeID) + WHERE event.packageID = package_dependency.dependency + AND package_dependency.packageID = ? + ORDER BY package_dependency.priority DESC"; + $statement = WCF::getDB()->prepareStatement($sql); + $statement->execute(array($packageID)); + while ($row = $statement->fetchArray()) { + if (isset($data[$row['objectType']]) && !isset($data[$row['objectType']]['events'][$row['eventName']])) { + $data[$row['objectType']]['events'][$row['eventName']] = new UserNotificationEvent(null, $row); + } + } + + return $data; + } +} diff --git a/com.woltlab.wcf.notification/files/lib/system/package/plugin/UserNotificationEventPackageInstallationPlugin.class.php b/com.woltlab.wcf.notification/files/lib/system/package/plugin/UserNotificationEventPackageInstallationPlugin.class.php index 1e1eb18d85..a89318707c 100644 --- a/com.woltlab.wcf.notification/files/lib/system/package/plugin/UserNotificationEventPackageInstallationPlugin.class.php +++ b/com.woltlab.wcf.notification/files/lib/system/package/plugin/UserNotificationEventPackageInstallationPlugin.class.php @@ -1,5 +1,6 @@ prepareStatement($sql, 1); + $statement->execute(array($this->installation->getPackageID(), $data['elements']['objecttype'])); + $row = $statement->fetchArray(); + if (empty($row['objectTypeID'])) throw new SystemException("unknown notification object type '".$data['elements']['objecttype']."' given"); + $objectTypeID = $row['objectTypeID']; + + // get notification type id $defaultNotificationTypeID = 0; + if (!empty($data['elements']['defaultnotificationtype'])) { + $sql = "SELECT notification_type.notificationTypeID + FROM wcf".WCF_N."_package_dependency package_dependency, + wcf".WCF_N."_user_notification_type notification_type + WHERE notification_type.packageID = package_dependency.dependency + AND package_dependency.packageID = ? + AND notification_type.notificationType = ? + ORDER BY package_dependency.priority DESC"; + $statement = WCF::getDB()->prepareStatement($sql, 1); + $statement->execute(array($this->installation->getPackageID(), $data['elements']['defaultnotificationtype'])); + $row = $statement->fetchArray(); + if (empty($row['objectTypeID'])) throw new SystemException("unknown notification type '".$data['elements']['defaultnotificationtype']."' given"); + $defaultNotificationTypeID = $row['notificationTypeID']; + } return array( 'eventName' => $data['elements']['name'], diff --git a/com.woltlab.wcf.notification/files/lib/system/user/notification/UserNotificationHandler.class.php b/com.woltlab.wcf.notification/files/lib/system/user/notification/UserNotificationHandler.class.php new file mode 100644 index 0000000000..3714807de2 --- /dev/null +++ b/com.woltlab.wcf.notification/files/lib/system/user/notification/UserNotificationHandler.class.php @@ -0,0 +1,85 @@ + + * @package com.woltlab.wcf.notification + * @subpackage system.user.notification + * @category Community Framework + */ +class UserNotificationHandler extends SingletonFactory { + /** + * list of available object types + * @var array + */ + protected $availableObjectTypes = array(); + + /** + * @see wcf\system\SingletonFactory::init() + */ + protected function init() { + // load cache + CacheHandler::getInstance()->addResource('user-notification-object-type-'.PACKAGE_ID, WCF_DIR.'cache/cache.user-notification-object-type-'.PACKAGE_ID.'.php', 'wcf\system\cache\CacheBuilderUserNotificationObjectType'); + $this->availableObjectTypes = CacheHandler::getInstance()->get('user-notification-object-type-'.PACKAGE_ID); + } + + /** + * Triggers a notification event. + * + * @param string $eventName + * @param string $objectType + * @param wcf\system\user\notification\object\UserNotificationObject $notificationObject + * @param array $recipientIDs + * @param array $additionalData + */ + public function fireEvent($eventName, $objectType, UserNotificationObject $notificationObject, array $recipientIDs, array $additionalData = array()) { + // check given object type and event name + if (!isset($this->availableObjectTypes[$objectType]['events'][$eventName])) { + throw new SystemException("Unknown event '.$objectType.'-.$eventName.' given"); + } + + // get objects + $objectTypeData = $this->availableObjectTypes[$objectType]['object']; + $eventData = $this->availableObjectTypes[$objectType]['events'][$eventName]; + + // save notification + $action = new UserNotificationAction(array(), 'create', array( + 'packageID' => PACKAGE_ID, + 'eventID' => $eventData->eventID, + 'objectID' => $notificationObject->getObjectID(), + 'time' => TIME_NOW, + 'shortOutput' => $eventData->getObject()->getShortOutput($eventName), + 'mediumOutput' => $eventData->getObject()->getMediumOutput($eventName), + 'longOutput' => $eventData->getObject()->getOutput($eventName), + 'additionalData' => serialize($additionalData), + 'recipientIDs' => $recipientIDs + )); + $notification = $action->executeAction(); + + // get recipients + $recipientList = new UserNotificationRecipientList(); + $recipientList->getConditionBuilder()->add('user_table.userID = ?', array($recipientIDs)); + $recipientList->readObjects(); + + // sends notifications + foreach ($recipientList->getObjects() as $recipient) { + foreach ($recipient->getNotificationTypes($eventData->eventID) as $notificationType) { + if ($eventData->getObject()->supportsNotificationType($notificationType)) { + $notificationType->getObject()->send($notification, $recipient, $eventData); + } + } + } + } +} diff --git a/com.woltlab.wcf.notification/files/lib/system/user/notification/event/UserNotificationEvent.class.php b/com.woltlab.wcf.notification/files/lib/system/user/notification/event/UserNotificationEvent.class.php new file mode 100644 index 0000000000..09f40305d4 --- /dev/null +++ b/com.woltlab.wcf.notification/files/lib/system/user/notification/event/UserNotificationEvent.class.php @@ -0,0 +1,66 @@ + + * @package com.woltlab.wcf.notification + * @subpackage system.user.notification.event + * @category Community Framework + */ +interface UserNotificationEvent { + /** + * Returns the message for this notification event. + * + * @param wcf\data\user\notification\type\UserNotificationType $notificationType + * @return string + */ + public function getMessage(UserNotificationType $notificationType); + + /** + * Returns the short output for this notification event. + * + * @return string + */ + public function getShortOutput(); + + /** + * Returns the medium output for this notification event. + * + * @return string + */ + public function getMediumOutput(); + + /** + * Returns the full output for this notification event. + * + * @return string + */ + public function getOutput(); + + /** + * Returns the human-readable title of this event. + * + * @return string + */ + public function getTitle(); + + /** + * Returns the human-readable description of this event. + * + * @return string + */ + public function getDescription(); + + /** + * Returns true if this event supports the given notification type. + * + * @param wcf\data\user\notification\type\UserNotificationType $notificationType + * @return boolean + */ + public function supportsNotificationType(UserNotificationType $notificationType); +} diff --git a/com.woltlab.wcf.notification/files/lib/system/user/notification/object/UserNotificationObject.class.php b/com.woltlab.wcf.notification/files/lib/system/user/notification/object/UserNotificationObject.class.php new file mode 100644 index 0000000000..555020fb37 --- /dev/null +++ b/com.woltlab.wcf.notification/files/lib/system/user/notification/object/UserNotificationObject.class.php @@ -0,0 +1,35 @@ + + * @package com.woltlab.wcf.notification + * @subpackage system.user.notification.object + * @category Community Framework + */ +interface UserNotificationObject { + /** + * Returns the ID of this object. + * + * @return integer + */ + public function getObjectID(); + + /** + * Returns the title of this object. + * + * @return string + */ + public function getTitle(); + + /** + * Returns the url of this object. + * + * @return string + */ + public function getURL(); +} diff --git a/com.woltlab.wcf.notification/files/lib/system/user/notification/object/type/UserNotificationObjectType.class.php b/com.woltlab.wcf.notification/files/lib/system/user/notification/object/type/UserNotificationObjectType.class.php new file mode 100644 index 0000000000..c595a30389 --- /dev/null +++ b/com.woltlab.wcf.notification/files/lib/system/user/notification/object/type/UserNotificationObjectType.class.php @@ -0,0 +1,31 @@ + + * @package com.woltlab.wcf.notification + * @subpackage system.user.notification.object.type + * @category Community Framework + */ +interface UserNotificationObjectType { + /** + * Gets a notification object by its ID. + * + * @param integer $objectID + * @return wcf\system\user\notification\object\UserNotificationObject + */ + public function getObjectByID($objectID); + + /** + * Gets notification objects by their IDs. + * + * @param array $objectIDs + * @return array + */ + public function getObjectsByIDs($objectIDs); + +} diff --git a/com.woltlab.wcf.notification/files/lib/system/user/notification/type/MailUserNotificationType.class.php b/com.woltlab.wcf.notification/files/lib/system/user/notification/type/MailUserNotificationType.class.php new file mode 100644 index 0000000000..9f7b00d5b4 --- /dev/null +++ b/com.woltlab.wcf.notification/files/lib/system/user/notification/type/MailUserNotificationType.class.php @@ -0,0 +1,60 @@ + + * @package com.woltlab.wcf.notification + * @subpackage system.user.notification.type + * @category Community Framework + */ +class MailUserNotificationType implements UserNotificationType { + /** + * @see wcf\system\user\notification\type\UserNotificationType::send() + */ + public function send(UserNotification $notification, User $user, UserNotificationEvent $event) { + // get message + $message = $event->getMessage($this, array( + 'user' => $user, + 'pageURL' => FileUtil::addTrailingSlash(PAGE_URL) + )); + + // append notification mail footer + $token = $user->notificationMailToken; + if (!$token) { + // generate token if not present + $token = StringUtil::substring($token = StringUtil::getHash(serialize(array($user->userID, StringUtil::getRandomID()))), 0, 20); + $editor = new UserEditor($user); + $editor->updateUserOptions(array('notificationMailToken' => $token)); + } + $message .= "\n".$event->getLanguage()->getDynamicVariable('wcf.user.notification.type.mail.footer', array( + 'user' => $user, + 'pageURL' => FileUtil::addTrailingSlash(PAGE_URL), + 'token' => $token, + 'notification' => $notification + )); + + // use short output as mail subject and strip its HTML + $shortMessage = StringUtil::stripHTML($notification->shortOutput); + + // build mail + $mail = new Mail(array($user->username => $user->email), $event->getLanguageVariable('wcf.user.notification.type.mail.subject', array('title' => $shortMessage)), $message); + $mail->send(); + } + + /** + * @see wcf\system\user\notification\type\UserNotificationType::revoke() + */ + public function revoke(UserNotification $notification, User $user, UserNotificationEvent $event) { + // unsupported + return; + } +} diff --git a/com.woltlab.wcf.notification/files/lib/system/user/notification/type/UserNotificationType.class.php b/com.woltlab.wcf.notification/files/lib/system/user/notification/type/UserNotificationType.class.php new file mode 100644 index 0000000000..6ed8fb6087 --- /dev/null +++ b/com.woltlab.wcf.notification/files/lib/system/user/notification/type/UserNotificationType.class.php @@ -0,0 +1,35 @@ + + * @package com.woltlab.wcf.notification + * @subpackage system.user.notification.type + * @category Community Framework + */ +interface UserNotificationType { + /** + * Sends the notification using this notification transport type. + * + * @param wcf\data\user\notification\UserNotification $notification + * @param wcf\data\user\User $user + * @param wcf\data\user\notification\event\UserNotificationEvent $event + */ + public function send(UserNotification $notification, User $user, UserNotificationEvent $event); + + /** + * Tries to revoke the notification. This might not be applicable for all notification types. + * + * @param wcf\data\user\notification\UserNotification $notification + * @param wcf\data\user\User $user + * @param wcf\data\user\notification\event\UserNotificationEvent $event + */ + public function revoke(UserNotification $notification, User $user, UserNotificationEvent $event); +} diff --git a/com.woltlab.wcf.notification/install.sql b/com.woltlab.wcf.notification/install.sql index 5857f676ad..367c463da1 100644 --- a/com.woltlab.wcf.notification/install.sql +++ b/com.woltlab.wcf.notification/install.sql @@ -17,7 +17,7 @@ DROP TABLE IF EXISTS wcf1_user_notification_to_user; CREATE TABLE wcf1_user_notification_to_user ( notificationID INT(10) NOT NULL, userID INT(10) NOT NULL, - confirmed TINYINT(1) NOT NULL, + confirmed TINYINT(1) NOT NULL DEFAULT 0, confirmationTime INT(10) NOT NULL DEFAULT 0, UNIQUE KEY notificationID (notificationID, userID) ); @@ -36,7 +36,7 @@ CREATE TABLE wcf1_user_notification_event ( acceptURL VARCHAR(255) NOT NULL DEFAULT '', declineURL VARCHAR(255) NOT NULL DEFAULT '', permissions TEXT, - options TEXT, + options TEXT, UNIQUE KEY packageID (packageID, eventName) ); diff --git a/com.woltlab.wcf.notification/package.xml b/com.woltlab.wcf.notification/package.xml index f7ee01560b..3c19547ab8 100644 --- a/com.woltlab.wcf.notification/package.xml +++ b/com.woltlab.wcf.notification/package.xml @@ -1,7 +1,8 @@ - + - User Notification System + User Notification System + Provides functions to deliver notification messages 1.0.0 Alpha 1 2010-08-22 1 @@ -20,5 +21,7 @@ pip.xml files.tar install.sql + userNotificationType.xml + coreobject.xml \ No newline at end of file diff --git a/com.woltlab.wcf.notification/userNotificationType.xml b/com.woltlab.wcf.notification/userNotificationType.xml new file mode 100644 index 0000000000..86ff008301 --- /dev/null +++ b/com.woltlab.wcf.notification/userNotificationType.xml @@ -0,0 +1,9 @@ + + + + + mail + wcf\system\user\notification\type\MailUserNotificationType + + + \ No newline at end of file -- 2.20.1