[freeside-commits] freeside/httemplate/edit/cust_main
select-domain.html, NONE, 1.1
Jeff Finucane,420,,
jeff at wavetail.420.am
Wed Feb 14 15:32:24 PST 2007
Update of /home/cvs/cvsroot/freeside/httemplate/edit/cust_main
In directory wavetail:/tmp/cvs-serv14661/httemplate/edit/cust_main
Added Files:
select-domain.html
Log Message:
selectable domain on first package in edit/cust_main
--- NEW FILE: select-domain.html ---
<% include('/elements/xmlhttp.html',
'url' => $p.'misc/svc_acct-domains.cgi',
'subs' => [ $opt{'prefix'}. 'get_domains' ],
)
%>
<SCRIPT TYPE="text/javascript">
function selopt(what,value,text,selected) {
var optionName = new Option(text, value, false, selected);
var length = what.length;
what.options[length] = optionName;
}
function <% $opt{'prefix'} %>pkgpart_svcpart_changed(what,selected) {
pkgpart_svcpart = what.options[what.selectedIndex].value;
function <% $opt{'prefix'} %>update_domains(domains) {
// blank the current domain list
for ( var i = what.form.<% $opt{'prefix'} %>domsvc.length; i >= 0; i-- )
what.form.<% $opt{'prefix'} %>domsvc.options[i] = null;
// add the new domains
var domainArray = eval('(' + domains + ')' );
for ( var s = 0; s < domainArray.length; s=s+2 ) {
var domainLabel = domainArray[s+1];
if ( domainLabel == "" )
domainLabel = '(n/a)';
selopt(what.form.<% $opt{'prefix'} %>domsvc, domainArray[s], domainLabel, (domainArray[s] == selected) ? true : false);
}
}
// go get the new domains
<% $opt{'prefix'} %>get_domains( pkgpart_svcpart, <% $opt{'prefix'} %>update_domains );
}
</SCRIPT>
<SELECT NAME="<% $opt{'prefix'} %>pkgpart_svcpart" onchange="<% $opt{'prefix'} %>pkgpart_svcpart_changed(this,0);" >
% foreach my $part_pkg ( @part_pkg ) {
<OPTION VALUE="<% $part_pkg->pkgpart. "_". $part_pkg->svcpart('svc_acct') %>"<% ( $opt{saved_pkgpart} && $part_pkg->pkgpart == $opt{saved_pkgpart} ) ? ' SELECTED' : '' %>><% $part_pkg->pkg. " - ". $part_pkg->comment %>
% }
</SELECT>
<SCRIPT>
pkgpart_svcpart_changed(document.bottomform.pkgpart_svcpart, <% $opt{saved_domsvc} %>);
</SCRIPT>
<%init>
my %opt = @_;
foreach my $opt (qw( svc_part pkgparts saved_pkgpart saved_domsvc prefix)) {
$opt{$_} = '' unless exists($opt{$_}) && defined($opt{$_});
}
$opt{saved_domsvc} = 0 unless $opt{saved_domsvc};
my @part_pkg = @{$opt{'pkgparts'}};
</%init>
More information about the freeside-commits
mailing list