summaryrefslogtreecommitdiff
path: root/httemplate/elements
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/elements')
-rw-r--r--httemplate/elements/about_freeside.html19
-rw-r--r--httemplate/elements/about_rt.html13
-rw-r--r--httemplate/elements/checkbox.html19
-rw-r--r--httemplate/elements/checkboxes.html10
-rw-r--r--httemplate/elements/file-upload.html2
-rw-r--r--httemplate/elements/header-popup.html33
-rw-r--r--httemplate/elements/header.html175
-rw-r--r--httemplate/elements/location.html50
-rw-r--r--httemplate/elements/menu.html237
-rw-r--r--httemplate/elements/menuarrow.gifbin0 -> 68 bytes
-rw-r--r--httemplate/elements/menubar.html118
-rw-r--r--httemplate/elements/popup_link-cust_main.html2
-rw-r--r--httemplate/elements/popup_link-ping.html30
-rw-r--r--httemplate/elements/popup_link.html8
-rw-r--r--httemplate/elements/progress-popup.html2
-rw-r--r--httemplate/elements/select-county.html6
-rw-r--r--httemplate/elements/select-cust-part_pkg.html12
-rw-r--r--httemplate/elements/select-cust-pkg_class.html12
-rw-r--r--httemplate/elements/select-cust_main-status.html7
-rw-r--r--httemplate/elements/select-cust_pkg-balances.html32
-rw-r--r--httemplate/elements/select-cust_pkg-status.html7
-rw-r--r--httemplate/elements/select-did.html5
-rw-r--r--httemplate/elements/select-domain.html2
-rw-r--r--httemplate/elements/select-part_pkg.html14
-rw-r--r--httemplate/elements/select-part_svc.html18
-rw-r--r--httemplate/elements/select-svc_acct-domain.html46
-rw-r--r--httemplate/elements/select-table.html22
-rw-r--r--httemplate/elements/select-taxclass.html8
-rw-r--r--httemplate/elements/select-terms.html26
-rw-r--r--httemplate/elements/selectlayers.html42
-rw-r--r--httemplate/elements/tr-checkbox.html8
-rw-r--r--httemplate/elements/tr-input-date-field.html27
-rw-r--r--httemplate/elements/tr-justtitle.html2
-rw-r--r--httemplate/elements/tr-select-cust-part_pkg.html107
-rw-r--r--httemplate/elements/tr-select-cust_pkg-balances.html31
-rw-r--r--httemplate/elements/tr-select-did.html20
-rw-r--r--httemplate/elements/tr-select-part_svc.html7
-rw-r--r--httemplate/elements/tr-select-pkg_class.html6
-rw-r--r--httemplate/elements/tr-select-svc_acct-domain.html34
-rw-r--r--httemplate/elements/tr-select-taxclass.html10
-rw-r--r--httemplate/elements/tr-selectmultiple-part_pkg.html9
-rw-r--r--httemplate/elements/tr-textarea.html30
-rw-r--r--httemplate/elements/tr-title.html7
-rw-r--r--httemplate/elements/xmenu.css2
-rw-r--r--httemplate/elements/xmenu.top.css2
45 files changed, 1034 insertions, 245 deletions
diff --git a/httemplate/elements/about_freeside.html b/httemplate/elements/about_freeside.html
new file mode 100644
index 0000000..8084583
--- /dev/null
+++ b/httemplate/elements/about_freeside.html
@@ -0,0 +1,19 @@
+<FONT SIZE="-2" STYLE="color:#999999">
+ <% include('/elements/popup_link.html',
+ 'action' => $fsurl.'docs/about.html',
+ 'label' => 'Freeside',
+ 'style' => 'color:#999999',
+ 'actionlabel' => 'About',
+ 'width' => 300,
+ 'height' => 360,
+ 'color' => '#7e0079',
+ 'scrolling' => 'no',
+ ) |n
+ %>&nbsp;v<% $FS::VERSION %><BR>
+ <A HREF="<% $conf->config('support-key') ? "http://www.freeside.biz/mediawiki/index.php/Supported:Documentation" : "http://www.freeside.biz/mediawiki/index.php/Freeside:1.9:Documentation" %>" TARGET="_blank" STYLE="color:#999999">Documentation</A>
+</FONT>
+<%init>
+
+my $conf = new FS::Conf;
+
+</%init>
diff --git a/httemplate/elements/about_rt.html b/httemplate/elements/about_rt.html
new file mode 100644
index 0000000..e3ee140
--- /dev/null
+++ b/httemplate/elements/about_rt.html
@@ -0,0 +1,13 @@
+% if ( $conf->config('ticket_system') eq 'RT_Internal' ) {
+% eval "use RT;";
+
+<FONT SIZE="-2" STYLE="color:#999999">
+ <A HREF="http://www.bestpractical.com/rt" TARGET="_blank" STYLE="color:#999999">RT<A>&nbsp;v<% $RT::VERSION %><BR>
+ <A HREF="http://wiki.bestpractical.com/" TARGET="_blank" STYLE="color:#999999">Documentation</A>
+</FONT>
+% }
+<%init>
+
+my $conf = new FS::Conf;
+
+</%init>
diff --git a/httemplate/elements/checkbox.html b/httemplate/elements/checkbox.html
new file mode 100644
index 0000000..5176070
--- /dev/null
+++ b/httemplate/elements/checkbox.html
@@ -0,0 +1,19 @@
+<% $opt{'prefix'} %><INPUT TYPE = "checkbox"
+ NAME = "<% $opt{field} %>"
+ ID = "<% $opt{id} %>"
+ VALUE = "<% $opt{value} %>"
+ <% $opt{curr_value} eq $opt{value}
+ ? ' CHECKED'
+ : ''
+ %>
+ <% $onchange %>
+ ><% $opt{'postfix'} %>
+<%init>
+
+my %opt = @_;
+
+my $onchange = $opt{'onchange'}
+ ? 'onChange="'. $opt{'onchange'}. '(this)"'
+ : '';
+
+</%init>
diff --git a/httemplate/elements/checkboxes.html b/httemplate/elements/checkboxes.html
index 1262245..b120ada 100644
--- a/httemplate/elements/checkboxes.html
+++ b/httemplate/elements/checkboxes.html
@@ -10,8 +10,9 @@ Example:
'names_list' => [ 'value',
'other value',
- [ 'complex value' => { 'desc' => "Add'l description",
- 'note' => '&nbsp;*',
+ [ 'complex value' => { 'label' => 'Display value',
+ 'desc' => "Add'l description",
+ 'note' => '&nbsp;*',
}
],
],
@@ -40,7 +41,10 @@ Example:
% foreach my $item ( @{ $opt{'names_list'} } ) {
%
% my $name = ref($item) ? $item->[0] : $item;
-% ( my $display = $name ) =~ s/ /&nbsp;/g;
+% my $display = ( ref($item) && $item->[1]{label} )
+% ? $item->[1]{label}
+% : $name;
+% $display =~ s/ /&nbsp;/g;
% $display .= $item->[1]{note} if ref($item) && $item->[1]{note};
% my $desc = ref($item) && $item->[1]{desc} ? $item->[1]{desc} : '';
%
diff --git a/httemplate/elements/file-upload.html b/httemplate/elements/file-upload.html
index c8b026d..7e2eeef 100644
--- a/httemplate/elements/file-upload.html
+++ b/httemplate/elements/file-upload.html
@@ -55,7 +55,7 @@
% foreach (@field) {
<TR>
- <TH ALIGN="right"><% shift @label %></TH>
+ <TH ALIGN="<% $param{'label_align'} || 'right' %>"><% shift @label %></TH>
<TD><INPUT TYPE="file" NAME="<% $_ %>" /></TD>
</TR>
% }
diff --git a/httemplate/elements/header-popup.html b/httemplate/elements/header-popup.html
index 68be108..d74581b 100644
--- a/httemplate/elements/header-popup.html
+++ b/httemplate/elements/header-popup.html
@@ -1,10 +1,3 @@
-%
-% my($title, $menubar) = ( shift, shift ); #$menubar is unused here though
-% my $etc = @_ ? shift : ''; #$etc is for things like onLoad= etc.
-% my $head = @_ ? shift : ''; #$head is for things that go in the <HEAD> section
-% my $conf = new FS::Conf;
-%
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
@@ -21,4 +14,30 @@
<FONT SIZE=6>
<CENTER><% $title %></CENTER>
</FONT>
+
+% unless ( $nobr ) {
<BR><!--<BR>-->
+% }
+
+<%init>
+
+my( $title, $menubar, $etc, $head ) = ( '', '', '', '' );
+#my( $nobr, $nocss ) = ( 0, 0 );
+my $nobr = 0;
+if ( ref($_[0]) ) {
+ my $opt = shift;
+ $title = $opt->{title};
+ $menubar = $opt->{menubar};
+ $etc = $opt->{etc};
+ $head = $opt->{head};
+ $nobr = $opt->{nobr};
+# $nocss = $opt->{nocss};
+} else {
+ ($title, $menubar) = ( shift, shift );
+ $etc = @_ ? shift : ''; #$etc is for things like onLoad= etc.
+ $head = @_ ? shift : ''; #$head is for things that go in the <HEAD> section
+}
+
+my $conf = new FS::Conf;
+
+</%init>
diff --git a/httemplate/elements/header.html b/httemplate/elements/header.html
index 8e902f0..b9ddc73 100644
--- a/httemplate/elements/header.html
+++ b/httemplate/elements/header.html
@@ -1,4 +1,26 @@
+<%doc>
+
+Example:
+
+ include( '/elements/header.html',
+ {
+ 'title' => 'Title',
+ 'menubar' => \@menubar,
+ 'etc' => '', #included in <BODY> tag, for things like onLoad=
+ 'head' => '', #included before closing </HEAD> tag
+ 'nobr' => 0, #1 for no <BR><BR> after the title
+ }
+ );
+
+ #old-style
+ include( '/elements/header.html', 'Title', $menubar, $etc, $head);
+
+
+</%doc>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+%#<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+%# above is what RT declares, should we switch now? hopefully no glitches result
+%# or just fuck it, XHTML died anyway, HTML 5 or bust?
<HTML>
<HEAD>
<TITLE>
@@ -10,6 +32,7 @@
<% include('menu.html', 'freeside_baseurl' => $fsurl,
'position' => $menu_position,
+ 'nocss' => $nocss,
) |n
%>
@@ -17,7 +40,7 @@
<SCRIPT TYPE="text/javascript">
function clearhint_search_cust (what) {
- if ( what.value == '(cust #, name, company or phone)' )
+ if ( what.value == '(cust #, name, company or contact phone)' )
what.value = '';
}
@@ -32,7 +55,7 @@
}
function clearhint_search_svc (what) {
- if ( what.value == '(user, email, ip, mac, or domain)' )
+ if ( what.value == '(user, email, ip, mac, domain or service phone)' )
what.value = '';
}
@@ -48,49 +71,16 @@
<BODY <% $menu_position eq 'left' ? qq( BACKGROUND="${fsurl}images/background-cheat.png" ) : ' BGCOLOR="#e8e8e8" ' %> <% $etc |n %> STYLE="margin-top:0; margin-bottom:0; margin-left:0; margin-right:0">
<table width="100%" CELLPADDING=0 CELLSPACING=0 STYLE="padding-left:0; padding-right:4">
<tr>
- <td rowspan=2 BGCOLOR="#ffffff"><IMG BORDER=0 ALT="freeside" SRC="<%$fsurl%>view/REAL_logo.cgi"></td>
- <td align=left rowspan=2 BGCOLOR="#ffffff"> <!-- valign="top" -->
+ <td BGCOLOR="#ffffff"><IMG BORDER=0 ALT="freeside" HEIGHT="36" SRC="<%$fsurl%>view/REAL_logo.cgi"></td>
+ <td align=left BGCOLOR="#ffffff"> <!-- valign="top" -->
<font size=6><% $company_name || 'ExampleCo' %></font>
</td>
- <td align=right valign=top BGCOLOR="#ffffff"><FONT SIZE="-1">Logged in as <b><% getotaker %>&nbsp;</b><br></FONT><FONT SIZE="-2"><a href="<%$fsurl%>pref/pref.html">Preferences</a>&nbsp;<BR></FONT>
- </td>
- </tr>
- <tr>
- <td align=right valign=bottom BGCOLOR="#ffffff">
-
- <table>
- <tr>
- <td align=right BGCOLOR="#ffffff">
- <FONT SIZE="-2">
- <% include('/elements/popup_link.html',
- 'action' => $fsurl.'docs/about.html',
- 'label' => 'Freeside',
- 'actionlabel' => 'About',
- 'width' => 300,
- 'height' => 360,
- 'color' => '#7e0079',
- 'scrolling' => 'no',
- ) |n
- %>&nbsp;v<% $FS::VERSION %><BR>
- <A HREF="<% $conf->config('support-key') ? "http://www.freeside.biz/mediawiki/index.php/Supported:Documentation" : "http://www.freeside.biz/mediawiki/index.php/Freeside:1.9:Documentation" %>" TARGET="_blank">Documentation</A><BR>
- </FONT>
- </td>
-% if ( $conf->config('ticket_system') eq 'RT_Internal' ) {
-% eval "use RT;";
-
- <td bgcolor=#000000></td>
- <td align=left>
- <FONT SIZE="-2">
- <A HREF="http://www.bestpractical.com/rt" TARGET="_blank">RT<A>&nbsp;v<% $RT::VERSION %><BR>
- <A HREF="http://wiki.bestpractical.com/" TARGET="_blank">Documentation</A><BR>
- </FONT>
- </td>
-% }
-
-
- </tr>
- </table>
-
+ <td align=right valign=top BGCOLOR="#ffffff"><FONT SIZE="-1">Logged in as <b><% getotaker %>&nbsp;</b><br></FONT><FONT SIZE="-2"><a href="<%$fsurl%>pref/pref.html" STYLE="color: #000000">Preferences</a>
+% if ( $conf->config("ticket_system")
+% && FS::TicketSystem->access_right(\%session, 'ModifySelf') ) {
+ | <a href="<%$fsurl%>rt/User/Prefs.html" STYLE="color: #000000">Ticketing preferences</a>
+% }
+ <BR></FONT>
</td>
</tr>
</table>
@@ -104,9 +94,16 @@ input.fsblackbutton {
border-left-color:#cccccc;
border-right-color:#aaaaaa;
border-bottom-color:#aaaaaa;
+ font-family: Arial, Verdana, Helvetica, sans-serif;
font-weight:bold;
padding-left:12px;
padding-right:12px;
+ padding-top:0px;
+ padding-bottom:0px;
+ margin-left:0px;
+ margin-right:0px;
+ margin-top:2px;
+ margin-bottom:0px;
overflow:visible;
filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#ff333333',EndColorStr='#ff666666')
}
@@ -119,12 +116,40 @@ input.fsblackbuttonselected {
border-left-color:#cccccc;
border-right-color:#aaaaaa;
border-bottom-color:#aaaaaa;
+ font-family: Arial, Verdana, Helvetica, sans-serif;
font-weight:bold;
padding-left:12px;
padding-right:12px;
+ padding-top:0px;
+ padding-bottom:0px;
+ margin-left:0px;
+ margin-right:0px;
+ margin-top:2px;
+ margin-bottom:0px;
overflow:visible;
filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#ff330033',EndColorStr='#ff7e0079')
}
+
+input.fstext {
+ border: 2px inset #eee;
+ /*border-top-color:#aaaaaa;
+ border-left-color:#aaaaaa;
+ border-right-color:#cccccc;
+ border-bottom-color:#cccccc;
+ */
+ vertical-align:bottom;
+ text-align:right;
+ font-family: Arial,Verdana,Helvetica,sans-serif;
+ padding-left: 0px;
+ padding-right: 0px;
+ padding-top: 0px;
+ padding-bottom: 0px;
+ margin-left:0px;
+ margin-right:0px;
+ margin-top:0px;
+ margin-bottom:1px;
+}
+
</style>
<TABLE WIDTH="100%" CELLSPACING=0 CELLPADDING=0>
@@ -136,12 +161,22 @@ input.fsblackbuttonselected {
<TR>
- <TD COLSPAN="6" WIDTH="100%" STYLE="padding:0">
+ <TD COLSPAN="4" WIDTH="100%" STYLE="padding:0" BGCOLOR="#000000">
<SCRIPT TYPE="text/javascript">
document.write(myBar);
</SCRIPT>
</TD>
+
+ <TD COLSPAN="2" ALIGN="right" STYLE="padding:0px 8px 0px 0px" BGCOLOR="#000000">
+ <TABLE CELLSPACING=0 CELLPADDING=0 BGCOLOR="#000000" BORDER=0>
+ <TR>
+ <TD ALIGN="right" STYLE="padding-right:3px;padding-bottom:1px;border-right:1px solid #999999"><% include('/elements/about_freeside.html') |n %></TD>
+ <TD ALIGN="left" STYLE="padding-left:3px;padding-bottom:1px"><% include('/elements/about_rt.html') |n %></TD>
+ </TR>
+ </TABLE>
+ </TD>
+
</TR>
<TR>
@@ -159,17 +194,11 @@ input.fsblackbuttonselected {
<TR>
<TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right">
- <FORM ACTION="<%$fsurl%>edit/cust_main.cgi" METHOD="GET" STYLE="margin:0">
- <INPUT TYPE="submit" VALUE="New customer" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="vertical-align:bottom; font-size:100%">
- </FORM>
- </TD>
-
- <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right">
% if ( $curuser->access_right('List customers') ) {
<FORM ACTION="<%$fsurl%>search/cust_main.cgi" METHOD="GET" STYLE="margin:0">
- <INPUT NAME="search_cust" TYPE="text" VALUE="(cust #, name, company or phone)" SIZE="28" onFocus="clearhint_search_cust(this);" onClick="clearhint_search_cust(this);" STYLE="vertical-align:bottom;text-align:right"><BR>
- <A HREF="<%$fsurl%>search/report_cust_main.html" STYLE="color: #ffffff; font-size: 70%">Advanced</A>
- <INPUT TYPE="submit" VALUE="Search customers" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:70%">
+ <INPUT NAME="search_cust" TYPE="text" VALUE="(cust #, name, company or contact phone)" SIZE="37" onFocus="clearhint_search_cust(this);" onClick="clearhint_search_cust(this);" CLASS="fstext"><BR>
+ <A HREF="<%$fsurl%>search/report_cust_main.html" STYLE="color: #ffffff; font-size: 11px">Advanced</A>
+ <INPUT TYPE="submit" VALUE="Search customers" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:11px">
</FORM>
% }
</TD>
@@ -178,9 +207,9 @@ input.fsblackbuttonselected {
% if ( $conf->exists('address2-search') ) {
<FORM ACTION="<%$fsurl%>search/cust_main.cgi" METHOD="GET" STYLE="margin:0;display:inline">
<INPUT TYPE="hidden" NAME="address2_on" VALUE="1">
- <INPUT NAME="address2_text" TYPE="text" VALUE="(Unit #)" SIZE="4" onFocus="clearhint_search_address2(this);" onClick="clearhint_search_address2(this);" STYLE="vertical-align:bottom;text-align:right;margin-bottom:1px">
+ <INPUT NAME="address2_text" TYPE="text" VALUE="(Unit #)" SIZE="4" onFocus="clearhint_search_address2(this);" onClick="clearhint_search_address2(this);" CLASS="fstext">
<BR>
- <INPUT TYPE="submit" VALUE="Search units" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:70%;padding-left:2px;padding-right:2px">
+ <INPUT TYPE="submit" VALUE="Search units" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:11px;padding-left:2px;padding-right:2px">
</FORM>
% }
</TD>
@@ -189,32 +218,32 @@ input.fsblackbuttonselected {
% if ( $curuser->access_right('View invoices') ) {
<FORM ACTION="<%$fsurl%>search/cust_bill.html" METHOD="GET" STYLE="margin:0;display:inline">
- <INPUT NAME="invnum" TYPE="text" VALUE="(inv #)" SIZE="4" onFocus="clearhint_search_invoice(this);" onClick="clearhint_search_invoice(this);" STYLE="vertical-align:bottom;text-align:right;margin-bottom:1px">
+ <INPUT NAME="invnum" TYPE="text" VALUE="(inv #)" SIZE="5" onFocus="clearhint_search_invoice(this);" onClick="clearhint_search_invoice(this);" CLASS="fstext">
% if ( $curuser->access_right('List invoices') ) {
-
- <A HREF="<%$fsurl%>search/report_cust_bill.html" STYLE="color: #ffffff; font-size: 70%">Advanced</A>
+ <A HREF="<%$fsurl%>search/report_cust_bill.html" STYLE="color: #ffffff; font-size: 11px">Adv</A>
% }
-
<BR>
- <INPUT TYPE="submit" VALUE="Search invoices" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:70%">
+ <INPUT TYPE="submit" VALUE="Search invoices" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:11px;padding-left:1px;padding-right:1px">
</FORM>
% }
</TD>
<TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right">
+% if ( $curuser->access_right('View customer services') ) {
<FORM ACTION="<%$fsurl%>search/cust_svc.html" METHOD="GET" STYLE="margin:0">
- <INPUT NAME="search_svc" TYPE="text" VALUE="(user, email, ip, mac, or domain)" SIZE="26" onFocus="clearhint_search_svc(this);" onClick="clearhint_search_svc(this);" STYLE="vertical-align:bottom;text-align:right"><BR>
- <A NOTYET="<%$fsurl%>search/svc_Smarter.html" STYLE="color: #000000; font-size: 70%">Advanced</A>
- <INPUT TYPE="submit" VALUE="Search services" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:70%">
+ <INPUT NAME="search_svc" TYPE="text" VALUE="(user, email, ip, mac, domain or service phone)" SIZE="41" onFocus="clearhint_search_svc(this);" onClick="clearhint_search_svc(this);" CLASS="fstext"><BR>
+ <A NOTYET="<%$fsurl%>search/svc_Smarter.html" STYLE="color: #000000; font-size:11px">Advanced</A>
+ <INPUT TYPE="submit" VALUE="Search services" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:11px">
</FORM>
+% }
</TD>
- <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right" STYLE="padding-right:4px">
+ <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right" STYLE="padding-left:4px;padding-right:4px">
% if ( $conf->config("ticket_system") ) {
<FORM ACTION="<% FS::TicketSystem->baseurl %>index.html" METHOD="GET" STYLE="margin:0">
- <INPUT NAME="q" TYPE="text" VALUE="(ticket #, subject, email or fulltext:text)" onFocus="clearhint_search_ticket(this);" onClick="clearhint_search_ticket(this);" STYLE="vertical-align:bottom;text-align:right"><BR>
- <A HREF="<% FS::TicketSystem->baseurl %>Search/Build.html" STYLE="color: #ffffff; font-size: 70%">Advanced</A>
- <INPUT TYPE="submit" VALUE="Search tickets" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:70%;padding-left:2px;padding-right:2px">
+ <INPUT NAME="q" TYPE="text" VALUE="(ticket #, subject, email or fulltext:text)" SIZE=33 onFocus="clearhint_search_ticket(this);" onClick="clearhint_search_ticket(this);" CLASS="fstext"><BR>
+ <A HREF="<% FS::TicketSystem->baseurl %>Search/Build.html" STYLE="color: #ffffff; font-size:11px">Advanced</A>
+ <INPUT TYPE="submit" VALUE="Search tickets" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:11px">
</FORM>
% }
</TD>
@@ -248,6 +277,15 @@ input.fsblackbuttonselected {
<BR>
<IMG SRC="<%$fsurl%>images/32clear.gif" HEIGHT="1" WIDTH="154">
+ <TABLE CELLSPACING=0 CELLPADDING=0 BGCOLOR="#000000" WIDTH="100%">
+ <TR>
+ <TD ALIGN="left" STYLE="padding-bottom:1px;border-bottom:1px solid #999999"><% include('/elements/about_freeside.html') |n %></TD>
+ </TR>
+ <TR>
+ <TD ALIGN="right" STYLE="padding-bottom:1px"><% include('/elements/about_rt.html') |n %></TD>
+ </TR>
+ </TABLE>
+
</TD>
<TD STYLE="padding:0" HEIGHT="100%" WIDTH=13 VALIGN="top"><IMG WIDTH="13" HEIGHT="100%" BORDER=0 ALT="" SRC="<%$fsurl%>images/black-gray-side.png"></TD>
@@ -267,7 +305,7 @@ input.fsblackbuttonselected {
<%init>
my( $title, $menubar, $etc, $head ) = ( '', '', '', '' );
-my( $nobr ) = ( 0 );
+my( $nobr, $nocss ) = ( 0, 0 );
if ( ref($_[0]) ) {
my $opt = shift;
$title = $opt->{title};
@@ -275,6 +313,7 @@ if ( ref($_[0]) ) {
$etc = $opt->{etc};
$head = $opt->{head};
$nobr = $opt->{nobr};
+ $nocss = $opt->{nocss};
} else {
($title, $menubar) = ( shift, shift );
$etc = @_ ? shift : ''; #$etc is for things like onLoad= etc.
diff --git a/httemplate/elements/location.html b/httemplate/elements/location.html
index d7b73a2..07aaa69 100644
--- a/httemplate/elements/location.html
+++ b/httemplate/elements/location.html
@@ -3,26 +3,28 @@
Example:
include( '/elements/location.html',
- 'object' => $cust_main, # or $cust_location
- 'prefix' => $pre, #only for cust_main objects
- 'onchange' => $javascript,
- 'disabled' => $disabled,
- 'same_checked' => $same_checked,
- 'geocode' => $geocode, #passed through
- 'no_asterisks' => 0, #set true to disable the red asterisks next
- #to required fields
+ 'object' => $cust_main, # or $cust_location
+ 'prefix' => $pre, #only for cust_main objects
+ 'onchange' => $javascript,
+ 'disabled' => $disabled,
+ 'same_checked' => $same_checked,
+ 'geocode' => $geocode, #passed through
+ 'censustract' => $censustract, #passed through
+ 'no_asterisks' => 0, #set true to disable the red asterisks next
+ #to required fields
+ 'address1_label' => 'Address', #label for address
)
</%doc>
<TR>
- <TH ALIGN="right"><%$r%>Address</TH>
+ <TH ALIGN="right"><%$r%><% $opt{'address1_label'} || 'Address' %></TH>
<TD COLSPAN=7>
<INPUT TYPE = "text"
NAME = "<%$pre%>address1"
ID = "<%$pre%>address1"
VALUE = "<% $object->get($pre.'address1') |h %>"
- SIZE = 58
+ SIZE = 54
onChange = "<% $onchange %>"
<% $disabled %>
<% $style %>
@@ -37,7 +39,7 @@ Example:
NAME = "<%$pre%>address2"
ID = "<%$pre%>address2"
VALUE = "<% $object->get($pre.'address2') |h %>"
- SIZE = 58
+ SIZE = 54
onChange = "<% $onchange %>"
<% $disabled %>
<% $style %>
@@ -47,7 +49,7 @@ Example:
<TR>
<TH ALIGN="right"><%$r%>City</TH>
- <TD>
+ <TD WIDTH="1">
<INPUT TYPE = "text"
NAME = "<%$pre%>city"
ID = "<%$pre%>city"
@@ -56,13 +58,11 @@ Example:
<% $disabled %>
<% $style %>
>
- </TD>
- <TH ALIGN="right" ID="<%$pre%>countylabel" <%$county_style%>><%$r%>County</TH>
- <TD>
- <% include('/elements/select-county.html', %select_hash ) %>
</TD>
- <TH ALIGN="right"><%$r%>State</TH>
- <TD>
+ <TH ALIGN="right" ID="<%$pre%>countylabel" <%$county_style%>><%$r%>County</TH>
+ <TD><% include('/elements/select-county.html', %select_hash ) %></TD>
+ <TH ALIGN="right" WIDTH="1"><%$r%>State</TH>
+ <TD WIDTH="1">
<% include('/elements/select-state.html', %select_hash ) %>
</TD>
<TH><%$r%>Zip</TH>
@@ -81,11 +81,21 @@ Example:
<TR>
<TH ALIGN="right"><%$r%>Country</TH>
- <TD COLSPAN=5><% include('/elements/select-country.html', %select_hash ) %></TD>
+ <TD COLSPAN=6><% include('/elements/select-country.html', %select_hash ) %></TD>
</TR>
% if ( !$pre ) {
<INPUT TYPE="hidden" NAME="geocode" VALUE="<% $opt{geocode} %>">
+% } else {
+% if ( $pre eq 'ship_' && $conf->exists('cust_main-require_censustract') ) {
+ <TR><TH ALIGN="right">Census tract<BR>(automatic)</TH>
+ <TD>
+ <INPUT TYPE="text" NAME="censustract" VALUE="<% $opt{censustract} %>">
+ </TD>
+ </TR>
+% } else {
+ <INPUT TYPE="hidden" NAME="censustract" VALUE="<% $opt{censustract} %>">
+% }
% }
<%init>
@@ -125,7 +135,7 @@ my @counties = counties( $object->get($pre.'state'),
$object->get($pre.'country'),
);
my @county_style = ();
-push @county_style, 'visibility:hidden'
+push @county_style, 'display:none' # 'visibility:hidden'
unless scalar(@counties) > 1;
my $style =
diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html
index 627f9c8..c54ed07 100644
--- a/httemplate/elements/menu.html
+++ b/httemplate/elements/menu.html
@@ -12,7 +12,9 @@
% }
-<link href="<%$fsurl%>elements/freeside.css" type="text/css" rel="stylesheet">
+% unless ( $opt{'nocss'} ) {
+ <link href="<%$fsurl%>elements/freeside.css" type="text/css" rel="stylesheet">
+% }
<SCRIPT TYPE="text/javascript">
@@ -33,8 +35,8 @@
%
% my( $subhtml, $submenuname ) = submenu($url_or_submenu, $item);
- <% $subhtml %>
- myBar.add(new WebFXMenuButton("<% $item %>", null, "<% $tooltip %>", <% $submenuname %> ));
+ <% $subhtml |n %>
+ myBar.add(new WebFXMenuButton("<% $item %>", null, "<% $tooltip %>", <% $submenuname |n %> ));
% } else {
@@ -56,7 +58,7 @@ my $fsurl = $opt{'freeside_baseurl'};
my $curuser = $FS::CurrentUser::CurrentUser;
-#Active tickets not assigned to a customer
+#XXX Active tickets not assigned to a customer
tie my %report_customers_lists, 'Tie::IxHash',
'by customer number' => [ $fsurl. 'search/cust_main.cgi?browse=custnum', '' ],
@@ -133,10 +135,19 @@ foreach my $svcdb ( FS::part_svc->svc_tables() ) {
}
if ( $svcdb eq 'svc_acct' ) {
+
$report_svc{"All $lcname never logged in"} =
[ svc_url( %svc_url, 'query' => "magic=nologin;sortby=svcnum" ),
'',
];
+
+ } elsif ( $svcdb eq 'svc_phone' ) {
+
+ $report_svc{"${name}' total usage by time period"} =
+ [ $fsurl. 'search/report_svc_phone.html',
+ 'Total usage (minutes, and amount billed) for the specified time period, per phone number.',
+ ];
+
}
if ( $curuser->access_right('View/link unlinked services') ) {
@@ -170,6 +181,8 @@ if ( $curuser->access_right('Financial reports') ) {
$report_packages{'All customer packages'} = [ $fsurl.'search/cust_pkg.cgi?pkgnum', 'List all customer packages', ];
$report_packages{'Suspended customer packages'} = [ $fsurl.'search/cust_pkg.cgi?magic=suspended', 'List suspended packages' ];
$report_packages{'Customer packages with unconfigured services'} = [ $fsurl.'search/cust_pkg.cgi?APKG_pkgnum', 'List packages which have provisionable services' ];
+$report_packages{'FCC Form 477 packages'} = [ $fsurl.'search/report_477.html', 'Summarize packages by census tract for particular types' ]
+ if $conf->exists('cust_main-require_censustract');
$report_packages{'Advanced package reports'} = [ $fsurl.'search/report_cust_pkg.html', 'by agent, date range, status, package definition' ];
tie my %report_rating, 'Tie::IxHash',
@@ -178,57 +191,106 @@ tie my %report_rating, 'Tie::IxHash',
'Time worked' => [ $fsurl.'search/report_rt_transaction.html', '' ],
;
+tie my %report_ticketing_statistics, 'Tie::IxHash',
+ 'Tickets per day per Queue' => [ $fsurl.'rt/RTx/Statistics/CallsQueueDay', 'View the number of tickets created, resolved or deleted in a specific Queue, over the requested period of days' ],
+ 'Ticket status by Queue' => [ $fsurl.'rt/RTx/Statistics/OpenStalled', 'View numbers of new, open and stalled tickets in a selected Queue' ],
+ 'Tickets per day (multiple Queues)' => [ $fsurl.'rt/RTx/Statistics/CallsMultiQueue', 'View tickets created, resolved or deleted on in one or more Queues over a specified time period' ],
+ 'Tickets per Day of Week' => [ $fsurl.'rt/RTx/Statistics/DayOfWeek', 'View trends showing when tickets are created, resolved or deleted' ],
+ 'Time to resolve' => [ $fsurl.'rt/RTx/Statistics/Resolution', 'View how long tickets take to be resolved by Queue' ],
+ 'Time to resolve (scatter graph)' => [ $fsurl.'rt/RTx/Statistics/TimeToResolve', 'View a detailed scatter graph of time to resolve tickets by Queue' ],
+;
+
+tie my %report_ticketing, 'Tie::IxHash',
+ 'Resolved by owner' => [ $fsurl.'rt/Tools/Reports/ResolvedByOwner.html', '' ],
+ 'Resolved in date range' => [ $fsurl.'rt/Tools/Reports/ResolvedByDates.html', '' ],
+ 'Created in date range' => [ $fsurl.'rt/Tools/Reports/CreatedByDates.html', '' ],
+ 'separator' => '',
+ 'Statistics' => [ \%report_ticketing_statistics, '' ],
+ 'separator2' => '',
+ 'Advanced ticket reports' => [ $fsurl.'rt/Search/Build.html', 'List tickets by any criteria' ],
+;
+
tie my %report_bill_event, 'Tie::IxHash',
'All billing events' => [ $fsurl.'search/report_cust_event.html', 'All billing events for a date range' ],
'Billing event errors' => [ $fsurl.'search/report_cust_event.html?failed=1', 'Failed credit cards, processor or printer problems, etc.' ],
- 'All invoice events' => [ $fsurl.'search/cust_bill_event.html', 'Reports on deprecated, old-style invoice events for a date range' ],
- 'Invoice event errors' => [ $fsurl.'search/cust_bill_event.html?failed=1', 'Reports on deprecated, old-style events for failed credit cards, processor or printer problems, etc.' ],
+# 'All invoice events' => [ $fsurl.'search/cust_bill_event.html', 'Reports on deprecated, old-style invoice events for a date range' ],
+# 'Invoice event errors' => [ $fsurl.'search/cust_bill_event.html?failed=1', 'Reports on deprecated, old-style events for failed credit cards, processor or printer problems, etc.' ],
;
-tie my %report_financial, 'Tie::IxHash',
- 'Sales, Credits and Receipts' => [ $fsurl.'graph/report_money_time.html', 'Sales, credits and receipts summary graph' ],
- 'Sales Report' => [ $fsurl.'graph/report_cust_bill_pkg.html', 'Sales report and graph (by agent, package class and/or date range)' ],
- 'Credit Report' => [ $fsurl.'search/report_cust_credit.html', 'Credit report (by employee and/or date range)' ],
- 'Payment Report' => [ $fsurl.'search/report_cust_pay.html', 'Payment report (by type and/or date range)' ],
+tie my %report_payments, 'Tie::IxHash',
+ 'Payments' => [ $fsurl.'search/report_cust_pay.html', 'Payment report (by type and/or date range)' ],
;
-$report_financial{'Pending Payment Report'} = [ $fsurl.'search/cust_pay_pending.html?magic=_date;statusNOT=done', 'Pending real-time payments' ]
+$report_payments{'Pending Payments'} = [ $fsurl.'search/cust_pay_pending.html?magic=_date;statusNOT=done', 'Pending real-time payments' ]
if $curuser->access_right('View customer pending payments');
-$report_financial{'Payment Batch Report'} = [ $fsurl.'search/pay_batch.html', 'Payment batches (by status and/or date range)' ]
+$report_payments{'Voided Payments'} = [ $fsurl.'search/report_cust_pay.html?void=1', 'Voided payment report (by type and/or date range)' ]
+ if $curuser->access_right('View customer pending payments');
+$report_payments{'Payment Batches'} = [ $fsurl.'search/pay_batch.html', 'Payment batches (by status and/or date range)' ]
if $conf->exists('batch-enable') || $conf->config('batch-enable_payby');
-$report_financial{'A/R Aging'} = [ $fsurl.'search/report_receivables.html', 'Accounts Receivable Aging report' ];
-$report_financial{'Prepaid Income'} = [ $fsurl.'search/report_prepaid_income.html', 'Prepaid income (unearned revenue) report' ];
-$report_financial{'Sales Tax Liability'} = [ $fsurl.'search/report_tax.html', 'Sales tax liability report (old taxclass system)' ];
-$report_financial{'Tax Liability'} = [ $fsurl.'search/report_newtax.html', 'Tax liability report (new tax products system)' ]
- if $conf->exists('enable_taxproducts');
-;
+$report_payments{'Unapplied Payment Aging'} = [ $fsurl.'search/report_unapplied_cust_pay.html', 'Unapplied payment aging report' ];
+
+tie my %report_financial, 'Tie::IxHash';
+if($curuser->access_right('Financial reports')) {
+
+ %report_financial = (
+ 'Sales, Credits and Receipts' => [ $fsurl.'graph/report_money_time.html', 'Sales, credits and receipts summary graph' ],
+ 'Sales Report' => [ $fsurl.'graph/report_cust_bill_pkg.html', 'Sales report and graph (by agent, package class and/or date range)' ],
+ 'Rated Call Sales Report' => [ $fsurl.'graph/report_cust_bill_pkg_detail.html', 'Sales report and graph (by agent, package class, usage class and/or date range)' ],
+ 'Credit Report' => [ $fsurl.'search/report_cust_credit.html', 'Credit report (by employee and/or date range)' ],
+ );
+ $report_financial{'A/R Aging'} = [ $fsurl.'search/report_receivables.html', 'Accounts Receivable Aging report' ];
+ $report_financial{'Prepaid Income'} = [ $fsurl.'search/report_prepaid_income.html', 'Prepaid income (unearned revenue) report' ];
+ $report_financial{'Sales Tax Liability'} = [ $fsurl.'search/report_tax.html', 'Sales tax liability report (internal taxclass system)' ];
+ $report_financial{'Tax Liability'} = [ $fsurl.'search/report_newtax.html', 'Tax liability report (vendor data tax products system)' ]
+ if $conf->exists('enable_taxproducts');
+
+} elsif($curuser->access_right('Receivables report')) {
+
+ $report_financial{'A/R Aging'} = [ $fsurl.'search/report_receivables.html', 'Accounts Receivable Aging report' ];
+
+} # else $report_financial contains nothing.
tie my %report_menu, 'Tie::IxHash';
$report_menu{'Customers'} = [ \%report_customers, 'Customer reports' ]
if $curuser->access_right('List customers');
$report_menu{'Invoices'} = [ \%report_invoices, 'Invoice reports' ]
if $curuser->access_right('List invoices');
+$report_menu{'Payments'} = [ \%report_payments, 'Payment reports' ]
+ if $curuser->access_right('Financial reports');
$report_menu{'Packages'} = [ \%report_packages, 'Package reports' ]
if $curuser->access_right('List packages');
$report_menu{'Services'} = [ \%report_services, 'Services reports' ]
if $curuser->access_right('List services');
$report_menu{'Usage'} = [ \%report_rating, 'Usage reports' ]
if $curuser->access_right('List rating data');
+$report_menu{'Tickets'} = [ \%report_ticketing, 'Ticket reports' ]
+ if $conf->config('ticket_system')
+ ;#&& FS::TicketSystem->access_right(\%session, 'Something');
$report_menu{'Billing events'} = [ \%report_bill_event, 'Billing events' ]
if $curuser->access_right('Billing event reports');
$report_menu{'Financial'} = [ \%report_financial, 'Financial reports' ]
- if $curuser->access_right('Financial reports');
+ if $curuser->access_right('Financial reports')
+ or $curuser->access_right('Receivables report');
$report_menu{'SQL Query'} = [ $fsurl.'search/report_sql.html', 'SQL Query' ]
if $curuser->access_right('Raw SQL');
tie my %tools_importing, 'Tie::IxHash',
- 'Import customers' => [ $fsurl.'misc/cust_main-import.cgi', '' ],
- 'Import customer comments from CSV file' => [ $fsurl.'misc/cust_main_note-import.html', '' ],
- 'Import one-time charges from CSV file' => [ $fsurl.'misc/cust_main-import_charges.cgi', '' ],
- 'Import payments from CSV file' => [ $fsurl.'misc/cust_pay-import.cgi', '' ],
- 'Import phone numbers (DIDs)' => [ $fsurl.'misc/phone_avail-import.html', '' ],
- 'Import Call Detail Records (CDRs) from CSV file' => [ $fsurl.'misc/cdr-import.html', '' ],
- 'Import tax rates from CSV files' => [ $fsurl.'misc/tax-import.cgi', '' ],
+ 'Customers' => [ $fsurl.'misc/cust_main-import.cgi', '' ],
+ 'Customer comments from CSV file' => [ $fsurl.'misc/cust_main_note-import.html', '' ],
+ 'One-time charges from CSV file' => [ $fsurl.'misc/cust_main-import_charges.cgi', '' ],
+ 'Payments from CSV file' => [ $fsurl.'misc/cust_pay-import.cgi', '' ],
+ 'Phone numbers (DIDs)' => [ $fsurl.'misc/phone_avail-import.html', '' ],
+ 'Call Detail Records (CDRs)' => [ $fsurl.'misc/cdr-import.html', '' ],
+# 'Import call rates and regions' => [ $fsurl.'misc/rate-import.html', '' ],
;
+if ( $conf->exists('enable_taxproducts') ) {
+ if ( $conf->exists('taxdatadirectdownload') ) {
+ $tools_importing{'Tax rates from vendor site'} =
+ [ $fsurl.'misc/tax-fetch_and_import.cgi', '' ];
+ } else {
+ $tools_importing{'Tax rates from CSV files'} =
+ [ $fsurl.'misc/tax-import.cgi', '' ];
+ }
+}
tie my %tools_exporting, 'Tie::IxHash',
'Download database dump' => [ $fsurl. 'misc/dump.cgi', '' ],
@@ -239,6 +301,14 @@ tie my %tools_exporting, 'Tie::IxHash',
# <!-- or <A HREF="browse/nas-sqlradius.cgi">RADIUS</A>
# <BR> -->
+tie my %tools_ticketing, 'Tie::IxHash',
+ 'Offline' => [ $fsurl.'rt/Tools/Offline.html', '' ],
+ 'My Day' => [ $fsurl.'rt/Tools/MyDay.html', '' ],
+ 'My Approvals' => [ $fsurl.'rt/Approvals/', '' ],
+;
+$tools_ticketing{'Cron Tool'} = [ $fsurl.'rt/Developer/CronTool/', '' ]
+ if $conf->exists('rt-crontool');
+
tie my %tools_menu, 'Tie::IxHash', ();
$tools_menu{'Quick payment entry'} = [ $fsurl.'misc/batch-cust_pay.html', 'Enter multiple payments in a batch' ]
if $curuser->access_right('Post payment batch');
@@ -247,6 +317,8 @@ $tools_menu{'Process payment batches'} = [ $fsurl.'search/pay_batch.cgi?magic=_d
&& $curuser->access_right('Process batches');
$tools_menu{'Job Queue'} = [ $fsurl.'search/queue.html', 'View pending job queue' ]
if $curuser->access_right('Job queue');
+$tools_menu{'Ticketing'} = [ \%tools_ticketing, 'Ticketing tools' ]
+ if $conf->config('ticket_system');
$tools_menu{'Time Queue'} = [ $fsurl.'search/timeworked.html', 'View pending support time' ]
if $curuser->access_right('Time queue');
$tools_menu{'Importing'} = [ \%tools_importing, 'Import tools' ]
@@ -255,72 +327,98 @@ $tools_menu{'Exporting'} = [ \%tools_exporting, 'Export tools' ]
if $curuser->access_right('Export');
tie my %config_employees, 'Tie::IxHash',
- 'View/Edit employees' => [ $fsurl.'browse/access_user.html', 'Setup internal users' ],
- 'View/Edit employee groups' => [ $fsurl.'browse/access_group.html', 'Employee groups allow you to control access to the backend' ],
+ 'Employees' => [ $fsurl.'browse/access_user.html', 'Setup internal users' ],
+ 'Employee groups' => [ $fsurl.'browse/access_group.html', 'Employee groups allow you to control access to the backend' ],
;
-tie my %config_export_svc_pkg, 'Tie::IxHash', ();
+tie my %config_export_svc, 'Tie::IxHash', ();
if ( $curuser->access_right('Configuration') ) {
- $config_export_svc_pkg{'View/Edit exports'} = [ $fsurl.'browse/part_export.cgi', 'Provisioning services to external machines, databases and APIs' ];
- $config_export_svc_pkg{'View/Edit service definitions'} = [ $fsurl.'browse/part_svc.cgi', 'Services are items you offer to your customers' ];
+ $config_export_svc{'Exports'} = [ $fsurl.'browse/part_export.cgi', 'Provisioning services to external machines, databases and APIs' ];
+ $config_export_svc{'Service definitions'} = [ $fsurl.'browse/part_svc.cgi', 'Services are items you offer to your customers' ];
}
-$config_export_svc_pkg{'View/Edit package definitions'} = [ $fsurl.'browse/part_pkg.cgi', 'One or more services are grouped together into a package and given pricing information. Customers purchase packages, not services' ]
+
+tie my %config_pkg, 'Tie::IxHash', ();
+$config_pkg{'Package definitions'} = [ $fsurl.'browse/part_pkg.cgi', 'One or more services are grouped together into a package and given pricing information. Customers purchase packages, not services' ]
if $curuser->access_right('Edit package definitions')
|| $curuser->access_right('Edit global package definitions');
if ( $curuser->access_right('Configuration') ) {
- $config_export_svc_pkg{'View/Edit package categories'} = [ $fsurl.'browse/pkg_category.html', 'Package categories define groups of package classes, for reporting and convenience purposes.' ];
- $config_export_svc_pkg{'View/Edit package classes'} = [ $fsurl.'browse/pkg_class.html', 'Package classes define groups of packages, for reporting and convenience purposes.' ];
- $config_export_svc_pkg{'View/Edit cancel reason types'} = [ $fsurl.'browse/reason_type.html?class=C', 'Cancel reason types define groups of reasons, for reporting and convenience purposes.' ];
- $config_export_svc_pkg{'View/Edit cancel reasons'} = [ $fsurl.'browse/reason.html?class=C', 'Cancel reasons explain why a service was cancelled.' ];
- $config_export_svc_pkg{'View/Edit suspend reason types'} = [ $fsurl.'browse/reason_type.html?class=S', 'Suspend reason types define groups of reasons, for reporting and convenience purposes.' ];
- $config_export_svc_pkg{'View/Edit suspend reasons'} = [ $fsurl.'browse/reason.html?class=S', 'Suspend reasons explain why a service was suspended.' ];
+ $config_pkg{'Package categories'} = [ $fsurl.'browse/pkg_category.html', 'Package categories define groups of package classes, for reporting and convenience purposes.' ];
+ $config_pkg{'Package tax classes'} = [ $fsurl.'browse/pkg_class.html', 'Package classes define groups of packages, for reporting and convenience purposes.' ];
+ $config_pkg{'Package report classes'} = [ $fsurl.'browse/part_pkg_report_option.html', 'Package classes define optional groups of packages for reporting purposes.' ];
+ $config_pkg{'Cancel reason types'} = [ $fsurl.'browse/reason_type.html?class=C', 'Cancel reason types define groups of reasons, for reporting and convenience purposes.' ];
+ $config_pkg{'Cancel reasons'} = [ $fsurl.'browse/reason.html?class=C', 'Cancel reasons explain why a service was cancelled.' ];
+ $config_pkg{'Suspend reason types'} = [ $fsurl.'browse/reason_type.html?class=S', 'Suspend reason types define groups of reasons, for reporting and convenience purposes.' ];
+ $config_pkg{'Suspend reasons'} = [ $fsurl.'browse/reason.html?class=S', 'Suspend reasons explain why a service was suspended.' ];
}
tie my %config_agent, 'Tie::IxHash',
- 'View/Edit agent types' => [ $fsurl.'browse/agent_type.cgi', 'Agent types define groups of package definitions that you can then assign to particular agents' ],
- 'View/Edit agents' => [ $fsurl.'browse/agent.cgi', 'Agents are resellers of your service. Agents may be limited to a subset of your full offerings (via their type)' ],
- 'View/Edit agent payment gateways' => [ $fsurl.'browse/payment_gateway.html', 'Credit card and electronic check processors for agent overrides' ];
+ 'Agent types' => [ $fsurl.'browse/agent_type.cgi', 'Agent types define groups of package definitions that you can then assign to particular agents' ],
+ 'Agents' => [ $fsurl.'browse/agent.cgi', 'Agents are resellers of your service. Agents may be limited to a subset of your full offerings (via their type)' ],
+ 'Agent payment gateways' => [ $fsurl.'browse/payment_gateway.html', 'Credit card and electronic check processors for agent overrides' ];
;
tie my %config_billing_rates, 'Tie::IxHash',
- 'View/Edit rate plans' => [ $fsurl.'browse/rate.cgi', 'Manage rate plans' ],
- 'View/Edit regions and prefixes' => [ $fsurl.'browse/rate_region.html', 'Manage regions and prefixes' ],
- 'View/Edit usage classes' => [ $fsurl.'browse/usage_class.html', 'Usage classes define groups of usage for taxation purposes.' ],
+ 'Rate plans' => [ $fsurl.'browse/rate.cgi', 'Manage rate plans' ],
+ 'Regions and prefixes' => [ $fsurl.'browse/rate_region.html', 'Manage regions and prefixes' ],
+ 'Usage classes' => [ $fsurl.'browse/usage_class.html', 'Usage classes define groups of usage for taxation purposes.' ],
+ 'Edit rates with Excel' => [ $fsurl.'misc/rate_edit_excel.html', 'Download and edit rates with Excel, then upload changes.' ], #"Edit with Excel" ?
;
tie my %config_billing, 'Tie::IxHash';
-# 'View/Edit payment gateways' => [ $fsurl.'browse/payment_gateway.html', 'Credit card and electronic check processors' ];
-$config_billing{'View/Edit billing events'} = [ $fsurl.'browse/part_event.html', 'Billing actions for customers, invoices and packages' ]
+# 'Payment gateways' => [ $fsurl.'browse/payment_gateway.html', 'Credit card and electronic check processors' ];
+$config_billing{'Billing events'} = [ $fsurl.'browse/part_event.html', 'Billing actions for customers, invoices and packages' ]
if $curuser->access_right('Edit billing events')
|| $curuser->access_right('Edit global billing events');
if ( $curuser->access_right('Configuration') ) {
- $config_billing{'View/Edit invoice events'} = [ $fsurl.'browse/part_bill_event.cgi', 'Deprecated, old-style actions for overdue invoices' ];
- $config_billing{'View/Edit invoice templates'} = [ $fsurl.'browse/invoice_template.html', 'Edit templates for HTML, plaintext and typeset invoices' ];
- $config_billing{'View/Edit prepaid cards'} = [ $fsurl.'search/prepay_credit.html', 'View outstanding cards, generate new cards' ];
- $config_billing{'View/Edit call rates and regions'} = [ \%config_billing_rates, 'Manage rate plans, regions and prefixes for VoIP and call billing' ];
- $config_billing{'View/Edit locales and tax rates (old tax class system)'} = [ $fsurl.'browse/cust_main_county.cgi', 'Change tax rates, or break down a country into states, or a state into counties and assign different tax rates to each' ];
- $config_billing{'View/Edit tax rates (new tax products system)'} = [ $fsurl.'browse/tax_rate.cgi', 'Edit tax rates for the new tax products system' ];
- $config_billing{'View/Edit credit reason types'} = [ $fsurl.'browse/reason_type.html?class=R', 'Credit reason types define groups of reasons, for reporting and convenience purposes.' ];
- $config_billing{'View/Edit credit reasons'} = [ $fsurl.'browse/reason.html?class=R', 'Credit reasons explain why a credit was issued.' ];
+ #$config_billing{'Invoice events'} = [ $fsurl.'browse/part_bill_event.cgi', 'Deprecated, old-style actions for overdue invoices' ];
+ $config_billing{'Invoice templates'} = [ $fsurl.'browse/invoice_template.html', 'Edit templates for HTML, plaintext and typeset invoices' ];
+ $config_billing{'Prepaid cards'} = [ $fsurl.'search/prepay_credit.html', 'View outstanding cards, generate new cards' ];
+ $config_billing{'Call rates and regions'} = [ \%config_billing_rates, 'Manage rate plans, regions and prefixes for VoIP and call billing' ];
+
+ my $config_taxes_name = 'Locales and tax rates'.
+ ( $conf->exists('enable_taxproducts')
+ ? ' (internal tax class system)'
+ : ''
+ );
+ $config_billing{$config_taxes_name} = [ $fsurl.'browse/cust_main_county.cgi', 'Change tax rates, or break down a country into states, or a state into counties and assign different tax rates to each' ];
+ $config_billing{'Tax rates (vendor data tax products system)'} = [ $fsurl.'browse/tax_rate.cgi', 'Edit tax rates for the vendor data tax products system' ]
+ if $conf->exists('enable_taxproducts');
+ $config_billing{'Tax classes'} = [ $fsurl. 'browse/part_pkg_taxclass.html', 'Tax classes' ];
+
+ $config_billing{'Credit reason types'} = [ $fsurl.'browse/reason_type.html?class=R', 'Credit reason types define groups of reasons, for reporting and convenience purposes.' ];
+ $config_billing{'Credit reasons'} = [ $fsurl.'browse/reason.html?class=R', 'Credit reasons explain why a credit was issued.' ];
}
+tie my %config_ticketing, 'Tie::IxHash',
+ 'Ticketing Users' => [ $fsurl.'rt/Admin/Users', 'View/Edit ticketing users' ], #XXX to be unified
+ 'Ticketing Groups' => [ $fsurl.'rt/Admin/Groups', 'View/Edit ticketing groups and group membership' ], #XXX to be unified
+ 'Ticketing Queues' => [ $fsurl.'rt/Admin/Queues', 'View/Edit ticketing queues and queue-specific properties' ],
+ 'Ticket Custom Fields' => [ $fsurl.'rt/Admin/CustomFields', 'View/Edit ticketing custom fields' ],
+ 'Ticketing Global' => [ $fsurl.'rt/Admin/Global', 'View/Edit ticketing configuration applicable to all queues' ],
+ #"System Configuraiton"? useless, just makes people report errors about missing Module::Versions::Report #'Ticketing Tools' => [ $fsurl.'rt/Admin/Tools', '' ],
+;
+
tie my %config_dialup, 'Tie::IxHash',
- 'View/Edit access numbers' => [ $fsurl.'browse/svc_acct_pop.cgi', 'Points of Presence' ],
+ 'Access numbers' => [ $fsurl.'browse/svc_acct_pop.cgi', 'Points of Presence' ],
;
tie my %config_broadband, 'Tie::IxHash',
- 'View/Edit routers' => [ $fsurl.'browse/router.cgi', 'Broadband access routers' ],
- 'View/Edit address blocks' => [ $fsurl.'browse/addr_block.cgi', 'Manage address blocks and block assignments to broadband routers' ],
+ 'Routers' => [ $fsurl.'browse/router.cgi', 'Broadband access routers' ],
+ 'Address blocks' => [ $fsurl.'browse/addr_block.cgi', 'Manage address blocks and block assignments to broadband routers' ],
+;
+
+tie my %config_phone, 'Tie::IxHash',
+ 'View/Edit phone device types' => [ $fsurl.'browse/part_device.html', 'Phone device types' ],
;
tie my %config_misc, 'Tie::IxHash';
-$config_misc{'View/Edit advertising sources'} = [ $fsurl.'browse/part_referral.html', 'Where a customer heard about your service. Tracked for informational purposes' ]
+$config_misc{'Advertising sources'} = [ $fsurl.'browse/part_referral.html', 'Where a customer heard about your service. Tracked for informational purposes' ]
if $curuser->access_right('Edit advertising sources')
|| $curuser->access_right('Edit global advertising sources');
if ( $curuser->access_right('Configuration') ) {
- $config_misc{'View/Edit virtual fields'} = [ $fsurl.'browse/part_virtual_field.cgi', 'Locally defined fields', ];
- $config_misc{'View/Edit message catalog'} = [ $fsurl.'browse/msgcat.cgi', 'Change error messages and other customizable labels' ];
- $config_misc{'View/Edit inventory classes and inventory'} = [ $fsurl.'browse/inventory_class.html', 'Setup inventory classes and stock inventory' ];
+ $config_misc{'Virtual fields'} = [ $fsurl.'browse/part_virtual_field.cgi', 'Locally defined fields', ];
+ $config_misc{'Message catalog'} = [ $fsurl.'browse/msgcat.cgi', 'Change error messages and other customizable labels' ];
+ $config_misc{'Inventory classes and inventory'} = [ $fsurl.'browse/inventory_class.html', 'Setup inventory classes and stock inventory' ];
}
tie my %config_menu, 'Tie::IxHash';
@@ -331,8 +429,9 @@ if ( $curuser->access_right('Configuration' ) ) {
'Employees' => [ \%config_employees, '' ],
);
}
-$config_menu{'Provisioning, services and packages'} =
- [ \%config_export_svc_pkg, '' ]
+$config_menu{'Provisioning and services'} = [ \%config_export_svc, '' ]
+ if $curuser->access_right('Configuration' );
+$config_menu{'Packages'} = [ \%config_pkg, '' ]
if $curuser->access_right('Configuration' )
|| $curuser->access_right('Edit package definitions')
|| $curuser->access_right('Edit global package definitions');
@@ -341,10 +440,15 @@ $config_menu{'Resellers'} = [ \%config_agent, '' ]
$config_menu{'Billing'} = [ \%config_billing, '' ]
if $curuser->access_right('Edit billing events')
|| $curuser->access_right('Edit global billing events');
+$config_menu{'Ticketing'} = [ \%config_ticketing, '' ]
+ if $conf->config('ticket_system')
+ && FS::TicketSystem->access_right(\%session, 'ShowConfigTab');
$config_menu{'Dialup'} = [ \%config_dialup, '' ]
if ( $curuser->access_right('Dialup configuration') );
$config_menu{'Fixed (username-less) broadband'} = [ \%config_broadband, '' ]
if ( $curuser->access_right('Broadband configuration') );
+$config_menu{'Phone'} = [ \%config_phone, '' ]
+ if ( $curuser->access_right('Configuration') );
$config_menu{'Miscellaneous'} = [ \%config_misc, '' ]
if $curuser->access_right('Edit advertising sources')
|| $curuser->access_right('Edit global advertising sources');
@@ -362,6 +466,8 @@ if ( $conf->config('ticket_system') ) {
'Ticketing start page',
],
}
+$menu{'New customer'} = [ $fsurl.'edit/cust_main.cgi', 'Add a new customer' ]
+ if $curuser->access_right('New customer');
$menu{'Reports'} = [ \%report_menu, 'Lists, reporting and graphing' ]
if keys %report_menu;
$menu{'Tools'} = [ \%tools_menu, 'Tools' ]
@@ -374,6 +480,7 @@ $menu{'Configuration'} = [ \%config_menu, 'Configuraiton and setup' ]
|| $curuser->access_right('Edit global billing events')
|| $curuser->access_right('Dialup configuration')
|| $curuser->access_right('Broadband configuration')
+ || $curuser->access_right('Phone configuration')
|| $curuser->access_right('Edit advertising sources')
|| $curuser->access_right('Edit global advertising sources');
@@ -417,7 +524,7 @@ sub submenu {
} keys %$submenu )
). "\n".
- "myMenu$menunum.width = 280;\n",
+ "myMenu$menunum.width = 256;\n",
"myMenu$menunum";
diff --git a/httemplate/elements/menuarrow.gif b/httemplate/elements/menuarrow.gif
new file mode 100644
index 0000000..ed2dee0
--- /dev/null
+++ b/httemplate/elements/menuarrow.gif
Binary files differ
diff --git a/httemplate/elements/menubar.html b/httemplate/elements/menubar.html
index ec6c13f..e6b7fb1 100644
--- a/httemplate/elements/menubar.html
+++ b/httemplate/elements/menubar.html
@@ -1,10 +1,108 @@
-%
-% my($item, $url, @html);
-% while (@_) {
-% ($item, $url) = splice(@_,0,2);
-% next if $item =~ /^\s*Main\s+Menu\s*$/i;
-% push @html, qq!<A HREF="$url">$item</A>!;
-% }
-%
-
-<% join(' | ', @html) %>
+<%doc>
+
+Example:
+
+ include( '/elements/menubar.html',
+
+ #options hashref (optional)
+ { 'newstyle' => 1, #may become the default at some point
+ 'url_base' => '', #prepended to menubar URLs, for convenience
+ 'selected' => '', #currently selected label
+ },
+
+ #menubar entries (required)
+ 'label' => $url,
+ 'label2' => $url2,
+ #etc.
+
+ );
+
+</%doc>
+%if ( $opt->{'newstyle'} ) {
+
+% #false laziness w/header.html... shouldn't these just go in freeside.css?
+
+ <style type="text/css">
+ a.fsblackbutton {
+ background-color:#333333;
+ color: #ffffff;
+ border:1px solid;
+ border-top-color:#cccccc;
+ border-left-color:#cccccc;
+ border-right-color:#aaaaaa;
+ border-bottom-color:#aaaaaa;
+ /*font-weight:bold;*/
+ /*padding-left:12px;
+ padding-right:12px;*/
+ padding-left:4px;
+ padding-right:4px;
+ text-decoration:none;
+ overflow:visible;
+ filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#ff333333',EndColorStr='#ff666666')
+ }
+
+ a.fsblackbuttonselected {
+ background-color:#7e0079;
+ color: #ffffff;
+ border:1px solid;
+ border-top-color:#cccccc;
+ border-left-color:#cccccc;
+ border-right-color:#aaaaaa;
+ border-bottom-color:#aaaaaa;
+ /*font-weight:bold;*/
+ /*padding-left:12px;
+ padding-right:12px;*/
+ padding-left:4px;
+ padding-right:4px;
+ text-decoration:none;
+ overflow:visible;
+ filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#ff330033',EndColorStr='#ff7e0079')
+ }
+ </style>
+
+ <TABLE BGCOLOR="#000000" BORDER=0 CELLSPACING=0 CELLPADDING=0>
+ <TR>
+ <TD><IMG SRC="<%$fsurl%>images/gray-black-side.png" WIDTH=13 HEIGHT=25></TD>
+ <TD>
+ <% join(' ', @html ) %>
+ </TD>
+ <TD><IMG SRC="<%$fsurl%>images/black-gray-side.png" WIDTH=13 HEIGHT=25></TD>
+ </TD>
+ </TR>
+ </TABLE>
+
+%} else {
+
+ <% join(' | ', @html) %>
+
+%}
+<%init>
+
+my $opt = ref($_[0]) ? shift : {};
+
+my $url_base = $opt->{'url_base'};
+
+my @html;
+while (@_) {
+
+ my ($item, $url) = splice(@_,0,2);
+ next if $item =~ /^\s*Main\s+Menu\s*$/i;
+
+ my $style = '';
+ if ( $opt->{'newstyle'} ) {
+
+ my $dclass = $item eq $opt->{'selected'}
+ ? 'fsblackbuttonselected'
+ : 'fsblackbutton';
+
+ $style =
+ qq( CLASS="$dclass" ).
+ qq( onMouseOver="this.className='fsblackbuttonselected'; return true;" ).
+ qq( onMouseOut="this.className='$dclass'; return true;" );
+ }
+
+ push @html, qq!<A HREF="$url_base$url" $style>$item</A>!;
+
+}
+
+</%init>
diff --git a/httemplate/elements/popup_link-cust_main.html b/httemplate/elements/popup_link-cust_main.html
index 6d92301..454fcc4 100644
--- a/httemplate/elements/popup_link-cust_main.html
+++ b/httemplate/elements/popup_link-cust_main.html
@@ -4,7 +4,7 @@ Example:
include('/elements/init_overlib.html')
- include( '/elements/cust_popup_link.html', { #hashref or a list, either way
+ include( '/elements/popup_link-cust_main.html', { #hashref or a list, either way
#required
'action' => 'content.html', # uri for content of popup which should
diff --git a/httemplate/elements/popup_link-ping.html b/httemplate/elements/popup_link-ping.html
new file mode 100644
index 0000000..9e5f143
--- /dev/null
+++ b/httemplate/elements/popup_link-ping.html
@@ -0,0 +1,30 @@
+<%doc>
+
+Example:
+
+ include('/elements/init_overlib.html')
+
+ include( '/elements/popup_link-ping.html', { #hashref or a list, either way
+ 'ip' => '10.9.8.7',
+ })
+
+</%doc>
+<% include('/elements/popup_link.html', $params ) %>\
+<%init>
+
+my $params = { 'closetext' => 'Close' };
+
+if (ref($_[0]) eq 'HASH') {
+ $params = { %$params, %{ $_[0] } };
+} else {
+ $params = { %$params, @_ };
+}
+
+$params->{'label'} ||= 'ping';
+$params->{'actionlabel'} ||= 'Ping '. $params->{'ip'};
+$params->{'width'} ||= 350;
+$params->{'height'} ||= 220;
+
+$params->{'action'} = $p. 'misc/ping.html?'. $params->{'ip'};
+
+</%init>
diff --git a/httemplate/elements/popup_link.html b/httemplate/elements/popup_link.html
index 2019387..49b624c 100644
--- a/httemplate/elements/popup_link.html
+++ b/httemplate/elements/popup_link.html
@@ -22,14 +22,16 @@ Example:
#uncommon opt
'aname' => "target", # link NAME= value, useful for #targets
'target' => '_parent',
+ 'style' => 'css-attribute:value',
} )
</%doc>
% if ($params->{'action'} && $label) {
<A HREF="javascript:void(0);"
- onClick="<% $onclick %>"
- <% $params->{'aname'} ? 'NAME="'. $params->{'aname'}. '"' : '' %>
- <% $params->{'target'} ? 'TARGET="'. $params->{'target'}. '"' : '' %>
+ onClick="<% $onclick |n %>"
+ <% $params->{'aname'} ? 'NAME="'. $params->{'aname'}. '"' : '' |n %>
+ <% $params->{'target'} ? 'TARGET="'. $params->{'target'}. '"' : '' |n %>
+ <% $params->{'style'} ? 'STYLE="'. $params->{'style'}. '"' : '' |n %>
><% $label %></A>\
% }
<%init>
diff --git a/httemplate/elements/progress-popup.html b/httemplate/elements/progress-popup.html
index 0bd71ff..8a55efb 100644
--- a/httemplate/elements/progress-popup.html
+++ b/httemplate/elements/progress-popup.html
@@ -31,10 +31,12 @@ function updateStatus( status_statustext ) {
var statusArray = eval('(' + status_statustext + ')');
var status = statusArray[0];
var statustext = statusArray[1];
+ var actiontext = statusArray[2];
//if ( status == 'progress' ) {
//IE workaround, no i have no idea why
if ( status.indexOf('progress') > -1 ) {
+ document.getElementById("progress_message").innerHTML = actiontext + '...';
document.getElementById("progress_percent").innerHTML = statustext + '%';
bar1.set(statustext);
bar1.update;
diff --git a/httemplate/elements/select-county.html b/httemplate/elements/select-county.html
index 59f235a..aa88abe 100644
--- a/httemplate/elements/select-county.html
+++ b/httemplate/elements/select-county.html
@@ -58,10 +58,12 @@ Example:
if ( countiesArray.length > 1 ) {
what.form.<% $pre %>county.style.display = '';
- countyFormLabel.style.visibility = 'visible';
+ //countyFormLabel.style.visibility = 'visible';
+ countyFormLabel.style.display = '';
} else {
what.form.<% $pre %>county.style.display = 'none';
- countyFormLabel.style.visibility = 'hidden';
+ //countyFormLabel.style.visibility = 'hidden';
+ countyFormLabel.style.display = 'none';
}
//run the callback
diff --git a/httemplate/elements/select-cust-part_pkg.html b/httemplate/elements/select-cust-part_pkg.html
index 2926629..7f91e81 100644
--- a/httemplate/elements/select-cust-part_pkg.html
+++ b/httemplate/elements/select-cust-part_pkg.html
@@ -31,11 +31,11 @@ my( %opt ) = @_;
my $cust_main = $opt{'cust_main'}
or die "cust_main not specified";
-$opt{'extra_sql'} .=
- ' AND ( agentnum IS NOT NULL '.
- ' OR 0 < ( SELECT COUNT(*) FROM type_pkgs '.
- ' WHERE typenum = '. $cust_main->agent->typenum.
- ' AND type_pkgs.pkgpart = part_pkg.pkgpart )'.
- ' )';
+$opt{'extra_sql'} .= ' AND '. FS::part_pkg->agent_pkgs_sql( $cust_main->agent );
+# ' AND ( agentnum IS NOT NULL '.
+# ' OR 0 < ( SELECT COUNT(*) FROM type_pkgs '.
+# ' WHERE typenum = '. $cust_main->agent->typenum.
+# ' AND type_pkgs.pkgpart = part_pkg.pkgpart )'.
+# ' )';
</%init>
diff --git a/httemplate/elements/select-cust-pkg_class.html b/httemplate/elements/select-cust-pkg_class.html
new file mode 100644
index 0000000..5c19efa
--- /dev/null
+++ b/httemplate/elements/select-cust-pkg_class.html
@@ -0,0 +1,12 @@
+<% include( '/elements/select-pkg_class.html',
+ 'pre_options' => [ '-1' => 'all' ], #XXX a config ?
+ #'pre_options' => [ '-2' => 'Select package class' ],
+ 'disable_empty' => 1,
+ %opt,
+ )
+%>
+<%init>
+
+my %opt = @_;
+
+</%init>
diff --git a/httemplate/elements/select-cust_main-status.html b/httemplate/elements/select-cust_main-status.html
index 2e0b6cb..bdbaac7 100644
--- a/httemplate/elements/select-cust_main-status.html
+++ b/httemplate/elements/select-cust_main-status.html
@@ -8,7 +8,9 @@
% foreach my $option ( @{ $opt{'statuses'} } ) {
<OPTION VALUE="<% $option %>"
- <% $option eq $curr_value ? 'SELECTED' : '' %>
+ <% ref($value) && $value->{$option} || $option eq $value
+ ? 'SELECTED' : ''
+ %>
><% $option %>
% }
@@ -25,6 +27,7 @@ my $onchange = $opt{'onchange'}
? 'onChange="'. $opt{'onchange'}. '(this)"'
: '';
-my $curr_value = $opt{'curr_value'} || $opt{'value'};
+my $value = $opt{'curr_value'} || $opt{'value'};
+$value = [ split(/\s*,\s*/, $value) ] if $opt{'multiple'} && $value =~ /,/;
</%init>
diff --git a/httemplate/elements/select-cust_pkg-balances.html b/httemplate/elements/select-cust_pkg-balances.html
new file mode 100644
index 0000000..cd2e1a8
--- /dev/null
+++ b/httemplate/elements/select-cust_pkg-balances.html
@@ -0,0 +1,32 @@
+<SELECT NAME="pkgnum">
+ <OPTION VALUE="">(any)
+% foreach my $cust_pkg (@cust_pkg) {
+% my $sel = ( $cgi->param('pkgnum') == $cust_pkg->pkgnum ) ? 'SELECTED' : '';
+ <OPTION <% $sel %> VALUE="<% $cust_pkg->pkgnum %>"><% $cust_pkg->pkg_label_long |h %>
+% }
+</SELECT>
+<%init>
+
+my %opt = @_;
+
+my $cgi = $opt{'cgi'};
+
+my @cust_pkg;
+if ( $opt{'cust_pkg'} ) {
+
+ @cust_pkg = @{ $opt{'cust_pkg'} };
+
+} else {
+
+ my $custnum = $opt{'custnum'};
+
+ my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } )
+ or die "unknown custnum $custnum\n";
+
+ @cust_pkg =
+ grep { ! $_->get('cancel') || $cust_main->balance_pkgnum($_->pkgnum) }
+ $cust_main->all_pkgs;
+
+}
+
+</%init>
diff --git a/httemplate/elements/select-cust_pkg-status.html b/httemplate/elements/select-cust_pkg-status.html
index 2d545c0..ec37eaf 100644
--- a/httemplate/elements/select-cust_pkg-status.html
+++ b/httemplate/elements/select-cust_pkg-status.html
@@ -8,7 +8,9 @@
% foreach my $option ( @{ $opt{'statuses'} } ) {
<OPTION VALUE="<% $option %>"
- <% $option eq $curr_value ? 'SELECTED' : '' %>
+ <% ref($value) && $value->{$option} || $option eq $value
+ ? 'SELECTED' : ''
+ %>
><% $option %>
% }
@@ -25,6 +27,7 @@ my $onchange = $opt{'onchange'}
? 'onChange="'. $opt{'onchange'}. '(this)"'
: '';
-my $curr_value = $opt{'curr_value'} || $opt{'value'};
+my $value = $opt{'curr_value'} || $opt{'value'};
+$value = [ split(/\s*,\s*/, $value) ] if $opt{'multiple'} && $value =~ /,/;
</%init>
diff --git a/httemplate/elements/select-did.html b/httemplate/elements/select-did.html
index 0695164..af8d595 100644
--- a/httemplate/elements/select-did.html
+++ b/httemplate/elements/select-did.html
@@ -68,8 +68,11 @@ my %opt = @_;
my $conf = new FS::Conf;
my $country = $conf->config('countrydefault') || 'US';
+#false laziness w/tr-select-did.html
#XXX make sure this comes through on errors too
-my $svcpart = $opt{'svcpart'} || $opt{'object'}->svcpart;
+my $svcpart = $opt{'svcpart'}
+ || $opt{'object'}->svcpart
+ || $opt{'object'}->cust_svc->svcpart;
my $part_svc = qsearchs('part_svc', { 'svcpart'=>$svcpart } );
die "unknown svcpart $svcpart" unless $part_svc;
diff --git a/httemplate/elements/select-domain.html b/httemplate/elements/select-domain.html
index a9998da..3372e06 100644
--- a/httemplate/elements/select-domain.html
+++ b/httemplate/elements/select-domain.html
@@ -7,7 +7,7 @@
' LEFT JOIN cust_pkg USING ( pkgnum ) '.
' LEFT JOIN cust_main USING ( custnum ) ',
'agent_virt' => 1,
- 'agent_null-right' => 'View/link unlinked services',
+ 'agent_null_right' => 'View/link unlinked services',
@_,
)
%>
diff --git a/httemplate/elements/select-part_pkg.html b/httemplate/elements/select-part_pkg.html
index 52b1cca..6b697ab 100644
--- a/httemplate/elements/select-part_pkg.html
+++ b/httemplate/elements/select-part_pkg.html
@@ -22,17 +22,27 @@ Example:
'name_col' => 'pkg',
'empty_label' => 'Select package', #should this be the default?
'label_callback' => sub { shift->pkg_comment },
- 'hashref' => { 'disabled' => '' },
+ 'hashref' => \%hash,
%opt,
)
%>
<%init>
-
+
my( %opt ) = @_;
$opt{'records'} = delete $opt{'part_pkg'}
if $opt{'part_pkg'};
+my %hash = ( 'disabled' => '' );
+
+if ( exists($opt{'classnum'}) && defined($opt{'classnum'}) ) {
+ if ( $opt{'classnum'} > 0 ) {
+ $hash{'classnum'} = $opt{'classnum'};
+ } elsif ( $opt{'classnum'} eq '' || $opt{'classnum'} == 0 ) {
+ $hash{'classnum'} = '';
+ } #else -1 or not specified, all classes, so don't set classnum
+}
+
$opt{'extra_sql'} .= ' AND '. FS::part_pkg->curuser_pkgs_sql;
</%init>
diff --git a/httemplate/elements/select-part_svc.html b/httemplate/elements/select-part_svc.html
new file mode 100644
index 0000000..72ab7f6
--- /dev/null
+++ b/httemplate/elements/select-part_svc.html
@@ -0,0 +1,18 @@
+<% include( '/elements/select-table.html',
+ 'table' => 'part_svc',
+ 'name_col' => 'svc',
+ 'label_showkey' => 1,
+ #N/A 'empty_label' => '(none)',
+ %opt,
+ )
+%>
+<%init>
+
+my( %opt ) = @_;
+
+$opt{'records'} = delete $opt{'part_svc'}
+ if $opt{'part_svc'};
+
+$opt{'records'} ||= [ qsearch( 'part_svc', {} ) ]; # { disabled=>'' } )
+
+</%init>
diff --git a/httemplate/elements/select-svc_acct-domain.html b/httemplate/elements/select-svc_acct-domain.html
new file mode 100644
index 0000000..c9a9206
--- /dev/null
+++ b/httemplate/elements/select-svc_acct-domain.html
@@ -0,0 +1,46 @@
+<SELECT NAME="domsvc" SIZE=1>
+% foreach my $svcnum (
+% sort { $svc_domain{$a} cmp $svc_domain{$b} }
+% keys %svc_domain
+% ) {
+% my $svc_domain = $svc_domain{$svcnum};
+% my $selected = ($svcnum == $domsvc) ? ' SELECTED' : ''
+
+ <OPTION VALUE="<% $svcnum %>" <% $selected %>><% $svc_domain{$svcnum} %>
+
+% }
+
+</SELECT>
+<%init>
+
+my %opt = @_;
+
+my $domsvc = $opt{'curr_value'};
+my $part_svc = $opt{'part_svc'}
+ || qsearchs('part_svc', { 'svcpart' => $opt{'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_domain = ();
+
+if ( $domsvc ) {
+ my $svc_domain = qsearchs('svc_domain', { 'svcnum' => $domsvc } );
+ if ( $svc_domain ) {
+ $svc_domain{$svc_domain->svcnum} = $svc_domain;
+ } else {
+ warn "unknown svc_domain.svcnum for svc_acct.domsvc: $domsvc";
+ }
+}
+
+%svc_domain = (
+ %svc_domain,
+ FS::svc_acct->domain_select_hash( 'svcpart' => $part_svc->svcpart,
+ 'pkgnum' => $pkgnum,
+ )
+);
+</%init>
diff --git a/httemplate/elements/select-table.html b/httemplate/elements/select-table.html
index 4efbcba..10a8b27 100644
--- a/httemplate/elements/select-table.html
+++ b/httemplate/elements/select-table.html
@@ -34,6 +34,7 @@ Example:
'empty_label' => '', #better specify it though, the default might change
'multiple' => 0, # bool
'disable_empty' => 0, # bool (implied by multiple)
+ 'label_showkey' => 0, # bool
'label_callback' => sub { my $record = shift; return "label"; },
#more params controlling HTML stuff about the <SELECT>
@@ -64,21 +65,32 @@ Example:
>
% while ( @pre_options ) {
- <OPTION VALUE="<% shift(@pre_options) %>"><% shift(@pre_options) %>
-
+% my $pre_opt = shift(@pre_options);
+% my $pre_label = shift(@pre_options);
+% my $selected = ( ref($value) && $value->{$pre_opt} )
+% || ( $value eq $pre_opt );
+ <OPTION VALUE="<% $pre_opt %>"
+ <% $selected ? 'SELECTED' : '' %>
+ ><% $pre_label %>
% }
% unless ( $opt{'multiple'} || $opt{'disable_empty'} ) {
<OPTION VALUE=""><% $opt{'empty_label'} || 'all' %>
% }
-% foreach my $record ( sort { $a->$name_col() cmp $b->$name_col() } @records ) {
+% foreach my $record ( sort { $a->$name_col() cmp $b->$name_col()
+% || $a->$key() <=> $b->$key()
+% }
+% @records
+% )
+% {
% my $recvalue = $record->$key();
<OPTION VALUE="<% $recvalue %>"
<% ref($value) && $value->{$recvalue} || $value == $recvalue
? ' SELECTED' : ''
%>
- ><% $opt{'label_callback'}
+ ><% $opt{'label_showkey'} ? "$recvalue: " : '' %>
+ <% $opt{'label_callback'}
? &{ $opt{'label_callback'} }( $record )
: $record->$name_col()
%>
@@ -139,7 +151,7 @@ if ( $opt{'records'} ) {
});
}
-unless ( ! $value
+unless ( $value < 1 # !$value #ignore negatives too
or ref($value)
or ! exists( $opt{hashref}->{disabled} ) #??
or grep { $value == $_->$key() } @records
diff --git a/httemplate/elements/select-taxclass.html b/httemplate/elements/select-taxclass.html
index 2504a5b..6845d23 100644
--- a/httemplate/elements/select-taxclass.html
+++ b/httemplate/elements/select-taxclass.html
@@ -1,6 +1,6 @@
% if ( $conf->exists('enable_taxclasses') ) {
- <SELECT NAME="<% $opt{'name'} || 'taxclass' %>">
+ <SELECT NAME="<% $opt{'element_name'} || $opt{'field'} || 'taxclass' %>">
% if ( $conf->exists('require_taxclasses') ) {
<OPTION VALUE="(select)">Select tax class
@@ -16,7 +16,7 @@
% } else {
- <INPUT TYPE="hidden" NAME="taxclass" VALUE="<% $selected_taxclass %>">
+ <INPUT TYPE="hidden" NAME="<% $opt{'element_name'} || $opt{'field'} || 'taxclass' %>" VALUE="<% $selected_taxclass %>">
% }
@@ -30,9 +30,9 @@ my $conf = new FS::Conf;
unless ( $opt{'taxclasses'} ) {
#my $sth = dbh->prepare('SELECT DISTINCT taxclass FROM cust_main_county')
- my $sth = dbh->prepare('SELECT taxclass FROM part_pkg_taxclass')
+ my $sth = dbh->prepare("SELECT taxclass FROM part_pkg_taxclass WHERE disabled IS NULL OR disabled = '' OR taxclass = ?")
or die dbh->errstr;
- $sth->execute or die $sth->errstr;
+ $sth->execute($selected_taxclass) or die $sth->errstr;
my %taxclasses = map { $_->[0] => 1 } @{$sth->fetchall_arrayref};
@{ $opt{'taxclasses'} } = grep $_, keys %taxclasses;
diff --git a/httemplate/elements/select-terms.html b/httemplate/elements/select-terms.html
new file mode 100644
index 0000000..629d1e4
--- /dev/null
+++ b/httemplate/elements/select-terms.html
@@ -0,0 +1,26 @@
+<SELECT NAME = "invoice_terms"
+ ID = "invoice_terms"
+ <% $opt{'disabled'} ? 'DISABLED' : ''%>
+>
+ <OPTION VALUE=""><% $empty_label %>
+% foreach my $term ( @terms ) {
+ <OPTION VALUE="<% $term %>" <% $curr_value eq $term ? ' SELECTED' : '' %>><% $term %>
+% }
+</SELECT>
+<%init>
+
+my %opt = @_;
+my $curr_value = $opt{'curr_value'};
+my $conf = new FS::Conf;
+
+my $empty_label =
+ $opt{'empty_label'}
+ || 'Default ('.
+ ($conf->config('invoice_default_terms') || 'Payable upon receipt').
+ ')';
+
+my @terms = ( 'Payable upon receipt',
+ ( map "Net $_", 0, 10, 15, 20, 30, 45, 60 ),
+ );
+
+</%init>
diff --git a/httemplate/elements/selectlayers.html b/httemplate/elements/selectlayers.html
index 82f5dd1..89fe41b 100644
--- a/httemplate/elements/selectlayers.html
+++ b/httemplate/elements/selectlayers.html
@@ -14,7 +14,7 @@ Example:
#XXX put this handling it its own selectlayers-fields.html element?
'layer_prefix' => 'prefix_', #optional prefix for fieldnames
- 'layer_fields' => [ 'layer' => [ 'fieldname',
+ 'layer_fields' => { 'layer' => [ 'fieldname',
{ label => 'fieldname2',
type => 'text', #implemented:
# text, money, fixed,
@@ -23,6 +23,7 @@ Example:
# select, select-agent,
# select-pkg_class,
# select-part_referral,
+ # select-taxclass,
# select-table,
#XXX tbd:
# more?
@@ -32,6 +33,7 @@ Example:
'layer2' => [ 'l2fieldname',
...
],
+ },
#current values for layer fields above
'layer_values' => { 'layer' => { 'fieldname' => 'current_value',
@@ -63,18 +65,29 @@ Example:
<SCRIPT TYPE="text/javascript">
% }
% unless ( grep $opt{$_}, qw(html_only select_only layers_only) ) {
- //alert('start function define');
+
+% if ( $opt{layermap} ) {
+% my %map = %{ $opt{layermap} };
+ var layermap = { "":"",
+ <% join(',', map { qq("$_":"$map{$_}") } keys %map ) %>
+ };
+% }
+
function <% $key %>changed(what) {
<% $opt{'onchange'} %>
var <% $key %>layer = what.options[what.selectedIndex].value;
-% foreach my $layer ( keys %$options ) {
-
+% foreach my $layer ( @layers ) {
+%
+% if ( $opt{layermap} ) {
+ if ( layermap[ <% $key %>layer ] == "<% $layer %>" ) {
+% } else {
if (<% $key %>layer == "<% $layer %>" ) {
+% }
-% foreach my $not ( grep { $_ ne $layer } keys %$options ) {
+% foreach my $not ( grep { $_ ne $layer } @layers ) {
% my $element = "document.getElementById('${key}d$not').style";
<% $element %>.display = "none";
<% $element %>.zIndex = 0;
@@ -90,7 +103,6 @@ Example:
//<% $opt{'onchange'} %>
}
- //alert('end function define');
% }
% unless ( grep $opt{$_}, qw(html_only js_only select_only layers_only) ) {
</SCRIPT>
@@ -124,10 +136,16 @@ Example:
%
% unless ( grep $opt{$_}, qw(js_only select_only) ) {
-% foreach my $layer ( keys %$options ) {
+% foreach my $layer ( @layers ) {
+% my $selected_layer;
+% if ( $opt{layermap} ) {
+% $selected_layer = $opt{layermap}->{$selected};
+% } else {
+% $selected_layer = $selected;
+% }
<DIV ID="<% $key %>d<% $layer %>"
- STYLE="<% $layer eq $selected
+ STYLE="<% $selected_layer eq $layer
? 'display: "" ; z-index: 1'
: 'display: none; z-index: 0'
%>"
@@ -162,6 +180,14 @@ tie my %options, 'Tie::IxHash',
my $between = exists($opt{html_between}) ? $opt{html_between} : '';
my $options = \%options;
+my @layers = ();
+if ( $opt{layermap} ) {
+ my %layers = map { $opt{layermap}->{$_} => 1 } keys %options;
+ @layers = keys %layers;
+} else {
+ @layers = keys %options;
+}
+
my $selected = exists($opt{curr_value}) ? $opt{curr_value} : '';
#XXX eek. also eek $layer_fields in the layer_callback() call...
diff --git a/httemplate/elements/tr-checkbox.html b/httemplate/elements/tr-checkbox.html
index 2e6d1f1..c3cf92d 100644
--- a/httemplate/elements/tr-checkbox.html
+++ b/httemplate/elements/tr-checkbox.html
@@ -1,13 +1,7 @@
<% include('tr-td-label.html', @_ ) %>
<TD <% $style %>>
- <INPUT TYPE = "checkbox"
- NAME = "<% $opt{field} %>"
- ID = "<% $opt{id} %>"
- VALUE = "<% $opt{value} %>"
- <% $opt{curr_value} eq $opt{value} ? ' CHECKED' : '' %>
- <% $onchange %>
- >
+ <% include('checkbox.html', @_) %>
</TD>
</TR>
diff --git a/httemplate/elements/tr-input-date-field.html b/httemplate/elements/tr-input-date-field.html
index 11581d5..2a731e1 100644
--- a/httemplate/elements/tr-input-date-field.html
+++ b/httemplate/elements/tr-input-date-field.html
@@ -23,17 +23,30 @@
<%init>
-my($name, $value, $label, $format, $usedatetime) = @_;
+my($name, $value, $label, $format, $usedatetime);
+if ( ref($_[0]) ) {
+ my $opt = shift;
+ $name = $opt->{'name'};
+ $value = $opt->{'value'};
+ $label = $opt->{'label'};
+ $format = $opt->{'format'};
+ $usedatetime = $opt->{'usedatetime'};
+} else {
+ ($name, $value, $label, $format, $usedatetime) = @_;
+}
$format = "%m/%d/%Y" unless $format;
$label = $name unless $label;
-if ($usedatetime) {
- my $dt = DateTime->from_epoch(epoch => $value, time_zone => 'floating');
- $value = $dt->strftime($format)
- unless $value eq '';
-}else{
- $value = time2str($format, $value);
+if ( $value =~ /\S/ ) {
+ if ( $usedatetime ) {
+ my $dt = DateTime->from_epoch(epoch => $value, time_zone => 'floating');
+ $value = $dt->strftime($format);
+ } elsif ( $value =~ /^\d+$/ ) {
+ $value = time2str($format, $value);
+ }
+} else {
+ $value = '';
}
</%init>
diff --git a/httemplate/elements/tr-justtitle.html b/httemplate/elements/tr-justtitle.html
index 7839a8c..8c14d34 100644
--- a/httemplate/elements/tr-justtitle.html
+++ b/httemplate/elements/tr-justtitle.html
@@ -1,5 +1,5 @@
<TR>
- <TH BGCOLOR="#e8e8e8" COLSPAN=2 ALIGN="left">
+ <TH BGCOLOR="#e8e8e8" COLSPAN=<% $opt{colspan} || 2 %> ALIGN="left">
<FONT SIZE="+1"><% $opt{value} %></FONT>
</TH>
</TR>
diff --git a/httemplate/elements/tr-select-cust-part_pkg.html b/httemplate/elements/tr-select-cust-part_pkg.html
new file mode 100644
index 0000000..75f1f6f
--- /dev/null
+++ b/httemplate/elements/tr-select-cust-part_pkg.html
@@ -0,0 +1,107 @@
+%if ( scalar(@pkg_class) > 1 && ! $conf->exists('disable-cust-pkg_class') ) {
+
+ <% include('/elements/xmlhttp.html',
+ 'url' => $p.'misc/cust-part_pkg.cgi',
+ 'subs' => [ 'get_part_pkg' ],
+ )
+ %>
+
+ <SCRIPT TYPE="text/javascript">
+
+ function opt(what,value,text) {
+ var optionName = new Option(text, value, false, false);
+ var length = what.length;
+ what.options[length] = optionName;
+ }
+
+ function classnum_changed(what) {
+
+ what.form.pkgpart.disabled = 'disabled'; //disable part_pkg dropdown
+ what.form.submit.disabled = true; //disable the submit button
+
+ classnum = what.options[what.selectedIndex].value;
+
+ function update_part_pkg(part_pkg) {
+
+ // blank the current packages
+ for ( var i = what.form.pkgpart.length; i>= 0; i-- )
+ what.form.pkgpart.options[i] = null;
+
+ // add the new packages
+ opt(what.form.pkgpart, '', 'Select package');
+ var packagesArray = eval('(' + part_pkg + ')' );
+ for ( var s = 0; s < packagesArray.length; s=s+2 ) {
+ var packagesLabel = packagesArray[s+1];
+ opt(what.form.pkgpart, packagesArray[s], packagesLabel);
+ }
+
+ what.form.pkgpart.disabled = ''; //re-enable part_pkg dropdown
+
+ }
+
+ get_part_pkg( <% $cust_main->custnum %>, classnum, update_part_pkg );
+
+ }
+
+ </SCRIPT>
+
+ <TR>
+ <TH ALIGN="right">Package Class</TH>
+ <TD COLSPAN=7>
+ <% include('/elements/select-cust-pkg_class.html',
+ 'curr_value' => $opt{'classnum'},
+ 'pkg_class' => \@pkg_class,
+ 'onchange' => 'classnum_changed',
+ )
+ %>
+ </TD>
+ </TR>
+
+%}
+
+<TR>
+ <TH ALIGN="right">Package</TH>
+ <TD COLSPAN=7>
+ <% include('/elements/select-cust-part_pkg.html',
+ 'curr_value' => $opt{'curr_value'}, #$pkgpart
+ 'classnum' => $opt{'classnum'},
+ 'cust_main' => $opt{'cust_main'}, #$cust_main
+ 'onchange' => 'enable_order_pkg',
+ )
+ %>
+ </TD>
+</TR>
+
+<%init>
+
+my $conf = new FS::Conf;
+
+my %opt = @_;
+
+my $pre_label = $opt{'pre_label'} || '';
+$pre_label .= ' ' if length($pre_label) && $pre_label =~ /\S$/;
+
+my $cust_main = $opt{'cust_main'}
+ or die "cust_main not specified";
+
+#my @pkg_class = sort { $a->classname cmp $b->classname }
+# qsearch( 'pkg_class', { 'disabled' => '' } );
+
+#"normal" part_pkg agent virtualization (agentnum or type)
+my @part_pkg = qsearch({
+ 'select' => 'DISTINCT classnum',
+ 'table' => 'part_pkg',
+ 'hashref' => { 'disabled' => '' },
+ 'extra_sql' =>
+ ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql( 'null'=>1 ).
+ ' AND '. FS::part_pkg->agent_pkgs_sql( $opt{'cust_main'}->agent ),
+});
+
+my @pkg_class =
+ sort { $a->classname cmp $b->classname } #should get a sort order in config
+ map { $_->pkg_class || new FS::pkg_class { 'classnum' => '',
+ 'classname' => '(none)' }
+ }
+ @part_pkg;
+
+</%init>
diff --git a/httemplate/elements/tr-select-cust_pkg-balances.html b/httemplate/elements/tr-select-cust_pkg-balances.html
new file mode 100644
index 0000000..89dc5d4
--- /dev/null
+++ b/httemplate/elements/tr-select-cust_pkg-balances.html
@@ -0,0 +1,31 @@
+% if ( scalar(@cust_pkg) == 0 ) {
+ <INPUT TYPE="hidden" NAME="pkgnum" VALUE="">
+% } elsif ( scalar(@cust_pkg) == 1 ) {
+ <INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $cust_pkg[0]->pkgnum %>">
+% } else {
+ <TR>
+ <TD ALIGN="right">For package</TD>
+ <TD COLSPAN=2>
+ <% include('select-cust_pkg-balances.html',
+ 'cust_pkg' => \@cust_pkg,
+ 'cgi' => $opt{'cgi'},
+ )
+ %>
+ </TD>
+ </TR>
+
+% }
+
+<%init>
+my %opt = @_;
+
+my $custnum = $opt{'custnum'};
+
+my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } )
+ or die "unknown custnum $custnum\n";
+
+my @cust_pkg =
+ grep { ! $_->get('cancel') || $cust_main->balance_pkgnum($_->pkgnum) }
+ $cust_main->all_pkgs;
+
+</%init>
diff --git a/httemplate/elements/tr-select-did.html b/httemplate/elements/tr-select-did.html
index c784033..987ade6 100644
--- a/httemplate/elements/tr-select-did.html
+++ b/httemplate/elements/tr-select-did.html
@@ -1,6 +1,6 @@
<% include('tr-td-label.html', @_ ) %>
-% if ( $opt{'curr_value'} ne '' ) {
+% if ( $opt{'curr_value'} ne '' && $use_selector ) {
<TD BGCOLOR="#dddddd" <% $cell_style %>><% $opt{'formatted_value'} || $opt{'curr_value'} || $opt{'value'} |h %></TD>
@@ -19,7 +19,23 @@
<%init>
my %opt = @_;
-
+#warn Dumper(\%opt); if $DEBUG;
my $cell_style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : '';
+#false laziness w/select-did.html
+#XXX make sure this comes through on errors too
+my $svcpart = $opt{'svcpart'}
+ || $opt{'object'}->svcpart
+ || $opt{'object'}->cust_svc->svcpart;
+
+my $part_svc = qsearchs('part_svc', { 'svcpart'=>$svcpart } );
+die "unknown svcpart $svcpart" unless $part_svc;
+
+my @exports = $part_svc->part_export_did;
+if ( scalar(@exports) > 1 ) {
+ die "more than one DID-providing export attached to svcpart $svcpart";
+}
+
+my $use_selector = scalar(@exports) ? 1 : 0;
+
</%init>
diff --git a/httemplate/elements/tr-select-part_svc.html b/httemplate/elements/tr-select-part_svc.html
index 0274ef1..af51487 100644
--- a/httemplate/elements/tr-select-part_svc.html
+++ b/httemplate/elements/tr-select-part_svc.html
@@ -7,11 +7,8 @@
<TR>
<TD ALIGN="right"><% $opt{'label'} || 'Package definition' %></TD>
<TD>
- <% include( '/elements/select-table.html',
- 'table' => 'part_svc',
- 'name_col' => 'svc',
- 'multiple' => 1,
- #N/A 'empty_label' => '(none)',
+ <% include( '/elements/select-part_svc.html',
+ 'multiple' => 1,
%opt,
)
%>
diff --git a/httemplate/elements/tr-select-pkg_class.html b/httemplate/elements/tr-select-pkg_class.html
index aa27609..ece4b58 100644
--- a/httemplate/elements/tr-select-pkg_class.html
+++ b/httemplate/elements/tr-select-pkg_class.html
@@ -1,6 +1,6 @@
-% if ( scalar(@{ $opt{'pkg_class'} }) == 0 ) {
+% if ( $count == 0 ) {
- <INPUT TYPE="hidden" NAME="<% $opt{'field'} || 'classnum' %>" VALUE="">
+ <INPUT TYPE="hidden" NAME="<% $opt{'element_name'} || $opt{'field'} || 'classnum' %>" VALUE="">
% } else {
@@ -22,6 +22,6 @@
my %opt = @_;
my $classnum = $opt{'curr_value'} || $opt{'value'};
-$opt{'pkg_class'} ||= [ qsearch( 'pkg_class', {} ) ]; # { disabled=>'' } )
+my $count = scalar( qsearch( 'pkg_class', {} ) );
</%init>
diff --git a/httemplate/elements/tr-select-svc_acct-domain.html b/httemplate/elements/tr-select-svc_acct-domain.html
new file mode 100644
index 0000000..9d1a4b6
--- /dev/null
+++ b/httemplate/elements/tr-select-svc_acct-domain.html
@@ -0,0 +1,34 @@
+%if ( $columnflag eq 'F' ) {
+ <INPUT TYPE="hidden" NAME="domsvc" VALUE="<% $domsvc %>">
+% } else {
+
+ <TR>
+ <TD ALIGN="right"><% $opt{'label'} || 'Domain' %></TD>
+ <TD>
+ <% include('/elements/select-svc_acct-domain.html',
+ 'curr_value' => $domsvc,
+ 'part_svc' => $part_svc,
+ 'cust_pkg' => $cust_pkg,
+ )
+ %>
+ </TD>
+ </TR>
+% }
+<%init>
+
+my %opt = @_;
+
+my $domsvc = $opt{'curr_value'};
+
+#required
+my $part_svc = $opt{'part_svc'}
+ || qsearchs('part_svc', { 'svcpart' => $opt{'svcpart'} });
+
+my $columnflag = $part_svc->part_svc_column('domsvc')->columnflag;
+
+#optional
+my $cust_pkg = $opt{'cust_pkg'};
+$cust_pkg ||= qsearchs('cust_pkg', { 'pkgnum' => $opt{'pkgnum'} })
+ if $opt{'pkgnum'};
+
+</%init>
diff --git a/httemplate/elements/tr-select-taxclass.html b/httemplate/elements/tr-select-taxclass.html
index 981c1a5..97f3cad 100644
--- a/httemplate/elements/tr-select-taxclass.html
+++ b/httemplate/elements/tr-select-taxclass.html
@@ -9,7 +9,11 @@
<TR>
<TD ALIGN="right"><% $opt{'label'} || 'Tax class: ' %></TD>
<TD>
- <% include( '/elements/select-taxclass.html', 'curr_value' => $selected_taxclass, %opt ) %>
+ <% include( '/elements/select-taxclass.html',
+ 'curr_value' => $selected_taxclass,
+ %opt
+ )
+ %>
</TD>
</TR>
@@ -23,9 +27,9 @@ my $selected_taxclass = $opt{'curr_value'}; # || $opt{'value'} necessary?
unless ( $opt{'taxclasses'} ) {
#my $sth = dbh->prepare('SELECT DISTINCT taxclass FROM cust_main_county')
- my $sth = dbh->prepare('SELECT taxclass FROM part_pkg_taxclass')
+ my $sth = dbh->prepare("SELECT taxclass FROM part_pkg_taxclass WHERE disabled IS NULL OR disabled = '' OR taxclass = ?")
or die dbh->errstr;
- $sth->execute or die $sth->errstr;
+ $sth->execute($selected_taxclass) or die $sth->errstr;
my %taxclasses = map { $_->[0] => 1 } @{$sth->fetchall_arrayref};
@{ $opt{'taxclasses'} } = grep $_, keys %taxclasses;
diff --git a/httemplate/elements/tr-selectmultiple-part_pkg.html b/httemplate/elements/tr-selectmultiple-part_pkg.html
index 455038d..d959a5b 100644
--- a/httemplate/elements/tr-selectmultiple-part_pkg.html
+++ b/httemplate/elements/tr-selectmultiple-part_pkg.html
@@ -2,11 +2,10 @@
<TD ALIGN="right"><% $opt{'label'} || 'Packages' %></TD>
<TD>
<% include( '/elements/select-table.html',
- 'table' => 'part_pkg',
- 'name_col' => 'pkg',
- 'value' => '',
- 'empty_label' => '(none)',
- 'element_etc' => 'multiple',
+ 'table' => 'part_pkg',
+ 'name_col' => 'pkg',
+ 'disable_empty' => 1,
+ 'element_etc' => 'multiple',
%opt,
)
%>
diff --git a/httemplate/elements/tr-textarea.html b/httemplate/elements/tr-textarea.html
new file mode 100644
index 0000000..ae2ef81
--- /dev/null
+++ b/httemplate/elements/tr-textarea.html
@@ -0,0 +1,30 @@
+<% include('tr-td-label.html', @_ ) %>
+
+ <TD <% $cell_style %>>
+
+ <TEXTAREA NAME = "<% $opt{field} %>"
+ ID = "<% $opt{id} %>"
+ <% $rows %>
+ <% $cols %>
+ <% $onchange %>
+ ><% $curr_value |h %></TEXTAREA>
+
+ </TD>
+
+</TR>
+
+<%init>
+
+my %opt = @_;
+
+my $onchange = $opt{'onchange'}
+ ? 'onChange="'. $opt{'onchange'}. '(this)"'
+ : '';
+
+my $rows = $opt{'rows'} ? 'ROWS="'.$opt{'rows'}.'"' : '';
+my $cols = $opt{'cols'} ? 'COLS="'.$opt{'cols'}.'"' : '';
+
+my $cell_style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : '';
+my $curr_value = $opt{'curr_value'};
+
+</%init>
diff --git a/httemplate/elements/tr-title.html b/httemplate/elements/tr-title.html
index 8517737..f2d269e 100644
--- a/httemplate/elements/tr-title.html
+++ b/httemplate/elements/tr-title.html
@@ -1,5 +1,10 @@
<TR>
- <TD BGCOLOR="#e8e8e8" COLSPAN=2>&nbsp;</TD>
+ <TD BGCOLOR="#e8e8e8" COLSPAN=<% $opt{colspan} || 2 %>>&nbsp;</TD>
</TR>
<% include('tr-justtitle.html', @_) %>
+<%init>
+
+my %opt = @_;
+
+</%init>
diff --git a/httemplate/elements/xmenu.css b/httemplate/elements/xmenu.css
index 97c7da8..33ad90c 100644
--- a/httemplate/elements/xmenu.css
+++ b/httemplate/elements/xmenu.css
@@ -128,6 +128,8 @@
padding: 1px 5px 1px 5px;
+ font-size: 14px;
+
/* color: black; */
color: white;
text-decoration: none;
diff --git a/httemplate/elements/xmenu.top.css b/httemplate/elements/xmenu.top.css
index 7591703..e86e4a6 100644
--- a/httemplate/elements/xmenu.top.css
+++ b/httemplate/elements/xmenu.top.css
@@ -125,6 +125,8 @@
padding: 1px 5px 1px 5px;
+ font-size: 16px;
+
/* color: black; */
color: white;
text-decoration: none;