<%doc> Cable management stuff... % % <%args> $id => undef; $start_id => undef; $end_id => undef; $cable_sort => undef; $edit => undef; $page_type => undef; $submit_site => undef; $backbone_srch => undef; $backbone_id_srch => undef; $site_srch => undef; % % <%flags> % % <%attr> title => 'Cable Plant' section => 'Plant' % % <%init> my $DEBUG = 0; my $MAX_SELECTION = 500; my %cssitem = (0 => "formtablec1", 1 => "formtablec2"); my $o = undef; my $name; $end_id = 0 if ($end_id == -1); $start_id = 0 if ($start_id == -1); if ($id) { $o = Site->retrieve($id); $name = $o->name; } else { $name = "Search"; } $backbone_srch = "%" . $backbone_srch . "%" if ($backbone_srch); $site_srch = "%" . $site_srch . "%" if ($site_srch); # For table building modules: my (@field_headers, @cell_data, @headers, @rows);
<%perl> print "
", Dumper(%ARGS), "

" if $DEBUG; # code for inserting/updating # ----------------------------------------------------------------------------- if(defined($ARGS{_action})) { print "ARGS is
", Dumper(%ARGS), "

" if $DEBUG; if (!$ui->form_to_db(%ARGS)) { $m->comp("error.mhtml", $ui->error()); } # Do this to 'flush' the values associated with the object # before redisplaying $o = undef; if ($id) { $o = Site->retrieve($id); $name = $o->name; } } # end insertion/update code # ----------------------------------------------------------------------------- %if ($o) {
<% ucfirst(lc($page_type)) %> for Site: <% $o->name %>  
%} % if ($edit) {
"> % } % if (uc($page_type) eq "HORIZONTAL") { % $m->abort() if (!defined($o)); <& cable_plant_horizontal.mhtml, o => $o, id => $id, MAX_SELECTION => $MAX_SELECTION, page_type => $page_type, cable_sort => $cable_sort, edit => $edit &> % } elsif (uc($page_type) eq "BACKBONE") { <& cable_plant_backbone.mhtml, o => $o, MAX_SELECTION => $MAX_SELECTION, start_id => $start_id, end_id => $end_id, page_type => $page_type, submit_site => $submit_site, backbone_srch => $backbone_srch, backbone_id_srch => $backbone_id_srch, edit => $edit, site_srch => $site_srch, cable_sort => $cable_sort &> % } elsif (uc($page_type) eq "CLOSETS") { % $m->abort() if (!defined($o) && !exists($ARGS{closet_srch})); <& cable_plant_closet.mhtml, o => $o, MAX_SELECTION => $MAX_SELECTION, closet_srch => $ARGS{closet_srch}, edit => $edit, id => $id, page_type => $page_type, cable_sort => $cable_sort &> % } elsif (uc($page_type) eq "STRANDS") { % $m->abort() if (!defined($backbone_id_srch)); <& cable_plant_strand.mhtml, o => $o, id => $id, MAX_SELECTION => $MAX_SELECTION, page_type => $page_type, backbone_id_srch => $backbone_id_srch, edit => $edit, cable_sort => $cable_sort &> % } else { % $m->comp("/generic/error.mhtml", error => "Unknown page type \"$page_type\""); % } % if ($edit) {
% } % if ($o) {
% }