X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Frouter.cgi;h=c08e54449e31e7fea428d43381cd47336d13ecfb;hb=0930d22ffc440f80c1b222b2e750cadbabd9e8f6;hp=a573c6504462c2627b5a78887740a3d27dcff212;hpb=2041a9143fac20b79ead4a1ae01224dedf5b27c2;p=freeside.git diff --git a/httemplate/edit/router.cgi b/httemplate/edit/router.cgi index a573c6504..c08e54449 100755 --- a/httemplate/edit/router.cgi +++ b/httemplate/edit/router.cgi @@ -1,77 +1,78 @@ - - -<% - -my $router; -if ( $cgi->keywords ) { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $router = qsearchs('router', { routernum => $1 }) - or print $cgi->redirect(popurl(2)."browse/router.cgi") ; -} else { - $router = new FS::router ( { - map { $_, scalar($cgi->param($_)) } fields('router') - } ); -} - -my $routernum = $router->routernum; -my $action = $routernum ? 'Edit' : 'Add'; - -print header("$action Router", menubar( - 'Main Menu' => "$p", - 'View all routers' => "${p}browse/router.cgi", -)); - -my $p3 = popurl(3); +<% include('/elements/header.html', "$action Router", menubar( + 'View all routers' => "${p}browse/router.cgi", + )) +%> -if($cgi->param('error')) { -%> Error: <%=$cgi->param('error')%> -<% } %> +<% include('/elements/error.html') %> -
+ - - - - - Router #<%=$routernum or "(NEW)"%> + + + + + Router #<%$routernum or "(NEW)"%> -

Name +

Name

Custom fields:
-<%=table() %> +<%table() %> +% +%foreach my $field ($router->virtual_fields) { +% print $router->pvf($field)->widget('HTML', 'edit', +% $router->getfield($field)); +%} +% -<% -foreach my $field ($router->virtual_fields) { - print $router->pvf($field)->widget('HTML', 'edit', - $router->getfield($field)); -} -%> +% +%unless ($router->svcnum) { +% - -<% -unless ($router->svcnum) { -%>

Select the service types available on this router
-<% +% +% +% foreach my $part_svc ( qsearch('part_svc', { svcdb => 'svc_broadband', +% disabled => '' }) ) { +% - foreach my $part_svc ( qsearch('part_svc', { svcdb => 'svc_broadband', - disabled => '' }) ) { - %>
- $part_svc->svcpart, routernum => $routernum } ) ? ' CHECKED' : ''%> VALUE="ON"> - - <%=$part_svc->svcpart%>: <%=$part_svc->svc%> - <% } %> + + <%$part_svc->svcpart%>: <%$part_svc->svc%> +% } +% } -<% } %>

- +<% include('/elements/footer.html') %> + +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +my $router; +if ( $cgi->keywords ) { + my($query) = $cgi->keywords; + $query =~ /^(\d+)$/; + $router = qsearchs('router', { routernum => $1 }) + or print $cgi->redirect(popurl(2)."browse/router.cgi") ; +} else { + $router = new FS::router ( { + map { $_, scalar($cgi->param($_)) } fields('router') + } ); +} + +my $routernum = $router->routernum; +my $action = $routernum ? 'Edit' : 'Add'; + +my $p3 = popurl(3); + +