summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-09-10 01:34:03 -0700
committerIvan Kohler <ivan@freeside.biz>2013-09-10 01:34:03 -0700
commitdcfdfa382ec3e357f1cd3c822fd5e658b0746f85 (patch)
tree2466faf950fa2a87490bcf904bd7b72bfac4802d /httemplate
parenta5dce53ac50026bc6caef192100162f1d86a863f (diff)
svc_cable service have a single serial / MAC / model, not one-to-many devices like svc_phone and svc_dsl, RT#22009
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/browse/cable_model.html33
-rw-r--r--httemplate/edit/cable_model.html20
-rw-r--r--httemplate/edit/process/cable_model.html10
-rw-r--r--httemplate/elements/select-cable_model.html7
-rw-r--r--httemplate/elements/tr-select-cable_model.html12
5 files changed, 82 insertions, 0 deletions
diff --git a/httemplate/browse/cable_model.html b/httemplate/browse/cable_model.html
new file mode 100644
index 000000000..af98d8941
--- /dev/null
+++ b/httemplate/browse/cable_model.html
@@ -0,0 +1,33 @@
+<& elements/browse.html,
+ 'title' => 'Cable modem models',
+ 'html_init' => $html_init,
+ 'name' => 'models',
+ 'disableable' => 1,
+ 'disabled_statuspos' => 1,
+ 'query' => { 'table' => 'cable_model',
+ 'hashref' => {},
+ 'order_by' => 'ORDER BY model_name',
+ },
+ 'count_query' => $count_query,
+ 'header' => $header,
+ 'fields' => $fields,
+ 'links' => $links,
+&>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+my $html_init =
+ #'Cable "modem" models.<BR><BR>'.
+ qq!<A HREF="${p}edit/cable_model.html"><I>Add a model</I></A><BR><BR>!;
+
+my $count_query = 'SELECT COUNT(*) FROM cable_model';
+
+my $link = [ $p.'edit/cable_model.html?', 'modelnum' ];
+
+my $header = [ 'Model' ];
+my $fields = [ 'model_name' ];
+my $links = [ $link ];
+
+</%init>
diff --git a/httemplate/edit/cable_model.html b/httemplate/edit/cable_model.html
new file mode 100644
index 000000000..0bda4e863
--- /dev/null
+++ b/httemplate/edit/cable_model.html
@@ -0,0 +1,20 @@
+<& elements/edit.html,
+ 'name_singular' => 'Model',
+ 'table' => 'cable_model',
+ 'fields' => [
+ 'model_name',
+ { field=>'disabled', type=>'checkbox', value=>'Y', },
+ ],
+ 'labels' => {
+ 'modelnum' => 'Model',
+ 'model_name' => 'Model',
+ 'disabled' => 'Disabled',
+ },
+ 'viewall_dir' => 'browse',
+&>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+</%init>
diff --git a/httemplate/edit/process/cable_model.html b/httemplate/edit/process/cable_model.html
new file mode 100644
index 000000000..072df02c4
--- /dev/null
+++ b/httemplate/edit/process/cable_model.html
@@ -0,0 +1,10 @@
+<& elements/process.html,
+ 'table' => 'cable_model',
+ 'viewall_dir' => 'browse',
+&>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+</%init>
diff --git a/httemplate/elements/select-cable_model.html b/httemplate/elements/select-cable_model.html
new file mode 100644
index 000000000..8d65a393e
--- /dev/null
+++ b/httemplate/elements/select-cable_model.html
@@ -0,0 +1,7 @@
+<% include( '/elements/select-table.html',
+ 'table' => 'cable_model',
+ 'name_col' => 'model_name',
+ 'empty_label' => 'Select model',
+ @_,
+ )
+%>
diff --git a/httemplate/elements/tr-select-cable_model.html b/httemplate/elements/tr-select-cable_model.html
new file mode 100644
index 000000000..94b5cd9f0
--- /dev/null
+++ b/httemplate/elements/tr-select-cable_model.html
@@ -0,0 +1,12 @@
+% #if ( scalar(@domains) < 2 ) {
+% #} else {
+ <TR>
+ <TD ALIGN="right"><% $opt{'label'} || 'Model' %></TD>
+ <TD>
+ <% include( '/elements/select-cable_model.html', %opt) %>
+ </TD>
+ </TR>
+% #}
+<%init>
+ my %opt = @_;
+</%init>