Index: openacs-4/packages/acs-subsite/www/pvt/alerts.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/pvt/alerts.tcl,v
diff -u -r1.9 -r1.10
--- openacs-4/packages/acs-subsite/www/pvt/alerts.tcl 29 May 2018 09:09:55 -0000 1.9
+++ openacs-4/packages/acs-subsite/www/pvt/alerts.tcl 3 Sep 2024 15:37:34 -0000 1.10
@@ -14,13 +14,13 @@
set user_id [ad_conn user_id]
-set user [acs_user::get -user_id $user_id]
-set first_names [dict get $user first_names]
-set last_name [dict get $user last_name]
-set email [dict get $user email]
-set url [dict get $user url]
-set full_name [dict get $user name]
-if { [string trim $full_name] eq "" } {
+set user_info [acs_user::get -user_id $user_id]
+set first_names [dict get $user_info first_names]
+set last_name [dict get $user_info last_name]
+set email [dict get $user_info email]
+set url [dict get $user_info url]
+set full_name [dict get $user_info name]
+if { [string is space $full_name] } {
set full_name "name unknown"
}
@@ -38,43 +38,43 @@
set rownum 0
if { [bboard_pls_blade_installed_p] == 1 } {
- set bboard_keyword_p 1
+ set bboard_keyword_p 1
} else {
- set bboard_keyword_p 0
+ set bboard_keyword_p 0
}
-
+
db_foreach alerts_list {
select bea.valid_p, bea.frequency, bea.keywords, bt.topic, bea.rowid
from bboard_email_alerts bea, bboard_topics bt
where bea.user_id = :user_id
and bea.topic_id = bt.topic_id
order by bea.frequency
} {
- incr rownum
+ incr rownum
- if { $valid_p == "f" } {
- # alert has been disabled for some reason
- set bboard_rows:$rownum(status) "disable"
- set bboard_rows:$rownum(action_url) "/bboard/alert-reenable?rowid=[ns_urlencode $rowid]"
- } else {
- # alert is enabled
- set bboard_rows:$rownum(status) "enable"
- set bboard_rows:$rownum(action_url) "/bboard/alert-disable?rowid=[ns_urlencode $rowid]"
- }
+ if { $valid_p == "f" } {
+ # alert has been disabled for some reason
+ set bboard_rows:$rownum(status) "disable"
+ set bboard_rows:$rownum(action_url) "/bboard/alert-reenable?rowid=[ns_urlencode $rowid]"
+ } else {
+ # alert is enabled
+ set bboard_rows:$rownum(status) "enable"
+ set bboard_rows:$rownum(action_url) "/bboard/alert-disable?rowid=[ns_urlencode $rowid]"
+ }
- set bboard_rows:$rownum(topic) $topic
- set bboard_rows:$rownum(frequency) $frequency
- set bboard_rows:$rownum(keywords) $keywords
-
+ set bboard_rows:$rownum(topic) $topic
+ set bboard_rows:$rownum(frequency) $frequency
+ set bboard_rows:$rownum(keywords) $keywords
+
} if_no_rows {
- set discussion_forum_alert_p 0
+ set discussion_forum_alert_p 0
}
}
if { [db_table_exists "classified_email_alerts"] } {
set classified_email_alert_p 1
-
+
set gc_system_name [gc_system_name]
set rownum 0
@@ -93,37 +93,37 @@
and sysdate <= expires
order by expires desc
} {
- incr rownum
-
- if { $valid_p == "f" } {
- # alert has been disabled for some reason
- set classified_rows:$rownum(status) "Off"
- set classified_rows:$rownum(action) "Re-enable"
- } else {
- # alert is enabled
- set classified_rows:$rownum(status) "On"
- set classified_rows:$rownum(action) "Disable"
- }
+ incr rownum
- if { $alert_type eq "all" } {
- set classified_rows:$rownum(alert_value) "--"
- } elseif { $alert_type eq "keywords" } {
- set classified_rows:$rownum(alert_value) $keywords
- } elseif { $alert_type eq "category" } {
- set classified_rows:$rownum(alert_value) $category
- } else {
- # I don't know what to do here...
- set classified_rows:$rownum(alert_value) "--"
- }
+ if { $valid_p == "f" } {
+ # alert has been disabled for some reason
+ set classified_rows:$rownum(status) "Off"
+ set classified_rows:$rownum(action) "Re-enable"
+ } else {
+ # alert is enabled
+ set classified_rows:$rownum(status) "On"
+ set classified_rows:$rownum(action) "Disable"
+ }
- set classified_rows:$rownum(domain) $domain
- set classified_rows:$rownum(rowid) $row_id
- set classified_rows:$rownum(expires) $expires
- set classified_rows:$rownum(frequency) [gc_PrettyFrequency $frequency]
- set classified_rows:$rownum(alert_type) $alert_type
-
+ if { $alert_type eq "all" } {
+ set classified_rows:$rownum(alert_value) "--"
+ } elseif { $alert_type eq "keywords" } {
+ set classified_rows:$rownum(alert_value) $keywords
+ } elseif { $alert_type eq "category" } {
+ set classified_rows:$rownum(alert_value) $category
+ } else {
+ # I don't know what to do here...
+ set classified_rows:$rownum(alert_value) "--"
+ }
+
+ set classified_rows:$rownum(domain) $domain
+ set classified_rows:$rownum(rowid) $row_id
+ set classified_rows:$rownum(expires) $expires
+ set classified_rows:$rownum(frequency) [gc_PrettyFrequency $frequency]
+ set classified_rows:$rownum(alert_type) $alert_type
+
} if_no_rows {
- set classified_email_alert_p 0
+ set classified_email_alert_p 0
}
}