Index: openacs-4/packages/notifications/tcl/notification-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/tcl/notification-procs-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/notifications/tcl/notification-procs-oracle.xql 29 May 2002 05:12:01 -0000 1.1 +++ openacs-4/packages/notifications/tcl/notification-procs-oracle.xql 3 Jun 2002 22:27:00 -0000 1.2 @@ -1,13 +1,14 @@ + - oracle8.1.6 + oracle8.1.6 - - -declare begin - notification.delete(:notification_id); -end; - - + + + declare begin + notification.delete(:notification_id); + end; + + Index: openacs-4/packages/notifications/tcl/notification-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/tcl/notification-procs.xql,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/notifications/tcl/notification-procs.xql 30 May 2002 06:26:09 -0000 1.3 +++ openacs-4/packages/notifications/tcl/notification-procs.xql 3 Jun 2002 22:27:00 -0000 1.4 @@ -1,61 +1,72 @@ + - - -select interval_id from notification_intervals where name= :name - - + + + select interval_id + from notification_intervals + where name = :name + + - - -select delivery_method_id from notification_delivery_methods where short_name= :name - - + + + select delivery_method_id + from notification_delivery_methods + where short_name = :name + + - - -select name, interval_id from -notification_intervals -order by n_seconds - - + + + select name, + interval_id + from notification_intervals + order by n_seconds + + - - -select name, notification_intervals.interval_id from -notification_intervals, notification_types_intervals -where -notification_intervals.interval_id = notification_types_intervals.interval_id -and type_id= :type_id -order by n_seconds - - + + + select name, + notification_intervals.interval_id + from notification_intervals, + notification_types_intervals + where notification_intervals.interval_id = notification_types_intervals.interval_id + and type_id = :type_id + order by n_seconds + + - - -select pretty_name, notification_delivery_methods.delivery_method_id -from notification_delivery_methods, notification_types_del_methods -where -notification_delivery_methods.delivery_method_id = notification_types_del_methods.delivery_method_id -and type_id= :type_id -order by pretty_name - - + + + select pretty_name, + notification_delivery_methods.delivery_method_id + from notification_delivery_methods, + notification_types_del_methods + where notification_delivery_methods.delivery_method_id = notification_types_del_methods.delivery_method_id + and type_id = :type_id + order by pretty_name + + - - -delete from notification_user_map -where notification_id= :notification_id - - + + + delete + from notification_user_map + where notification_id = :notification_id + + - - -insert into notification_user_map -(notification_id, user_id, sent_date) values -(:notification_id, :user_id, sysdate) - - + + + insert + into notification_user_map + (notification_id, user_id, sent_date) + values + (:notification_id, :user_id, sysdate) + + Index: openacs-4/packages/notifications/tcl/notification-reply-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/tcl/notification-reply-procs-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/notifications/tcl/notification-reply-procs-oracle.xql 3 Jun 2002 08:13:18 -0000 1.1 +++ openacs-4/packages/notifications/tcl/notification-reply-procs-oracle.xql 3 Jun 2002 22:27:00 -0000 1.2 @@ -1,13 +1,14 @@ + - oracle8.1.6 + oracle8.1.6 - - -declare begin - notification_reply.delete(reply_id => :reply_id); -end; - - + + + declare begin + notification_reply.delete(reply_id => :reply_id); + end; + + Index: openacs-4/packages/notifications/tcl/notification-request-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/tcl/notification-request-procs-oracle.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/notifications/tcl/notification-request-procs-oracle.xql 29 May 2002 05:12:01 -0000 1.2 +++ openacs-4/packages/notifications/tcl/notification-request-procs-oracle.xql 3 Jun 2002 22:27:00 -0000 1.3 @@ -1,21 +1,22 @@ + - oracle8.1.6 + oracle8.1.6 - - -declare begin - notification_request.delete(request_id => :request_id); -end; - - + + + declare begin + notification_request.delete(request_id => :request_id); + end; + + - - -declare begin - notification_request.delete_all(object_id => :object_id); -end; - - + + + declare begin + notification_request.delete_all(object_id => :object_id); + end; + + Index: openacs-4/packages/notifications/tcl/notification-request-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/tcl/notification-request-procs-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/notifications/tcl/notification-request-procs-postgresql.xql 24 May 2002 20:42:42 -0000 1.1 +++ openacs-4/packages/notifications/tcl/notification-request-procs-postgresql.xql 3 Jun 2002 22:27:00 -0000 1.2 @@ -1,11 +1,12 @@ + - postgresql7.1 + postgresql7.1 - - -select notification_request__delete(:request_id); - - + + + select notification_request__delete(:request_id); + + Index: openacs-4/packages/notifications/tcl/notification-request-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/tcl/notification-request-procs.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/notifications/tcl/notification-request-procs.xql 3 Jun 2002 05:55:01 -0000 1.2 +++ openacs-4/packages/notifications/tcl/notification-request-procs.xql 3 Jun 2002 22:27:00 -0000 1.3 @@ -1,4 +1,5 @@ + @@ -7,7 +8,7 @@ from notification_requests where type_id = :type_id and user_id = :user_id - and object_id= :object_id + and object_id = :object_id Index: openacs-4/packages/notifications/tcl/notification-type-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/tcl/notification-type-procs.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/notifications/tcl/notification-type-procs.xql 24 May 2002 20:42:42 -0000 1.1 +++ openacs-4/packages/notifications/tcl/notification-type-procs.xql 3 Jun 2002 22:27:00 -0000 1.2 @@ -1,55 +1,72 @@ + - - -select type_id from notification_types where short_name = :short_name - - + + + select type_id + from notification_types + where short_name = :short_name + + - - -select type_id, short_name, pretty_name, description from notification_types -where short_name= :short_name - - + + + select type_id, + short_name, + pretty_name, + description + from notification_types + where short_name = :short_name + + - - -insert into notification_types_intervals -(type_id, interval_id) select :type_id, :interval_id -from dual where not exists -(select 1 from notification_types_intervals -where type_id = :type_id -and interval_id = :interval_id) - - + + + insert + into notification_types_intervals + (type_id, interval_id) + select :type_id, + :interval_id + from dual + where not exists (select 1 + from notification_types_intervals + where type_id = :type_id + and interval_id = :interval_id) + + - - -delete from notification_types_intervals -where type_id = :type_id -and interval_id = :interval_id - - + + + delete + from notification_types_intervals + where type_id = :type_id + and interval_id = :interval_id + + - - -insert into notification_types_del_methods -(type_id, delivery_method_id) select :type_id, :delivery_method_id -from dual where not exists -(select 1 from notification_types_del_methods -where type_id = :type_id -and delivery_method_id = :delivery_method_id) - - + + + insert + into notification_types_del_methods + (type_id, delivery_method_id) + select :type_id, + :delivery_method_id + from dual + where not exists (select 1 + from notification_types_del_methods + where type_id = :type_id + and delivery_method_id = :delivery_method_id) + + - - -delete from notification_types_del_methods -where type_id = :type_id -and delivery_method_id = :delivery_method_id - - + + + delete + from notification_types_del_methods + where type_id = :type_id + and delivery_method_id = :delivery_method_id + + Index: openacs-4/packages/notifications/tcl/sweep-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/tcl/sweep-procs-oracle.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/notifications/tcl/sweep-procs-oracle.xql 3 Jun 2002 08:13:18 -0000 1.2 +++ openacs-4/packages/notifications/tcl/sweep-procs-oracle.xql 3 Jun 2002 22:27:00 -0000 1.3 @@ -1,30 +1,40 @@ + - oracle8.1.6 + oracle8.1.6 - - -select notification_id -from notifications where not exists -(select notifications.notification_id -from notifications, notification_requests, notification_user_map -where notifications.type_id = notification_requests.type_id -and notifications.object_id = notification_requests.object_id -and notifications.notification_id = notification_user_map.notification_id (+) -and sent_date is NULL) - - + + + select notification_id + from notifications + where not exists (select notifications.notification_id + from notifications, + notification_requests, + notification_user_map + where notifications.type_id = notification_requests.type_id + and notifications.object_id = notification_requests.object_id + and notifications.notification_id = notification_user_map.notification_id (+) + and sent_date is null) + + - - -select notifications.notification_id, notif_subject, notif_text, notif_html, notification_requests.user_id, acs_object.name(object_id) as object_name -from notifications, notification_requests, notification_user_map -where notifications.type_id = notification_requests.type_id -and interval_id = :interval_id -and notifications.object_id = notification_requests.object_id -and notifications.notification_id = notification_user_map.notification_id (+) -and sent_date is NULL - - + + + select notifications.notification_id, + notif_subject, + notif_text, + notif_html, + notification_requests.user_id, + acs_object.name(notifications.object_id) as object_name + from notifications, + notification_requests, + notification_user_map + where notifications.type_id = notification_requests.type_id + and interval_id = :interval_id + and notifications.object_id = notification_requests.object_id + and notifications.notification_id = notification_user_map.notification_id (+) + and sent_date is null + + Index: openacs-4/packages/notifications/tcl/sweep-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/tcl/sweep-procs.tcl,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/notifications/tcl/sweep-procs.tcl 3 Jun 2002 08:13:18 -0000 1.4 +++ openacs-4/packages/notifications/tcl/sweep-procs.tcl 3 Jun 2002 22:27:00 -0000 1.5 @@ -28,9 +28,11 @@ # Get email set email [cc_email_from_party $user_id] - acs_mail_lite::send -to_addr $email -from_addr "notifications@openforce.biz" \ - -subject $subject \ - -body $content + acs_mail_lite::send \ + -to_addr $email \ + -from_addr "notifications@openforce.biz" \ + -subject $subject \ + -body $content } ad_proc -public cleanup_notifications {} { @@ -63,14 +65,15 @@ db_transaction { # Send it send_one -user_id [ns_set get $notif user_id] \ - -subject "\[[ad_system_name] - [ns_set get $notif object_name]\]: [ns_set get $notif notif_subject]" \ - -content [ns_set get $notif notif_text] \ - -response_id [ns_set get $notif response_id] \ - -delivery_method_id [ns_set get $notif delivery_method_id] + -subject "\[[ad_system_name] - [ns_set get $notif object_name]\] [ns_set get $notif notif_subject]" \ + -content [ns_set get $notif notif_text] \ + -response_id [ns_set get $notif response_id] \ + -delivery_method_id [ns_set get $notif delivery_method_id] # Markt it as sent - notification::mark_sent -notification_id [ns_set get $notif notification_id] \ - -user_id [ns_set get $notif user_id] + notification::mark_sent \ + -notification_id [ns_set get $notif notification_id] \ + -user_id [ns_set get $notif user_id] } } else { # It's batched, we're not handling this one yet