diff options
Diffstat (limited to 'httemplate')
-rw-r--r-- | httemplate/browse/nas.html | 33 | ||||
-rw-r--r-- | httemplate/edit/elements/edit.html | 2 | ||||
-rw-r--r-- | httemplate/edit/nas.html | 41 | ||||
-rw-r--r-- | httemplate/edit/process/nas.html | 7 | ||||
-rw-r--r-- | httemplate/elements/tr-td-label.html | 4 | ||||
-rw-r--r-- | httemplate/search/elements/search-html.html | 60 |
6 files changed, 113 insertions, 34 deletions
diff --git a/httemplate/browse/nas.html b/httemplate/browse/nas.html new file mode 100644 index 000000000..c9d57e8ed --- /dev/null +++ b/httemplate/browse/nas.html @@ -0,0 +1,33 @@ +<& elements/browse.html, + 'title' => 'RADIUS clients', + 'name_singular' => 'RADIUS client', + 'query' => { 'table' => 'nas', }, + 'count_query' => 'SELECT COUNT(*) FROM nas', + 'header' => [ 'Hostname', 'Short name', #'Shared secret', + 'Type', 'Ports', 'Server', 'Community', + 'Description', + ], + 'fields' => [ 'nasname', + 'shortname', + #'secret', + 'type', + 'ports', + 'server', + 'community', + 'description', + ], + 'links' => [ $link, $link ], + 'align' => 'lllrlll', + 'add_link' => 1, + #'disableable' => 1, + #'disabled_statuspos' => 2, + #All options from /search/elements/search.html are available. +&> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +my $link = [ $p.'edit/nas.html?', 'nasnum' ]; + +</%init> diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html index d9843471f..6db54fd48 100644 --- a/httemplate/edit/elements/edit.html +++ b/httemplate/edit/elements/edit.html @@ -287,6 +287,7 @@ Example: % % #any? % 'colspan' => $f->{'colspan'}, +% 'required' => $f->{'required'}, % ); % % $include_common{$_} = $f->{$_} foreach grep exists($f->{$_}), @@ -755,6 +756,7 @@ my $fields = $opt{'fields'} || [ grep { $_ ne $pkey } fields($table) ]; #my @actualfields = map { ref($_) ? $_->{'field'} : $_ } @$fields; +#$m->comp('/elements/handle_uri_query'); if ( $cgi->param('redirect') ) { my $session = $cgi->param('redirect'); my $pref = $curuser->option("redirect$session"); diff --git a/httemplate/edit/nas.html b/httemplate/edit/nas.html new file mode 100644 index 000000000..64d722e52 --- /dev/null +++ b/httemplate/edit/nas.html @@ -0,0 +1,41 @@ +<& elements/edit.html, + 'name_singular' => 'RADIUS client', + 'table' => 'nas', + 'viewall_dir' => 'browse', + 'labels' => { 'nasnum' => 'NAS', + 'nasname' => 'Hostname', + 'shortname' => 'Short name', + 'secret' => 'Shared secret', + 'type' => 'Type', + 'ports' => 'Ports', + 'server' => 'Server', + 'community' => 'Community', + 'description' => 'Description', + }, + 'fields' => [ + { field=> 'nasname', required=>1, size=>40, maxlength=>128 }, + { field=>'shortname', size=>16, maxlength=>32 }, + { field=>'secret', size=>40, maxlength=>60, required=>1 }, + { field=>'type', type=>'select', + options=>[qw( cisco computone livingston max40xx multitech netserver + pathras patton portslave tc usrhiper other )], + }, + { field=>'ports', size=>5 }, + { field=>'server', size=>40, maxlength=>64 }, + { field=>'community', size=>40, maxlength=>50 }, + { field=>'description', size=>100, maxlength=>200 }, + ], + 'html_bottom' => '<font color="#ff0000">*</font> '. + emt('required fields'). '<BR>', + 'new_hashref_callback' => sub { +{ 'type' => 'other', + 'secret' => 'secret', + 'description' => 'RADIUS Client', + }; + }, +&> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +</%init> diff --git a/httemplate/edit/process/nas.html b/httemplate/edit/process/nas.html new file mode 100644 index 000000000..04b46a5c0 --- /dev/null +++ b/httemplate/edit/process/nas.html @@ -0,0 +1,7 @@ +<& elements/process.html, table=>'nas', viewall_dir=>'browse', &> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +</%init> diff --git a/httemplate/elements/tr-td-label.html b/httemplate/elements/tr-td-label.html index f8473891f..8125541c7 100644 --- a/httemplate/elements/tr-td-label.html +++ b/httemplate/elements/tr-td-label.html @@ -4,7 +4,7 @@ VALIGN = "<% $opt{'valign'} || 'top' %>" STYLE = "<% $style %>" ID = "<% $opt{label_id} || $opt{id}. '_label0' %>" - ><% $opt{label} %></TD> + ><% $required %><% $opt{label} %></TD> <%init> @@ -14,4 +14,6 @@ my $style = 'padding-top: 3px'; $style .= '; '. $opt{'cell_style'} if $opt{'cell_style'}; +my $required = $opt{'required'} ? '<font color="#ff0000">*</font> ' : ''; + </%init> diff --git a/httemplate/search/elements/search-html.html b/httemplate/search/elements/search-html.html index 8e6546cf8..d1f4b2f1e 100644 --- a/httemplate/search/elements/search-html.html +++ b/httemplate/search/elements/search-html.html @@ -29,42 +29,36 @@ % } % } % -% if ( $type eq 'html-print' ) { - - <% $opt{nohtmlheader} - ? '' - : include( '/elements/header-popup.html', $opt{'title'} ) - %> - -% } elsif ( $type eq 'select' ) { - - <% $opt{nohtmlheader} - ? '' - : include( '/elements/header-popup.html', $opt{'title'} ) - %> - <% defined($opt{'html_init'}) - ? ( ref($opt{'html_init'}) - ? &{$opt{'html_init'}}() - : $opt{'html_init'} - ) - : '' - %> - -% } else { +% unless ( $opt{nohtmlheader} ) { % -% my @menubar = (); -% if ( $opt{'menubar'} ) { -% @menubar = @{ $opt{'menubar'} }; -% #} else { -% # @menubar = ( 'Main menu' => $p ); +% if ( $type eq 'html-print' ) { + <& /elements/header-popup.html, $opt{'title'} &> +% } else { +% if ( $type eq 'select' ) { + <&/elements/header-popup.html, $opt{'title'} &> +% } else { +% +% my @menubar = (); +% if ( $opt{'menubar'} ) { +% @menubar = @{ $opt{'menubar'} }; +% #} else { +% # @menubar = ( 'Main menu' => $p ); +% } + + <& /elements/header.html, $opt{'title'}, + include( '/elements/menubar.html', @menubar ) + &> + +% } % } +% +% } +% +% unless ( $type eq 'html-print' ) { - <% $opt{nohtmlheader} - ? '' - : include( '/elements/header.html', $opt{'title'}, - include( '/elements/menubar.html', @menubar ) - ) - %> +% if ( $opt{'add_link'} ) { #or after html_init? + <A HREF="<%$p%>edit/<% $opt{query}->{table} %>.html"><I>Add a <% $opt{'name_singular'} %></I></A><BR><BR> +% } <% defined($opt{'html_init'}) ? ( ref($opt{'html_init'}) |