diff options
author | Ivan Kohler <ivan@freeside.biz> | 2014-01-04 16:23:54 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2014-01-04 16:23:54 -0800 |
commit | 5264cbf1175e3ea73cf9bcf5087c5028e6cf3b1c (patch) | |
tree | 01c07f0d3f21feaf8fa606355ed38da700fd6db1 /httemplate | |
parent | 50e89d97c110d58e0755c69775e0d243a82e352d (diff) |
svc_conferencing, RT#24389
Diffstat (limited to 'httemplate')
-rw-r--r-- | httemplate/browse/conferencing_quality.html | 32 | ||||
-rw-r--r-- | httemplate/browse/conferencing_type.html | 32 | ||||
-rw-r--r-- | httemplate/edit/conferencing_quality.html | 21 | ||||
-rw-r--r-- | httemplate/edit/conferencing_type.html | 21 | ||||
-rw-r--r-- | httemplate/edit/process/conferencing_quality.html | 10 | ||||
-rw-r--r-- | httemplate/edit/process/conferencing_type.html | 10 | ||||
-rw-r--r-- | httemplate/elements/duration.html | 74 | ||||
-rw-r--r-- | httemplate/elements/menu.html | 7 | ||||
-rw-r--r-- | httemplate/elements/select-conferencing_quality.html | 7 | ||||
-rw-r--r-- | httemplate/elements/select-conferencing_type.html | 7 | ||||
-rw-r--r-- | httemplate/elements/tr-duration.html | 30 | ||||
-rw-r--r-- | httemplate/elements/tr-select-conferencing_quality.html | 6 | ||||
-rw-r--r-- | httemplate/elements/tr-select-conferencing_type.html | 6 | ||||
-rw-r--r-- | httemplate/view/elements/svc_Common.html | 4 |
14 files changed, 264 insertions, 3 deletions
diff --git a/httemplate/browse/conferencing_quality.html b/httemplate/browse/conferencing_quality.html new file mode 100644 index 000000000..88545591b --- /dev/null +++ b/httemplate/browse/conferencing_quality.html @@ -0,0 +1,32 @@ +<& elements/browse.html, + 'title' => 'Conferencing quality levels', + 'html_init' => $html_init, + 'name_singular' => 'quality', + 'disableable' => 1, + 'disabled_statuspos' => 1, + 'query' => { 'table' => 'conferencing_quality', + 'hashref' => {}, + 'order_by' => 'ORDER BY qualityid', + }, + 'count_query' => $count_query, + 'header' => $header, + 'fields' => $fields, + 'links' => $links, +&> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +my $html_init = + qq!<A HREF="${p}edit/conferencing_quality.html"><I>Add a conferencing quality</I></A><BR><BR>!; + +my $count_query = 'SELECT COUNT(*) FROM conferencing_quality'; + +my $link = [ $p.'edit/conferencing_quality.html?', 'confqualitynum' ]; + +my $header = [ 'ID', 'Quality' ]; +my $fields = [ 'qualityid', 'qualityname' ]; +my $links = [ $link, $link ]; + +</%init> diff --git a/httemplate/browse/conferencing_type.html b/httemplate/browse/conferencing_type.html new file mode 100644 index 000000000..176b6a278 --- /dev/null +++ b/httemplate/browse/conferencing_type.html @@ -0,0 +1,32 @@ +<& elements/browse.html, + 'title' => 'Conferencing types', + 'html_init' => $html_init, + 'name_singular' => 'type', + 'disableable' => 1, + 'disabled_statuspos' => 1, + 'query' => { 'table' => 'conferencing_type', + 'hashref' => {}, + 'order_by' => 'ORDER BY typeid', + }, + 'count_query' => $count_query, + 'header' => $header, + 'fields' => $fields, + 'links' => $links, +&> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +my $html_init = + qq!<A HREF="${p}edit/conferencing_type.html"><I>Add a conferencing type</I></A><BR><BR>!; + +my $count_query = 'SELECT COUNT(*) FROM conferencing_type'; + +my $link = [ $p.'edit/conferencing_type.html?', 'conftypenum' ]; + +my $header = [ 'ID', 'Type' ]; +my $fields = [ 'typeid', 'typename' ]; +my $links = [ $link, $link ]; + +</%init> diff --git a/httemplate/edit/conferencing_quality.html b/httemplate/edit/conferencing_quality.html new file mode 100644 index 000000000..4d93deefa --- /dev/null +++ b/httemplate/edit/conferencing_quality.html @@ -0,0 +1,21 @@ +<& elements/edit.html, + 'table' => 'conferencing_quality', + 'name_singular' => 'quality', + 'fields' => [ + { field=>'qualityid', type=>'text', size=>4 }, + { field=>'qualityname', type=>'text', }, + { field=>'disabled', type=>'checkbox', value=>'Y'}, + ], + 'labels' => { 'confqualitynum' => 'Type', + 'qualityid' => 'ID', + 'qualityname' => 'Name', + 'disabled' => 'Disabled', + }, + 'viewall_dir' => 'browse', +&> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +</%init> diff --git a/httemplate/edit/conferencing_type.html b/httemplate/edit/conferencing_type.html new file mode 100644 index 000000000..964a5601a --- /dev/null +++ b/httemplate/edit/conferencing_type.html @@ -0,0 +1,21 @@ +<& elements/edit.html, + 'table' => 'conferencing_type', + 'name_singular' => 'type', + 'fields' => [ + { field=>'typeid', type=>'text', size=>4 }, + { field=>'typename', type=>'text', }, + { field=>'disabled', type=>'checkbox', value=>'Y'}, + ], + 'labels' => { 'conftypenum' => 'Type', + 'typeid' => 'ID', + 'typename' => 'Name', + 'disabled' => 'Disabled', + }, + 'viewall_dir' => 'browse', +&> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +</%init> diff --git a/httemplate/edit/process/conferencing_quality.html b/httemplate/edit/process/conferencing_quality.html new file mode 100644 index 000000000..e68b4ead7 --- /dev/null +++ b/httemplate/edit/process/conferencing_quality.html @@ -0,0 +1,10 @@ +<& elements/process.html, + 'table' => 'conferencing_quality', + 'viewall_dir' => 'browse', +&> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +</%init> diff --git a/httemplate/edit/process/conferencing_type.html b/httemplate/edit/process/conferencing_type.html new file mode 100644 index 000000000..a67d7792a --- /dev/null +++ b/httemplate/edit/process/conferencing_type.html @@ -0,0 +1,10 @@ +<& elements/process.html, + 'table' => 'conferencing_type', + 'viewall_dir' => 'browse', +&> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +</%init> diff --git a/httemplate/elements/duration.html b/httemplate/elements/duration.html new file mode 100644 index 000000000..106e56ba0 --- /dev/null +++ b/httemplate/elements/duration.html @@ -0,0 +1,74 @@ +<% $opt{'prefix'} %><INPUT TYPE = "text" + NAME = "<% $opt{field} %>" + ID = "<% $opt{id} %>" + VALUE = "<% $value |h %>" + <% $size %> + <% $maxlength %> + <% $style %> + <% $opt{autocomplete} ? 'autocomplete="off"' : '' %> + <% $opt{disabled} %> + <% $onchange %> + ><SELECT NAME = "<% $opt{field} %>_units" + ID = "<% $opt{id} %>_units" + onChange = "<% $opt{field} %>_units_changed(this)" + > + <OPTION VALUE="1">minutes</OPTION> + <OPTION SELECTED VALUE="60">hours</OPTION> + </SELECT><% $opt{'postfix'} %> +<SCRIPT TYPE="text/javascript"> + function <% $opt{field} %>_units_changed(what) { + var units = what.options[what.selectedIndex].value; + if ( units == 60 ) { // changed from minutes to hours, so /60 + + var value = what.form.<% $opt{field} %>.value; + value = value / 60; + what.form.<% $opt{field} %>.value = value; + + } else if ( units == 1 ) { // changed from hours to minutes, so *60 + + var value = what.form.<% $opt{field} %>.value; + value = Math.round(value * 60); + what.form.<% $opt{field} %>.value = value; + + } + } +</SCRIPT> +<%init> + +my %opt = @_; + +my $value = length($opt{curr_value}) ? $opt{curr_value} : $opt{value}; +$value = $value / 60; + +my $onchange = $opt{'onchange'} + ? join(' ', map $_.'="'. $opt{'onchange'}. '(this)"', + qw( onChange onKeyDown onKeyUp onKeyPress ) + ) + : ''; + +$opt{'size'} ||= 4; +my $size = 'SIZE="'. $opt{'size'}. '"'; + +$opt{'maxlength'} ||= 3; +my $maxlength = 'MAXLENGTH="'. $opt{'maxlength'}. '"'; + +$opt{'disabled'} = &{ $opt{'disabled'} }( \%opt ) + if ref($opt{'disabled'}) eq 'CODE'; +$opt{'disabled'} = 'DISABLED' + if $opt{'disabled'} && $opt{'disabled'} !~ /disabled/i; # uuh... yeah? + +my @style = ref($opt{'style'}) + ? @{ $opt{'style'} } + : $opt{'style'} + ? ( $opt{'style'} ) + : (); + +push @style, 'text-align: '. $opt{'text-align'} + if $opt{'text-align'}; + +push @style, 'background-color: #dddddd' + if $opt{'disabled'} && ! $opt{'nodarken_disabled'}; + +my $style = scalar(@style) ? 'STYLE="'. join(';', @style). '"' : ''; + +</%init> diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index 2ae216c5c..a403bb31e 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -535,6 +535,11 @@ tie my %config_alarm, 'Tie::IxHash', 'Alarm central stations' => [ $fsurl.'browse/alarm_station.html', '' ], ; +tie my %config_conferencing, 'Tie::IxHash', + 'Conferencing types' => [ $fsurl.'browse/conferencing_type.html', '' ], + 'Quality levels' => [ $fsurl.'browse/conferencing_quality.html', '' ], +; + 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' ]; @@ -551,6 +556,8 @@ $config_export_svc{'RADIUS'} = [ \%config_radius, '' ] if $curuser->access_right('Configuration'); $config_export_svc{'Cable'} = [ \%config_cable, '' ] if $curuser->access_right('Configuration'); +$config_export_svc{'Conferencing'} = [ \%config_conferencing, '' ] + if $curuser->access_right('Configuration'); $config_export_svc{'Alarm'} = [ \%config_alarm, '' ] if $curuser->access_right(['Alarm configuration', 'Alarm global configuration']); $config_export_svc{'Hardware types'} = [ $fsurl.'browse/hardware_class.html', 'Set up hardware type catalog' ] diff --git a/httemplate/elements/select-conferencing_quality.html b/httemplate/elements/select-conferencing_quality.html new file mode 100644 index 000000000..b4de267ac --- /dev/null +++ b/httemplate/elements/select-conferencing_quality.html @@ -0,0 +1,7 @@ +<& /elements/select-table.html, + 'table' => 'conferencing_quality', + 'name_col' => 'qualityname', + 'order_by' => 'ORDER BY qualityid', + 'empty_label' => 'Select quality', + @_, +&> diff --git a/httemplate/elements/select-conferencing_type.html b/httemplate/elements/select-conferencing_type.html new file mode 100644 index 000000000..d9245033e --- /dev/null +++ b/httemplate/elements/select-conferencing_type.html @@ -0,0 +1,7 @@ +<& /elements/select-table.html, + 'table' => 'conferencing_type', + 'name_col' => 'typename', + 'order_by' => 'ORDER BY typeid', + 'empty_label' => 'Select type', + @_, +&> diff --git a/httemplate/elements/tr-duration.html b/httemplate/elements/tr-duration.html new file mode 100644 index 000000000..2517302ea --- /dev/null +++ b/httemplate/elements/tr-duration.html @@ -0,0 +1,30 @@ +<%doc> + +Example: + + <& /elements/tr-duration.html, + 'label' => 'Do or do not', + 'field' => 'field_name', + 'value' => 'Y', + &> + +</%doc> +<% include('tr-td-label.html', @_ ) %> + + <TD <% $style %>> + <% include('duration.html', @_) %> + </TD> + +</TR> + +<%init> + +my %opt = @_; + +my $onchange = $opt{'onchange'} + ? 'onChange="'. $opt{'onchange'}. '(this)"' + : ''; + +my $style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : ''; + +</%init> diff --git a/httemplate/elements/tr-select-conferencing_quality.html b/httemplate/elements/tr-select-conferencing_quality.html new file mode 100644 index 000000000..ba7a6857c --- /dev/null +++ b/httemplate/elements/tr-select-conferencing_quality.html @@ -0,0 +1,6 @@ +<& /elements/tr-select-table.html, + label => 'Quality', + table => 'conferencing_quality', + name_col => 'qualityname', + @_, +&> diff --git a/httemplate/elements/tr-select-conferencing_type.html b/httemplate/elements/tr-select-conferencing_type.html new file mode 100644 index 000000000..2177fc66f --- /dev/null +++ b/httemplate/elements/tr-select-conferencing_type.html @@ -0,0 +1,6 @@ +<& /elements/tr-select-table.html, + label => 'Conference type', + table => 'conferencing_type', + name_col => 'typename', + @_, +&> diff --git a/httemplate/view/elements/svc_Common.html b/httemplate/view/elements/svc_Common.html index d34ed509a..65f373cb6 100644 --- a/httemplate/view/elements/svc_Common.html +++ b/httemplate/view/elements/svc_Common.html @@ -78,9 +78,7 @@ function areyousure(href) { % my $hack_strict_refs = \&{ $f->{'value_callback'} }; % $value = &$hack_strict_refs($svc_x); % } else { -% $value = exists($f->{'value'}) -% ? $f->{'value'} -% : encode_entities($svc_x->$field); +% $value = encode_entities($svc_x->$field); % } % } else { % $field = $f; |