diff options
author | Ivan Kohler <ivan@freeside.biz> | 2013-12-10 20:59:42 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2013-12-10 20:59:42 -0800 |
commit | 430b2c784d2ee9ea5be00b821d2dbd27279ef132 (patch) | |
tree | c8a224219c1425bd3fa03b1a54487bf1f3de7449 /httemplate/browse/addr_range.html | |
parent | 6ced51db0e73603461591e54b7f606467e7c7af0 (diff) | |
parent | e1157f37c618a7b9cdb2793d61999458076dc51b (diff) |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Conflicts:
FS/FS/Mason.pm
FS/MANIFEST
Diffstat (limited to 'httemplate/browse/addr_range.html')
-rw-r--r-- | httemplate/browse/addr_range.html | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/httemplate/browse/addr_range.html b/httemplate/browse/addr_range.html new file mode 100644 index 000000000..d657f32ec --- /dev/null +++ b/httemplate/browse/addr_range.html @@ -0,0 +1,66 @@ +<& elements/browse.html, + 'title' => 'Address Ranges', + 'name_singular' => 'address range', + 'html_init' => $html_init, + 'html_foot' => $html_foot, + 'query' => { 'table' => 'addr_range', + 'order_by' => $order_by, + }, + 'count_query' => "SELECT count(*) from addr_range", + 'header' => [ 'From', + '', # the dash + 'To', + 'Status', + # would be nice to show whether any addresses in the + # range are assigned, but that's ugly + ], + 'fields' => [ 'start', + sub { '–' }, + 'end', + 'desc', + ], + 'links' => [ + [ '#' ], + '', + [ '#' ], + ], + 'link_onclicks' => [ $edit_link, + '', + $edit_link, + '', + ], +&> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Broadband global configuration'); +# addr_ranges are ALWAYS global, else there will be chaos + +my $order_by = "ORDER BY inet(start)"; # Pg-ism +# though we could also make the field itself inet-type... +# this would simplify a lot of things. + +my $html_init = include('/elements/error.html'); + +my $edit_link = sub { + my $addr_range = shift; + include('/elements/popup_link_onclick.html', + action => $p.'edit/addr_range.html?rangenum='. + $addr_range->rangenum, + actionlabel => 'Edit address range', + width => 650, + height => 420, + ); +}; + +my $add_link = include('/elements/popup_link_onclick.html', + action => $p.'edit/addr_range.html', + actionlabel => 'Edit address range', + width => 650, + height => 420, +); + +my $html_foot = qq!<A HREF="#" onclick="$add_link"> +<I>Add a new address range</I></A>!; + +</%init> |