workflow::case::role::set_assignee_values (public)

 workflow::case::role::set_assignee_values -case_id case_id \
    -form_name form_name [ -prefix prefix ]

Defined in packages/workflow/tcl/case-procs.tcl

Get the assignee widget for use with ad_form for this role.

Switches:
-case_id (required)
the ID of the case.
-form_name (required)
-prefix (optional, defaults to "role_")
Author:
Lars Pind <lars@collaboraid.biz>

Partial Call Graph (max 5 caller/called nodes):
%3 packages/acs-tcl/lib/page-error.tcl packages/acs-tcl/ lib/page-error.tcl workflow::case::role::set_assignee_values workflow::case::role::set_assignee_values packages/acs-tcl/lib/page-error.tcl->workflow::case::role::set_assignee_values packages/bug-tracker/www/bug.tcl packages/bug-tracker/ www/bug.tcl packages/bug-tracker/www/bug.tcl->workflow::case::role::set_assignee_values acs_community_member_link acs_community_member_link (public) workflow::case::role::set_assignee_values->acs_community_member_link ad_conn ad_conn (public) workflow::case::role::set_assignee_values->ad_conn workflow::case::get_element workflow::case::get_element (public) workflow::case::role::set_assignee_values->workflow::case::get_element workflow::case::role::get_assignees workflow::case::role::get_assignees (public) workflow::case::role::set_assignee_values->workflow::case::role::get_assignees workflow::get_roles workflow::get_roles (public) workflow::case::role::set_assignee_values->workflow::get_roles

Testcases:
No testcase defined.
Source code:
    set workflow_id [workflow::case::get_element -case_id $case_id -element workflow_id]

    # Set role assignee values
    foreach role_id [workflow::get_roles -workflow_id $workflow_id] {
        workflow::role::get -role_id $role_id -array role
        set element "${prefix}$role(short_name)"

        # HACK: Only care about the first assignee
        set assignees [workflow::case::role::get_assignees -case_id $case_id -role_id $role_id]
        if { [llength $assignees] == 0 } {
            array set cur_assignee { party_id {} name {} email {} }
        } else {
            array set cur_assignee [lindex $assignees 0]
        }

        if { [uplevel info exists $form_name:$element] } {
            # Set normal value
            if { [uplevel template::form is_request $form_name] || [uplevel [list element get_property $form_name $element mode]] eq "display" } {
                uplevel [list element set_value $form_name $element $cur_assignee(party_id)]
            }
            
            # Set display value
            if { $cur_assignee(party_id) eq "" } {
                set display_value "<i>None</i>"
            } else {
                set display_value [acs_community_member_link  -user_id $cur_assignee(party_id)  -label $cur_assignee(name)] 
                if { [ad_conn user_id] != 0 } {
                    append display_value " (<a href=\"mailto:$cur_assignee(email)\">$cur_assignee(email)</a>)"
                } else {
            append display_value " ([string replace $cur_assignee(email)  [expr {[string first "@$cur_assignee(email)]+3}] end "..."])"
        }
            }

            uplevel [list element set_properties $form_name $element -display_value $display_value]
        }
    }
Generic XQL file:
packages/workflow/tcl/case-procs.xql

PostgreSQL XQL file:
packages/workflow/tcl/case-procs-postgresql.xql

Oracle XQL file:
packages/workflow/tcl/case-procs-oracle.xql

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