BugTracker "New Bug" link in Project Overview

in intranet-bug-tracker/tcl/intranet-bug-tracker-procs.tcl the function im_bug_tracker_list_component should be changed to the followings

ad_proc -public im_bug_tracker_list_component {
    project_id
} {
    shows a list of bugs in the current project
} {
    if {![im_project_has_type $project_id "Bug Tracker Container"]} {
        return ""
    }

# Original code line
#    set html ""
#------------------
#

        set action_url "/bug-tracker/bug-add"
        set return_url [im_url_with_query]
        set options [im_bt_project_options]
        if {[llength $options] > 0} {
                set project_html [im_bt_generic_select -options $options bug_container_project_id ""]
                set button_text [lang::message::lookup "" intranet-bug-tracker.New_Issue "New Issue"]
                set button_html "<input type=submit value=\"$button_text\">"
        } else {
                # Just return an empty string in order to disable this component
                return ""
                set project_html [lang::message::lookup "" intranet-bug-tracker.You_are_not_a_member_of_any_maintenance_projects "You are not a member of any maintenance project"]
                set button_html ""
        }

    db_multirow bug_list bug_list "
        select
              	bug_number,summary
        from
            	im_projects parent,
                im_projects children,
                bt_bugs
        where
             	children.project_type_id not in ([im_project_type_task])
                and children.tree_sortkey between parent.tree_sortkey and tree_right(parent.tree_sortkey)
                and parent.project_id = [im_project_super_project_id $project_id]
                and bug_container_project_id=children.project_id
        order by bug_number desc
    "
    db_multirow bug_list bug_list "
        select
              	bug_number,summary
        from
            	im_projects parent,
                im_projects children,
                bt_bugs
        where
             	children.project_type_id not in ([im_project_type_task])
                and children.tree_sortkey between parent.tree_sortkey and tree_right(parent.tree_sortkey)
                and parent.project_id = [im_project_super_project_id $project_id]
                and bug_container_project_id=children.project_id
        order by bug_number desc
    "

	set html "<a href=\"$action_url?bug_container_project_id=$project_id&return_url=$return_url\">[lang::message::lookup "" intranet-bug-tracker.Create_a_New_Issue "Create a New Issue"]</a>"

   template::list::create \
        -name bug_list \
        -key bug_id \
        -pass_properties { return_url } \
        -elements {
            bug_number {
                label "bug\#"
                link_url_eval {
                        [return "/bug-tracker/bug?[export_vars -url { bug_number return_url  } ]" ]
                }
            }
            summary {
                label "Summary"
            }
	}

    append html [template::list::render -name bug_list]

    return $html
}
/var/customers/webs/cw01/wiki/data/pages/project-open/bt_link.txt · Last modified: 2010/07/28 10:31 by wadmin
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki