diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-04-30 02:34:51 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-04-30 02:34:51 -0700 |
commit | 7d34aacffa38c4cac09b54080487a66c264e4668 (patch) | |
tree | e3b27abf58b2c71ff3a12eb18971140c60e6d973 /httemplate | |
parent | 58cdf1b78c0cd419eacf7db8661564af050e0f12 (diff) |
service dependencies: UI, RT#33685
Diffstat (limited to 'httemplate')
-rw-r--r-- | httemplate/browse/part_svc_link.html | 32 | ||||
-rw-r--r-- | httemplate/edit/elements/export_svc.html | 6 | ||||
-rw-r--r-- | httemplate/edit/elements/part_svc_column.html | 7 | ||||
-rwxr-xr-x | httemplate/edit/part_svc.cgi | 5 | ||||
-rw-r--r-- | httemplate/edit/part_svc_link.html | 51 | ||||
-rw-r--r-- | httemplate/edit/process/part_svc_link.html | 5 | ||||
-rw-r--r-- | httemplate/elements/menu.html | 1 |
7 files changed, 97 insertions, 10 deletions
diff --git a/httemplate/browse/part_svc_link.html b/httemplate/browse/part_svc_link.html new file mode 100644 index 000000000..d31acc646 --- /dev/null +++ b/httemplate/browse/part_svc_link.html @@ -0,0 +1,32 @@ +<& elements/browse.html, + 'title' => 'Service dependencies', + 'name_singular' => 'dependency', + 'menubar' => [ 'Add a new service dependency' => + $p.'edit/part_svc_link.html', + ], + 'query' => { 'table' => 'part_svc_link', + 'order_by' => 'ORDER BY src_svcpart', + }, + 'count_query' => 'SELECT COUNT(*) FROM part_svc_link', + 'header' => [ 'Source', 'Dependency', ], + 'fields' => [ 'src_svc', 'description', ], + 'sort_fields' => [], + 'links' => [ $svc_link, $link, ], + 'disableable' => 1, + 'disabled_statuspos' => 1, + 'agent_virt' => 1, + 'agent_null' => 1, + 'agent_null_right' => 'Configuration', + #agent_null_right_link' + 'agent_pos' => 0, +&> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +my $svc_link = [ "${p}edit/part_svc.cgi?", 'src_svcpart' ]; + +my $link = [ "${p}edit/part_svc_link.html?", 'svclinknum' ]; + +</%init> diff --git a/httemplate/edit/elements/export_svc.html b/httemplate/edit/elements/export_svc.html index 5962ae7f8..1735148a4 100644 --- a/httemplate/edit/elements/export_svc.html +++ b/httemplate/edit/elements/export_svc.html @@ -39,8 +39,8 @@ function toggle_selectrole() { } </&> </script> -<& /elements/table.html &> - <TR><TH COLSPAN=<% $columns %>>Exports</TH></TR> +<FONT CLASS="fsinnerbox-title">Exports</FONT> +<TABLE CLASS="fsinnerbox"> <TR> % # exports % foreach my $part_export (@part_export) { @@ -81,4 +81,4 @@ function toggle_selectrole() { % } % } </TR> -</TABLE><BR><BR> +</TABLE><BR> diff --git a/httemplate/edit/elements/part_svc_column.html b/httemplate/edit/elements/part_svc_column.html index a6ccaf867..23a6deb56 100644 --- a/httemplate/edit/elements/part_svc_column.html +++ b/httemplate/edit/elements/part_svc_column.html @@ -63,15 +63,14 @@ my %communigate_fields = ( ); </%once> <INPUT TYPE="hidden" NAME="svcdb" VALUE="<% $svcdb %>"> -<BR><BR> +<BR> %# include export selection <& export_svc.html, part_svc => $part_svc, svcdb => $svcdb &> -For the selected table, you can give fields default or fixed (unchangeable) -values, or select an inventory class to manually or automatically fill in -that field. + +<FONT CLASS="fsinnerbox-title">Fields</FONT> <& /elements/table-grid.html, cellpadding => 4 &> <TR> <TH BGCOLOR="#cccccc">Field</TH> diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 7a47f1550..a07fc6005 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -187,10 +187,9 @@ window.onload = function() { <BR> -<BR> -Table <% $widget->html %> +<FONT SIZE="+1"><B>Table</B></FONT> <% $widget->html %> -<% include('/elements/footer.html') %> +<& /elements/footer.html &> <%init> diff --git a/httemplate/edit/part_svc_link.html b/httemplate/edit/part_svc_link.html new file mode 100644 index 000000000..64a99d6f4 --- /dev/null +++ b/httemplate/edit/part_svc_link.html @@ -0,0 +1,51 @@ +<& elements/edit.html, + 'table' => 'part_svc_link', + 'name_singular' => 'dependency', + 'labels' => \%labels, + 'fields' => \@fields, +&> +<%init> +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +my @fields = ( + { field => 'agentnum', + type => 'select-agent', + empty_label => '(global)', + }, + { field => 'src_svcpart', + type => 'select-part_svc', + empty_label => 'Select service definition', + }, + { field => 'dst_svcpart', + type => 'select-part_svc', + empty_label => 'Select service definition', + }, + { field => 'link_type', + type => 'select', + #XXX false laziness w/part_svc_link POD documentation + options =>[ qw( + part_svc_restrict part_svc_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', + 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', + cust_svc_suspend_cascade => 'Suspend the target service before the source service', + }, + }, + { field => 'disabled', type => 'checkbox', value => 'Y' } +); +my %labels = ( + 'svclinknum ' => '', + 'agentnum' => 'Agent', + 'src_svcpart' => 'Source service', + 'dst_svcpart' => 'Destination service', + 'link_type' => 'Dependency type', + 'disabled' => 'Disabled' +); +</%init> diff --git a/httemplate/edit/process/part_svc_link.html b/httemplate/edit/process/part_svc_link.html new file mode 100644 index 000000000..ffe979d29 --- /dev/null +++ b/httemplate/edit/process/part_svc_link.html @@ -0,0 +1,5 @@ +<& elements/process.html, table=>'part_svc_link', viewall_dir=>'browse' &> +<%init> +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); +</%init> diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index 0aefcd77a..e152cb690 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -577,6 +577,7 @@ tie my %config_export_svc, 'Tie::IxHash', (); if ( $curuser->access_right('Configuration') ) { $config_export_svc{'Service definitions'} = [ $fsurl.'browse/part_svc.cgi', 'Services are items you offer to your customers' ]; $config_export_svc{'Service classes'} = [ $fsurl.'browse/part_svc_class.html', 'Services classes are user-defined, informational types for services' ]; + $config_export_svc{'Service dependencies'} = [ $fsurl.'browse/part_svc_link.html', 'Services depencies define rules between service definitions' ]; $config_export_svc{'Provisioning exports'} = [ $fsurl.'browse/part_export.cgi', 'Provisioning services to external machines, databases and APIs' ]; } $config_export_svc{'Dialup'} = [ \%config_dialup, '' ] |