diff options
Diffstat (limited to 'httemplate/elements')
-rw-r--r-- | httemplate/elements/checkboxes-table.html | 2 | ||||
-rw-r--r-- | httemplate/elements/header.html | 4 | ||||
-rw-r--r-- | httemplate/elements/location.html | 18 | ||||
-rw-r--r-- | httemplate/elements/menu.html | 3 | ||||
-rw-r--r-- | httemplate/elements/search-cust_main.html | 44 | ||||
-rw-r--r-- | httemplate/elements/select-areacode.html | 7 | ||||
-rw-r--r-- | httemplate/elements/select-did.html | 10 | ||||
-rw-r--r-- | httemplate/elements/tr-search-cust_main.html | 15 | ||||
-rw-r--r-- | httemplate/elements/tr-select-cust_location.html | 10 |
9 files changed, 73 insertions, 40 deletions
diff --git a/httemplate/elements/checkboxes-table.html b/httemplate/elements/checkboxes-table.html index a31bdb9..b6b04d1 100644 --- a/httemplate/elements/checkboxes-table.html +++ b/httemplate/elements/checkboxes-table.html @@ -46,7 +46,7 @@ % % my $hashref = $opt{'hashref'} || {}; % -% my $extra_sql = $opt{'extra_sql'} || ''; +% my $extra_sql = ''; % % if ( $opt{'agent_virt'} ) { % $extra_sql .= ' AND' . $FS::CurrentUser::CurrentUser->agentnums_sql( diff --git a/httemplate/elements/header.html b/httemplate/elements/header.html index 22e872e..8da91ef 100644 --- a/httemplate/elements/header.html +++ b/httemplate/elements/header.html @@ -24,7 +24,7 @@ Example: <HTML> <HEAD> <TITLE> - <% $title %> + <% $title |h %> </TITLE> <META HTTP-Equiv="Cache-Control" Content="no-cache"> <META HTTP-Equiv="Pragma" Content="no-cache"> @@ -293,7 +293,7 @@ input.fstext { <TD BGCOLOR="#e8e8e8" HEIGHT="100%" VALIGN="top"> <!-- WIDTH="100%"> --> <FONT SIZE=6> - <% $title %> + <% $title |h %> </FONT> % unless ( $nobr ) { diff --git a/httemplate/elements/location.html b/httemplate/elements/location.html index 07aaa69..0ec6c04 100644 --- a/httemplate/elements/location.html +++ b/httemplate/elements/location.html @@ -18,7 +18,7 @@ Example: </%doc> <TR> - <TH ALIGN="right"><%$r%><% $opt{'address1_label'} || 'Address' %></TH> + <<%$th%> ALIGN="right"><%$r%><% $opt{'address1_label'} || 'Address' %></<%$th%>> <TD COLSPAN=7> <INPUT TYPE = "text" NAME = "<%$pre%>address1" @@ -48,7 +48,7 @@ Example: </TR> <TR> - <TH ALIGN="right"><%$r%>City</TH> + <<%$th%> ALIGN="right"><%$r%>City</<%$th%>> <TD WIDTH="1"> <INPUT TYPE = "text" NAME = "<%$pre%>city" @@ -59,13 +59,13 @@ Example: <% $style %> > </TD> - <TH ALIGN="right" ID="<%$pre%>countylabel" <%$county_style%>><%$r%>County</TH> + <<%$th%> ALIGN="right" ID="<%$pre%>countylabel" <%$county_style%>><%$r%>County</<%$th%>> <TD><% include('/elements/select-county.html', %select_hash ) %></TD> - <TH ALIGN="right" WIDTH="1"><%$r%>State</TH> + <<%$th%> ALIGN="right" WIDTH="1"><%$r%>State</<%$th%>> <TD WIDTH="1"> <% include('/elements/select-state.html', %select_hash ) %> </TD> - <TH><%$r%>Zip</TH> + <<%$th%>><%$r%>Zip</<%$th%>> <TD> <INPUT TYPE = "text" NAME = "<%$pre%>zip" @@ -80,7 +80,7 @@ Example: </TR> <TR> - <TH ALIGN="right"><%$r%>Country</TH> + <<%$th%> ALIGN="right"><%$r%>Country</<%$th%>> <TD COLSPAN=6><% include('/elements/select-country.html', %select_hash ) %></TD> </TR> @@ -88,7 +88,7 @@ Example: <INPUT TYPE="hidden" NAME="geocode" VALUE="<% $opt{geocode} %>"> % } else { % if ( $pre eq 'ship_' && $conf->exists('cust_main-require_censustract') ) { - <TR><TH ALIGN="right">Census tract<BR>(automatic)</TH> + <TR><<%$th%> ALIGN="right">Census tract<BR>(automatic)</<%$th%>> <TD> <INPUT TYPE="text" NAME="censustract" VALUE="<% $opt{censustract} %>"> </TD> @@ -123,7 +123,7 @@ $object->set($pre.'state', $statedefault ) || $object->get($pre.'country') ne $countrydefault; my @style = (); -push @style, 'background-color: #dddddd"' if $disabled; +push @style, 'background-color: #dddddd' if $disabled; my @address2_label_style = (); push @address2_label_style, 'visibility:hidden' @@ -161,4 +161,6 @@ my %select_hash = ( 'style' => \@style, ); +my $th = $opt{'no_bold'} ? 'TD' : 'TH'; + </%init> diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index d4a915e..a68a575 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -235,6 +235,7 @@ if($curuser->access_right('Financial reports')) { 'Sales, Credits and Receipts' => [ $fsurl.'graph/report_money_time.html', 'Sales, credits and receipts summary graph' ], 'Sales Report' => [ $fsurl.'graph/report_cust_bill_pkg.html', 'Sales report and graph (by agent, package class and/or date range)' ], 'Rated Call Sales Report' => [ $fsurl.'graph/report_cust_bill_pkg_detail.html', 'Sales report and graph (by agent, package class, usage class and/or date range)' ], + 'Employee Commission Report' => [ $fsurl.'search/report_employee_commission.html', '' ], 'Credit Report' => [ $fsurl.'search/report_cust_credit.html', 'Credit report (by employee and/or date range)' ], 'Refund Report' => [ $fsurl.'search/report_cust_refund.html', 'Refund report (by type and/or date range)' ], ); @@ -320,7 +321,7 @@ $tools_menu{'Job Queue'} = [ $fsurl.'search/queue.html', 'View pending job queu if $curuser->access_right('Job queue'); $tools_menu{'Ticketing'} = [ \%tools_ticketing, 'Ticketing tools' ] if $conf->config('ticket_system'); -$tools_menu{'Time Queue'} = [ $fsurl.'search/timeworked.html', 'View pending support time' ] +$tools_menu{'Time Queue'} = [ $fsurl.'search/report_timeworked.html', 'View pending support time' ] if $curuser->access_right('Time queue'); $tools_menu{'Attachments'} = [ $fsurl.'browse/cust_attachment.html', 'View customer attachments' ] if !$conf->config('disable_cust_attachment') and $curuser->access_right('View attachments') and $curuser->access_right('Browse attachments'); diff --git a/httemplate/elements/search-cust_main.html b/httemplate/elements/search-cust_main.html index ef0d22c..23c4369 100644 --- a/httemplate/elements/search-cust_main.html +++ b/httemplate/elements/search-cust_main.html @@ -3,36 +3,37 @@ Example: include( '/elements/search-cust_main.html, - 'field_name' => 'custnum', + 'field' => 'custnum', + #slightly deprecated old synonym for field#'field_name'=>'custnum', 'find_button' => 1, #add a "find" button to the field 'curr_value' => 54, #current value 'value => 32, #deprecated synonym for curr_value ); </%doc> -<INPUT TYPE="hidden" NAME="<% $opt{'field_name'} %>" VALUE="<% $value %>"> +<INPUT TYPE="hidden" NAME="<% $field %>" VALUE="<% $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" + NAME = "<% $field %>_search" + ID = "<% $field %>_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);" + onFocus="clearhint_<% $field %>_search(this);" + onClick="clearhint_<% $field %>_search(this);" + onChange="smart_<% $field %>_search(this);" > % if ( $opt{'find_button'} ) { <INPUT TYPE = "button" VALUE = 'Find', - NAME = "<% $opt{'field_name'} %>_findbutton" - onClick = "smart_<% $opt{'field_name'} %>_search(this.form.<% $opt{'field_name'} %>_search);" + NAME = "<% $field %>_findbutton" + onClick = "smart_<% $field %>_search(this.form.<% $field %>_search);" > % } -<SELECT NAME="<% $opt{'field_name'} %>_select" ID="<% $opt{'field_name'} %>_select" STYLE="color:#ff0000; display:none" onChange="select_<% $opt{'field_name'} %>(this);"> +<SELECT NAME="<% $field %>_select" ID="<% $field %>_select" STYLE="color:#ff0000; display:none" onChange="select_<% $field %>(this);"> </SELECT> <% include('/elements/xmlhttp.html', @@ -43,7 +44,7 @@ Example: <SCRIPT TYPE="text/javascript"> - function clearhint_<% $opt{'field_name'} %>_search (what) { + function clearhint_<% $field %>_search (what) { what.style.color = '#000000'; @@ -55,7 +56,7 @@ Example: } - function smart_<% $opt{'field_name'} %>_search(what) { + function smart_<% $field %>_search(what) { var customer = what.value; @@ -73,11 +74,11 @@ Example: what.style.color= '#000000'; what.style.backgroundColor = '#dddddd'; - var customer_select = document.getElementById('<% $opt{'field_name'} %>_select'); + var customer_select = document.getElementById('<% $field %>_select'); //alert("search for customer " + customer); - function <% $opt{'field_name'} %>_search_update(customers) { + function <% $field %>_search_update(customers) { //alert('customers returned: ' + customers); @@ -88,7 +89,7 @@ Example: if ( customerArray.length == 0 ) { - what.form.<% $opt{'field_name'} %>.value = ''; + what.form.<% $field %>.value = ''; what.value = 'Customer not found: ' + what.value; what.style.color = '#ff0000'; @@ -100,7 +101,7 @@ Example: //alert('one customer found: ' + customerArray[0]); - what.form.<% $opt{'field_name'} %>.value = customerArray[0][0]; + what.form.<% $field %>.value = customerArray[0][0]; what.value = customerArray[0][1]; what.style.display = ''; @@ -129,17 +130,17 @@ Example: } - smart_search( customer, <% $opt{'field_name'} %>_search_update ); + smart_search( customer, <% $field %>_search_update ); } - function select_<% $opt{'field_name'} %> (what) { + function select_<% $field %> (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('<% $field %>_search'); if ( custnum == '' ) { //what.style.color = '#ff0000'; @@ -154,7 +155,7 @@ Example: } else { - what.form.<% $opt{'field_name'} %>.value = custnum; + what.form.<% $field %>.value = custnum; customer_obj.value = customer; customer_obj.style.color = '#000000'; @@ -177,7 +178,8 @@ Example: <%init> my( %opt ) = @_; -$opt{'field_name'} ||= 'custnum'; + +my $field = $opt{'field'} || $opt{'field_name'} || 'custnum'; my $value = $opt{'curr_value'} || $opt{'value'}; diff --git a/httemplate/elements/select-areacode.html b/httemplate/elements/select-areacode.html index aa2d73b..453205c 100644 --- a/httemplate/elements/select-areacode.html +++ b/httemplate/elements/select-areacode.html @@ -12,7 +12,7 @@ what.options[length] = optionName; } - function <% $opt{'prefix'} %>state_changed(what, callback) { + function <% $opt{'state_prefix'} %>state_changed(what, callback) { what.form.<% $opt{'prefix'} %>areacode.disabled = 'disabled'; what.form.<% $opt{'prefix'} %>areacode.style.display = 'none'; @@ -24,7 +24,7 @@ what.form.<% $opt{'prefix'} %>exchange.disabled = 'disabled'; what.form.<% $opt{'prefix'} %>phonenum.disabled = 'disabled'; - state = what.options[what.selectedIndex].value; + var state = what.options[what.selectedIndex].value; function <% $opt{'prefix'} %>update_areacodes(areacodes) { @@ -86,6 +86,7 @@ my %opt = @_; -$opt{disabled} = 'disabled' unless exists $opt{disabled}; +$opt{disabled} = 'disabled' unless exists $opt{disabled}; +$opt{state_prefix} = $opt{prefix} unless exists $opt{state_prefix}; </%init> diff --git a/httemplate/elements/select-did.html b/httemplate/elements/select-did.html index af8d595..b62d6a0 100644 --- a/httemplate/elements/select-did.html +++ b/httemplate/elements/select-did.html @@ -3,7 +3,7 @@ Example: include('/elements/select-did.html', - 'field' => 'phonenum', + #can't actuall change from phonenum yet# 'field' => 'phonenum', 'svcpart' => 5, #OR @@ -18,6 +18,7 @@ Example: <TR> <TD> <% include('/elements/select-state.html', + 'prefix' => 'phonenum_', #$field.'_', 'country' => $country, 'disable_empty' => 0, 'empty_label' => 'Select state', @@ -26,8 +27,9 @@ Example: </TD> <TD> <% include('/elements/select-areacode.html', - 'svcpart' => $svcpart, - 'empty' => 'Select area code', + 'state_prefix' => 'phonenum_', #$field.'_', + 'svcpart' => $svcpart, + 'empty' => 'Select area code', ) %> </TD> @@ -84,4 +86,6 @@ if ( scalar(@exports) > 1 ) { my $use_selector = scalar(@exports) ? 1 : 0; +#my $field = $opt{'field'} || 'phonenum'; + </%init> diff --git a/httemplate/elements/tr-search-cust_main.html b/httemplate/elements/tr-search-cust_main.html new file mode 100644 index 0000000..9df91a1 --- /dev/null +++ b/httemplate/elements/tr-search-cust_main.html @@ -0,0 +1,15 @@ +<% include('tr-td-label.html', @_ ) %> + + <TD <% $colspan %> <% $cell_style %> ID="<% $opt{input_id} || $opt{id}.'_input0' %>"><% include('search-cust_main.html', @_ ) %></TD> + +</TR> + +<%init> + +my %opt = @_; + +my $cell_style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : ''; + +my $colspan = $opt{'colspan'} ? 'COLSPAN="'.$opt{'colspan'}.'"' : ''; + +</%init> diff --git a/httemplate/elements/tr-select-cust_location.html b/httemplate/elements/tr-select-cust_location.html index da16dfe..bc39154 100644 --- a/httemplate/elements/tr-select-cust_location.html +++ b/httemplate/elements/tr-select-cust_location.html @@ -118,7 +118,7 @@ Example: </SCRIPT> <TR> - <TH ALIGN="right">Service location</TH> + <<%$th%> ALIGN="right"><% $opt{'label'} || 'Service location' %></<%$th%>> <TD COLSPAN=7> <SELECT NAME="locationnum" onChange="locationnum_changed(this);"> <OPTION VALUE="">(default service address) @@ -139,6 +139,7 @@ Example: #'onchange' ? probably not 'disabled' => ( $locationnum == -1 ? '' : 'DISABLED' ), 'no_asterisks' => 1, + 'no_bold' => $opt{'no_bold'}, ) %> @@ -156,6 +157,7 @@ my $statedefault = $conf->config('statedefault') my %opt = @_; my $cgi = $opt{'cgi'}; +my $cust_pkg = $opt{'cust_pkg'}; my $cust_main = $opt{'cust_main'}; my $prefix = length($cust_main->ship_last) ? 'ship_' : ''; @@ -170,9 +172,15 @@ if ( $locationnum && $locationnum != -1 ) { $cust_location = new FS::cust_location; if ( $locationnum == -1 ) { $cust_location->$_( $cgi->param($_) ) foreach @location_fields; + } elsif ( $cust_pkg && $cust_pkg->locationnum ) { + my $pkg_location = $cust_pkg->cust_location; + $cust_location->$_( $pkg_location->$_ ) foreach @location_fields; + $opt{'empty_label'} ||= 'package address: '.$pkg_location->line; } else { $cust_location->$_( $cust_main->get($prefix.$_) ) foreach @location_fields; } } +my $th = $opt{'no_bold'} ? 'TD' : 'TH'; + </%init> |