';
}
%perl>
<%perl>
foreach my $o ( values %rrs ) {
if ($action eq 'edit' && $rr->id == $o->id) {
$edit = 1;
} else {
$edit = 0;
}
print ' ';
print '
';
print '
'.$o->get_label.'
';
print '
';
if ( $edit ) {
print '
';
print '
';
} else {
print '
[refresh] ';
if ( $manager && $manager->can($user, 'edit', $o) ){
print '
[edit] ';
}
if ( $manager && $manager->can($user, "delete", $o) ){
print '
[delete] ';
}
}
print '
';
$ui->add_to_fields(edit=>$edit, o=>$o, fields=>['name', 'zone', 'active', 'info'],
field_headers=>\@field_headers, cell_data=>\@cell_data,
linkpages=>['', 'zone.html', '', '']);
$ui->add_to_fields(edit=>0, o=>$o, fields=>['created', 'modified'],
field_headers=>\@field_headers, cell_data=>\@cell_data);
$ui->add_to_fields(edit=>$edit, o=>$o, fields=>['expiration'],
field_headers=>\@field_headers, cell_data=>\@cell_data);
if ( $manager && $manager->can($user, "access_section", 'host.html:auto_update') ){
if ( my $device = ($o->devices)[0] ){
push @field_headers, 'Device:';
push @cell_data, '
'.$device->get_label.' ';
}
$ui->add_to_fields(edit=>$edit, o=>$o, fields=>['auto_update'],
field_headers=>\@field_headers, cell_data=>\@cell_data,
);
}
$m->comp('/generic/attribute_table.mhtml', %comphash, width=>2);
(@field_headers, @cell_data) = ((),());
my @arecs = $o->a_records();
my @ips;
#####################################################################################################
#RRADDR
if ( $o->name eq '@' || $o->name eq $o->zone->name || (!$o->cnames && !$o->ptr_records) ){
print '
';
print '
Address '.$ui->table_descr_link('RRADDR', '(A/AAAA)').
'
';
print '
';
if ( $manager && $manager->can($user, "access_section", 'host.html:add_rraddr') ){
push( @field_headers, ("IP:", "TTL") );
push( @cell_data, "
" );
push( @cell_data, "
" );
my $newrraddr = $m->scomp('/generic/attribute_table.mhtml', %comphash, width=>2);
(@field_headers, @cell_data) = ((),());
$newrraddr =~ s/\n//g;
$newrraddr =~ s/
//g;
$newrraddr =~ s/'/\\'/g;
print '';
print ' ';
if ( !$edit ){
if ( $manager && $manager->can($user, 'edit', $o) ){
print '';
}
}
}else{
print ' ';
}
print ' '; #close containerheadright
#display/edit rraddr
print '
';
foreach my $arecord (sort { $a->ipblock->address_numeric
<=>
$b->ipblock->address_numeric } @arecs) {
my $ipblock = $arecord->ipblock;
if ( int($ipblock) == 0 ){
# This record should not exist then
$arecord->delete;
next;
}
push @ips, $ipblock;
push( @field_headers, "IP:");
push( @cell_data, "
".$ipblock->address." ");
$ui->add_to_fields(o=>$arecord, edit=>$edit, fields=>['ttl'],
field_headers=>\@field_headers, cell_data=>\@cell_data,
linkpages=>[''], with_delete=>1);
$m->comp('/generic/attribute_table.mhtml', %comphash, width=>2);
(@field_headers, @cell_data) = ((),());
}
print '
';
print '
';
################################################################
# DHCP host scopes
# Do not show client id options unless the subnet has DHCP enabled
foreach my $ipblock ( @ips ){
my $gscope; # global scope
if ( $ipblock->parent && $ipblock->parent->dhcp_scopes ) {
# Subnet is in DHCP
$gscope = $ipblock->parent->dhcp_scopes->first->get_global;
$m->comp('/generic/error.mhtml', error=>"Could not determine global scope for IP ".
$ipblock->get_label)
unless $gscope;
}else{
next;
}
print '
';
print '
DHCP for '.$ipblock->address.'
';
print '
';
print '
';
if ( $scope ){
my $t_width;
if ( my $phys = $scope->physaddr() ){
# Show the MAC address
push @field_headers, ('Ethernet: ');
push( @cell_data, '
'.$phys->address.' ' );
if ( $edit ){
push @field_headers, 'Delete';
push @cell_data, '
';
}
$t_width = 2;
}elsif ( $ipblock->version == 6 ){
push @field_headers, ('DUID: ');
if ( $edit ){
push @cell_data, '
';
}else{
push( @cell_data, $scope->duid );
}
if ( $edit ){
push @field_headers, 'Delete';
push @cell_data, '
';
}
$t_width = 2;
}
$m->comp('/generic/attribute_table.mhtml', %comphash, width=>$t_width);
(@field_headers, @cell_data) = ((),());
}else{
if ( $add_dhcp == $ipblock->id ){
# User wants to add a scope with this ip
print '
';
print '
';
print '
';
print '
';
if ( $ipblock->version == 4 ||
($ipblock->version == 6 &&
Netdot->config->get('DHCPD_ALLOW_ETHERNET_FOR_IPV6_HOST_DECL')) ){
push @field_headers, ('Ethernet: ');
push( @cell_data, '
' );
}elsif ( $ipblock->version == 6 ){
push @field_headers, ('DUID: ');
push( @cell_data, '
' );
}
$m->comp('/generic/attribute_table.mhtml', %comphash, width=>1);
(@field_headers, @cell_data) = ((),());
}
}
print '
';
}
#####################################################################################################
#RRHINFO
print '
';
print '
Hardware Information '.
$ui->table_descr_link('RRHINFO', '(HINFO)').'
';
print '
';
my $cpu_defaults = $ui->config->get('DEFAULT_HINFO_CPU_VALUES');
my $os_defaults = $ui->config->get('DEFAULT_HINFO_OS_VALUES');
my $defaults = [ $cpu_defaults, $os_defaults ];
if ( !$o->hinfo_records ){
#new rrhinfo
$ui->add_to_fields(table=>'RRHINFO', edit=>1, fields=>['cpu', 'os', 'ttl'],
field_headers=>\@field_headers, cell_data=>\@cell_data,
defaults =>$defaults,
linkpages=>['view.html','view.html','']);
my $newhinfo = $m->scomp('/generic/attribute_table.mhtml', %comphash, width=>2);
(@field_headers, @cell_data) = ((),());
$newhinfo =~ s/\n//g;
$newhinfo =~ s/
//g;
$newhinfo =~ s/'/\\'/g;
print '';
print ' ';
if ( !$edit ){
if ( $manager && $manager->can($user, 'edit', $o) ){
print '';
}
}
}else{
print ' ';
}
print ' '; #close containerheadright
#display/edit
print '
';
if (my @hinfos = $o->hinfo_records()) {
foreach my $hinfo (@hinfos) {
$ui->add_to_fields(o=>$hinfo, edit=>$edit, fields=>['cpu', 'os', 'ttl'],
field_headers=>\@field_headers, cell_data=>\@cell_data,
defaults =>$defaults,
linkpages=>['view.html','view.html',''], with_delete=>1
);
$m->comp('/generic/attribute_table.mhtml', %comphash, width=>2);
(@field_headers, @cell_data) = ((),());
}
}
print '
';
print '
';
#####################################################################################################
#RRTXT
print '
';
print '
Text Records '.$ui->table_descr_link('RRTXT', '(TXT)').
'
';
print '
';
#new rrtxt
$ui->add_to_fields(table=>'RRTXT', edit=>1, fields=>['txtdata', 'ttl'],
field_headers=>\@field_headers, cell_data=>\@cell_data,
linkpages=>['view.html','']);
my $newtxt = $m->scomp('/generic/attribute_table.mhtml', %comphash, width=>2);
(@field_headers, @cell_data) = ((),());
$newtxt =~ s/\n//g;
$newtxt =~ s/
//g;
$newtxt =~ s/'/\\'/g;
print '';
print ' ';
if ( !$edit ){
if ( $manager && $manager->can($user, 'edit', $o) ){
print '';
}
}
print ' '; #close containerheadright
#display/edit
print '
';
if (my @txts = $o->txt_records()) {
foreach my $txt (@txts) {
$ui->add_to_fields(o=>$txt, edit=>$edit, fields=>['txtdata', 'ttl'],
field_headers=>\@field_headers, cell_data=>\@cell_data,
linkpages=>['view.html',''], with_delete=>1);
$m->comp('/generic/attribute_table.mhtml', %comphash, width=>2);
(@field_headers, @cell_data) = ((),());
}
}
print '
';
print '
';
#####################################################################################################
#RRMX
print '
';
print '
Mail Exchangers '.$ui->table_descr_link('RRMX', '(MX)').
'
';
print '
';
#new rrmx
$ui->add_to_fields(table=>'RRMX', edit=>1, fields=>['preference', 'exchange', 'ttl'],
field_headers=>\@field_headers, cell_data=>\@cell_data,
linkpages=>['', 'view.html','']);
my $newmx = $m->scomp('/generic/attribute_table.mhtml', %comphash);
(@field_headers, @cell_data) = ((),());
$newmx =~ s/\n//g;
$newmx =~ s/
//g;
$newmx =~ s/'/\\'/g;
print '';
print ' ';
if ( !$edit ){
if ( $manager && $manager->can($user, 'edit', $o) ){
print '';
}
}
print ' '; #close containerheadright
#display/edit
print '
';
if (my @mxs = sort { $a->preference <=> $b->preference } $o->mx_records()) {
foreach my $mx (@mxs) {
$ui->add_to_fields(o=>$mx, edit=>$edit, fields=>['preference', 'exchange', 'ttl'],
field_headers=>\@field_headers, cell_data=>\@cell_data,
linkpages=>['','view.html',''], with_delete=>1);
$m->comp('/generic/attribute_table.mhtml', %comphash, width=>2);
(@field_headers, @cell_data) = ((),());
}
}
print '
';
print '
';
#####################################################################################################
#RRMX pointing to $o
if ( my @mxs = RRMX->search(exchange=>$o->get_label) ){
print '
';
print '
MX records pointing to '.$o->get_label.'
';
# display only
print '
';
foreach my $mx ( sort { $a->rr->name cmp $b->rr->name } @mxs ) {
$ui->add_to_fields(o=>$mx, edit=>0, fields=>['rr'],
field_headers=>\@field_headers, cell_data=>\@cell_data,
linkpages=>['host.html']);
$m->comp('/generic/attribute_table.mhtml', %comphash, width=>1);
(@field_headers, @cell_data) = ((),());
}
print '
';
}
#####################################################################################################
#RRCNAME for somewhere pointing to $o
print '
';
print '
Aliases of '.$o->get_label.' '.
$ui->table_descr_link('RRCNAME', '(CNAME)').'
';
print '
'; #close containerheadright
#new rrcname
if ( $add_alias ){
push( @field_headers, ("Name", "TTL") );
print '
';
print '
';
print '
';
print '
';
push( @cell_data, '
' );
push( @cell_data, '
' );
$m->comp('/generic/attribute_table.mhtml', %comphash, width=>2);
(@field_headers, @cell_data) = ((),());
}
#display/edit
print '
';
if ( my @cnames = RRCNAME->search(cname=>$o->get_label) ){
foreach my $cname ( sort { $a->rr->name cmp $b->rr->name } @cnames ) {
$ui->add_to_fields(o=>$cname, edit=>0, fields=>['rr'],
field_headers=>\@field_headers, cell_data=>\@cell_data,
linkpages=>['host.html']);
$ui->add_to_fields(o=>$cname, edit=>$edit, fields=>['ttl'],
field_headers=>\@field_headers, cell_data=>\@cell_data,
with_delete=>1);
$m->comp('/generic/attribute_table.mhtml', %comphash, width=>2);
(@field_headers, @cell_data) = ((),());
}
}
print '
';
}
#####################################################################################################
#RRCNAME for aliases of $o ($o pointing to somewhere)
# cannot have an A/AAAA record at the same time
# the $o is unique in the cname table
if ( !$o->a_records && !$o->ptr_records && !$o->ns_records ) {
print '
';
print '
'.$o->get_label.' is an alias of '.
$ui->table_descr_link('RRCNAME', '(CNAME)').'
';
print '
';
my @cnames = $o->cnames();
if ( !@cnames ){
#new rrcname (only add if there isn't one)
$ui->add_to_fields(table=>'RRCNAME', edit=>1, fields=>['cname', 'ttl'],
field_headers=>\@field_headers, cell_data=>\@cell_data,
linkpages=>['view.html','']);
my $newcname = $m->scomp('/generic/attribute_table.mhtml', %comphash);
(@field_headers, @cell_data) = ((),());
$newcname =~ s/\n//g;
$newcname =~ s/
//g;
$newcname =~ s/'/\\'/g;
print '';
print ' ';
if ( !$edit ){
if ( $manager && $manager->can($user, 'edit', $o) ){
print '';
}
}
}else{
print ' ';
}
print ' '; #close containerheadright
#display/edit
print '
';
if ( @cnames ) {
my $cname = $cnames[0]; # shouldn't be more than one, right?
# Deal with cname field
# The trick here is that the cname is a varchar field, so it could or
# could not be referencing a record which exists in Netdot.
# We let the user edit the text, but when not editing, we'll try
# to find an existing RR and provide a hyperlink if found.
if ( $edit ){
# Edit cname field
$ui->add_to_fields(o=>$cname, edit=>1, fields=>['cname'],
field_headers=>\@field_headers, cell_data=>\@cell_data);
$m->comp('/generic/attribute_table.mhtml', %comphash);
(@field_headers, @cell_data) = ((),());
}else{
if ( my $cnamerr = RR->search(name=>$cname->cname)->first ){
push @field_headers, "Canonical Name:";
push @cell_data, "
".$cnamerr->get_label." ";
}else{
push @field_headers, "Canonical Name:";
push @cell_data, $cname->cname;
}
}
# Add TTL
$ui->add_to_fields(o=>$cname, edit=>$edit, fields=>['ttl'],
field_headers=>\@field_headers, cell_data=>\@cell_data);
$m->comp('/generic/attribute_table.mhtml', %comphash);
(@field_headers, @cell_data) = ((),());
}
if (!$o->a_records()) {
print '
';
}
print '
';
}
#####################################################################################################
# Restrict access to the following records
# Unpriviledged users can only work on these records if they have permissions on the whole zone
#####################################################################################################
if ( !$o->cnames && ($manager &&
($manager->can($user, "edit", $o->zone) ||
$manager->can($user, "access_section", 'host.html:extra_records'))
)){
#####################################################################################################
#RRPTR
foreach my $arecord ( @arecs ) {
next if int($arecord->ipblock) == 0;
my $ipblock = $arecord->ipblock;
# We can assume there is only one per IP
my $ptr = $ipblock->ptr_records->first;
print '
';
print '
Reverse for '.$ipblock->get_label.' '.
$ui->table_descr_link('RRPTR', '(PTR)').'
';
print '
';
print ' ';
if ( !$ptr ){
if ( !$edit ){
if ( $manager && $manager->can($user, 'edit', $o) ){
print '
[add] ';
}
}
}
print '
'; #close containerheadright
print '
';
if ( $add_ptr == $ipblock->id ){
# new rrptr
my $rzone;
if ( ($ipblock->parent != 0) && $ipblock->parent->reverse_zone ){
$rzone = $ipblock->parent->reverse_zone;
}
push( @field_headers, ("Name", "Zone", "Domain Name", "TTL") );
print ' ';
print ' ';
if ( $rzone ){
my $name = RRPTR->get_name(ipblock=>$ipblock, zone=>$rzone);
push( @cell_data, ' ' );
}else{
push( @cell_data, ' ' );
}
my $zone_select = '';
foreach my $z ( sort { $a->name cmp $b->name } Zone->retrieve_all ){
next unless $z->is_dot_arpa;
if ( $rzone && $rzone->id == $z->id ){
$zone_select .= ''.$z->get_label.' ';
}else{
$zone_select .= ''.$z->get_label.' ';
}
}
$zone_select .= " ";
push( @cell_data, $zone_select );
push( @cell_data, ' ' );
push( @cell_data, ' ' );
$m->comp('/generic/attribute_table.mhtml', %comphash);
(@field_headers, @cell_data) = ((),());
print ' ';
print ' ';
}
# display/edit
if ( $ptr ) {
$ui->add_to_fields(o=>$ptr, edit=>0, fields=>['rr', 'ptrdname', 'ttl'],
field_headers=>\@field_headers, cell_data=>\@cell_data,
linkpages=>['host.html', '', ''], with_delete=>1);
$m->comp('/generic/attribute_table.mhtml', %comphash);
(@field_headers, @cell_data) = ((),());
}
print '
';
}
#####################################################################################################
#RRNS
if ( $o->name eq '@' || $o->name eq $o->zone->name || (!$o->a_records && !$o->ptr_records) ){
print '
';
print '
Name Servers '.$ui->table_descr_link('RRNS', '(NS)').'
';
print '
';
#new rrns
$ui->add_to_fields(table=>'RRNS', edit=>1, fields=>['nsdname', 'ttl'],
field_headers=>\@field_headers, cell_data=>\@cell_data,
linkpages=>['view.html','']);
my $newns = $m->scomp('/generic/attribute_table.mhtml', %comphash);
(@field_headers, @cell_data) = ((),());
$newns =~ s/\n//g;
$newns =~ s/
//g;
$newns =~ s/'/\\'/g;
print '';
print ' ';
if ( !$edit ){
if ( $manager && $manager->can($user, 'access_section', 'add_ns_records')
&& $manager->can($user, 'edit', $o) ){
print '';
}
}
print ' '; #close containerheadright
#display/edit
print '
';
if (my @nss = $o->ns_records()) {
my $ns_edit = $edit;
unless ( $manager && $manager->can($user, 'access_section', 'edit_ns_records')
&& $manager->can($user, 'edit', $o) ){
# Do not allow edits unless they have permissions
$ns_edit = 0;
}
foreach my $ns (@nss) {
$ui->add_to_fields(o=>$ns, edit=>$ns_edit, fields=>['nsdname', 'ttl'],
field_headers=>\@field_headers, cell_data=>\@cell_data,
linkpages=>['view.html',''], with_delete=>1);
$m->comp('/generic/attribute_table.mhtml', %comphash);
(@field_headers, @cell_data) = ((),());
}
}
print '
';
print '
';
}
#####################################################################################################
#RRDS
if ( !$o->a_records && !$o->ptr_records ){
print '
';
print '
Delegation Signers '.
$ui->table_descr_link('RRDS', '(DS)').'
';
print '
';
my @field_names = ('key_tag', 'algorithm', 'digest_type', 'digest', 'ttl');
#new rrds
$ui->add_to_fields(table=>'RRDS', edit=>1, fields=>\@field_names,
field_headers=>\@field_headers, cell_data=>\@cell_data,
);
my $newds = $m->scomp('/generic/attribute_table.mhtml', %comphash);
(@field_headers, @cell_data) = ((),());
$newds =~ s/\n//g;
$newds =~ s/
//g;
$newds =~ s/'/\\'/g;
print '';
print ' ';
if ( !$edit ){
if ( $manager && $manager->can($user, 'access_section', 'add_ds_records')
&& $manager->can($user, 'edit', $o) ){
print '';
}
}
print ' '; #close containerheadright
#display/edit
print '
';
if (my @dss = $o->ds_records()) {
my $ds_edit = $edit;
unless ( $manager && $manager->can($user, 'access_section', 'edit_ns_records')
&& $manager->can($user, 'edit', $o) ){
# Do not allow edits unless they have permissions
$ds_edit = 0;
}
foreach my $ds (@dss) {
$ui->add_to_fields(o=>$ds, edit=>$ds_edit, fields=>\@field_names,
field_headers=>\@field_headers, cell_data=>\@cell_data,
with_delete=>1);
$m->comp('/generic/attribute_table.mhtml', %comphash);
(@field_headers, @cell_data) = ((),());
}
}
print '
';
print '
';
}
#####################################################################################################
#RRNAPTR
if ( !$o->a_records && !$o->ptr_records && !$o->ns_records ){
print '
';
print '
Name Authority Pointer '.
$ui->table_descr_link('RRNAPTR', '(NAPTR)').'
';
print '
';
#new rrnaptr
$ui->add_to_fields(table=>'RRNAPTR', edit=>1,
fields=>['order_field', 'preference', 'flags',
'services', 'regexpr', 'replacement', 'ttl'],
field_headers=>\@field_headers, cell_data=>\@cell_data,
linkpages=>['view.html','']);
my $newnaptr = $m->scomp('/generic/attribute_table.mhtml', %comphash);
(@field_headers, @cell_data) = ((),());
$newnaptr =~ s/\n//g;
$newnaptr =~ s/
//g;
$newnaptr =~ s/'/\\'/g;
print '';
print ' ';
if ( !$edit ){
if ( $manager && $manager->can($user, 'edit', $o) ){
print '';
}
}
print ' '; #close containerheadright
#display/edit
print '
';
if (my @naptrs = $o->naptr_records()) {
foreach my $naptr (@naptrs) {
$ui->add_to_fields(o=>$naptr, edit=>$edit,
fields=>['order_field', 'preference', 'flags',
'services', 'regexpr', 'replacement', 'ttl'],
field_headers=>\@field_headers, cell_data=>\@cell_data,
linkpages=>['view.html','view.html',''], with_delete=>1);
$m->comp('/generic/attribute_table.mhtml', %comphash);
(@field_headers, @cell_data) = ((),());
}
}
print '
';
print '
';
}
#####################################################################################################
#RRPTR (when the name is the PTR record's name)
if ( !$o->a_records && !$o->ns_records ){
print '
';
print '
Pointer Records '.
$ui->table_descr_link('RRPTR', '(PTR)').'
';
print '
';
#new rrptr
push( @field_headers, "IP:");
push( @cell_data, "
");
$ui->add_to_fields(table=>'RRPTR', edit=>1, fields=>['ptrdname', 'ttl'],
field_headers=>\@field_headers, cell_data=>\@cell_data,
linkpages=>['']);
my $newptr = $m->scomp('/generic/attribute_table.mhtml', %comphash);
(@field_headers, @cell_data) = ((),());
$newptr =~ s/\n//g;
$newptr =~ s/
//g;
$newptr =~ s/'/\\'/g;
print '';
print ' ';
if ( !$edit ){
if ( $manager && $manager->can($user, 'edit', $o) ){
print '';
}
}
print ' '; #close containerheadright
#display/edit
print '
';
if (my @ptrs = $o->ptr_records()) {
foreach my $ptr (@ptrs) {
push( @field_headers, "IP:");
if ($edit) {
push( @cell_data, "
" );
} else {
push( @cell_data, "
".
$ptr->ipblock->address." ");
}
$ui->add_to_fields(o=>$ptr, edit=>$edit, fields=>['ptrdname', 'ttl'],
field_headers=>\@field_headers, cell_data=>\@cell_data,
linkpages=>['', ''], with_delete=>1);
$m->comp('/generic/attribute_table.mhtml', %comphash);
(@field_headers, @cell_data) = ((),());
}
}
print '
';
print '
';
}
#####################################################################################################
#RRLOC
if ( !$o->ptr_records && !$o->ns_records ){
print '
';
print '
Location Records '.
$ui->table_descr_link('RRLOC', '(LOC)').'
';
print '
';
#new
$ui->add_to_fields(table=>'RRLOC', edit=>1,
fields=>['latitude', 'longitude', 'altitude', 'size',
'horiz_pre', 'vert_pre', 'ttl'],
field_headers=>\@field_headers, cell_data=>\@cell_data,
linkpages=>['view.html', 'view.html', 'view.html', 'view.html', 'view.html',
'view.html', ''],
);
my $newloc = $m->scomp('/generic/attribute_table.mhtml', %comphash);
(@field_headers, @cell_data) = ((),());
$newloc =~ s/\n//g;
$newloc =~ s/
//g;
$newloc =~ s/'/\\'/g;
print '';
print ' ';
if ( !$edit ){
if ( $manager && $manager->can($user, 'edit', $o) ){
print '';
}
}
print ' '; #close containerheadright
#display/edit
print '
';
if (my @locs = $o->loc_records()) {
foreach my $loc (@locs) {
$ui->add_to_fields(o=>$loc, edit=>$edit,
fields=>['latitude', 'longitude', 'altitude',
'size', 'horiz_pre', 'vert_pre', 'ttl'],
field_headers=>\@field_headers, cell_data=>\@cell_data,
linkpages=>['view.html', 'view.html', 'view.html', 'view.html',
'view.html', 'view.html', ''],
with_delete=>1
);
$m->comp('/generic/attribute_table.mhtml', %comphash);
(@field_headers, @cell_data) = ((),());
}
}
print '
';
print '
';
}
#####################################################################################################
#RRSRV
# Only show this part if owner name follows valid format
if ( $o->name =~ /^_.+\._.+/ ){
print '
';
print '
Service Records '.
$ui->table_descr_link('RRSRV', '(SRV)').'
';
print '
';
#new rrsrv
$ui->add_to_fields(table=>'RRSRV', edit=>1, fields=>['priority', 'weight', 'port', 'target', 'ttl'],
field_headers=>\@field_headers, cell_data=>\@cell_data,
linkpages=>['view.html','view.html','view.html','view.html','']);
my $newsrv = $m->scomp('/generic/attribute_table.mhtml', %comphash);
(@field_headers, @cell_data) = ((),());
$newsrv =~ s/\n//g;
$newsrv =~ s/
//g;
$newsrv =~ s/'/\\'/g;
print '';
print ' ';
if ( !$edit ){
if ( $manager && $manager->can($user, 'edit', $o) ){
print '';
}
}
print ' '; #close containerheadright
#display/edit
print '
';
if (my @srvs = $o->srv_records()) {
foreach my $srv (@srvs) {
$ui->add_to_fields(o=>$srv, edit=>$edit, fields=>['priority', 'weight', 'port', 'target', 'ttl'],
field_headers=>\@field_headers, cell_data=>\@cell_data, with_delete=>1);
$m->comp('/generic/attribute_table.mhtml', %comphash);
(@field_headers, @cell_data) = ((),());
}
}
print '
';
print '
';
}
} # close restrict if
print '
'; #close container
print '