Index: openacs-4/packages/forums/sql/postgresql/forums-notifications-init.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/sql/postgresql/forums-notifications-init.sql,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/forums/sql/postgresql/forums-notifications-init.sql 1 Jul 2002 04:08:13 -0000 1.3 +++ openacs-4/packages/forums/sql/postgresql/forums-notifications-init.sql 12 Aug 2013 09:34:30 -0000 1.4 @@ -11,45 +11,52 @@ -- the integration with Notifications -create function inline_0() returns integer as ' -declare + + +-- +-- procedure inline_0/0 +-- +CREATE OR REPLACE FUNCTION inline_0( + +) RETURNS integer AS $$ +DECLARE impl_id integer; v_foo integer; -begin +BEGIN -- the notification type impl impl_id := acs_sc_impl__new ( - ''NotificationType'', - ''forums_forum_notif_type'', - ''forums'' + 'NotificationType', + 'forums_forum_notif_type', + 'forums' ); v_foo := acs_sc_impl_alias__new ( - ''NotificationType'', - ''forums_forum_notif_type'', - ''GetURL'', - ''forum::notification::get_url'', - ''TCL'' + 'NotificationType', + 'forums_forum_notif_type', + 'GetURL', + 'forum::notification::get_url', + 'TCL' ); v_foo := acs_sc_impl_alias__new ( - ''NotificationType'', - ''forums_forum_notif_type'', - ''ProcessReply'', - ''forum::notification::process_reply'', - ''TCL'' + 'NotificationType', + 'forums_forum_notif_type', + 'ProcessReply', + 'forum::notification::process_reply', + 'TCL' ); PERFORM acs_sc_binding__new ( - ''NotificationType'', - ''forums_forum_notif_type'' + 'NotificationType', + 'forums_forum_notif_type' ); v_foo:= notification_type__new ( NULL, impl_id, - ''forums_forum_notif'', - ''Forum Notification'', - ''Notifications for Entire Forums'', + 'forums_forum_notif', + 'Forum Notification', + 'Notifications for Entire Forums', now(), NULL, NULL, @@ -60,47 +67,47 @@ insert into notification_types_intervals (type_id, interval_id) select v_foo, interval_id - from notification_intervals where name in (''instant'',''hourly'',''daily''); + from notification_intervals where name in ('instant','hourly','daily'); insert into notification_types_del_methods (type_id, delivery_method_id) select v_foo, delivery_method_id - from notification_delivery_methods where short_name in (''email''); + from notification_delivery_methods where short_name in ('email'); -- the notification type impl impl_id := acs_sc_impl__new ( - ''NotificationType'', - ''forums_message_notif_type'', - ''forums'' + 'NotificationType', + 'forums_message_notif_type', + 'forums' ); v_foo := acs_sc_impl_alias__new ( - ''NotificationType'', - ''forums_message_notif_type'', - ''GetURL'', - ''forum::notification::get_url'', - ''TCL'' + 'NotificationType', + 'forums_message_notif_type', + 'GetURL', + 'forum::notification::get_url', + 'TCL' ); v_foo := acs_sc_impl_alias__new ( - ''NotificationType'', - ''forums_message_notif_type'', - ''ProcessReply'', - ''forum::notification::process_reply'', - ''TCL'' + 'NotificationType', + 'forums_message_notif_type', + 'ProcessReply', + 'forum::notification::process_reply', + 'TCL' ); PERFORM acs_sc_binding__new ( - ''NotificationType'', - ''forums_message_notif_type'' + 'NotificationType', + 'forums_message_notif_type' ); v_foo:= notification_type__new ( NULL, impl_id, - ''forums_message_notif'', - ''Message Notification'', - ''Notifications for Message Thread'', + 'forums_message_notif', + 'Message Notification', + 'Notifications for Message Thread', now(), NULL, NULL, @@ -111,16 +118,17 @@ insert into notification_types_intervals (type_id, interval_id) select v_foo, interval_id - from notification_intervals where name in (''instant'',''hourly'',''daily''); + from notification_intervals where name in ('instant','hourly','daily'); insert into notification_types_del_methods (type_id, delivery_method_id) select v_foo, delivery_method_id - from notification_delivery_methods where short_name in (''email''); + from notification_delivery_methods where short_name in ('email'); return (0); -end; -' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; + select inline_0(); drop function inline_0(); \ No newline at end of file