bug_tracker::get_related_files_links (public)

 bug_tracker::get_related_files_links -bug_id bug_id

Defined in packages/bug-tracker/tcl/bug-tracker-procs.tcl

Switches:
-bug_id (required)

Partial Call Graph (max 5 caller/called nodes):
%3 packages/bug-tracker/www/bug.tcl packages/bug-tracker/ www/bug.tcl bug_tracker::get_related_files_links bug_tracker::get_related_files_links packages/bug-tracker/www/bug.tcl->bug_tracker::get_related_files_links _ _ (public) bug_tracker::get_related_files_links->_ ad_conn ad_conn (public) bug_tracker::get_related_files_links->ad_conn ad_return_url ad_return_url (public) bug_tracker::get_related_files_links->ad_return_url db_foreach db_foreach (public) bug_tracker::get_related_files_links->db_foreach export_vars export_vars (public) bug_tracker::get_related_files_links->export_vars

Testcases:
No testcase defined.
Source code:
    set related_files_list [list]
    set user_id [ad_conn user_id]
    set admin_p [permission::permission_p  -party_id $user_id  -object_id [ad_conn package_id]  -privilege "admin"]
    set return_url [ad_return_url]

    db_foreach get_related_files_for_bug {} {
        set view_url [export_vars -base related-file-download {bug_id related_object_id {t $related_revision_id}}]
        set properties_url [export_vars -base "related-file-properties" {bug_id related_object_id}]
        set delete_url [export_vars -base "related-file-delete" {bug_id related_object_id return_url}]
        set new_version_url [export_vars -base "related-file-update" {bug_id related_object_id return_url}]
        if { $related_creation_user == $user_id || $admin_p } {
            set extra_actions [subst { |
                <a href="[ns_quotehtml $new_version_url]">upload new version</a> |
                <a href="[ns_quotehtml $delete_url]">delete</a>
            }]
        } else {
            set extra_actions ""
        }
        lappend related_files_list [subst {$related_title
            <a href="[ns_quotehtml $view_url]">download</a> |
            <a href="[ns_quotehtml $properties_url]">properties</a>$extra_actions
        }]
    } if_no_rows {
        set related_files_string [_ bug-tracker.No_related_files]
    }

    if { [llength $related_files_list] != 0 } {
        set related_files_string [join $related_files_list "<br>"]
    }

    return $related_files_string
Generic XQL file:
<fullquery name="bug_tracker::get_related_files_links.get_related_files_for_bug">
    <querytext>
      select l.rel_id,
             l.object_id_two as related_object_id,
             r.title as related_title,
             i.name as related_name,
             o.creation_user as related_creation_user,
             r.revision_id as related_revision_id
        from acs_data_links l,
             cr_items i,
             cr_revisions r,
             acs_objects o
       where l.object_id_one = :bug_id
             and l.object_id_two = i.item_id
             and r.revision_id = i.live_revision
             and i.item_id = o.object_id
             and (i.content_type = 'content_revision' or i.content_type = 'image')
       order by l.object_id_two
    </querytext>
</fullquery>
packages/bug-tracker/tcl/bug-tracker-procs.xql

PostgreSQL XQL file:
packages/bug-tracker/tcl/bug-tracker-procs-postgresql.xql

Oracle XQL file:
packages/bug-tracker/tcl/bug-tracker-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: