Index: openacs-4/packages/bug-tracker/lib/nav-bar.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/lib/nav-bar.tcl,v diff -u -r1.4.2.1 -r1.4.2.2 --- openacs-4/packages/bug-tracker/lib/nav-bar.tcl 13 Jan 2003 18:40:37 -0000 1.4.2.1 +++ openacs-4/packages/bug-tracker/lib/nav-bar.tcl 5 Mar 2003 18:12:37 -0000 1.4.2.2 @@ -11,12 +11,19 @@ set package_url [ad_conn package_url] set component_id [bug_tracker::conn component_id] -set admin_p [ad_permission_p $package_id admin] +set admin_p [permission::permission_p -object_id $package_id -privilege admin] +set create_p [expr { [ad_conn user_id] == 0 || [permission::permission_p -object_id [ad_conn package_id] -privilege create] }] set notification_url [lindex $notification_link 0] set notification_label [lindex $notification_link 1] set notification_title [lindex $notification_link 2] +# Paches enabled for this project? +set patches_p [bug_tracker::patches_p] + +# Is this project using multiple versions? +set versions_p [bug_tracker::versions_p] + regexp {/([^/]+)/[^/]*$} [ad_conn url] match last_dir if { [string equal $last_dir "admin"] } { @@ -30,23 +37,30 @@ array set filter [bug_tracker::conn filter] -multirow append links "Bugs" "${url_prefix}.?[export_vars { filter:array }]" +multirow append links "[bug_tracker::conn Bugs]" "${url_prefix}." -if { [ad_permission_p [ad_conn package_id] create] || [ad_conn user_id] == 0 } { - multirow append links "New Bug" "${url_prefix}bug-add" +if { $create_p } { + multirow append links "New [bug_tracker::conn Bug]" "${url_prefix}bug-add" } if { [ad_conn user_id] != 0 } { - multirow append links "My Bugs" "${url_prefix}.?[export_vars -url { { filter.actionby {[ad_conn user_id]} } }]" + multirow append links "My [bug_tracker::conn Bugs]" "${url_prefix}.?[export_vars -url { { filter.assignee {[ad_conn user_id]} } }]" } -multirow append links "Patches" "[ad_conn package_url]patch-list" +if { $patches_p } { + multirow append links "Patches" "[ad_conn package_url]patch-list" -if { [ad_permission_p [ad_conn package_id] create] || [ad_conn user_id] == 0 } { - multirow append links "New Patch" "[ad_conn package_url]patch-add" + if { $create_p } { + multirow append links "New Patch" "[ad_conn package_url]patch-add" + } } -multirow append links "Prefs" "[ad_conn package_url]prefs" +multirow append links "Notifications" "[ad_conn package_url]notifications" + +if { $versions_p } { + multirow append links "Prefs" "[ad_conn package_url]prefs" +} + if { $admin_p } { multirow append links "Admin" "[ad_conn package_url]admin/" }