diff options
author | Ivan Kohler <ivan@freeside.biz> | 2012-09-18 02:56:30 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2012-09-18 02:56:30 -0700 |
commit | 806d426d106efea2b2b13314108c4ac046511e1c (patch) | |
tree | 89b277b7b0cca1b412e74b68869bccf733bc14c2 | |
parent | 1ad547a47f16b4230762e752fbe48d460ed997e1 (diff) |
export host selection per service, RT#17914
-rw-r--r-- | FS/FS/part_export.pm | 25 | ||||
-rwxr-xr-x | httemplate/browse/part_export.cgi | 12 | ||||
-rwxr-xr-x | httemplate/browse/part_svc.cgi | 11 | ||||
-rwxr-xr-x | httemplate/edit/part_svc.cgi | 7 |
4 files changed, 28 insertions, 27 deletions
diff --git a/FS/FS/part_export.pm b/FS/FS/part_export.pm index 97394af18..c757d368d 100644 --- a/FS/FS/part_export.pm +++ b/FS/FS/part_export.pm @@ -330,6 +330,31 @@ sub label { ($self->exportname || $self->exporttype ). ' ('. $self->machine. ')'; } +=item label_html + +Returns a label for this export, "exportname: exporttype to machine". + +=cut + +sub label_html { + my $self = shift; + + my $label = $self->exportname + ? '<B>'. $self->exportname. '</B>: ' #<BR>'. + : ''; + + $label .= $self->exporttype; + + $label .= ' to '. ( $self->machine eq '_SVC_MACHINE' + ? 'per-service hostname' + : $self->machine + ) + if $self->machine; + + $label; + +} + #=item part_svc # #Returns the service definition (see L<FS::part_svc>) for this export. diff --git a/httemplate/browse/part_export.cgi b/httemplate/browse/part_export.cgi index beed70887..b7ecc00a6 100755 --- a/httemplate/browse/part_export.cgi +++ b/httemplate/browse/part_export.cgi @@ -36,17 +36,7 @@ function part_export_areyousure(href) { <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><A HREF="<% $p %>edit/part_export.cgi?<% $part_export->exportnum %>"><% $part_export->exportnum %></A></TD> <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"> -% if( $part_export->exportname ) { - <B><% $part_export->exportname %>:</B><BR> -% } - <% $part_export->exporttype %> - <% $part_export->machine - ? 'to '. ( $part_export->machine eq '_SVC_MACHINE' - ? 'per-service hostname' - : $part_export->machine - ) - : '' - %> + <% $part_export->label_html %> (<A HREF="<% $p %>edit/part_export.cgi?<% $part_export->exportnum %>">edit</A> | <A HREF="javascript:part_export_areyousure('<% $p %>misc/delete-part_export.cgi?<% $part_export->exportnum %>')">delete</A>) </TD> diff --git a/httemplate/browse/part_svc.cgi b/httemplate/browse/part_svc.cgi index 26d090a3d..a8f4a7c84 100755 --- a/httemplate/browse/part_svc.cgi +++ b/httemplate/browse/part_svc.cgi @@ -141,16 +141,7 @@ function part_export_areyousure(href) { % <TR> - <TD><A HREF="<% $p %>edit/part_export.cgi?<% $part_export->exportnum %>"> -<% $part_export->exportnum %>: -% if ($part_export->exportname) { -<B><% $part_export->exportname %></B> ( -% } -<% $part_export->exporttype %> to <% $part_export->machine %> -% if ($part_export->exportname) { -) -% } -</A></TD> + <TD><A HREF="<% $p %>edit/part_export.cgi?<% $part_export->exportnum %>"><% $part_export->label_html %></A></TD> </TR> % } diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 4bd083798..007c24629 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -144,12 +144,7 @@ % && qsearchs( 'export_svc', { % exportnum => $part_export->exportnum, % svcpart => $clone || $part_svc->svcpart }); -% $html .= '>'.$part_export->exportnum. ': '; -% $html .= $part_export->exportname . '<DIV ALIGN="right"><FONT SIZE=-1>' -% if ( $part_export->exportname ); -% $html .= $part_export->exporttype. ' to '. $part_export->machine; -% $html .= '</FONT></DIV>' if ( $part_export->exportname ); -% $html .= '</TD>'; +% $html .= '>'. $part_export->label_html. '</TD>'; % $count++; % $html .= '</TR><TR>' unless $count % $columns; % } |