bug-add.tcl
Bug add page.
- Location:
- /packages/bug-tracker/www/bug-add.tcl
- Author:
- Lars Pind <lars@pinds.com>
- Created:
- 2002-03-25
- CVS ID:
$Id$
Related Files
[ hide source ] | [ make this the default ]
File Contents
ad_page_contract { Bug add page. @author Lars Pind (lars@pinds.com) @creation-date 2002-03-25 @cvs-id $Id$ } { {return_url:trim,notnull "."} } -validate { valid_return_url -requires return_url { # actually, one should use the page filter localurl from OpenACS 5.9 if {[util::external_url_p $return_url]} { ad_complain "invalid return_url" } } } permission::require_permission -object_id [ad_conn package_id] -privilege create # User needs to be logged in here auth::require_login # Set some common bug-tracker variables set project_name [bug_tracker::conn project_name] set package_id [ad_conn package_id] set package_key [ad_conn package_key] set Bug_name [bug_tracker::conn Bug] set page_title [_ bug-tracker.New_1] set workflow_id [bug_tracker::bug::get_instance_workflow_id] set context [list $page_title] set user_id [ad_conn user_id] # Is this project using multiple versions? set versions_p [bug_tracker::versions_p] # Create the form ad_form -name bug -cancel_url $return_url -form { bug_id:key(acs_object_id_seq) {component_id:text(select) {label "[bug_tracker::conn Component]"} {options {[bug_tracker::components_get_options]}} {value {[bug_tracker::conn component_id]}} } {summary:text {label "[_ bug-tracker.Summary]"} {html {size 50}} } {found_in_version:text(select),optional {label "[_ bug-tracker.Version]"} {options {[bug_tracker::version_get_options -include_unknown]}} {value {[bug_tracker::conn user_version_id]}} } {fix_for_version:text(select),optional {label "Fix For Version"} {options {[bug_tracker::version_get_options -include_unknown]}} {value {[bug_tracker::conn user_version_id]}} } {return_url:text(hidden) {value $return_url}} } workflow::role::add_assignee_widgets -workflow_id $workflow_id -form_name bug -mode edit -roles resolver foreach {category_id category_name} [bug_tracker::category_types] { ad_form -extend -name bug -form [list \ [list "${category_id}:integer(select)" \ [list label $category_name] \ [list options [bug_tracker::category_get_options -parent_id $category_id]] \ [list value [bug_tracker::get_default_keyword -parent_id $category_id]] \ ] \ ] } ad_form -extend -name bug -form { {description:richtext(richtext),optional {label "Description"} {html {cols 60 rows 13}} {value { {Steps to Reproduce 1. Browse to http://... 2. do ... Actual Results Expected Results} {text/enhanced} } } } } #ad_form -extend -name bug -form { # {description:richtext(richtext),optional # {label "[_ bug-tracker.Description]"} # {html {cols 60 rows 13}} # } # #} ad_form -extend -name bug -new_data { set keyword_ids [list] foreach {category_id category_name} [bug_tracker::category_types] { # -singular not required here since it's a new bug lappend keyword_ids [element get_value bug $category_id] } bug_tracker::bug::new \ -bug_id $bug_id \ -package_id $package_id \ -component_id $component_id \ -found_in_version $found_in_version \ -summary $summary \ -description [template::util::richtext::get_property contents $description] \ -desc_format [template::util::richtext::get_property format $description] \ -keyword_ids $keyword_ids \ -fix_for_version $fix_for_version \ -assign_to $role_resolver \ -user_id $user_id } -after_submit { bug_tracker::bugs_exist_p_set_true ad_returnredirect $return_url ad_script_abort } if { !$versions_p } { element set_properties bug found_in_version -widget hidden element set_properties bug fix_for_version -widget hidden } ad_return_template