projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
523a6ea
)
allow exports to add links to customer view (#1407)
author
jeff
<jeff>
Wed, 12 Mar 2008 16:24:34 +0000
(16:24 +0000)
committer
jeff
<jeff>
Wed, 12 Mar 2008 16:24:34 +0000
(16:24 +0000)
FS/FS/UI/Web.pm
patch
|
blob
|
history
FS/FS/cust_svc.pm
patch
|
blob
|
history
FS/FS/part_export.pm
patch
|
blob
|
history
FS/FS/part_export/prizm.pm
patch
|
blob
|
history
FS/FS/svc_Common.pm
patch
|
blob
|
history
eg/export_template.pm
patch
|
blob
|
history
httemplate/view/cust_main/packages.html
patch
|
blob
|
history
diff --git
a/FS/FS/UI/Web.pm
b/FS/FS/UI/Web.pm
index
6a97f96
..
e4a9ac1
100644
(file)
--- a/
FS/FS/UI/Web.pm
+++ b/
FS/FS/UI/Web.pm
@@
-149,6
+149,14
@@
sub svc_X_link {
"$ahref$x</A>";
}
"$ahref$x</A>";
}
+sub svc_export_links {
+ my ($m, $part_svc, $cust_svc) = @_ or return '';
+
+ my $ahref = $cust_svc->export_links;
+
+ join('', @$ahref);
+}
+
sub parse_lt_gt {
my($cgi, $field) = @_;
sub parse_lt_gt {
my($cgi, $field) = @_;
diff --git
a/FS/FS/cust_svc.pm
b/FS/FS/cust_svc.pm
index
8eecda3
..
51fc186
100644
(file)
--- a/
FS/FS/cust_svc.pm
+++ b/
FS/FS/cust_svc.pm
@@
-392,6
+392,20
@@
sub _svc_label {
}
}
+=item export_links
+
+Returns a list of html elements associated with this services exports.
+
+=cut
+
+sub export_links {
+ my $self = shift;
+ my $svc_x = $self->svc_x
+ or return "can't find ". $self->part_svc->svcdb. '.svcnum '. $self->svcnum;
+
+ $svc_x->export_links;
+}
+
=item svc_x
Returns the FS::svc_XXX object for this service (i.e. an FS::svc_acct object or
=item svc_x
Returns the FS::svc_XXX object for this service (i.e. an FS::svc_acct object or
diff --git
a/FS/FS/part_export.pm
b/FS/FS/part_export.pm
index
6adcab9
..
983e0b0
100644
(file)
--- a/
FS/FS/part_export.pm
+++ b/
FS/FS/part_export.pm
@@
-359,6
+359,14
@@
sub _export_unsuspend {
$self->_export_replace( $svc_x, $old );
}
$self->_export_replace( $svc_x, $old );
}
+=item export_links SVC_OBJECT ARRAYREF
+
+Adds a list of web elements to ARRAYREF specific to this export and SVC_OBJECT.
+The elements are displayed in the UI to lead the the operator to external
+configuration, monitoring, and similar tools.
+
+=cut
+
=back
=head1 SUBROUTINES
=back
=head1 SUBROUTINES
diff --git
a/FS/FS/part_export/prizm.pm
b/FS/FS/part_export/prizm.pm
index
3ba1b27
..
754d428
100644
(file)
--- a/
FS/FS/part_export/prizm.pm
+++ b/
FS/FS/part_export/prizm.pm
@@
-463,6
+463,14
@@
sub _export_unsuspend {
'';
}
'';
}
+sub export_links {
+ my( $self, $svc, $arrayref ) = ( shift, shift, shift );
+
+ push @$arrayref, '<A HREF="http://'. $svc->ip_addr. '">SM</A>';
+
+ '';
+}
+
sub queue_statuschange {
my( $self, $method, $jobs, $svc, @args ) = @_;
sub queue_statuschange {
my( $self, $method, $jobs, $svc, @args ) = @_;
diff --git
a/FS/FS/svc_Common.pm
b/FS/FS/svc_Common.pm
index
787acee
..
d830f2f
100644
(file)
--- a/
FS/FS/svc_Common.pm
+++ b/
FS/FS/svc_Common.pm
@@
-708,6
+708,19
@@
sub unsuspend {
$self->export('unsuspend', @$export_args);
}
$self->export('unsuspend', @$export_args);
}
+=item export_links
+
+Runs export_links callbacks and returns the links.
+
+=cut
+
+sub export_links {
+ my $self = shift;
+ my $return = [];
+ $self->export('links', $return);
+ $return;
+}
+
=item export HOOK [ EXPORT_ARGS ]
Runs the provided export hook (i.e. "suspend", "unsuspend") for this service.
=item export HOOK [ EXPORT_ARGS ]
Runs the provided export hook (i.e. "suspend", "unsuspend") for this service.
diff --git
a/eg/export_template.pm
b/eg/export_template.pm
index
2830ce3
..
22eb36a
100644
(file)
--- a/
eg/export_template.pm
+++ b/
eg/export_template.pm
@@
-56,7
+56,7
@@
sub _export_delete {
ref($err_or_queue) ? '' : $err_or_queue;
}
ref($err_or_queue) ? '' : $err_or_queue;
}
-#these t
wo
are optional
+#these t
hree
are optional
# fallback for svc_acct will change and restore password
sub _export_suspend {
my( $self, $svc_something ) = (shift, shift);
# fallback for svc_acct will change and restore password
sub _export_suspend {
my( $self, $svc_something ) = (shift, shift);
@@
-72,6
+72,13
@@
sub _export_unsuspend {
ref($err_or_queue) ? '' : $err_or_queue;
}
ref($err_or_queue) ? '' : $err_or_queue;
}
+sub export_links {
+ my($self, $svc_something, $arrayref) = (shift, shift, shift);
+ #push @$arrayref, qq!<A HREF="http://example.com/~!. $svc_something->username.
+ # qq!">!. $svc_something->username. qq!</A>!;
+ '';
+}
+
###
#a good idea to queue anything that could fail or take any time
###
#a good idea to queue anything that could fail or take any time
diff --git
a/httemplate/view/cust_main/packages.html
b/httemplate/view/cust_main/packages.html
index
167c625
..
891fa30
100755
(executable)
--- a/
httemplate/view/cust_main/packages.html
+++ b/
httemplate/view/cust_main/packages.html
@@
-299,10
+299,11
@@
Current packages
<TR>
<TD ALIGN="right" VALIGN="top"><% FS::UI::Web::svc_link($m, $part_svc, $cust_svc) %></TD>
<TD STYLE="padding-bottom:0px"><B><% FS::UI::Web::svc_label_link($m, $part_svc, $cust_svc) %></B></TD>
<TR>
<TD ALIGN="right" VALIGN="top"><% FS::UI::Web::svc_link($m, $part_svc, $cust_svc) %></TD>
<TD STYLE="padding-bottom:0px"><B><% FS::UI::Web::svc_label_link($m, $part_svc, $cust_svc) %></B></TD>
+ <TD><% FS::UI::Web::svc_export_links($m, $part_svc, $cust_svc) %></TD>
</TR>
<TR>
</TR>
<TR>
- <TD ALIGN="right" COLSPAN="
2
" VALIGN="top" STYLE="padding-bottom:1px;padding-top:0px"><FONT SIZE="-2" COLOR="#FFD000">
+ <TD ALIGN="right" COLSPAN="
3
" VALIGN="top" STYLE="padding-bottom:1px;padding-top:0px"><FONT SIZE="-2" COLOR="#FFD000">
<% $cust_svc->overlimit ? "Overlimit: ". time2str('%b %o %Y' . ($conf->exists('cust_pkg-display_times') ? ' %l:%M %P' : ''), $cust_svc->overlimit) : '' %>
</FONT></TD>
<% $cust_svc->overlimit ? "Overlimit: ". time2str('%b %o %Y' . ($conf->exists('cust_pkg-display_times') ? ' %l:%M %P' : ''), $cust_svc->overlimit) : '' %>
</FONT></TD>
@@
-338,7
+339,7
@@
Current packages
% ) {
<TR>
% ) {
<TR>
- <TD COLSPAN=
2
ALIGN="center" STYLE="padding-bottom:4px;padding-top:0px">
+ <TD COLSPAN=
3
ALIGN="center" STYLE="padding-bottom:4px;padding-top:0px">
<B><% svc_provision_link($cust_pkg, $part_svc, $conf, $curuser) %></B>
</TD>
</TR>
<B><% svc_provision_link($cust_pkg, $part_svc, $conf, $curuser) %></B>
</TD>
</TR>