diff options
Diffstat (limited to 'httemplate/elements')
32 files changed, 1081 insertions, 1038 deletions
diff --git a/httemplate/elements/checkboxes-table-name.html b/httemplate/elements/checkboxes-table-name.html index 8e9dd29d2..0a92e4548 100644 --- a/httemplate/elements/checkboxes-table-name.html +++ b/httemplate/elements/checkboxes-table-name.html @@ -1,85 +1,85 @@ -<% - - ## - # required - ## - # 'link_table' => 'table_name', - # - # 'name_col' => 'name_column', - # #or - # 'name_callback' => sub { }, - # - # 'names_list' => [ 'value', 'other value' ], - # - ## - # recommended (required?) - ## - # 'source_obj' => $obj, - # #or? - # #'source_table' => 'table_name', - # #'sourcenum' => '4', #current value of primary key in source_table - # # # (none is okay, just pass it if you have it) - ## - # optional - ## - # 'num_col' => 'col_name' #if column name is different in link_table than - # #source_table - # 'link_static' => { 'column' => 'value' }, - - my( %opt ) = @_; - - my( $source_pkey, $sourcenum, $source_obj ); - if ( $opt{'source_obj'} ) { - - $source_obj = $opt{'source_obj'}; - #$source_table = $source_obj->dbdef_table->table; - $source_pkey = $source_obj->dbdef_table->primary_key; - $sourcenum = $source_obj->$source_pkey(); - - } else { - - #$source_obj? - $source_pkey = $opt{'source_table'} - ? dbdef->table($opt{'source_table'})->primary_key - : ''; - $sourcenum = $opt{'sourcenum'}; - } - - $source_pkey = $opt{'num_col'} || $source_pkey; - - my $link_static = $opt{'link_static'} || {}; - -%> - -<% foreach my $name ( @{ $opt{'names_list'} } ) { - - my $checked; - if ( $cgi->param('error') ) { - - $checked = $cgi->param($opt{'link_table'}. ".$name" ) - ? 'CHECKED' - : ''; - - } else { - - $checked = - qsearchs( $opt{'link_table'}, { - $source_pkey => $sourcenum, - $opt{'name_col'} => $name, - %$link_static, - } ) - ? 'CHECKED' - : '' - - } - -%> - - <INPUT TYPE="checkbox" NAME="<%= $opt{'link_table'}. ".$name" %>" <%= $checked %> VALUE="ON"> - - <%= $name %> +% +% +% ## +% # required +% ## +% # 'link_table' => 'table_name', +% # +% # 'name_col' => 'name_column', +% # #or +% # 'name_callback' => sub { }, +% # +% # 'names_list' => [ 'value', 'other value' ], +% # +% ## +% # recommended (required?) +% ## +% # 'source_obj' => $obj, +% # #or? +% # #'source_table' => 'table_name', +% # #'sourcenum' => '4', #current value of primary key in source_table +% # # # (none is okay, just pass it if you have it) +% ## +% # optional +% ## +% # 'num_col' => 'col_name' #if column name is different in link_table than +% # #source_table +% # 'link_static' => { 'column' => 'value' }, +% +% my( %opt ) = @_; +% +% my( $source_pkey, $sourcenum, $source_obj ); +% if ( $opt{'source_obj'} ) { +% +% $source_obj = $opt{'source_obj'}; +% #$source_table = $source_obj->dbdef_table->table; +% $source_pkey = $source_obj->dbdef_table->primary_key; +% $sourcenum = $source_obj->$source_pkey(); +% +% } else { +% +% #$source_obj? +% $source_pkey = $opt{'source_table'} +% ? dbdef->table($opt{'source_table'})->primary_key +% : ''; +% $sourcenum = $opt{'sourcenum'}; +% } +% +% $source_pkey = $opt{'num_col'} || $source_pkey; +% +% my $link_static = $opt{'link_static'} || {}; +% +% +% foreach my $name ( @{ $opt{'names_list'} } ) { +% +% my $checked; +% if ( $cgi->param('error') ) { +% +% $checked = $cgi->param($opt{'link_table'}. ".$name" ) +% ? 'CHECKED' +% : ''; +% +% } else { +% +% $checked = +% qsearchs( $opt{'link_table'}, { +% $source_pkey => $sourcenum, +% $opt{'name_col'} => $name, +% %$link_static, +% } ) +% ? 'CHECKED' +% : '' +% +% } +% +% + + + <INPUT TYPE="checkbox" NAME="<% $opt{'link_table'}. ".$name" %>" <% $checked %> VALUE="ON"> + + <% $name %> <BR> +% } -<% } %> diff --git a/httemplate/elements/checkboxes-table.html b/httemplate/elements/checkboxes-table.html index 16376fa3d..cdfa58eca 100644 --- a/httemplate/elements/checkboxes-table.html +++ b/httemplate/elements/checkboxes-table.html @@ -1,122 +1,123 @@ -<% +% +% +% ## +% # required +% ## +% # 'target_table' => 'table_name', +% # 'link_table' => 'table_name', +% # +% # 'name_col' => 'name_column', +% # #or +% # 'name_callback' => sub { }, +% # +% ## +% # recommended (required?) +% ## +% # 'source_obj' => $obj, +% # #or? +% # #'source_table' => 'table_name', +% # #'sourcenum' => '4', #current value of primary key in source_table +% # # # (none is okay, just pass it if you have it) +% ## +% # optional +% ## +% # 'disable-able' => 1, +% +% my( %opt ) = @_; +% +% my $target_pkey = dbdef->table($opt{'target_table'})->primary_key; +% +% my( $source_pkey, $sourcenum, $source_obj ); +% if ( $opt{'source_obj'} ) { +% +% $source_obj = $opt{'source_obj'}; +% #$source_table = $source_obj->dbdef_table->table; +% $source_pkey = $source_obj->dbdef_table->primary_key; +% $sourcenum = $source_obj->$source_pkey(); +% +% } else { +% +% #$source_obj? +% $source_pkey = $opt{'source_table'} +% ? dbdef->table($opt{'source_table'})->primary_key +% : ''; +% $sourcenum = $opt{'sourcenum'}; +% } +% +% my $hashref = $opt{'hashref'} || {}; +% +% my $extra_sql = ''; +% +% if ( $opt{'disable-able'} ) { +% $hashref->{'disabled'} = ''; +% +% $extra_sql .= ( $sourcenum && $source_pkey ) +% ? "OR $source_pkey = $sourcenum" +% : ''; +% } +% +% +% foreach my $target_obj ( +% qsearch({ 'table' => $opt{'target_table'}, +% 'hashref' => $hashref, +% 'select' => $opt{'target_table'}. '.*', +% 'addl_from' => "LEFT JOIN $opt{'link_table'} USING ( $target_pkey )", +% 'extra_sql' => $extra_sql, +% }) +% ) { +% +% my $targetnum = $target_obj->$target_pkey(); +% +% my $checked; +% if ( $cgi->param('error') ) { +% +% $checked = $cgi->param($target_pkey.$targetnum) +% ? 'CHECKED' +% : ''; +% +% } else { +% +% $checked = qsearchs( $opt{'link_table'}, { +% $source_pkey => $sourcenum, +% $target_pkey => $targetnum, +% } ) +% ? 'CHECKED' +% : '' +% +% } +% +% + + + <INPUT TYPE="checkbox" NAME="<% $target_pkey. $targetnum %>" <% $checked %> VALUE="ON"> +% if ( $opt{'target_link'} ) { + + + <A HREF="<% $opt{'target_link'} %><% $targetnum %>"> +% +% +% } +% +<% $targetnum %>: +% if ( $opt{'name_callback'} ) { + + + <% &{ $opt{'name_callback'} }( $target_obj ) %><% $opt{'target_link'} ? '</A>' : '' %> +% } else { +% my $name_col = $opt{'name_col'}; +% + + + <% $target_obj->$name_col() %><% $opt{'target_link'} ? '</A>' : '' %> +% } +% if ( $opt{'disable-able'} ) { + + + <% $target_obj->disabled =~ /^Y/i ? ' (DISABLED)' : '' %> +% } - ## - # required - ## - # 'target_table' => 'table_name', - # 'link_table' => 'table_name', - # - # 'name_col' => 'name_column', - # #or - # 'name_callback' => sub { }, - # - ## - # recommended (required?) - ## - # 'source_obj' => $obj, - # #or? - # #'source_table' => 'table_name', - # #'sourcenum' => '4', #current value of primary key in source_table - # # # (none is okay, just pass it if you have it) - ## - # optional - ## - # 'disable-able' => 1, - - my( %opt ) = @_; - - my $target_pkey = dbdef->table($opt{'target_table'})->primary_key; - - my( $source_pkey, $sourcenum, $source_obj ); - if ( $opt{'source_obj'} ) { - - $source_obj = $opt{'source_obj'}; - #$source_table = $source_obj->dbdef_table->table; - $source_pkey = $source_obj->dbdef_table->primary_key; - $sourcenum = $source_obj->$source_pkey(); - - } else { - - #$source_obj? - $source_pkey = $opt{'source_table'} - ? dbdef->table($opt{'source_table'})->primary_key - : ''; - $sourcenum = $opt{'sourcenum'}; - } - - my $hashref = $opt{'hashref'} || {}; - - my $extra_sql = ''; - - if ( $opt{'disable-able'} ) { - $hashref->{'disabled'} = ''; - - $extra_sql .= ( $sourcenum && $source_pkey ) - ? "OR $source_pkey = $sourcenum" - : ''; - } - -%> - -<% foreach my $target_obj ( - qsearch({ 'table' => $opt{'target_table'}, - 'hashref' => $hashref, - 'select' => $opt{'target_table'}. '.*', - 'addl_from' => "LEFT JOIN $opt{'link_table'} USING ( $target_pkey )", - 'extra_sql' => $extra_sql, - }) - ) { - - my $targetnum = $target_obj->$target_pkey(); - - my $checked; - if ( $cgi->param('error') ) { - - $checked = $cgi->param($target_pkey.$targetnum) - ? 'CHECKED' - : ''; - - } else { - - $checked = qsearchs( $opt{'link_table'}, { - $source_pkey => $sourcenum, - $target_pkey => $targetnum, - } ) - ? 'CHECKED' - : '' - - } - -%> - - <INPUT TYPE="checkbox" NAME="<%= $target_pkey. $targetnum %>" <%= $checked %> VALUE="ON"> - - <% if ( $opt{'target_link'} ) { %> - - <A HREF="<%= $opt{'target_link'} %><%= $targetnum %>"><% - - } - %><%= $targetnum %>: - - <% if ( $opt{'name_callback'} ) { %> - - <%= &{ $opt{'name_callback'} }( $target_obj ) %><%= $opt{'target_link'} ? '</A>' : '' %> - - <% } else { - my $name_col = $opt{'name_col'}; - %> - - <%= $target_obj->$name_col() %><%= $opt{'target_link'} ? '</A>' : '' %> - - <% } %> - - <% if ( $opt{'disable-able'} ) { %> - - <%= $target_obj->disabled =~ /^Y/i ? ' (DISABLED)' : '' %> - - <% } %> <BR> +% } -<% } %> diff --git a/httemplate/elements/header-popup.html b/httemplate/elements/header-popup.html index 73377abfe..43d9bc3af 100644 --- a/httemplate/elements/header-popup.html +++ b/httemplate/elements/header-popup.html @@ -1,22 +1,23 @@ -<% - 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; -%> +% +% 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> <TITLE> - <%= $title %> + <% $title %> </TITLE> <META HTTP-Equiv="Cache-Control" Content="no-cache"> <META HTTP-Equiv="Pragma" Content="no-cache"> <META HTTP-Equiv="Expires" Content="0"> - <%= $head %> + <% $head %> </HEAD> - <BODY BGCOLOR="#e8e8e8" <%= $etc %>> + <BODY BGCOLOR="#e8e8e8" <% $etc %>> <FONT SIZE=6> - <CENTER><%= $title %></CENTER> + <CENTER><% $title %></CENTER> </FONT> <BR><!--<BR>--> diff --git a/httemplate/elements/header.html b/httemplate/elements/header.html index ea8c418c3..ca74ca5b9 100644 --- a/httemplate/elements/header.html +++ b/httemplate/elements/header.html @@ -1,21 +1,22 @@ -<% - my($title, $menubar) = ( shift, shift ); - 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; +% +% my($title, $menubar) = ( shift, shift ); +% 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> <TITLE> - <%= $title %> + <% $title %> </TITLE> <META HTTP-Equiv="Cache-Control" Content="no-cache"> <META HTTP-Equiv="Pragma" Content="no-cache"> <META HTTP-Equiv="Expires" Content="0"> - <%= include('menu.html', 'freeside_baseurl' => $fsurl ) %> + <% include('menu.html', 'freeside_baseurl' => $fsurl ) %> <SCRIPT TYPE="text/javascript"> function clearhint_search_cust (what) { @@ -39,17 +40,17 @@ } </SCRIPT> - <%= $head %> + <% $head %> </HEAD> - <BODY BACKGROUND="<%=$fsurl%>images/background-cheat.png" <%= $etc %> STYLE="margin-top:0; margin-bottom:0; margin-left:0; margin-right:0"> + <BODY BACKGROUND="<%$fsurl%>images/background-cheat.png" <% $etc %> 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%>images/small-logo.png"></td> + <td rowspan=2 BGCOLOR="#ffffff"><IMG BORDER=0 ALT="freeside" SRC="<%$fsurl%>images/small-logo.png"></td> <td align=left rowspan=2 BGCOLOR="#ffffff"> <!-- valign="top" --> - <font size=6><%= $conf->config('company_name') || 'ExampleCo' %></font> + <font size=6><% $conf->config('company_name') || 'ExampleCo' %></font> </td> - <td align=right valign=top BGCOLOR="#ffffff"><FONT SIZE="-1">Logged in as <b><%= getotaker %> </b><br></FONT><FONT SIZE="-2"><a href="<%=$fsurl%>pref/XXXwritethis">Preferences</a> <BR></FONT> + <td align=right valign=top BGCOLOR="#ffffff"><FONT SIZE="-1">Logged in as <b><% getotaker %> </b><br></FONT><FONT SIZE="-2"><a href="<%$fsurl%>pref/XXXwritethis">Preferences</a> <BR></FONT> </td> </tr> <tr> @@ -59,20 +60,22 @@ <tr> <td align=right BGCOLOR="#ffffff"> <FONT SIZE="-2"> - <A HREF="http://www.sisd.com/freeside">Freeside</A> v<%= $FS::VERSION %><BR> - <A HREF="<%= $fsurl %>docs/">Documentation</A><BR> + <A HREF="http://www.sisd.com/freeside">Freeside</A> v<% $FS::VERSION %><BR> + <A HREF="<% $fsurl %>docs/">Documentation</A><BR> </FONT> </td> - <% if ( $conf->config('ticket_system') eq 'RT_Internal' ) { %> - <% eval "use RT;"; %> +% 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">RT<A> v<%= $RT::VERSION %><BR> + <A HREF="http://www.bestpractical.com/rt">RT<A> v<% $RT::VERSION %><BR> <A HREF="http://wiki.bestpractical.com/">Documentation</A><BR> </FONT> </td> - <% } %> +% } + </tr> </table> @@ -115,50 +118,54 @@ input.fsblackbuttonselected { <TABLE WIDTH="100%" CELLSPACING=0 CELLPADDING=0> <TR> - <TD COLSPAN=5 WIDTH="100%" STYLE="padding:0"><IMG BORDER=0 ALT="" SRC="<%=$fsurl%>images/black-gradient.png" HEIGHT="13" WIDTH="100%"></TD> + <TD COLSPAN=5 WIDTH="100%" STYLE="padding:0"><IMG BORDER=0 ALT="" SRC="<%$fsurl%>images/black-gradient.png" HEIGHT="13" WIDTH="100%"></TD> </TR> <TR> <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right"> - <FORM ACTION="<%=$fsurl%>edit/cust_main.cgi" METHOD="GET" STYLE="margin:0"> + <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"> </FORM> </TD> <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right"> - <FORM ACTION="<%=$fsurl%>search/cust_main.cgi" METHOD="GET" STYLE="margin:0"> + <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/cust_main.html" STYLE="color: #000000; font-size: 70%">Advanced</A> + <A HREF="<%$fsurl%>search/cust_main.html" STYLE="color: #000000; 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%"> </FORM> </TD> <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right"> - <% if ( $FS::CurrentUser::CurrentUser->access_right('View invoices') ) { %> - <FORM ACTION="<%=$fsurl%>search/cust_bill.html" METHOD="GET" STYLE="margin:0;display:inline"> +% if ( $FS::CurrentUser::CurrentUser->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"> - <% if ( $FS::CurrentUser::CurrentUser->access_right('List invoices') ) { %> - <A HREF="<%=$fsurl%>search/report_cust_bill.html" STYLE="color: #ffffff; font-size: 70%">Advanced</A> - <% } %> +% if ( $FS::CurrentUser::CurrentUser->access_right('List invoices') ) { + + <A HREF="<%$fsurl%>search/report_cust_bill.html" STYLE="color: #ffffff; font-size: 70%">Advanced</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%"> </FORM> - <% } %> +% } + </TD> <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right"> - <FORM ACTION="<%=$fsurl%>search/svc_Smart.html" METHOD="GET" STYLE="margin:0"> + <FORM ACTION="<%$fsurl%>search/svc_Smart.html" METHOD="GET" STYLE="margin:0"> <INPUT NAME="search_svc" TYPE="text" VALUE="(user, user@domain or domain)" SIZE="26" onFocus="clearhint_search_svc(this);" onClick="clearhint_search_svc(this);" STYLE="vertical-align:bottom;text-align:right"><BR> - <A HREF="<%=$fsurl%>search/svc_Smarter.html" STYLE="color: #000000; font-size: 70%">Advanced</A> + <A HREF="<%$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%"> </FORM> </TD> <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right" STYLE="padding-right:4px"> - <FORM ACTION="<%=$fsurl%>rt/index.html" METHOD="GET" STYLE="margin:0"> + <FORM ACTION="<%$fsurl%>rt/index.html" METHOD="GET" STYLE="margin:0"> <INPUT NAME="q" TYPE="text" VALUE="(ticket # or subject string)" onFocus="clearhint_search_ticket(this);" onClick="clearhint_search_ticket(this);" STYLE="vertical-align:bottom;text-align:right"><BR> - <A HREF="<%=$fsurl%>rt/Search/Build.html" STYLE="color: #ffffff; font-size: 70%">Advanced</A> + <A HREF="<%$fsurl%>rt/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"> </FORM> </TD> @@ -168,8 +175,8 @@ input.fsblackbuttonselected { <TABLE WIDTH="100%" HEIGHT="100%" CELLSPACING=0 CELLPADDING=4> <TR> <TD BGCOLOR="#000000" STYLE="padding:0" WIDTH="154"></TD> - <TD STYLE="padding:0" WIDTH="13"><IMG BORDER=0 ALT="" SRC="<%=$fsurl%>images/black-gray-corner.png"></TD> - <TD STYLE="padding:0"><IMG BORDER=0 ALT="" SRC="<%=$fsurl%>images/black-gray-top.png" HEIGHT="13" WIDTH="100%"></TD> + <TD STYLE="padding:0" WIDTH="13"><IMG BORDER=0 ALT="" SRC="<%$fsurl%>images/black-gray-corner.png"></TD> + <TD STYLE="padding:0"><IMG BORDER=0 ALT="" SRC="<%$fsurl%>images/black-gray-top.png" HEIGHT="13" WIDTH="100%"></TD> </TR> <TR HEIGHT="100%"> <TD BGCOLOR="#000000" ALIGN="left" HEIGHT="100%" WIDTH="154" VALIGN="top" ALIGN="right"> @@ -177,15 +184,15 @@ input.fsblackbuttonselected { document.write(myBar); </SCRIPT> <BR> - <IMG SRC="<%=$fsurl%>images/32clear.gif" HEIGHT="1" WIDTH="154"> + <IMG SRC="<%$fsurl%>images/32clear.gif" HEIGHT="1" WIDTH="154"> </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> + <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> <TD BGCOLOR="#e8e8e8" HEIGHT="100%"> <!-- WIDTH="100%"> --> <FONT SIZE=6> - <%= $title %> + <% $title %> </FONT> <BR><BR> - <%= $menubar !~ /^\s*$/ ? "$menubar<BR><BR>" : '' %> + <% $menubar !~ /^\s*$/ ? "$menubar<BR><BR>" : '' %> diff --git a/httemplate/elements/jsrsServer.html b/httemplate/elements/jsrsServer.html index fd6dc5465..f37b0aaee 100644 --- a/httemplate/elements/jsrsServer.html +++ b/httemplate/elements/jsrsServer.html @@ -1,3 +1,4 @@ -<% - my $server = new FS::UI::Web::JSRPC '', $cgi; -%><%= $server->process %> +% +% my $server = new FS::UI::Web::JSRPC '', $cgi; +% +<% $server->process %> diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index a5b41aefd..f05866046 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -1,329 +1,330 @@ -<% - my( %opt ) = @_; - my $conf = new FS::Conf; - my $fsurl = $opt{'freeside_baseurl'}; - - my $curuser = $FS::CurrentUser::CurrentUser; - - #Active tickets not assigned to a customer - - tie my %report_customers_lists, 'Tie::IxHash', - 'by customer number' => [ $fsurl. 'search/cust_main.cgi?browse=custnum', '' ], - 'by last name' => [ $fsurl. 'search/cust_main.cgi?browse=last', '' ], - 'by company name' => [ $fsurl. 'search/cust_main.cgi?browse=company', '' ], - 'by active trouble tickets' => [ $fsurl. 'search/cust_main.cgi?browse=tickets', '' ], - ; - - tie my %report_customers_search, 'Tie::IxHash', - 'by ordering employee' => [ $fsurl. 'search/cust_main-otaker.cgi' ], - ; - - tie my %report_customers, 'Tie::IxHash', - 'List customers' => [ \%report_customers_lists, 'List customers' ], - 'Search customers' => [ \%report_customers_search, 'Search customers' ], - 'Zip code distribution' => [ $fsurl.'search/report_cust_main-zip.html', 'Zip codes by number of customers' ], - ; - - tie my %report_invoices_open, 'Tie::IxHash', - 'All open invoices' => [ $fsurl.'search/cust_bill.html?OPEN_date', 'All invoices with an unpaid balance' ], - '15 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN15_date', 'Invoices 15 days or older with an unpaid balance' ], - '30 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN30_date', 'Invoices 30 days or older with an unpaid balance' ], - '60 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN60_date', 'Invoices 60 days or older with an unpaid balance' ], - '90 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN90_date', 'Invoices 90 days or older with an unpaid balance' ], - '120 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN120_date', 'Invoices 120 days or older with an unpaid balance' ], - ; - - tie my %report_invoices, 'Tie::IxHash', - 'Open invoices' => [ \%report_invoices_open, 'Open invoices' ], - 'All invoices' => [ $fsurl. 'search/cust_bill.html?date', 'List all invoices' ], - 'Advanced invoice reports' => [ $fsurl.'search/report_cust_bill.html', 'by agent, date range, etc.' ], - ; - - tie my %report_services_acct, 'Tie::IxHash', - 'All accounts by username' => [ $fsurl.'search/svc_acct.cgi?username', '' ], - 'All accounts by UID' => [ $fsurl.'search/svc_acct.cgi?uid', '' ], - ; - $report_services_acct{'Unlinked accounts'} = [ $fsurl.'search/svc_acct.cgi?UN_uid', 'Pre-Freeside accounts without a customer record' ] - if $curuser->access_right('View/link unlinked services'); - - tie my %report_services_domain, 'Tie::IxHash', - 'All domains' => [ $fsurl.'search/svc_domain.cgi?domain', '' ], - ; - $report_services_domain{'Unlinked domains'} = [ $fsurl.'search/svc_domain.cgi?UN_domain', 'Pre-Freeside domains without a customer record' ] - if $curuser->access_right('View/link unlinked services'); - - tie my %report_services_forward, 'Tie::IxHash', - 'All mail forwards' => [ $fsurl.'search/svc_forward.cgi?svcnum', '' ], - ; - $report_services_forward{'Unlinked mail forwards'} = [ $fsurl.'search/svc_forward.cgi?UN_svcnum', 'Pre-Freeside mail forwards without a customer record' ] - if $curuser->access_right('View/link unlinked services'); - - tie my %report_services_www, 'Tie::IxHash', - 'All virtual hosts' => [ $fsurl.'search/svc_www.cgi?svcnum', '' ], - ; - $report_services_www{'Unlinked virtual hosts'} = [ $fsurl.'search/svc_www.cgi?UN_svcnum', 'Pre-Freeside virtual hosts without a customer record' ] - if $curuser->access_right('View/link unlinked services'); - - tie my %report_services_broadband, 'Tie::IxHash', - 'All broadband services' => [ $fsurl.'search/svc_broadband.cgi?svcnum', '' ], - #'Unlinked domain' => [ $fsurl.'search/svc_acct.cgi?UN_uid', 'Pre-Freeside domains without a customer record' ], - ; - - tie my %report_services_phone, 'Tie::IxHash', - 'All phone numbers' => [ $fsurl.'search/svc_phone.cgi?svcnum', '' ], - ; - - tie my %report_services_external, 'Tie::IxHash', - 'All external services' => [ $fsurl.'search/svc_external.cgi?id', '' ], - ; - $report_services_external{'Unlinked external services'} = [ $fsurl.'search/svc_external.cgi?UN_id', 'Pre-Freeside domains without a customer record' ] - if $curuser->access_right('View/link unlinked services'); - - tie my %report_services, 'Tie::IxHash'; - if ( $curuser->access_right('Configuration') ) { - $report_services{'Service definitions'} = [ $fsurl.'browse/part_svc.cgi?orderby=active', 'Service definitions by number of active packages' ]; - $report_services{'separator'} = ''; - } - $report_services{'Accounts'} = [ \%report_services_acct, 'Access accounts and mailboxes' ]; - $report_services{'Domains'} = [ \%report_services_domain, 'Domains', ]; - $report_services{'Mail forwards'} = [ \%report_services_forward, 'Mail forwards', ]; - $report_services{'Virtual hosts'} = [ \%report_services_www, 'Virtual hosting', ]; - $report_services{'Broadband services'} = [ \%report_services_broadband, 'Fixed (username-less) broadband services', ]; - $report_services{'Phone numbers'} = [ \%report_services_phone, 'Telephone numbers', ]; - $report_services{'External services'} = [ \%report_services_external, 'External services', ]; - - tie my %report_packages, 'Tie::IxHash'; - if ( $curuser->access_right('Configuration') ) { - $report_packages{'Package definitions'} = [ $fsurl.'browse/part_pkg.cgi?active=1', 'Package definitions by number of active packages' ]; - $report_packages{'separator'} = ''; - } - $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{'Advanced package reports'} = [ $fsurl.'search/report_cust_pkg.html', 'by agent, date range, status, package definition' ]; - - tie my %report_rating, 'Tie::IxHash', - 'Call Detail Records (CDRs)' => [ $fsurl.'search/report_cdr.html', '' ], - ; - - 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', 'Credit report (by type and/or date range)' ], - 'A/R Aging' => [ $fsurl.'search/report_receivables.html', 'Accounts Receivable Aging report' ], - 'Prepaid Income' => [ $fsurl.'search/report_prepaid_income.html', 'Prepaid income (unearned revenue) report' ], - 'Sales Tax Liability' => [ $fsurl.'search/report_tax.html', 'Sales tax liability report' ], - ; - - 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{'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{'Rating data'} = [ \%report_rating, 'Rating reports' ] - if $curuser->access_right('List rating data'); - $report_menu{'Financial'} = [ \%report_financial, 'Financial reports' ] - if $curuser->access_right('Financial reports'); - - tie my %tools_importing, 'Tie::IxHash', - 'Import customers from CSV file' => [ $fsurl.'misc/cust_main-import.cgi', '' ], - 'Import one-time charges from CSV file' => [ $fsurl.'misc/cust_main-import_charges.cgi', '' ], - 'Import Call Detail Records (CDRs) from CSV file' => [ $fsurl.'misc/cdr-import.html', '' ], - ; - - tie my %tools_exporting, 'Tie::IxHash', - 'Download database dump' => [ $fsurl. 'misc/dump.cgi', '' ], - ; - - # <!-- <BR>View active NAS ports: - # <A HREF="browse/nas.cgi">session server</A> --> - # <!-- or <A HREF="browse/nas-sqlradius.cgi">RADIUS</A> - # <BR> --> - - 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'); - $tools_menu{'Job Queue'} = [ $fsurl.'search/queue.html', 'View pending job queue' ] - if $curuser->access_right('Job queue'); - $tools_menu{'Importing'} = [ \%tools_importing, 'Import tools' ] - if $curuser->access_right('Import'); - $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' ], - ; - - tie my %config_export_svc_pkg, 'Tie::IxHash', - 'View/Edit exports' => [ $fsurl.'browse/part_export.cgi', 'Provisioning services to external machines, databases and APIs' ], - 'View/Edit service definitions' => [ $fsurl.'browse/part_svc.cgi', 'Services are items you offer to your customers' ], - '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' ], - 'View/Edit package classes' => [ $fsurl.'browse/pkg_class.html', 'Package classes define groups of packages, for reporting and convenience purposes.' ], - ; - - 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)' ], - ; - - tie my %config_billing, 'Tie::IxHash', - 'View/Edit payment gateways' => [ $fsurl.'browse/payment_gateway.html', 'Credit card and electronic check processors' ], - 'View/Edit invoice events' => [ $fsurl.'browse/part_bill_event.cgi', 'Actions for overdue invoices' ], - 'View/Edit prepaid cards' => [ $fsurl.'search/prepay_credit.html', 'View outstanding cards, generate new cards' ], - 'View/Edit call rates and regions' => [ $fsurl.'browse/rate.cgi', 'Manage rate plans, regions and prefixes for VoIP and call billing' ], - 'View/Edit locales and tax rates' => [ $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' ], - ; - - tie my %config_dialup, 'Tie::IxHash', - 'View/Edit 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' ], - ; - - 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' ] - if $curuser->access_right('Configuration') - || $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' ]; - } - - tie my %config_menu, 'Tie::IxHash'; - if ( $curuser->access_right('Configuration' ) ) { - %config_menu = ( - 'Settings' => [ $fsurl.'config/config-view.cgi', '' ], - 'separator' => '', #its a separator! - 'Employees' => [ \%config_employees, '' ], - 'Provisioning, services and packages' - => [ \%config_export_svc_pkg, '' ], - 'Resellers' => [ \%config_agent, '' ], - 'Billing' => [ \%config_billing, '' ], - 'Dialup' => [ \%config_dialup, '' ], - 'Fixed (username-less) broadband' - => [ \%config_broadband, '' ], - ); - } - $config_menu{'Miscellaneous'} = [ \%config_misc, '' ] - if $curuser->access_right('Configuration') - || $curuser->access_right('Edit advertising sources') - || $curuser->access_right('Edit global advertising sources'); - - tie my %menu, 'Tie::IxHash', - 'Billing Main' => [ $fsurl, 'Billing start page', ], - 'Ticketing Main' => [ - ( $conf->config('ticket_system') eq 'RT_External' - ? FS::TicketSystem->baseurl() - : $fsurl.'rt/' - ), - 'Ticketing start page', - ], - ; - $menu{'Reports'} = [ \%report_menu, 'Lists, reporting and graphing' ] - if keys %report_menu; - $menu{'Tools'} = [ \%tools_menu, 'Tools' ] - if keys %tools_menu; - $menu{'Configuration'} = [ \%config_menu, 'Configuraiton and setup' ] - if $curuser->access_right('Configuration') - || $curuser->access_right('Edit advertising sources') - || $curuser->access_right('Edit global advertising sources'); - - use vars qw($gmenunum); - $gmenunum = 0; - - sub submenu { - my($submenu, $title) = @_; - my $menunum = $gmenunum++; - - #return two args: html, menuname - - "var myMenu$menunum = new WebFXMenu;\n". - #"myMenu$menunum.useAutoPosition = true;\n". - "myMenu$menunum.emptyText = '$title';\n". - - ( - join("\n", map { - - if ( !ref( $submenu->{$_} ) ) { - - "myMenu$menunum.add(new WebFXMenuSeparator());"; - - } else { - - my($url_or_submenu, $tooltip ) = @{ $submenu->{$_} }; - if ( ref($url_or_submenu) ) { - - my($subhtml, $submenuname ) = submenu($url_or_submenu, $_); #mmm, recursion - - "$subhtml\n". - "myMenu$menunum.add(new WebFXMenuItem(\"$_\", null, \"$tooltip\", $submenuname ));"; - - } else { - - "myMenu$menunum.add(new WebFXMenuItem(\"$_\", \"$url_or_submenu\", \"$tooltip\" ));"; - - } - - } - - } keys %$submenu ) - ). "\n". - "myMenu$menunum.width = 224\n", - - "myMenu$menunum"; - - } - -%> - -<script type="text/javascript" src="<%=$fsurl%>elements/cssexpr.js"></script> -<script type="text/javascript" src="<%=$fsurl%>elements/xmenu.js"></script> -<link href="<%=$fsurl%>elements/xmenu.css" type="text/css" rel="stylesheet"> -<link href="<%=$fsurl%>elements/freeside.css" type="text/css" rel="stylesheet"> +% +% my( %opt ) = @_; +% my $conf = new FS::Conf; +% my $fsurl = $opt{'freeside_baseurl'}; +% +% my $curuser = $FS::CurrentUser::CurrentUser; +% +% #Active tickets not assigned to a customer +% +% tie my %report_customers_lists, 'Tie::IxHash', +% 'by customer number' => [ $fsurl. 'search/cust_main.cgi?browse=custnum', '' ], +% 'by last name' => [ $fsurl. 'search/cust_main.cgi?browse=last', '' ], +% 'by company name' => [ $fsurl. 'search/cust_main.cgi?browse=company', '' ], +% 'by active trouble tickets' => [ $fsurl. 'search/cust_main.cgi?browse=tickets', '' ], +% ; +% +% tie my %report_customers_search, 'Tie::IxHash', +% 'by ordering employee' => [ $fsurl. 'search/cust_main-otaker.cgi' ], +% ; +% +% tie my %report_customers, 'Tie::IxHash', +% 'List customers' => [ \%report_customers_lists, 'List customers' ], +% 'Search customers' => [ \%report_customers_search, 'Search customers' ], +% 'Zip code distribution' => [ $fsurl.'search/report_cust_main-zip.html', 'Zip codes by number of customers' ], +% ; +% +% tie my %report_invoices_open, 'Tie::IxHash', +% 'All open invoices' => [ $fsurl.'search/cust_bill.html?OPEN_date', 'All invoices with an unpaid balance' ], +% '15 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN15_date', 'Invoices 15 days or older with an unpaid balance' ], +% '30 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN30_date', 'Invoices 30 days or older with an unpaid balance' ], +% '60 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN60_date', 'Invoices 60 days or older with an unpaid balance' ], +% '90 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN90_date', 'Invoices 90 days or older with an unpaid balance' ], +% '120 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN120_date', 'Invoices 120 days or older with an unpaid balance' ], +% ; +% +% tie my %report_invoices, 'Tie::IxHash', +% 'Open invoices' => [ \%report_invoices_open, 'Open invoices' ], +% 'All invoices' => [ $fsurl. 'search/cust_bill.html?date', 'List all invoices' ], +% 'Advanced invoice reports' => [ $fsurl.'search/report_cust_bill.html', 'by agent, date range, etc.' ], +% ; +% +% tie my %report_services_acct, 'Tie::IxHash', +% 'All accounts by username' => [ $fsurl.'search/svc_acct.cgi?username', '' ], +% 'All accounts by UID' => [ $fsurl.'search/svc_acct.cgi?uid', '' ], +% ; +% $report_services_acct{'Unlinked accounts'} = [ $fsurl.'search/svc_acct.cgi?UN_uid', 'Pre-Freeside accounts without a customer record' ] +% if $curuser->access_right('View/link unlinked services'); +% +% tie my %report_services_domain, 'Tie::IxHash', +% 'All domains' => [ $fsurl.'search/svc_domain.cgi?domain', '' ], +% ; +% $report_services_domain{'Unlinked domains'} = [ $fsurl.'search/svc_domain.cgi?UN_domain', 'Pre-Freeside domains without a customer record' ] +% if $curuser->access_right('View/link unlinked services'); +% +% tie my %report_services_forward, 'Tie::IxHash', +% 'All mail forwards' => [ $fsurl.'search/svc_forward.cgi?svcnum', '' ], +% ; +% $report_services_forward{'Unlinked mail forwards'} = [ $fsurl.'search/svc_forward.cgi?UN_svcnum', 'Pre-Freeside mail forwards without a customer record' ] +% if $curuser->access_right('View/link unlinked services'); +% +% tie my %report_services_www, 'Tie::IxHash', +% 'All virtual hosts' => [ $fsurl.'search/svc_www.cgi?svcnum', '' ], +% ; +% $report_services_www{'Unlinked virtual hosts'} = [ $fsurl.'search/svc_www.cgi?UN_svcnum', 'Pre-Freeside virtual hosts without a customer record' ] +% if $curuser->access_right('View/link unlinked services'); +% +% tie my %report_services_broadband, 'Tie::IxHash', +% 'All broadband services' => [ $fsurl.'search/svc_broadband.cgi?svcnum', '' ], +% #'Unlinked domain' => [ $fsurl.'search/svc_acct.cgi?UN_uid', 'Pre-Freeside domains without a customer record' ], +% ; +% +% tie my %report_services_phone, 'Tie::IxHash', +% 'All phone numbers' => [ $fsurl.'search/svc_phone.cgi?svcnum', '' ], +% ; +% +% tie my %report_services_external, 'Tie::IxHash', +% 'All external services' => [ $fsurl.'search/svc_external.cgi?id', '' ], +% ; +% $report_services_external{'Unlinked external services'} = [ $fsurl.'search/svc_external.cgi?UN_id', 'Pre-Freeside domains without a customer record' ] +% if $curuser->access_right('View/link unlinked services'); +% +% tie my %report_services, 'Tie::IxHash'; +% if ( $curuser->access_right('Configuration') ) { +% $report_services{'Service definitions'} = [ $fsurl.'browse/part_svc.cgi?orderby=active', 'Service definitions by number of active packages' ]; +% $report_services{'separator'} = ''; +% } +% $report_services{'Accounts'} = [ \%report_services_acct, 'Access accounts and mailboxes' ]; +% $report_services{'Domains'} = [ \%report_services_domain, 'Domains', ]; +% $report_services{'Mail forwards'} = [ \%report_services_forward, 'Mail forwards', ]; +% $report_services{'Virtual hosts'} = [ \%report_services_www, 'Virtual hosting', ]; +% $report_services{'Broadband services'} = [ \%report_services_broadband, 'Fixed (username-less) broadband services', ]; +% $report_services{'Phone numbers'} = [ \%report_services_phone, 'Telephone numbers', ]; +% $report_services{'External services'} = [ \%report_services_external, 'External services', ]; +% +% tie my %report_packages, 'Tie::IxHash'; +% if ( $curuser->access_right('Configuration') ) { +% $report_packages{'Package definitions'} = [ $fsurl.'browse/part_pkg.cgi?active=1', 'Package definitions by number of active packages' ]; +% $report_packages{'separator'} = ''; +% } +% $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{'Advanced package reports'} = [ $fsurl.'search/report_cust_pkg.html', 'by agent, date range, status, package definition' ]; +% +% tie my %report_rating, 'Tie::IxHash', +% 'Call Detail Records (CDRs)' => [ $fsurl.'search/report_cdr.html', '' ], +% ; +% +% 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', 'Credit report (by type and/or date range)' ], +% 'A/R Aging' => [ $fsurl.'search/report_receivables.html', 'Accounts Receivable Aging report' ], +% 'Prepaid Income' => [ $fsurl.'search/report_prepaid_income.html', 'Prepaid income (unearned revenue) report' ], +% 'Sales Tax Liability' => [ $fsurl.'search/report_tax.html', 'Sales tax liability report' ], +% ; +% +% 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{'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{'Rating data'} = [ \%report_rating, 'Rating reports' ] +% if $curuser->access_right('List rating data'); +% $report_menu{'Financial'} = [ \%report_financial, 'Financial reports' ] +% if $curuser->access_right('Financial reports'); +% +% tie my %tools_importing, 'Tie::IxHash', +% 'Import customers from CSV file' => [ $fsurl.'misc/cust_main-import.cgi', '' ], +% 'Import one-time charges from CSV file' => [ $fsurl.'misc/cust_main-import_charges.cgi', '' ], +% 'Import Call Detail Records (CDRs) from CSV file' => [ $fsurl.'misc/cdr-import.html', '' ], +% ; +% +% tie my %tools_exporting, 'Tie::IxHash', +% 'Download database dump' => [ $fsurl. 'misc/dump.cgi', '' ], +% ; +% +% # <!-- <BR>View active NAS ports: +% # <A HREF="browse/nas.cgi">session server</A> --> +% # <!-- or <A HREF="browse/nas-sqlradius.cgi">RADIUS</A> +% # <BR> --> +% +% 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'); +% $tools_menu{'Job Queue'} = [ $fsurl.'search/queue.html', 'View pending job queue' ] +% if $curuser->access_right('Job queue'); +% $tools_menu{'Importing'} = [ \%tools_importing, 'Import tools' ] +% if $curuser->access_right('Import'); +% $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' ], +% ; +% +% tie my %config_export_svc_pkg, 'Tie::IxHash', +% 'View/Edit exports' => [ $fsurl.'browse/part_export.cgi', 'Provisioning services to external machines, databases and APIs' ], +% 'View/Edit service definitions' => [ $fsurl.'browse/part_svc.cgi', 'Services are items you offer to your customers' ], +% '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' ], +% 'View/Edit package classes' => [ $fsurl.'browse/pkg_class.html', 'Package classes define groups of packages, for reporting and convenience purposes.' ], +% ; +% +% 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)' ], +% ; +% +% tie my %config_billing, 'Tie::IxHash', +% 'View/Edit payment gateways' => [ $fsurl.'browse/payment_gateway.html', 'Credit card and electronic check processors' ], +% 'View/Edit invoice events' => [ $fsurl.'browse/part_bill_event.cgi', 'Actions for overdue invoices' ], +% 'View/Edit prepaid cards' => [ $fsurl.'search/prepay_credit.html', 'View outstanding cards, generate new cards' ], +% 'View/Edit call rates and regions' => [ $fsurl.'browse/rate.cgi', 'Manage rate plans, regions and prefixes for VoIP and call billing' ], +% 'View/Edit locales and tax rates' => [ $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' ], +% ; +% +% tie my %config_dialup, 'Tie::IxHash', +% 'View/Edit 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' ], +% ; +% +% 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' ] +% if $curuser->access_right('Configuration') +% || $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' ]; +% } +% +% tie my %config_menu, 'Tie::IxHash'; +% if ( $curuser->access_right('Configuration' ) ) { +% %config_menu = ( +% 'Settings' => [ $fsurl.'config/config-view.cgi', '' ], +% 'separator' => '', #its a separator! +% 'Employees' => [ \%config_employees, '' ], +% 'Provisioning, services and packages' +% => [ \%config_export_svc_pkg, '' ], +% 'Resellers' => [ \%config_agent, '' ], +% 'Billing' => [ \%config_billing, '' ], +% 'Dialup' => [ \%config_dialup, '' ], +% 'Fixed (username-less) broadband' +% => [ \%config_broadband, '' ], +% ); +% } +% $config_menu{'Miscellaneous'} = [ \%config_misc, '' ] +% if $curuser->access_right('Configuration') +% || $curuser->access_right('Edit advertising sources') +% || $curuser->access_right('Edit global advertising sources'); +% +% tie my %menu, 'Tie::IxHash', +% 'Billing Main' => [ $fsurl, 'Billing start page', ], +% 'Ticketing Main' => [ +% ( $conf->config('ticket_system') eq 'RT_External' +% ? FS::TicketSystem->baseurl() +% : $fsurl.'rt/' +% ), +% 'Ticketing start page', +% ], +% ; +% $menu{'Reports'} = [ \%report_menu, 'Lists, reporting and graphing' ] +% if keys %report_menu; +% $menu{'Tools'} = [ \%tools_menu, 'Tools' ] +% if keys %tools_menu; +% $menu{'Configuration'} = [ \%config_menu, 'Configuraiton and setup' ] +% if $curuser->access_right('Configuration') +% || $curuser->access_right('Edit advertising sources') +% || $curuser->access_right('Edit global advertising sources'); +% +% use vars qw($gmenunum); +% $gmenunum = 0; +% +% sub submenu { +% my($submenu, $title) = @_; +% my $menunum = $gmenunum++; +% +% #return two args: html, menuname +% +% "var myMenu$menunum = new WebFXMenu;\n". +% #"myMenu$menunum.useAutoPosition = true;\n". +% "myMenu$menunum.emptyText = '$title';\n". +% +% ( +% join("\n", map { +% +% if ( !ref( $submenu->{$_} ) ) { +% +% "myMenu$menunum.add(new WebFXMenuSeparator());"; +% +% } else { +% +% my($url_or_submenu, $tooltip ) = @{ $submenu->{$_} }; +% if ( ref($url_or_submenu) ) { +% +% my($subhtml, $submenuname ) = submenu($url_or_submenu, $_); #mmm, recursion +% +% "$subhtml\n". +% "myMenu$menunum.add(new WebFXMenuItem(\"$_\", null, \"$tooltip\", $submenuname ));"; +% +% } else { +% +% "myMenu$menunum.add(new WebFXMenuItem(\"$_\", \"$url_or_submenu\", \"$tooltip\" ));"; +% +% } +% +% } +% +% } keys %$submenu ) +% ). "\n". +% "myMenu$menunum.width = 224\n", +% +% "myMenu$menunum"; +% +% } +% +% + + +<script type="text/javascript" src="<%$fsurl%>elements/cssexpr.js"></script> +<script type="text/javascript" src="<%$fsurl%>elements/xmenu.js"></script> +<link href="<%$fsurl%>elements/xmenu.css" type="text/css" rel="stylesheet"> +<link href="<%$fsurl%>elements/freeside.css" type="text/css" rel="stylesheet"> <SCRIPT TYPE="text/javascript"> - webfxMenuImagePath = "<%=$fsurl%>images/"; + webfxMenuImagePath = "<%$fsurl%>images/"; webfxMenuUseHover = 1; webfxMenuShowTime = 300; webfxMenuHideTime = 300; var myBar = new WebFXMenuBar; +% foreach my $item ( keys %menu ) { +% +% my( $url_or_submenu, $tooltip ) = @{ $menu{$item} }; +% +% if ( ref($url_or_submenu) ) { +% +% #warn $item; +% +% my( $subhtml, $submenuname ) = submenu($url_or_submenu, $item); +% +% + + + <% $subhtml %> + myBar.add(new WebFXMenuButton("<% $item %>", null, "<% $tooltip %>", <% $submenuname %> )); +% } else { - <% foreach my $item ( keys %menu ) { - - my( $url_or_submenu, $tooltip ) = @{ $menu{$item} }; - - if ( ref($url_or_submenu) ) { - - #warn $item; - - my( $subhtml, $submenuname ) = submenu($url_or_submenu, $item); - - %> - - <%= $subhtml %> - myBar.add(new WebFXMenuButton("<%= $item %>", null, "<%= $tooltip %>", <%= $submenuname %> )); - - <% } else { %> - myBar.add(new WebFXMenuButton("<%= $item %>", "<%= $url_or_submenu %>", "<%= $tooltip %>" )); - - <% } + myBar.add(new WebFXMenuButton("<% $item %>", "<% $url_or_submenu %>", "<% $tooltip %>" )); +% } +% +% } +% - } - %> myBar.show( null, 'vertical' ); //myBar.show( null, 'horizontal' ); diff --git a/httemplate/elements/menubar.html b/httemplate/elements/menubar.html index 29facb6b6..ec6c13fea 100644 --- a/httemplate/elements/menubar.html +++ b/httemplate/elements/menubar.html @@ -1,9 +1,10 @@ -<% - 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) %> +% +% 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) %> diff --git a/httemplate/elements/pager.html b/httemplate/elements/pager.html index 0510d327d..2327594a8 100644 --- a/httemplate/elements/pager.html +++ b/httemplate/elements/pager.html @@ -1,42 +1,43 @@ -<% +% +% +% my %opt = @_; +% +% my $pager = ''; +% if ( $opt{'total'} != $opt{'num_rows'} && $opt{'maxrecords'} ) { +% unless ( $opt{'offset'} == 0 ) { +% $cgi->param('offset', $opt{'offset'} - $opt{'maxrecords'}); +% + + + <A HREF="<% $cgi->self_url %>"><B><FONT SIZE="+1">Previous</FONT></B></A> +% +% } +% my $page = 0; +% for ( my $poff = 0; $poff < $opt{'total'}; $poff += $opt{'maxrecords'} ) { +% $page++; +% if ( $opt{'offset'} == $poff ) { +% + + + <FONT SIZE="+2"><% $page %></FONT> +% +% } else { +% $cgi->param('offset', $poff); +% + + + <A HREF="<% $cgi->self_url %>"><% $page %></A> +% +% } +% } +% unless ( $opt{'offset'} + $opt{'maxrecords'} > $opt{'total'} ) { +% $cgi->param('offset', $opt{'offset'} + $opt{'maxrecords'}); +% + + + <A HREF="<% $cgi->self_url %>"><B><FONT SIZE="+1">Next</FONT></B></A> +% +% } +% } +% - my %opt = @_; - - my $pager = ''; - if ( $opt{'total'} != $opt{'num_rows'} && $opt{'maxrecords'} ) { - unless ( $opt{'offset'} == 0 ) { - $cgi->param('offset', $opt{'offset'} - $opt{'maxrecords'}); -%> - - <A HREF="<%= $cgi->self_url %>"><B><FONT SIZE="+1">Previous</FONT></B></A> - -<% - } - my $page = 0; - for ( my $poff = 0; $poff < $opt{'total'}; $poff += $opt{'maxrecords'} ) { - $page++; - if ( $opt{'offset'} == $poff ) { -%> - - <FONT SIZE="+2"><%= $page %></FONT> - -<% - } else { - $cgi->param('offset', $poff); -%> - - <A HREF="<%= $cgi->self_url %>"><%= $page %></A> - -<% - } - } - unless ( $opt{'offset'} + $opt{'maxrecords'} > $opt{'total'} ) { - $cgi->param('offset', $opt{'offset'} + $opt{'maxrecords'}); -%> - - <A HREF="<%= $cgi->self_url %>"><B><FONT SIZE="+1">Next</FONT></B></A> - -<% - } - } -%> diff --git a/httemplate/elements/phonenumber.html b/httemplate/elements/phonenumber.html index 6e16ec0ad..0e730ebcc 100644 --- a/httemplate/elements/phonenumber.html +++ b/httemplate/elements/phonenumber.html @@ -1,17 +1,22 @@ -<% - my( $number, %opt ) = @_; - my $conf = new FS::Conf; - ( my $snumber = $number ) =~ s/\D//g; -%> +% +% my( $number, %opt ) = @_; +% my $conf = new FS::Conf; +% ( my $snumber = $number ) =~ s/\D//g; +% + <SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws.js"></SCRIPT> <SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws_iframe.js"></SCRIPT> <SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws_draggable.js"></SCRIPT> <SCRIPT TYPE="text/javascript" SRC="../elements/iframecontentmws.js"></SCRIPT> -<% if ( length($number) ) { %> - <%= $number %> - <% if ( $opt{'callable'} && $conf->config('vonage-username') ) { %> - <A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('https://secure.click2callu.com/tpcc/makecall?username=<%= $conf->config('vonage-username') %>&password=<%= $conf->config('vonage-password') %>&fromnumber=<%= $conf->config('vonage-fromnumber')%>&tonumber=1<%= $snumber %>', 240, 64, 'call_popup'), CAPTION, 'Initiating call', STICKY, AUTOSTATUSCAP, CLOSECLICK, DRAGGABLE, WIDTH, 240, HEIGHT, 64 ); return false;" TITLE="Call this number"><IMG SRC="<%=$fsurl%>images/red_telephone_mimooh_01.png" BORDER=0 ALT="Call this number"></A> - <% } %> -<% } else { %> +% if ( length($number) ) { + + <% $number %> +% if ( $opt{'callable'} && $conf->config('vonage-username') ) { + + <A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('https://secure.click2callu.com/tpcc/makecall?username=<% $conf->config('vonage-username') %>&password=<% $conf->config('vonage-password') %>&fromnumber=<% $conf->config('vonage-fromnumber')%>&tonumber=1<% $snumber %>', 240, 64, 'call_popup'), CAPTION, 'Initiating call', STICKY, AUTOSTATUSCAP, CLOSECLICK, DRAGGABLE, WIDTH, 240, HEIGHT, 64 ); return false;" TITLE="Call this number"><IMG SRC="<%$fsurl%>images/red_telephone_mimooh_01.png" BORDER=0 ALT="Call this number"></A> +% } +% } else { + -<% } %> +% } + diff --git a/httemplate/elements/progress-init.html b/httemplate/elements/progress-init.html index ec485f438..3894feef9 100644 --- a/httemplate/elements/progress-init.html +++ b/httemplate/elements/progress-init.html @@ -1,17 +1,18 @@ -<% - my( $formname, $fields, $action, $url_or_message, $key ) = @_; - $key = '' unless defined $key; +% +% my( $formname, $fields, $action, $url_or_message, $key ) = @_; +% $key = '' unless defined $key; +% +% my $url_or_message_link; +% if ( ref($url_or_message) ) { #its a message or something +% $url_or_message_link = +% 'message='. uri_escape( $url_or_message->{'message'} ) +% } else { +% $url_or_message_link = "url=$url_or_message"; +% } +% - my $url_or_message_link; - if ( ref($url_or_message) ) { #its a message or something - $url_or_message_link = - 'message='. uri_escape( $url_or_message->{'message'} ) - } else { - $url_or_message_link = "url=$url_or_message"; - } -%> -<%= include('/elements/xmlhttp.html', +<% include('/elements/xmlhttp.html', 'method' => 'POST', 'url' => $action, 'subs' => [ 'start_job' ], @@ -27,12 +28,12 @@ function OLiframeContent(src, width, height, name) { +'<div>[iframe not supported]</div></iframe>'); } -function <%=$key%>process () { +function <%$key%>process () { - //alert('<%=$key%>process for form <%=$formname%>'); + //alert('<%$key%>process for form <%$formname%>'); - if ( document.<%=$formname%>.submit.disabled == false ) { - document.<%=$formname%>.submit.disabled=true; + if ( document.<%$formname%>.submit.disabled == false ) { + document.<%$formname%>.submit.disabled=true; } overlib( 'Submitting job to server...', WIDTH, 444, HEIGHT, 168, CAPTION, 'Please wait...', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', CLOSECLICK, MIDX, 0, MIDY, 0 ); @@ -40,9 +41,9 @@ function <%=$key%>process () { var Hash = new Array(); var x = 0; var fieldName; - for (var i = 0; i<document.<%=$formname%>.elements.length; i++) { - field = document.<%=$formname%>.elements[i]; - if ( <%= join(' || ', map { "(field.name.indexOf('$_') > -1)" } @$fields ) %> + for (var i = 0; i<document.<%$formname%>.elements.length; i++) { + field = document.<%$formname%>.elements[i]; + if ( <% join(' || ', map { "(field.name.indexOf('$_') > -1)" } @$fields ) %> ) { if ( field.type == 'select-multiple' ) { @@ -56,7 +57,7 @@ function <%=$key%>process () { } } else if ( ( field.type != 'radio' && field.type != 'checkbox' ) || ( ( field.type == 'radio' || field.type == 'checkbox' ) - && document.<%=$formname%>.elements[i].checked + && document.<%$formname%>.elements[i].checked ) ) { @@ -67,17 +68,17 @@ function <%=$key%>process () { } // jsrsPOST = true; - // jsrsExecute( '<%= $action %>', <%=$key%>myCallback, 'start_job', Hash ); + // jsrsExecute( '<% $action %>', <%$key%>myCallback, 'start_job', Hash ); - //alert('start_job( ' + Hash + ', <%=$key%>myCallback )' ); + //alert('start_job( ' + Hash + ', <%$key%>myCallback )' ); //alert('start_job()' ); - <%=$key%>start_job( Hash, <%=$key%>myCallback ); + <%$key%>start_job( Hash, <%$key%>myCallback ); } -function <%=$key%>myCallback( jobnum ) { +function <%$key%>myCallback( jobnum ) { - overlib( OLiframeContent('<%=$p%>elements/progress-popup.html?jobnum=' + jobnum + ';<%=$url_or_message_link%>;formname=<%=$formname%>' , 444, 168, 'progress_popup'), CAPTION, 'Please wait...', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', CLOSECLICK, MIDX, 0, MIDY, 0 ); + overlib( OLiframeContent('<%$p%>elements/progress-popup.html?jobnum=' + jobnum + ';<%$url_or_message_link%>;formname=<%$formname%>' , 444, 168, 'progress_popup'), CAPTION, 'Please wait...', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', CLOSECLICK, MIDX, 0, MIDY, 0 ); } diff --git a/httemplate/elements/progress-popup.html b/httemplate/elements/progress-popup.html index 544440138..8f2ff1982 100644 --- a/httemplate/elements/progress-popup.html +++ b/httemplate/elements/progress-popup.html @@ -1,16 +1,17 @@ -<% - my $jobnum = $cgi->param('jobnum'); - my $url = $cgi->param('url'); - my $message = $cgi->param('message'); - my $formname = scalar($cgi->param('formname')); -%> +% +% my $jobnum = $cgi->param('jobnum'); +% my $url = $cgi->param('url'); +% my $message = $cgi->param('message'); +% my $formname = scalar($cgi->param('formname')); +% + <HTML> <HEAD> <TITLE></TITLE> </HEAD> <BODY BGCOLOR="#ccccff" onLoad="refreshStatus()"> -<%= include('/elements/xmlhttp.html', +<% include('/elements/xmlhttp.html', 'url' => $p.'elements/jsrsServer.html', 'subs' => [ 'job_status' ], ) @@ -20,9 +21,9 @@ <SCRIPT TYPE="text/javascript" src="../elements/qlib/progress.js"></SCRIPT> <SCRIPT TYPE="text/javascript"> function refreshStatus () { - //jsrsExecute( '<%=$p%>elements/jsrsServer.html', updateStatus, 'job_status', '<%= $jobnum %>' ); + //jsrsExecute( '<%$p%>elements/jsrsServer.html', updateStatus, 'job_status', '<% $jobnum %>' ); - job_status( '<%= $jobnum %>', updateStatus ); + job_status( '<% $jobnum %>', updateStatus ); } function updateStatus( status_statustext ) { @@ -37,29 +38,33 @@ function updateStatus( status_statustext ) { document.getElementById("progress_percent").innerHTML = statustext + '%'; bar1.set(statustext); bar1.update; - //jsrsExecute( '<%=$p%>elements/jsrsServer.html', updateStatus, 'job_status', '<%= $jobnum %>' ); - job_status( '<%= $jobnum %>', updateStatus ); + //jsrsExecute( '<%$p%>elements/jsrsServer.html', updateStatus, 'job_status', '<% $jobnum %>' ); + job_status( '<% $jobnum %>', updateStatus ); } else if ( status.indexOf('complete') > -1 ) { -<% if ( $message ) { %> - document.getElementById("progress_message").innerHTML = "<%= $message %>"; +% if ( $message ) { + + document.getElementById("progress_message").innerHTML = "<% $message %>"; document.getElementById("progress_bar").innerHTML = ''; document.getElementById("progress_percent").innerHTML = '<INPUT TYPE="button" VALUE="OK" onClick="parent.nd(1);">'; document.getElementById("progress_jobnum").innerHTML = ''; - if ( parent.document.<%=$formname%>.submit.disabled == true ) { - parent.document.<%=$formname%>.submit.disabled=false; + if ( parent.document.<%$formname%>.submit.disabled == true ) { + parent.document.<%$formname%>.submit.disabled=false; } -<% } elsif ( $url ) { %> - window.top.location.href = '<%= $url %>'; -<% } else { %> +% } elsif ( $url ) { + + window.top.location.href = '<% $url %>'; +% } else { + alert('job done but no url or message specified'); -<% } %> +% } + } else if ( status.indexOf('error') > -1 ) { document.getElementById("progress_message").innerHTML = '<FONT SIZE="+1" COLOR="#FF0000">Error: ' + statustext + '</FONT>'; document.getElementById("progress_bar").innerHTML = ''; document.getElementById("progress_percent").innerHTML = '<INPUT TYPE="button" VALUE="OK" onClick="parent.nd(1);">'; document.getElementById("progress_jobnum").innerHTML = ''; - if ( parent.document.<%=$formname%>.submit.disabled == true ) { - parent.document.<%=$formname%>.submit.disabled=false; + if ( parent.document.<%$formname%>.submit.disabled == true ) { + parent.document.<%$formname%>.submit.disabled=false; } } else { alert('XXX unknown status returned from server: ' + status); @@ -90,7 +95,7 @@ function updateStatus( status_statustext ) { </TD> </TR><TR> <TD ALIGN="center" ID="progress_jobnum"> - (progress of job #<%= $jobnum %>) + (progress of job #<% $jobnum %>) </TD> </TR> </TABLE> diff --git a/httemplate/elements/search-cust_main.html b/httemplate/elements/search-cust_main.html index ca91b4027..f2b17eacb 100644 --- a/httemplate/elements/search-cust_main.html +++ b/httemplate/elements/search-cust_main.html @@ -1,27 +1,28 @@ -<% - my( %opt ) = @_; - $opt{'field_name'} ||= 'custnum'; - - my $cust_main = ''; - if ( $opt{'value'} ) { - $cust_main = qsearchs( - 'table' => 'cust_main', - 'hashref' => { 'custnum' => $opt{'value'} }, - 'extra_sql' => " AND ". $FS::CurrentUser::CurrentUser->agentnums_sql, - ); - } -%> - -<INPUT TYPE="hidden" NAME="<%= $opt{'field_name'} %>" VALUE="<%= $opt{'value'} %>"> +% +% my( %opt ) = @_; +% $opt{'field_name'} ||= 'custnum'; +% +% my $cust_main = ''; +% if ( $opt{'value'} ) { +% $cust_main = qsearchs( +% 'table' => 'cust_main', +% 'hashref' => { 'custnum' => $opt{'value'} }, +% 'extra_sql' => " AND ". $FS::CurrentUser::CurrentUser->agentnums_sql, +% ); +% } +% + + +<INPUT TYPE="hidden" NAME="<% $opt{'field_name'} %>" VALUE="<% $opt{'value'} %>"> <!-- some false laziness w/ misc/batch-cust_pay.html, though not as bad as i'd thought at first... --> -<INPUT TYPE="text" NAME="<%= $opt{'field_name'} %>_search" ID="<%= $opt{'field_name'} %>_search" SIZE="32" VALUE="<%= $cust_main ? $cust_main->name : '(cust #, name or company)' %>" onFocus="clearhint_<%= $opt{'field_name'} %>_search(this);" onClick="clearhint_<%= $opt{'field_name'} %>_search(this);" onChange="smart_<%= $opt{'field_name'} %>_search(this);"> +<INPUT TYPE="text" NAME="<% $opt{'field_name'} %>_search" ID="<% $opt{'field_name'} %>_search" SIZE="32" VALUE="<% $cust_main ? $cust_main->name : '(cust #, name or company)' %>" onFocus="clearhint_<% $opt{'field_name'} %>_search(this);" onClick="clearhint_<% $opt{'field_name'} %>_search(this);" onChange="smart_<% $opt{'field_name'} %>_search(this);"> -<SELECT NAME="<%= $opt{'field_name'} %>_select" ID="<%= $opt{'field_name'} %>_select" STYLE="color:#ff0000; display:none" onChange="select_<%= $opt{'field_name'} %>(this);"> +<SELECT NAME="<% $opt{'field_name'} %>_select" ID="<% $opt{'field_name'} %>_select" STYLE="color:#ff0000; display:none" onChange="select_<% $opt{'field_name'} %>(this);"> </SELECT> -<%= include('/elements/xmlhttp.html', +<% include('/elements/xmlhttp.html', 'url' => $p. 'misc/xmlhttp-cust_main-search.cgi', 'subs' => [ 'smart_search' ], ) @@ -29,7 +30,7 @@ <SCRIPT TYPE="text/javascript"> - function clearhint_<%= $opt{'field_name'} %>_search (what) { + function clearhint_<% $opt{'field_name'} %>_search (what) { what.style.color = '#000000'; @@ -41,7 +42,7 @@ } - function smart_<%= $opt{'field_name'} %>_search(what) { + function smart_<% $opt{'field_name'} %>_search(what) { var customer = what.value; @@ -59,11 +60,11 @@ what.style.color= '#000000'; what.style.backgroundColor = '#dddddd'; - var customer_select = document.getElementById('<%= $opt{'field_name'} %>_select'); + var customer_select = document.getElementById('<% $opt{'field_name'} %>_select'); //alert("search for customer " + customer); - function <%= $opt{'field_name'} %>_search_update(customers) { + function <% $opt{'field_name'} %>_search_update(customers) { //alert('customers returned: ' + customers); @@ -74,7 +75,7 @@ if ( customerArray.length == 0 ) { - what.form.<%= $opt{'field_name'} %>.value = ''; + what.form.<% $opt{'field_name'} %>.value = ''; what.value = 'Customer not found: ' + what.value; what.style.color = '#ff0000'; @@ -86,7 +87,7 @@ //alert('one customer found: ' + customerArray[0]); - what.form.<%= $opt{'field_name'} %>.value = customerArray[0][0]; + what.form.<% $opt{'field_name'} %>.value = customerArray[0][0]; what.value = customerArray[0][1]; what.style.display = ''; @@ -115,17 +116,17 @@ } - smart_search( customer, <%= $opt{'field_name'} %>_search_update ); + smart_search( customer, <% $opt{'field_name'} %>_search_update ); } - function select_<%= $opt{'field_name'} %> (what) { + function select_<% $opt{'field_name'} %> (what) { var custnum = what.options[what.selectedIndex].value; var customer = what.options[what.selectedIndex].text; - var customer_obj = document.getElementById('<%= $opt{'field_name'} %>_search'); + var customer_obj = document.getElementById('<% $opt{'field_name'} %>_search'); if ( custnum == '' ) { //what.style.color = '#ff0000'; @@ -140,7 +141,7 @@ } else { - what.form.<%= $opt{'field_name'} %>.value = custnum; + what.form.<% $opt{'field_name'} %>.value = custnum; customer_obj.value = customer; customer_obj.style.color = '#000000'; diff --git a/httemplate/elements/select-access_group.html b/httemplate/elements/select-access_group.html index b05f565ea..299a66a45 100644 --- a/httemplate/elements/select-access_group.html +++ b/httemplate/elements/select-access_group.html @@ -1,10 +1,11 @@ -<% - my( $groupnum, %opt ) = @_; - - %opt{'records'} = delete $opt{'access_group'} - if $opt{'access_group'}; - -%><%= include( '/elements/select-table.html', +% +% my( $groupnum, %opt ) = @_; +% +% %opt{'records'} = delete $opt{'access_group'} +% if $opt{'access_group'}; +% +% +<% include( '/elements/select-table.html', 'table' => 'access_group', 'name_col' => 'groupname', 'value' => $groupnum, diff --git a/httemplate/elements/select-agent.html b/httemplate/elements/select-agent.html index 009cc6e06..e85ede5b8 100644 --- a/httemplate/elements/select-agent.html +++ b/httemplate/elements/select-agent.html @@ -1,10 +1,11 @@ -<% - my( $agentnum, %opt ) = @_; - - $opt{'records'} = delete $opt{'agents'} - if $opt{'agents'}; - -%><%= include( '/elements/select-table.html', +% +% my( $agentnum, %opt ) = @_; +% +% $opt{'records'} = delete $opt{'agents'} +% if $opt{'agents'}; +% +% +<% include( '/elements/select-table.html', 'table' => 'agent', 'name_col' => 'agent', 'value' => $agentnum, diff --git a/httemplate/elements/select-cust-fields.html b/httemplate/elements/select-cust-fields.html index 4d47fbe40..98feaf85c 100644 --- a/httemplate/elements/select-cust-fields.html +++ b/httemplate/elements/select-cust-fields.html @@ -1,23 +1,24 @@ -<% - my( $cust_fields, %opt ) = @_; +% +% my( $cust_fields, %opt ) = @_; +% +% use FS::ConfDefaults; +% $opt{'avail_fields'} ||= [ FS::ConfDefaults->cust_fields_avail() ]; +% +% tie my %hash, 'Tie::IxHash', @{ $opt{'avail_fields'} }; +% +% - use FS::ConfDefaults; - $opt{'avail_fields'} ||= [ FS::ConfDefaults->cust_fields_avail() ]; - - tie my %hash, 'Tie::IxHash', @{ $opt{'avail_fields'} }; - -%> <SELECT NAME="cust_fields"> <OPTION VALUE="">(configured default) +% +% foreach my $value ( keys %hash ) { - <% - foreach my $value ( keys %hash ) { %> - <OPTION VALUE="<%= $value %>"><%= $hash{$value} %> + <OPTION VALUE="<% $value %>"><% $hash{$value} %> +% } - <% } %> </SELECT> diff --git a/httemplate/elements/select-cust_pkg-status.html b/httemplate/elements/select-cust_pkg-status.html index 5da93fe79..58f270342 100644 --- a/httemplate/elements/select-cust_pkg-status.html +++ b/httemplate/elements/select-cust_pkg-status.html @@ -1,19 +1,20 @@ -<% - my( $status, %opt ) = @_; +% +% my( $status, %opt ) = @_; +% +% $opt{'statuses'} ||= [ FS::cust_pkg->statuses() ]; # { disabled=>'' } ) +% +% - $opt{'statuses'} ||= [ FS::cust_pkg->statuses() ]; # { disabled=>'' } ) - -%> <SELECT NAME="status"> <OPTION VALUE="">all +% foreach my $status ( @{ $opt{'statuses'} } ) { - <% foreach my $status ( @{ $opt{'statuses'} } ) { %> - <OPTION VALUE="<%= $status %>"><%= $status %> + <OPTION VALUE="<% $status %>"><% $status %> +% } - <% } %> </SELECT> diff --git a/httemplate/elements/select-month_year.html b/httemplate/elements/select-month_year.html index 2866960bd..34476bc94 100644 --- a/httemplate/elements/select-month_year.html +++ b/httemplate/elements/select-month_year.html @@ -1,59 +1,62 @@ -<% - - my %opt = @_; - - my $prefix = $opt{'prefix'} || ''; - my $disabled = $opt{'disabled'} || ''; - my $empty = $opt{'empty_option'} || ''; - my $start_year = $opt{'start_year'}; - my $end_year = $opt{'end_year'} || '2037'; - - my @mon; - if ( $opt{'show_month_abbr'} ) { - @mon = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec); - } else { - @mon = ( 1 .. 12 ); - } - - my $date = $opt{'selected_date'} || ''; - $date = '' if $date eq '-'; - #$date ||= '01-2000' unless $empty; - - my $mon = $opt{'selected_mon'} || 0; - my $year = $opt{'selected_year'} || 0; - if ( $date ) { - if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format - ( $mon, $year ) = ( $2, $1 ); - } elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) { - ( $mon, $year ) = ( $1, $3 ); - } else { - die "unrecognized expiration date format: $date"; - } - } - - unless ( $start_year ) { - my @t = localtime; - $start_year = $t[5] + 1900; - } - $start_year = $year if $start_year > $year && $year > 0; - -%> - -<SELECT NAME="<%= $prefix %>_month" SIZE="1" <%= $disabled%>> - -<%= $empty ? '<OPTION VALUE="">' : '' %> - -<% foreach ( 1 .. 12 ) { %> - <OPTION<%= $_ == $mon ? ' SELECTED' : '' %> VALUE="<%= $_ %>"><%= $mon[$_-1] %> -<% } %> - -</SELECT>/<SELECT NAME="<%= $prefix %>_year" SIZE="1" <%= $disabled%>> - -<%= $empty ? '<OPTION VALUE="">' : '' %> - -<% for ( $start_year .. $end_year ) { %> - <OPTION<%= $_ == $year ? ' SELECTED' : '' %> VALUE="<%= $_ %>"><%= $_ %> -<% } %> +% +% +% my %opt = @_; +% +% my $prefix = $opt{'prefix'} || ''; +% my $disabled = $opt{'disabled'} || ''; +% my $empty = $opt{'empty_option'} || ''; +% my $start_year = $opt{'start_year'}; +% my $end_year = $opt{'end_year'} || '2037'; +% +% my @mon; +% if ( $opt{'show_month_abbr'} ) { +% @mon = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec); +% } else { +% @mon = ( 1 .. 12 ); +% } +% +% my $date = $opt{'selected_date'} || ''; +% $date = '' if $date eq '-'; +% #$date ||= '01-2000' unless $empty; +% +% my $mon = $opt{'selected_mon'} || 0; +% my $year = $opt{'selected_year'} || 0; +% if ( $date ) { +% if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format +% ( $mon, $year ) = ( $2, $1 ); +% } elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) { +% ( $mon, $year ) = ( $1, $3 ); +% } else { +% die "unrecognized expiration date format: $date"; +% } +% } +% +% unless ( $start_year ) { +% my @t = localtime; +% $start_year = $t[5] + 1900; +% } +% $start_year = $year if $start_year > $year && $year > 0; +% +% + + +<SELECT NAME="<% $prefix %>_month" SIZE="1" <% $disabled%>> + +<% $empty ? '<OPTION VALUE="">' : '' %> +% foreach ( 1 .. 12 ) { + + <OPTION<% $_ == $mon ? ' SELECTED' : '' %> VALUE="<% $_ %>"><% $mon[$_-1] %> +% } + + +</SELECT>/<SELECT NAME="<% $prefix %>_year" SIZE="1" <% $disabled%>> + +<% $empty ? '<OPTION VALUE="">' : '' %> +% for ( $start_year .. $end_year ) { + + <OPTION<% $_ == $year ? ' SELECTED' : '' %> VALUE="<% $_ %>"><% $_ %> +% } + </SELECT> diff --git a/httemplate/elements/select-part_referral.html b/httemplate/elements/select-part_referral.html index deb87bd3b..efcc477af 100644 --- a/httemplate/elements/select-part_referral.html +++ b/httemplate/elements/select-part_referral.html @@ -1,10 +1,11 @@ -<% - my( $refnum, %opt ) = @_; - - $opt{'records'} = delete $opt{'part_referrals'} - if $opt{'part_referrals'}; - -%><%= include( '/elements/select-table.html', +% +% my( $refnum, %opt ) = @_; +% +% $opt{'records'} = delete $opt{'part_referrals'} +% if $opt{'part_referrals'}; +% +% +<% include( '/elements/select-table.html', 'table' => 'part_referral', 'name_col' => 'referral', 'value' => $refnum, diff --git a/httemplate/elements/select-pkg_class.html b/httemplate/elements/select-pkg_class.html index 032c7abda..0d8e6ac84 100644 --- a/httemplate/elements/select-pkg_class.html +++ b/httemplate/elements/select-pkg_class.html @@ -1,12 +1,13 @@ -<% - my( $classnum, %opt ) = @_; - - $opt{'records'} = delete $opt{'pkg_class'} - if $opt{'pkg_class'}; - - #warn "***** select-pkg-class: \n". Dumper(%opt); - -%><%= include( '/elements/select-table.html', +% +% my( $classnum, %opt ) = @_; +% +% $opt{'records'} = delete $opt{'pkg_class'} +% if $opt{'pkg_class'}; +% +% #warn "***** select-pkg-class: \n". Dumper(%opt); +% +% +<% include( '/elements/select-table.html', 'table' => 'pkg_class', 'name_col' => 'classname', 'value' => $classnum, diff --git a/httemplate/elements/select-table.html b/httemplate/elements/select-table.html index 36eb4e211..83445f41a 100644 --- a/httemplate/elements/select-table.html +++ b/httemplate/elements/select-table.html @@ -1,63 +1,65 @@ -<% - - ##required - # 'table' => 'table_name', - # 'name_col' => 'name_column', - # - ##strongly recommended (you want your forms to be "sticky" on errors, right?) - # 'value' => 'current_value', - # - ##opt - # 'empty_label' => '', #better specify it though, the default might change - # 'hashref' => {}, - # 'extra_sql' => '', - # 'records' => \@records, #instead of hashref - # 'pre_options' => [ 'value' => 'option' ], #before normal options - # 'element_name' => '', #HTML element name, defaults to the name of - # # the primary key column - # 'element_etc' => '', #additional attributes (i.e. "DISABLED") for the - # #<SELECT> element - - my( %opt ) = @_; - - #warn "***** select-table: \n". Dumper(%opt); - - my $key = dbdef->table($opt{'table'})->primary_key; #? $opt{'primary_key'} || - - my $name_col = $opt{'name_col'}; - - my @records = (); - if ( $opt{'records'} ) { - @records = @{ $opt{'records'} }; - } else { - @records = qsearch( { - 'table' => $opt{'table'}, - 'hashref' => ( $opt{'hashref'} || {} ), - 'extra_sql' => ( $opt{'extra_sql'} || '' ), - }); - } - - my @pre_options = $opt{'pre_options'} ? @{ $opt{'pre_options'} } : (); - -%> - -<SELECT NAME="<%= $opt{'element_name'} || $key %>" <%= $opt{'element_etc'} %>> - - <% while ( @pre_options ) { %> - <OPTION VALUE="<%= shift(@pre_options) %>"><%= shift(@pre_options) %> - <% } %> - - <OPTION VALUE=""><%= $opt{'empty_label'} || 'all' %> - - <% foreach my $record ( sort { $a->$name_col() cmp $b->$name_col() } - @records - ) - { - %> - - <OPTION VALUE="<%= $record->$key() %>"<%= $opt{'value'} == $record->$key() ? ' SELECTED' : '' %>><%= $record->$name_col() %> - - <% } %> +% +% +% ##required +% # 'table' => 'table_name', +% # 'name_col' => 'name_column', +% # +% ##strongly recommended (you want your forms to be "sticky" on errors, right?) +% # 'value' => 'current_value', +% # +% ##opt +% # 'empty_label' => '', #better specify it though, the default might change +% # 'hashref' => {}, +% # 'extra_sql' => '', +% # 'records' => \@records, #instead of hashref +% # 'pre_options' => [ 'value' => 'option' ], #before normal options +% # 'element_name' => '', #HTML element name, defaults to the name of +% # # the primary key column +% # 'element_etc' => '', #additional attributes (i.e. "DISABLED") for the +% # #<SELECT> element +% +% my( %opt ) = @_; +% +% #warn "***** select-table: \n". Dumper(%opt); +% +% my $key = dbdef->table($opt{'table'})->primary_key; #? $opt{'primary_key'} || +% +% my $name_col = $opt{'name_col'}; +% +% my @records = (); +% if ( $opt{'records'} ) { +% @records = @{ $opt{'records'} }; +% } else { +% @records = qsearch( { +% 'table' => $opt{'table'}, +% 'hashref' => ( $opt{'hashref'} || {} ), +% 'extra_sql' => ( $opt{'extra_sql'} || '' ), +% }); +% } +% +% my @pre_options = $opt{'pre_options'} ? @{ $opt{'pre_options'} } : (); +% +% + + +<SELECT NAME="<% $opt{'element_name'} || $key %>" <% $opt{'element_etc'} %>> +% while ( @pre_options ) { + + <OPTION VALUE="<% shift(@pre_options) %>"><% shift(@pre_options) %> +% } + + + <OPTION VALUE=""><% $opt{'empty_label'} || 'all' %> +% foreach my $record ( sort { $a->$name_col() cmp $b->$name_col() } +% @records +% ) +% { +% + + + <OPTION VALUE="<% $record->$key() %>"<% $opt{'value'} == $record->$key() ? ' SELECTED' : '' %>><% $record->$name_col() %> +% } + </SELECT> diff --git a/httemplate/elements/select-taxclass.html b/httemplate/elements/select-taxclass.html index e5a1abba1..495572323 100644 --- a/httemplate/elements/select-taxclass.html +++ b/httemplate/elements/select-taxclass.html @@ -1,42 +1,40 @@ -<% - my $conf = new FS::Conf; - my $selected_taxclass = scalar(@_) ? shift : ''; -%> +% +% my $conf = new FS::Conf; +% my $selected_taxclass = scalar(@_) ? shift : ''; +% +% if ( $conf->exists('enable_taxclasses') ) { -<% if ( $conf->exists('enable_taxclasses') ) { %> <SELECT NAME="taxclass"> +% if ( $conf->exists('require_taxclasses') ) { - <% if ( $conf->exists('require_taxclasses') ) { %> <OPTION VALUE="(select)">Select tax class +% } else { - <% } else { %> <OPTION VALUE=""> +% } +% +% my $sth = dbh->prepare('SELECT DISTINCT taxclass FROM cust_main_county') +% or die dbh->errstr; +% $sth->execute or die $sth->errstr; +% my %taxclasses = map { $_->[0] => 1 } @{$sth->fetchall_arrayref}; +% my @taxclasses = grep $_, keys %taxclasses; +% +% foreach my $taxclass ( @taxclasses ) { - <% } %> - - <% - my $sth = dbh->prepare('SELECT DISTINCT taxclass FROM cust_main_county') - or die dbh->errstr; - $sth->execute or die $sth->errstr; - my %taxclasses = map { $_->[0] => 1 } @{$sth->fetchall_arrayref}; - my @taxclasses = grep $_, keys %taxclasses; - %> - - <% foreach my $taxclass ( @taxclasses ) { %> - - <OPTION VALUE="<%= $taxclass %>"<%= $taxclass eq $selected_taxclass ? ' SELECTED' : '' %>><%= $taxclass %> - <% } %> + <OPTION VALUE="<% $taxclass %>"<% $taxclass eq $selected_taxclass ? ' SELECTED' : '' %>><% $taxclass %> +% } + </SELECT> +% } else { -<% } else { %> - <INPUT TYPE="hidden" NAME="taxclass" VALUE="<%= $selected_taxclass %>"> - -<% } %> + <INPUT TYPE="hidden" NAME="taxclass" VALUE="<% $selected_taxclass %>"> +% } + diff --git a/httemplate/elements/small_custview.html b/httemplate/elements/small_custview.html index e0c22e0c4..9060d897d 100644 --- a/httemplate/elements/small_custview.html +++ b/httemplate/elements/small_custview.html @@ -1,2 +1,3 @@ -<% my $conf = new FS::Conf; %> -<%= small_custview( shift, shift || scalar($conf->config('countrydefault')), @_ ) %> +% my $conf = new FS::Conf; + +<% small_custview( shift, shift || scalar($conf->config('countrydefault')), @_ ) %> diff --git a/httemplate/elements/table-grid.html b/httemplate/elements/table-grid.html index fd1cb9113..0f532e86b 100644 --- a/httemplate/elements/table-grid.html +++ b/httemplate/elements/table-grid.html @@ -1,9 +1,10 @@ -<% - my %opt = @_; - $opt{cellspacing} ||= 0; - $opt{cellpadding} ||= 0; +% +% my %opt = @_; +% $opt{cellspacing} ||= 0; +% $opt{cellpadding} ||= 0; +% +% -%> <STYLE TYPE="text/css"> .grid table { border: solid; empty-cells: show } @@ -16,5 +17,5 @@ </STYLE> -<TABLE CLASS="grid" CELLSPACING=<%= $opt{cellspacing} %> CELLPADDING=<%= $opt{cellpadding} %> BORDER=1 BORDERCOLOR="#000000" STYLE="border: solid 1px black; empty-cells: show"> +<TABLE CLASS="grid" CELLSPACING=<% $opt{cellspacing} %> CELLPADDING=<% $opt{cellpadding} %> BORDER=1 BORDERCOLOR="#000000" STYLE="border: solid 1px black; empty-cells: show"> diff --git a/httemplate/elements/table.html b/httemplate/elements/table.html index 3b6108719..8152b65d8 100644 --- a/httemplate/elements/table.html +++ b/httemplate/elements/table.html @@ -1,8 +1,11 @@ -<% - my $color = shift; - if ( $color ) { -%> - <TABLE BGCOLOR="<%= $color %>" BORDER=1 WIDTH="100%" CELLSPACING=0 CELLPADDING=2 BORDERCOLOR="#999999"> -<% } else { %> +% +% my $color = shift; +% if ( $color ) { +% + + <TABLE BGCOLOR="<% $color %>" BORDER=1 WIDTH="100%" CELLSPACING=0 CELLPADDING=2 BORDERCOLOR="#999999"> +% } else { + <TABLE BORDER=1 CELLSPACING=0 CELLPADDING=2 BORDERCOLOR="#999999"> -<% } %> +% } + diff --git a/httemplate/elements/tr-select-access_group.html b/httemplate/elements/tr-select-access_group.html index 0beec0842..e443ad26a 100644 --- a/httemplate/elements/tr-select-access_group.html +++ b/httemplate/elements/tr-select-access_group.html @@ -1,22 +1,22 @@ -<% - my( $groupnum, %opt ) = @_; +% +% my( $groupnum, %opt ) = @_; +% +% $opt{'access_group'} ||= [ qsearch( 'access_group', {} ) ]; # { disabled=>'' } ) +% +% #warn "***** tr-select-access_group: \n". Dumper(%opt); +% +% if ( scalar(@{ $opt{'access_group'} }) == 0 ) { - $opt{'access_group'} ||= [ qsearch( 'access_group', {} ) ]; # { disabled=>'' } ) - - #warn "***** tr-select-access_group: \n". Dumper(%opt); -%> - -<% if ( scalar(@{ $opt{'access_group'} }) == 0 ) { %> <INPUT TYPE="hidden" NAME="groupnum" VALUE=""> +% } else { -<% } else { %> <TR> - <TD ALIGN="right"><%= $opt{'label'} || 'Access group' %></TD> + <TD ALIGN="right"><% $opt{'label'} || 'Access group' %></TD> <TD> - <%= include( '/elements/select-access_group.html', $groupnum, %opt ) %> + <% include( '/elements/select-access_group.html', $groupnum, %opt ) %> </TD> </TR> +% } -<% } %> diff --git a/httemplate/elements/tr-select-agent.html b/httemplate/elements/tr-select-agent.html index 6158f6f47..37b1c1e88 100644 --- a/httemplate/elements/tr-select-agent.html +++ b/httemplate/elements/tr-select-agent.html @@ -1,34 +1,34 @@ -<% - my( $agentnum, %opt ) = @_; +% +% my( $agentnum, %opt ) = @_; +% +% my @agents; +% if ( $opt{'agents'} ) { +% #@agents = @{ $opt{'agents'} }; +% #here is the agent virtualization +% my $agentnums_href = $FS::CurrentUser::CurrentUser->agentnums_href; +% @agents = grep $agentnums_href->{$_->agentnum}, @{ $opt{'agents'} }; +% delete $opt{'agents'}; +% } else { +% @agents = $FS::CurrentUser::CurrentUser->agents; +% } +% +% +% if ( scalar(@agents) == 1 ) { - my @agents; - if ( $opt{'agents'} ) { - #@agents = @{ $opt{'agents'} }; - #here is the agent virtualization - my $agentnums_href = $FS::CurrentUser::CurrentUser->agentnums_href; - @agents = grep $agentnums_href->{$_->agentnum}, @{ $opt{'agents'} }; - delete $opt{'agents'}; - } else { - @agents = $FS::CurrentUser::CurrentUser->agents; - } -%> + <INPUT TYPE="hidden" NAME="agentnum" VALUE="<% $agents[0]->agentnum %>"> +% } else { -<% if ( scalar(@agents) == 1 ) { %> - - <INPUT TYPE="hidden" NAME="agentnum" VALUE="<%= $agents[0]->agentnum %>"> - -<% } else { %> <TR> - <TD ALIGN="right"><%= $opt{'label'} || 'Agent' %></TD> + <TD ALIGN="right"><% $opt{'label'} || 'Agent' %></TD> <TD> - <%= include( '/elements/select-agent.html', $agentnum, + <% include( '/elements/select-agent.html', $agentnum, 'agents' => \@agents, %opt, ) %> </TD> </TR> +% } -<% } %> diff --git a/httemplate/elements/tr-select-cust-fields.html b/httemplate/elements/tr-select-cust-fields.html index ca37e4276..80562fe3d 100644 --- a/httemplate/elements/tr-select-cust-fields.html +++ b/httemplate/elements/tr-select-cust-fields.html @@ -1,14 +1,15 @@ -<% - my( $cust_fields, %opt ) = @_; +% +% my( $cust_fields, %opt ) = @_; +% +% use FS::ConfDefaults; +% $opt{'avail_fields'} ||= [ FS::ConfDefaults->cust_fields_avail() ]; +% +% - use FS::ConfDefaults; - $opt{'avail_fields'} ||= [ FS::ConfDefaults->cust_fields_avail() ]; - -%> <TR> - <TD ALIGN="right"><%= $opt{'label'} || 'Customer fields' %></TD> + <TD ALIGN="right"><% $opt{'label'} || 'Customer fields' %></TD> <TD> - <%= include( '/elements/select-cust-fields.html', $cust_fields, %opt ) %> + <% include( '/elements/select-cust-fields.html', $cust_fields, %opt ) %> </TD> </TR> diff --git a/httemplate/elements/tr-select-cust_pkg-status.html b/httemplate/elements/tr-select-cust_pkg-status.html index 17768517d..22ee146cd 100644 --- a/httemplate/elements/tr-select-cust_pkg-status.html +++ b/httemplate/elements/tr-select-cust_pkg-status.html @@ -1,13 +1,14 @@ -<% - my( $status, %opt ) = @_; +% +% my( $status, %opt ) = @_; +% +% $opt{'statuses'} ||= [ FS::cust_pkg->statuses() ]; # { disabled=>'' } ) +% +% - $opt{'statuses'} ||= [ FS::cust_pkg->statuses() ]; # { disabled=>'' } ) - -%> <TR> - <TD ALIGN="right"><%= $opt{'label'} || 'Status' %></TD> + <TD ALIGN="right"><% $opt{'label'} || 'Status' %></TD> <TD> - <%= include( '/elements/select-cust_pkg-status.html', $status, %opt ) %> + <% include( '/elements/select-cust_pkg-status.html', $status, %opt ) %> </TD> </TR> diff --git a/httemplate/elements/tr-select-from_to.html b/httemplate/elements/tr-select-from_to.html index d7e5a8337..083243d40 100644 --- a/httemplate/elements/tr-select-from_to.html +++ b/httemplate/elements/tr-select-from_to.html @@ -1,33 +1,34 @@ -<% +% +% +% #my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); +% my ($curmon,$curyear) = (localtime(time))[4,5]; +% +% #find first month +% my $syear = 1899+$curyear; +% my $smonth = $curmon+1; +% +% #want 12 month by default, not 13 +% $smonth++; +% if ( $smonth > 12 ) { $smonth-=12; $syear++ } +% +% #find last month +% my $eyear = 1900+$curyear; +% my $emonth = $curmon+1; +% +% my %hash = ( +% 'show_month_abbr' => 1, +% 'start_year' => '1999', +% 'end_year' => '2012', #haha, well... +% @_, +% ); +% +% - #my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); - my ($curmon,$curyear) = (localtime(time))[4,5]; - - #find first month - my $syear = 1899+$curyear; - my $smonth = $curmon+1; - - #want 12 month by default, not 13 - $smonth++; - if ( $smonth > 12 ) { $smonth-=12; $syear++ } - - #find last month - my $eyear = 1900+$curyear; - my $emonth = $curmon+1; - - my %hash = ( - 'show_month_abbr' => 1, - 'start_year' => '1999', - 'end_year' => '2012', #haha, well... - @_, - ); - -%> <TR> <TD ALIGN="right">From: </TD> <TD> - <%= include('/elements/select-month_year.html', + <% include('/elements/select-month_year.html', 'prefix' => 'start', 'selected_mon' => $smonth, 'selected_year' => $syear, @@ -40,7 +41,7 @@ <TR> <TD ALIGN="right">To: </TD> <TD> - <%= include('/elements/select-month_year.html', + <% include('/elements/select-month_year.html', 'prefix' => 'end', 'selected_mon' => $emonth, 'selected_year' => $eyear, diff --git a/httemplate/elements/tr-select-part_referral.html b/httemplate/elements/tr-select-part_referral.html index 0108388bc..35c5b8047 100644 --- a/httemplate/elements/tr-select-part_referral.html +++ b/httemplate/elements/tr-select-part_referral.html @@ -1,30 +1,30 @@ -<% - my( $refnum, %opt ) = @_; +% +% my( $refnum, %opt ) = @_; +% +% $opt{'part_referrals'} ||= +% [ FS::part_referral->all_part_referral( 1 ) ]; #1: include global +% +% my $r = qq!<font color="#ff0000">*</font> !; +% +% +% if ( scalar( @{$opt{'part_referrals'}} ) == 0 ) { +% eidiot "You have not created any advertising sources. You must create at least one advertising source before adding a customer. Go to ". popurl(2). "browse/part_referral.html and create one or more advertising sources."; +% } elsif ( scalar( @{$opt{'part_referrals'}} ) == 1 ) { +% - $opt{'part_referrals'} ||= - [ FS::part_referral->all_part_referral( 1 ) ]; #1: include global - my $r = qq!<font color="#ff0000">*</font> !; + <INPUT TYPE="hidden" NAME="refnum" VALUE="<% $opt{'part_referrals'}->[0]->refnum %>"> +% } else { -%> - -<% if ( scalar( @{$opt{'part_referrals'}} ) == 0 ) { - eidiot "You have not created any advertising sources. You must create at least one advertising source before adding a customer. Go to ". popurl(2). "browse/part_referral.html and create one or more advertising sources."; - } elsif ( scalar( @{$opt{'part_referrals'}} ) == 1 ) { -%> - - <INPUT TYPE="hidden" NAME="refnum" VALUE="<%= $opt{'part_referrals'}->[0]->refnum %>"> - -<% } else { %> <TR> - <TH ALIGN="right"><%=$r%>Advertising source</TH> + <TH ALIGN="right"><%$r%>Advertising source</TH> <TD> - <%= include( '/elements/select-part_referral.html', $refnum, + <% include( '/elements/select-part_referral.html', $refnum, 'part_referrals' => $opt{'part_referrals'}, ) %> </TD> </TR> +% } -<% } %> diff --git a/httemplate/elements/tr-select-pkg_class.html b/httemplate/elements/tr-select-pkg_class.html index fbab0db14..7f37e816e 100644 --- a/httemplate/elements/tr-select-pkg_class.html +++ b/httemplate/elements/tr-select-pkg_class.html @@ -1,22 +1,22 @@ -<% - my( $classnum, %opt ) = @_; +% +% my( $classnum, %opt ) = @_; +% +% $opt{'pkg_class'} ||= [ qsearch( 'pkg_class', {} ) ]; # { disabled=>'' } ) +% +% #warn "***** tr-select-pkg-class: \n". Dumper(%opt); +% +% if ( scalar(@{ $opt{'pkg_class'} }) == 0 ) { - $opt{'pkg_class'} ||= [ qsearch( 'pkg_class', {} ) ]; # { disabled=>'' } ) - - #warn "***** tr-select-pkg-class: \n". Dumper(%opt); -%> - -<% if ( scalar(@{ $opt{'pkg_class'} }) == 0 ) { %> <INPUT TYPE="hidden" NAME="classnum" VALUE=""> +% } else { -<% } else { %> <TR> - <TD ALIGN="right"><%= $opt{'label'} || 'Package class' %></TD> + <TD ALIGN="right"><% $opt{'label'} || 'Package class' %></TD> <TD> - <%= include( '/elements/select-pkg_class.html', $classnum, %opt ) %> + <% include( '/elements/select-pkg_class.html', $classnum, %opt ) %> </TD> </TR> +% } -<% } %> diff --git a/httemplate/elements/xmlhttp.html b/httemplate/elements/xmlhttp.html index e03438822..6efc395f7 100644 --- a/httemplate/elements/xmlhttp.html +++ b/httemplate/elements/xmlhttp.html @@ -1,15 +1,16 @@ -<% - my ( %opt ) = @_; +% +% my ( %opt ) = @_; +% +% my $url = $opt{'url'}; +% my $method = exists($opt{'method'}) ? $opt{'method'} : 'GET'; +% #my @subs = @{ $opt{'subs'}; +% my $key = exists($opt{'key'}) ? $opt{'key'} : ''; +% +% $url .= ( ($url =~ /\?/) ? '&' : '?' ) +% if $method eq 'GET'; +% +% - my $url = $opt{'url'}; - my $method = exists($opt{'method'}) ? $opt{'method'} : 'GET'; - #my @subs = @{ $opt{'subs'}; - my $key = exists($opt{'key'}) ? $opt{'key'} : ''; - - $url .= ( ($url =~ /\?/) ? '&' : '?' ) - if $method eq 'GET'; - -%> <SCRIPT TYPE="text/javascript"> @@ -31,22 +32,22 @@ return A; } +% foreach my $func ( @{$opt{'subs'}} ) { +% +% my $furl = $url; +% $furl =~ s/\"/\\\\\"/; #javascript escape +% +% - <% foreach my $func ( @{$opt{'subs'}} ) { - - my $furl = $url; - $furl =~ s/\"/\\\\\"/; #javascript escape - - %> - function <%=$key%><%=$func%>() { + function <%$key%><%$func%>() { // count args; build URL - var url = "<%=$furl%>"; - var a = <%=$key%><%=$func%>.arguments; + var url = "<%$furl%>"; + var a = <%$key%><%$func%>.arguments; var args; var len; - var content = 'sub=<%= uri_escape($func) %>'; + var content = 'sub=<% uri_escape($func) %>'; if ( a && typeof a == 'object' && a[0].constructor == Array ) { args = a[0]; len = args.length @@ -58,14 +59,14 @@ content = content + "&arg=" + escape(args[i]); content = content.replace( /[+]/g, '%2B'); // fix unescaped plus signs - if ( '<%=$method%>' == 'GET' ) { + if ( '<%$method%>' == 'GET' ) { url = url + content; } - //alert('<%=$method%> ' + url); + //alert('<%$method%> ' + url); var xmlhttp = rs_init_object(); - xmlhttp.open("<%=$method%>", url, true); + xmlhttp.open("<%$method%>", url, true); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState != 4) @@ -89,7 +90,7 @@ } } - if ( '<%=$method%>' == 'POST' ) { + if ( '<%$method%>' == 'POST' ) { xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlhttp.send(content); @@ -104,7 +105,7 @@ //rs_debug("x_$func_name url = " + url); //rs_debug("x_$func_name waiting.."); } +% } - <% } %> </SCRIPT> |