party::name (public)

 party::name [ -party_id party_id ] [ -email email ]

Defined in packages/acs-tcl/tcl/community-core-procs.tcl

Gets the party name of the provided party_id

Switches:
-party_id (optional)
The party_id to get the name from.
-email (optional)
The email of the party
Returns:
The party name
Authors:
Miguel Marin <miguelmarin@viaro.net>
Viaro Networks www.viaro.net
Malte Sussdorff <malte.sussdorff@cognovis.de>

Partial Call Graph (max 5 caller/called nodes):
%3 packages/forums/www/admin/subscribe-others-2.tcl packages/forums/ www/admin/subscribe-others-2.tcl party::name party::name packages/forums/www/admin/subscribe-others-2.tcl->party::name packages/forums/www/admin/subscribe-others.tcl packages/forums/ www/admin/subscribe-others.tcl packages/forums/www/admin/subscribe-others.tcl->party::name apm_package_installed_p apm_package_installed_p (public) party::name->apm_package_installed_p db_string db_string (public) party::name->db_string party::get_by_email party::get_by_email (public) party::name->party::get_by_email person::name person::name (public) party::name->person::name

Testcases:
No testcase defined.
Source code:
    if {$party_id eq "" && $email eq ""} {
        error "You need to provide either party_id or email"
    } elseif {"" ne $party_id && "" ne $email } {
        error "Only provide party_id OR email, not both"
    }

    if {$party_id eq ""} {
        set party_id [party::get_by_email -email $email]
    }

    set name [person::name -person_id $party_id]

    if { $name eq "" && [apm_package_installed_p "organizations"] } {
        set name [db_string get_org_name {} -default ""]
    }

    if { $name eq "" } {
        set name [db_string get_group_name {} -default ""]
    }

    if { $name eq "" } {
        set name [db_string get_party_name {} -default ""]
    }

    return $name
Generic XQL file:
<fullquery name="party::name.get_org_name">
    <querytext>
	select
		name
	from
		organizations
	where
		organization_id = :party_id
    </querytext>
</fullquery>

<fullquery name="party::name.get_group_name">
    <querytext>
	select
		group_name
	from
		groups
	where
		group_id = :party_id
    </querytext>
</fullquery>

<fullquery name="party::name.get_party_name">
    <querytext>
	select
		party_name
	from
		party_names
	where
		party_id = :party_id
    </querytext>
</fullquery>
packages/acs-tcl/tcl/community-core-procs.xql

PostgreSQL XQL file:
packages/acs-tcl/tcl/community-core-procs-postgresql.xql

Oracle XQL file:
packages/acs-tcl/tcl/community-core-procs-oracle.xql

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