summaryrefslogtreecommitdiff
path: root/httemplate/elements
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2014-01-04 16:23:54 -0800
committerIvan Kohler <ivan@freeside.biz>2014-01-04 16:23:54 -0800
commit5264cbf1175e3ea73cf9bcf5087c5028e6cf3b1c (patch)
tree01c07f0d3f21feaf8fa606355ed38da700fd6db1 /httemplate/elements
parent50e89d97c110d58e0755c69775e0d243a82e352d (diff)
svc_conferencing, RT#24389
Diffstat (limited to 'httemplate/elements')
-rw-r--r--httemplate/elements/duration.html74
-rw-r--r--httemplate/elements/menu.html7
-rw-r--r--httemplate/elements/select-conferencing_quality.html7
-rw-r--r--httemplate/elements/select-conferencing_type.html7
-rw-r--r--httemplate/elements/tr-duration.html30
-rw-r--r--httemplate/elements/tr-select-conferencing_quality.html6
-rw-r--r--httemplate/elements/tr-select-conferencing_type.html6
7 files changed, 137 insertions, 0 deletions
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',
+ @_,
+&>