bug_tracker::bug::edit (public)

 bug_tracker::bug::edit -bug_id bug_id \
    -enabled_action_id enabled_action_id [ -user_id user_id ] \
    [ -creation_ip creation_ip ] -description description \
    -desc_format desc_format -array array [ -entry_id entry_id ]

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

Edit a bug, then send out notifications, etc. Calls bug_tracker::bug::update.

Switches:
-bug_id (required)
-enabled_action_id (required)
-user_id (optional)
-creation_ip (optional)
-description (required)
-desc_format (required)
-array (required)
-entry_id (optional)
Returns:
bug_id The same bug_id passed in, just for convenience.
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 bug_tracker::bug::workflow_create bug_tracker::bug::workflow_create (private) bug_tracker::bug::edit bug_tracker::bug::edit bug_tracker::bug::workflow_create->bug_tracker::bug::edit bug_tracker::scheduled::close_bugs bug_tracker::scheduled::close_bugs (public) bug_tracker::scheduled::close_bugs->bug_tracker::bug::edit packages/acs-tcl/lib/page-error.tcl packages/acs-tcl/ lib/page-error.tcl packages/acs-tcl/lib/page-error.tcl->bug_tracker::bug::edit packages/bug-tracker/www/bug.tcl packages/bug-tracker/ www/bug.tcl packages/bug-tracker/www/bug.tcl->bug_tracker::bug::edit packages/bug-tracker/www/bulk-update-op.tcl packages/bug-tracker/ www/bulk-update-op.tcl packages/bug-tracker/www/bulk-update-op.tcl->bug_tracker::bug::edit bug_tracker::bug::workflow_short_name bug_tracker::bug::workflow_short_name (public) bug_tracker::bug::edit->bug_tracker::bug::workflow_short_name bug_tracker::category_types bug_tracker::category_types (public) bug_tracker::bug::edit->bug_tracker::category_types content::keyword::item_assign content::keyword::item_assign (public) bug_tracker::bug::edit->content::keyword::item_assign db_transaction db_transaction (public) bug_tracker::bug::edit->db_transaction workflow::case::action::execute workflow::case::action::execute (public) bug_tracker::bug::edit->workflow::case::action::execute

Testcases:
No testcase defined.
Source code:
    upvar $array row

    array set assignments [list]

    set role_prefix "role_"
    foreach name [array names row "${role_prefix}*"] {
        set assignments([string range $name [string length $role_prefix] end]) $row($name)
        unset row($name)
    }

    db_transaction {
        # Update the bug info
        update  -bug_id $bug_id  -user_id $user_id  -creation_ip $creation_ip  -array row

        # Update the keywords
        foreach {category_id category_name} [bug_tracker::category_types] {
            if { [info exists row($category_id)] && $row($category_id) ne "" } {
                content::keyword::item_assign -item_id $bug_id -keyword_id $row($category_id)
            }
            # LARS:
            # We don't unassign if no value is supplied for one of the categories
            # we just leave them untouched.
        }

        set case_id [workflow::case::get_id  -workflow_short_name [workflow_short_name]  -object_id $bug_id]

        # Assignments
        workflow::case::role::assign  -replace  -case_id $case_id  -array assignments

        workflow::case::action::execute  -enabled_action_id $enabled_action_id  -comment $description  -comment_mime_type $desc_format  -user_id $user_id  -entry_id $entry_id

    }
    return $bug_id
Generic XQL file:
packages/bug-tracker/tcl/bug-procs.xql

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

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

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