new.tcl

Form to create a new relational segment

Location:
/packages/acs-subsite/www/admin/rel-segments/new.tcl
Author:
mbryzek@arsdigita.com
Created:
Mon Dec 11 13:51:21 2000
CVS ID:
$Id: new.tcl,v 1.7.2.2 2020/01/02 17:29:20 antoniop Exp $

Related Files

[ hide source ] | [ make this the default ]

File Contents

ad_page_contract {

    Form to create a new relational segment

    @author mbryzek@arsdigita.com
    @creation-date Mon Dec 11 13:51:21 2000
    @cvs-id $Id: new.tcl,v 1.7.2.2 2020/01/02 17:29:20 antoniop Exp $

} {
    group_id:integer,notnull
    { rel_type:trim "" }
    { return_url:localurl "" }
} -properties {
    context:onevalue
    export_vars:onevalue
    group_id:onevalue
    primary_rels:multirow
    group_name:onevalue
    subsite_group_id:onevalue
} -validate {
    group_in_scope_p -requires {group_id:notnull} {
        if { ![application_group::contains_party_p -party_id $group_id -include_self]} {
            ad_complain "The group either does not exist or does not belong to this subsite."
        }
    }
}

set subsite_group_id [application_group::group_id_from_package_id]

# If the user has specified a rel_type, redirect to new-2
if { $rel_type ne "" } {
    ad_returnredirect [export_vars -base new-2 {group_id rel_type return_url}]
    ad_script_abort
}

permission::require_permission -object_id $group_id -privilege "read"

set context [list [list "" "Relational segments""Add segment"]

set export_vars [export_vars -form {group_id return_url}]
# Select out all relationship types
db_multirow rel_types select_relation_types {}

set group_name [db_string select_basic_info {
    select group_name from groups
    where group_id = :group_id
}]

ad_return_template

# Local variables:
#    mode: tcl
#    tcl-indent-level: 4
#    indent-tabs-mode: nil
# End: