summaryrefslogtreecommitdiff
path: root/httemplate/edit
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2015-04-30 04:01:21 -0700
committerIvan Kohler <ivan@freeside.biz>2015-04-30 04:01:21 -0700
commit67b56f17cc51d10394a986fb3d105213b097ee79 (patch)
treea4c41eb1fa5caca96430658b4b70319f776d657f /httemplate/edit
parent7d34aacffa38c4cac09b54080487a66c264e4668 (diff)
service dependencies: part_pkg_restrict / part_pkg_restrict_soft, RT#33685
Diffstat (limited to 'httemplate/edit')
-rw-r--r--httemplate/edit/elements/edit.html11
-rwxr-xr-xhttemplate/edit/part_pkg.cgi5
-rw-r--r--httemplate/edit/part_svc_link.html6
-rwxr-xr-xhttemplate/edit/process/part_pkg.cgi3
4 files changed, 22 insertions, 3 deletions
diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html
index 5a7920b6f..76df82064 100644
--- a/httemplate/edit/elements/edit.html
+++ b/httemplate/edit/elements/edit.html
@@ -132,6 +132,9 @@ Example:
'html_init' => '', #after the header/menubar
+ 'form_init' => '', #after html_init, error and the opening <FORM>, but
+ #before any other form contents
+
#string or coderef of additional HTML to add before </TABLE>
'html_table_bottom' => '',
@@ -244,6 +247,14 @@ Example:
<INPUT TYPE="hidden" NAME="svcdb" VALUE="<% $table %>">
<INPUT TYPE="hidden" NAME="<% $pkey %>" VALUE="<% $clone ? '' : $object->$pkey() %>">
+ <% defined($opt{'form_init'})
+ ? ( ref($opt{'form_init'})
+ ? &{$opt{'form_init'}}()
+ : $opt{'form_init'}
+ )
+ : ''
+ %>
+
% unless ( $opt{'no_pkey_display'} ) {
<FONT SIZE="+1"><B>
diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi
index 6629407f0..fbc19c3f5 100755
--- a/httemplate/edit/part_pkg.cgi
+++ b/httemplate/edit/part_pkg.cgi
@@ -559,6 +559,11 @@ my $error_callback = sub {
'cgiparam'
);
+ if ( $cgi->param('error') =~ / is suggested with / ) {
+ #yeah, detection is a shitty kludge, but we don't have exception objects
+ $opt->{form_init} = '<INPUT TYPE="checkbox" NAME="part_pkg_restrict_soft_override" VALUE="Y"> Override suggestion<BR><BR>';
+ }
+
};
my $new_hashref_callback = sub { { 'plan' => 'flat' }; };
diff --git a/httemplate/edit/part_svc_link.html b/httemplate/edit/part_svc_link.html
index 64a99d6f4..c8c385dd5 100644
--- a/httemplate/edit/part_svc_link.html
+++ b/httemplate/edit/part_svc_link.html
@@ -25,13 +25,13 @@ my @fields = (
type => 'select',
#XXX false laziness w/part_svc_link POD documentation
options =>[ qw(
- part_svc_restrict part_svc_restrict_soft
+ part_pkg_restrict part_pkg_restrict_soft
cust_svc_provision_restrict cust_svc_unprovision_restrict
cust_svc_unprovision_cascade cust_svc_suspend_cascade
)],
labels => {
- part_svc_restrict => 'In package defintions, prevent including the destination service definition unless the source service definition is also included',
- part_svc_restrict_soft => 'Soft order block: in package definitions, warn if the destination service definition is included without the source service definition',
+ part_pkg_restrict => 'In package defintions, require the destination service definition when the source service definition is included',
+ part_pkg_restrict_soft => 'In package definitions, suggest the destination service definition when the source service definition is included',
cust_svc_provision_restrict => 'Require the target service to be provisioned before the source service',
cust_svc_unprovision_restrict => 'Require the target service to be unprovisioned before the source service',
cust_svc_unprovision_cascade => 'Automatically unprovision the target service when the source service is unprovisioned',
diff --git a/httemplate/edit/process/part_pkg.cgi b/httemplate/edit/process/part_pkg.cgi
index 0343cc0fb..eda3f33d4 100755
--- a/httemplate/edit/process/part_pkg.cgi
+++ b/httemplate/edit/process/part_pkg.cgi
@@ -188,6 +188,9 @@ my $args_callback = sub {
push @args, 'part_pkg_vendor' => \%part_pkg_vendor;
}
+ push @args, 'part_pkg_restrict_soft_override' => 1
+ if $cgi->param('part_pkg_restrict_soft_override');
+
#warn "args: ".join('/', @args). "\n";
@args;