[freeside-commits] freeside/httemplate/elements tr-select-svc_pbx.html, NONE, 1.1 select-svc_pbx.html, NONE, 1.1
Ivan,,,
ivan at wavetail.420.am
Mon Jan 25 14:14:34 PST 2010
Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory wavetail.420.am:/tmp/cvs-serv7217/httemplate/elements
Added Files:
tr-select-svc_pbx.html select-svc_pbx.html
Log Message:
linking DIDs and users to PBXes, RT#7051
--- NEW FILE: select-svc_pbx.html ---
<SELECT <% $opt{'multiple'} ? 'MULTIPLE' : 'SIZE=1' %>
NAME = "<% $opt{'element_name'} || $opt{'field'} || 'pbxsvc' %>"
<% $opt{'element_etc'} %>
>
% unless ( $opt{'multiple'} || $opt{'disable_empty'} ) {
<OPTION VALUE=""><% $opt{'empty_label'} || '' %>
% }
% foreach my $svcnum (
% sort { $svc_pbx{$a} cmp $svc_pbx{$b} }
% keys %svc_pbx
% ) {
% my $svc_pbx = $svc_pbx{$svcnum};
% my $selected = ($svcnum == $pbxsvc) ? ' SELECTED' : '';
<OPTION VALUE="<% $svcnum %>" <% $selected %>><% $svc_pbx{$svcnum} %>
% }
</SELECT>
<%init>
# false laziness w/select-svc_acct-domain.html
my %opt = @_;
my $pbxsvc = $opt{'curr_value'};
my $part_svc = $opt{'part_svc'}
|| qsearchs('part_svc', { 'svcpart' => $opt{'svcpart'} });
my $svcpart = $part_svc ? $part_svc->svcpart : '';
#optional
my $cust_pkg = $opt{'cust_pkg'};
$cust_pkg ||= qsearchs('cust_pkg', { 'pkgnum' => $opt{'pkgnum'} })
if $opt{'pkgnum'};
my $pkgnum = $cust_pkg ? $cust_pkg->pkgnum : '';
my %svc_pbx = ();
if ( $pbxsvc ) {
my $svc_pbx = qsearchs('svc_pbx', { 'svcnum' => $pbxsvc } );
if ( $svc_pbx ) {
$svc_pbx{$svc_pbx->svcnum} = $svc_pbx;
} else {
warn "unknown svc_pbx.svcnum for svc_acct.pbxsvc: $pbxsvc";
}
}
%svc_pbx = (
%svc_pbx,
FS::svc_Common->pbx_select_hash( 'svcpart' => $svcpart,
'pkgnum' => $pkgnum,
)
);
</%init>
--- NEW FILE: tr-select-svc_pbx.html ---
%if ( $columnflag eq 'F' || !keys(%svc_pbx) ) {
<INPUT TYPE="hidden" NAME="<% $opt{'element_name'} || $opt{'field'} || 'pbxsvc' %>" VALUE="<% $pbxsvc %>">
% } else {
<TR>
<TD ALIGN="right"><% $opt{'label'} || 'PBX' %></TD>
<TD>
<% include('/elements/select-svc_pbx.html',
'curr_value' => $pbxsvc,
'part_svc' => $part_svc,
'cust_pkg' => $cust_pkg,
)
%>
</TD>
</TR>
% }
<%init>
# false laziness w/tr-select-svc_acct-domain.html
my %opt = @_;
my $pbxsvc = $opt{'curr_value'};
#required
my $part_svc = $opt{'part_svc'}
|| qsearchs('part_svc', { 'svcpart' => $opt{'svcpart'} });
my $svcpart =
$part_svc ? $part_svc->svcpart : '';
my $columnflag =
$part_svc ? $part_svc->part_svc_column('pbxsvc')->columnflag : '';
#optional
my $cust_pkg = $opt{'cust_pkg'};
$cust_pkg ||= qsearchs('cust_pkg', { 'pkgnum' => $opt{'pkgnum'} })
if $opt{'pkgnum'};
# false laziness w/select-svc_pbx.html
my $pkgnum = $cust_pkg ? $cust_pkg->pkgnum : '';
my %svc_pbx = ();
if ( $pbxsvc ) {
my $svc_pbx = qsearchs('svc_pbx', { 'svcnum' => $pbxsvc } );
if ( $svc_pbx ) {
$svc_pbx{$svc_pbx->svcnum} = $svc_pbx;
} else {
warn "unknown svc_pbx.svcnum for svc_acct.pbxsvc: $pbxsvc";
}
}
%svc_pbx = (
%svc_pbx,
FS::svc_Common->pbx_select_hash( 'svcpart' => $svcpart,
'pkgnum' => $pkgnum,
)
);
</%init>
More information about the freeside-commits
mailing list