projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1ad547a
)
export host selection per service, RT#17914
author
Ivan Kohler
<ivan@freeside.biz>
Tue, 18 Sep 2012 09:56:30 +0000
(
02:56
-0700)
committer
Ivan Kohler
<ivan@freeside.biz>
Tue, 18 Sep 2012 09:56:30 +0000
(
02:56
-0700)
FS/FS/part_export.pm
patch
|
blob
|
history
httemplate/browse/part_export.cgi
patch
|
blob
|
history
httemplate/browse/part_svc.cgi
patch
|
blob
|
history
httemplate/edit/part_svc.cgi
patch
|
blob
|
history
diff --git
a/FS/FS/part_export.pm
b/FS/FS/part_export.pm
index
97394af
..
c757d36
100644
(file)
--- a/
FS/FS/part_export.pm
+++ b/
FS/FS/part_export.pm
@@
-330,6
+330,31
@@
sub label {
($self->exportname || $self->exporttype ). ' ('. $self->machine. ')';
}
($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.
#=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
beed708
..
b7ecc00
100755
(executable)
--- 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 %>">
<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>
(<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
26d090a
..
a8f4a7c
100755
(executable)
--- a/
httemplate/browse/part_svc.cgi
+++ b/
httemplate/browse/part_svc.cgi
@@
-141,16
+141,7
@@
function part_export_areyousure(href) {
%
<TR>
%
<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>
% }
</TR>
% }
diff --git
a/httemplate/edit/part_svc.cgi
b/httemplate/edit/part_svc.cgi
index
4bd0837
..
007c246
100755
(executable)
--- 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 });
% && 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;
% }
% $count++;
% $html .= '</TR><TR>' unless $count % $columns;
% }