%#-- Begin HTML --# <& '/widgets/wrappers/sharky/header.mc', title => "$disp Profile", context => "Admin | Profile | $disp | $crumb" &>
<%perl>; $m->comp('/widgets/profile/hidden.mc', value => $id, name => 'source_id') if defined $id; $m->comp("/widgets/wrappers/sharky/table_top.mc", caption => "Properties", number => 1 ); if (defined $id) { # It's an existing org. Spit out the org name. $m->comp('/widgets/profile/displayFormElement.mc', objref => $src, localize => 0, key => 'name', readOnly => 1); } elsif (!defined $id && !$new_org) { # It's a new source. Give 'em a list of available organizations to choose # from. $m->comp('/widgets/select_object/select_object.mc', object => 'org', name => 'org', field => 'name', disp => 'Organization', useTable => 1, constrain => { personal => 0 } ); $m->out(qq {
 }); $m->comp('/widgets/profile/imageSubmit.mc', formName => "src_profile", callback => "new_org", alt => 'New Organization', image => "new_organization_lgreen", js => qq{onClick="requiredFields='';return customSubmit('src_profile', 'new_org', 1)"} ); $m->out(qq{
\n}); } elsif ($new_org) { # We'll be displaying all fields except active. $used = { active => 1 }; } $m->comp('/widgets/profile/dumpRemainingFields.mc', objref => $src, fieldsUsed => $used, readOnly => $no_edit); $m->comp("/widgets/wrappers/sharky/table_bottom.mc"); $m->comp("/widgets/grp_membership/grp_membership.mc", grp_class => 'Bric::Util::Grp::Source', obj => $src, formName => 'src_profile', no_edit => $no_edit, widget => $type, num => 2 ); <& '/widgets/profile/formButtons.mc', type => $type, section => $section, no_del => $no_del, no_save => $no_edit, widget => $type &>
<& '/widgets/wrappers/sharky/footer.mc', param => \%ARGS &> %#-- End HTML --# %#-- Once Section --# <%once>; my $class = 'Bric::Biz::Org::Source'; my $section = 'admin'; my $type = 'source'; my $disp = get_disp_name($type); %#-- Shared Section --# <%shared>; my $used = { active => 1, name => 1, long_name => 1 }; %#-- Args Section --# <%args> $id => undef $new_org => undef %#-- Init Section --# <%init>; # Instantiate an object. my $src = $ARGS{obj} ? $ARGS{obj} : defined $id ? $class->lookup({ id => $id}) : $class->new; $id ||= $src->get_id; # Check authorization. chk_authz($src, $id ? READ : CREATE); my $no_edit = !chk_authz($src, ($id ? EDIT : CREATE), 1); my $no_del = !$id || $no_edit; # Get the name for the breadcrumb trail. my $crumb = $src->get_source_name; $crumb = $crumb ? ""$crumb"" : 'New'; <%doc> ############################################################################### =head1 NAME /admin/profile/source/dhandler - Interface for managing sources. =head1 VERSION $LastChangedRevision$ =head1 DATE $LastChangedDate$ =head1 DESCRIPTION This element handles the display for editing sources.