Index: openacs-4/packages/notifications/www/request-notification.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/www/request-notification.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/notifications/www/request-notification.tcl 24 May 2005 21:10:47 -0000 1.1 +++ openacs-4/packages/notifications/www/request-notification.tcl 27 Oct 2014 16:41:51 -0000 1.2 @@ -2,13 +2,13 @@ Subscribe a person or a group to a notification of an object and a type. - @author Natalia P�rez (nperper@it.uc3m.es) + @author Natalia Pérez (nperper@it.uc3m.es) @create-date 2005-03-28 } { - object_id:integer,notnull - type_id - {group_id ""} + object_id:naturalnum,notnull + type_id:naturalnum,notnull + {group_id:naturalnum ""} } set package_id [ad_conn package_id] @@ -27,13 +27,13 @@ set delivery_methods [notification::get_delivery_methods -type_id $type_id] #if group_id parameter exists then all users of this community are subscribed if they're not already subscribed -if {$group_id != ""} { +if {$group_id ne ""} { set interval_id [notification::get_interval_id -name instant] set delivery_method_id [notification::get_delivery_method_id -name email] db_foreach get_member_id {} { # Add notification for this user if they're not already subscribed for an instant alert - if {[string equal [notification::request::get_request_id -user_id $user_id -type_id $type_id -object_id $object_id] ""] } { + if {[notification::request::get_request_id -user_id $user_id -type_id $type_id -object_id $object_id] eq ""} { notification::request::new -type_id $type_id -user_id $user_id -object_id $object_id -interval_id $interval_id \ -delivery_method_id $delivery_method_id } @@ -61,23 +61,23 @@ -widget select\ -label "[_ notifications.Delivery_Method]"\ -options $delivery_methods\ - -value [lindex [lindex $delivery_methods 0] 1] + -value [lindex $delivery_methods 0 1] set username "" if {[template::form is_valid notify]} { template::form get_values notify party_id interval_id type_id delivery_method_id db_foreach get_user {} { - if {[string equal [notification::request::get_request_id -user_id $user_id -type_id $type_id -object_id $object_id] ""] } { + if {[notification::request::get_request_id -user_id $user_id -type_id $type_id -object_id $object_id] eq ""} { notification::request::new -type_id $type_id -user_id $user_id -object_id $object_id -interval_id $interval_id \ -delivery_method_id $delivery_method_id } } #if party_id is a group of users then returnredirect, else we get an error db_0or1row get_user_name {} - if {$username == ""} { + if {$username eq ""} { ad_returnredirect $return_url }