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.9.2.1 --- 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 16 May 2019 09:54:29 -0000 1.9.2.1 @@ -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 } }