Commit 6304ee5e authored by Penny Leach's avatar Penny Leach
Browse files

[untested] beginnings of internal notification plugin

parent 426f13b9
......@@ -8,7 +8,7 @@
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
<FIELD NAME="type" TYPE="char" LENGTH="50" NOTNULL="true" />
<FIELD NAME="user" TYPE="int" LENGTH="10" NOTNULL="true" />
<FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" />
<FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
<FIELD NAME="message" TYPE="text" NOTNULL="true" />
<FIELD NAME="url" TYPE="text" NOTNULL="false" />
......@@ -17,7 +17,7 @@
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" />
<KEY NAME="typefk" TYPE="foreign" FIELDS="type" REFTABLE="activity_type" REFFIELDS="name" />
<KEY NAME="userfk" TYPE="foreign" FIELDS="user" REFTABLE="usr" REFFIELDS="id" />
<KEY NAME="userfk" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id" />
</KEYS>
</TABLE>
</TABLES>
......
......@@ -26,14 +26,26 @@
defined('INTERNAL') || die();
require_once(get_config('docroot') . 'notification/lib.php');
class PluginNotificationInternal extends PluginNotification {
public static function notify_user($user, $data) {
// @todo
$toinsert = new StdClass;
$toinsert->type = $data->activitytype;
$toinsert->usr = $user->id;
if (!empty($user->markasread)) {
$toinsert->read = 1;
}
else {
$toinsert->read = 0;
}
$toinsert->message = $message;
$toinsert->cime = db_format_timestamp(time());
if (!empty($data->url)) {
$toinsert->url = $data->url;
}
insert_record('notification_internal_activity', $toinsert);
}
}
?>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment