old.rss.tcl

Does not contain a contract.

Location:
/packages/bug-tracker/www/old.rss.tcl

Related Files

[ hide source ] | [ make this the default ]

File Contents

set base "[ad_url][ad_conn package_url]"
set items [list]
set project_name [bug_tracker::conn project_name]
set package_id [ad_conn package_id]
set ubase "[ad_url]/shared/community-member?user_id="

db_foreach bugs { 
  SELECT * from (
    SELECT 'bug' as type, b.bug_number as id, c.component_name, b.summary, b.status,
           to_char(bact.action_date,'YYYY-MM-DD HH24:MI:SS') as action_date, bact.action, bact.resolution, bact.comment, bact.comment_format,
           u.user_id, u.email, u.first_names || ' ' || u.last_name as name
      FROM bt_bugs b, bt_components c, bt_bug_actions bact, dir_all_users u
     WHERE b.component_id = c.component_id 
       and b.bug_id = bact.bug_id
       and bact.actor = u.user_id
       and ( (b.status = 'open' and bact.action_date > now() - interval '7 days' ) or bact.action_date > now() - interval '2 days' )
       and b.project_id = :package_id
    UNION 
    SELECT 'patch', p.patch_number as id, c.component_name, p.summary, p.status,
           to_char(pact.action_date,'YYYY-MM-DD HH24:MI:SS'), pact.action, null, pact.comment, pact.comment_format, 
           u.user_id, u.email, u.first_names || ' ' || u.last_name
      FROM bt_patches p, bt_components c, bt_patch_actions pact, dir_all_users u 
     WHERE p.component_id =  c.component_id 
       and p.patch_id = pact.patch_id
       and pact.actor = u.user_id
       and ((p.status = 'open' and pact.action_date > now() - interval '7 days') or pact.action_date > now() - interval '2 days' )
       and p.project_id = :package_id
  ) x order by action_date desc
} { 
    switch $type { 
        bug {
        set title "$type $id: $action: $summary \[$component_name\]"
            set link "${base}bug?bug_number=$id"
            set desc "<a href=\"${ubase}$user_id\">$name</a>\n\n<br>$comment"
        }
        patch { 
            set title "$type $id: $action: $summary \[$component_name\]" 
            set link "${base}patch?patch_number=$id"
            set desc "<a href=\"${ubase}$user_id\">$name</a>\n\n<br>$comment\n\n<br><a href=\"${base}patch?patch_number=$id&download=1\">download patch $id</a>"
        } 
        default {
            set link $base
            set desc {}
        }
    }

    lappend items [list \
        title $title \
            link $link \
        description $desc \
        timestamp $action_date \
        ]
}

ns_return 200 text/plain [rss_gen \
        -version 1.0 \
        -channel_title                  "$project_name" \
        -channel_link                   $base \
        -channel_description            "BUGS from <a href=\"http://openacs.org/bugtracker\">OpenACS</a>" \
        -image [list \
            url ${base}alex.gif \
            title OpenACS \
            link http://openacs.org/ \
            width 88 \
            height 31 ] \
        -items                          $items \
        -channel_copyright              "" \
        -channel_managingEditor         "davis@xarg.net" \
        -channel_webMaster              "webmaster@xarg.net" \
        -channel_pubDate                [clock format [clock seconds] -format "%Y-%m-%dT%H:%M"] \
                        ]

# bt_bug_actions                  | table    | nsadmin
# bt_bug_number_seq               | view     | nsadmin
# bt_bugs                         | table    | nsadmin
# bt_components                   | table    | nsadmin
# bt_patch_actions                | table    | nsadmin
# bt_patch_bug_map                | table    | nsadmin
# bt_patch_number_seq             | view     | nsadmin
# bt_patches                      | table    | nsadmin
# bt_priority_codes               | table    | nsadmin
# bt_projects                     | table    | nsadmin
# bt_severity_codes               | table    | nsadmin
# bt_user_prefs                   | table    | nsadmin
# bt_versions                     | table    | nsadmin