summaryrefslogtreecommitdiff
path: root/httemplate/misc
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/misc')
-rwxr-xr-xhttemplate/misc/change_pkg.cgi12
-rw-r--r--httemplate/misc/choose_tax_location.html90
-rwxr-xr-xhttemplate/misc/cust_main-merge.html40
-rwxr-xr-xhttemplate/misc/delete-domain_record.cgi2
-rw-r--r--httemplate/misc/email-customers.html1
-rw-r--r--httemplate/misc/merge_cust.html72
-rw-r--r--httemplate/misc/order_pkg.html53
-rwxr-xr-xhttemplate/misc/unprovision.cgi32
-rw-r--r--httemplate/misc/xmlhttp-cust_main-address_standardize.html1
-rw-r--r--httemplate/misc/xmlhttp-cust_main-search.cgi4
10 files changed, 38 insertions, 269 deletions
diff --git a/httemplate/misc/change_pkg.cgi b/httemplate/misc/change_pkg.cgi
index ec10b85cf..16b707121 100755
--- a/httemplate/misc/change_pkg.cgi
+++ b/httemplate/misc/change_pkg.cgi
@@ -2,7 +2,7 @@
<% include('/elements/error.html') %>
-<FORM NAME="OrderPkgForm" ACTION="<% $p %>edit/process/change-cust_pkg.html" METHOD=POST>
+<FORM ACTION="<% $p %>edit/process/change-cust_pkg.html" METHOD=POST>
<INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum %>">
<% ntable('#cccccc') %>
@@ -31,16 +31,8 @@
</TABLE>
-<% include( '/elements/standardize_locations.html',
- 'form' => "OrderPkgForm",
- 'onlyship' => 1,
- 'no_company' => 1,
- 'callback' => 'document.OrderPkgForm.submit();',
- )
-%>
-
<BR>
-<INPUT NAME="submitButton" TYPE="button" VALUE="Change package" onClick="this.disabled=true; standardize_locations();">
+<INPUT TYPE="submit" VALUE="Change package">
</FORM>
</BODY>
diff --git a/httemplate/misc/choose_tax_location.html b/httemplate/misc/choose_tax_location.html
deleted file mode 100644
index dce04c77d..000000000
--- a/httemplate/misc/choose_tax_location.html
+++ /dev/null
@@ -1,90 +0,0 @@
-<FORM NAME="choosegeocodeform">
-<CENTER><BR><B>Choose tax location</B><BR><BR>
-<P>the geocode is:<% $header %></P>
-<P STYLE="<% $style %>"><% $header %></P>
-
-<SELECT NAME='geocodes' ID='geocodes' STYLE="<% $style %>">
-% foreach my $location (@cust_tax_location) {
-% my %value = ( zip => $zip5,
-% map { $_ => $location->$_ }
-% qw ( city state geocode )
-% );
-% map { $value{$_} = $location{$_} } qw ( city state )
-% if $location{country} eq 'CA';
-%
-% my $value = encode_entities(objToJson({ %value })
-% );
-% my $content = '';
-% $content .= $location->$_. '&nbsp;' x ( $max{$_} - length($location->$_) )
-% foreach qw( city county state );
-% $content .= $location->cityflag eq 'I' ? 'Y' : 'N' ;
-% my $selected = '' ;
-% if ($geocode && $location->geocode eq $geocode) {
-% $selected = 'SELECTED';
-% }
- <OPTION VALUE="<% $value %>" STYLE="<% $style %>" <% $selected %>><% $content %>
-% }
-</SELECT><BR><BR>
-
-<TABLE><TR>
- <TD> <BUTTON TYPE="button" onClick="set_geocode(document.getElementById('geocodes'));"><IMG SRC="<%$p%>images/tick.png" ALT=""> Set location </BUTTON></TD>
- <TD><BUTTON TYPE="button" onClick="document.<% $formname %>.submitButton.disabled=false; parent.cClick();"><IMG SRC="<%$p%>images/cross.png" ALT=""> Cancel submission </BUTTON></TD>
-</TR>
-</TABLE>
-
-</CENTER>
-</FORM>
-<%init>
-
-my $conf = new FS::Conf;
-
-my %location = ();
-
-($location{data_vendor}) = $cgi->param('data_vendor') =~ /^([-\w]+)$/;
-($location{city}) = $cgi->param('city') =~ /^([\w ]+)$/;
-($location{state}) = $cgi->param('state') =~ /^(\w+)$/;
-($location{zip}) = $cgi->param('zip') =~ /^([-\w ]+)$/;
-($location{country}) = $cgi->param('country') =~ /^([\w ]+)$/;
-
-my($geocode) = $cgi->param('geocode') =~ /^([\w]+)$/;
-
-my($formname) = $cgi->param('formname') =~ /^([\w]*)$/;
-$formname ||= 'CustomerForm';
-
-my($zip5, $zip4) = split('-', $location{zip});
-
-#only support US & CA
-my $hashref = { 'data_vendor' => $location{data_vendor} };
-$hashref->{zip} = $location{country} eq 'CA' ? substr($zip5,0,1) : $zip5,
-
-my @keys = keys(%$hashref);
-my @cust_tax_location = ();
-until ( @cust_tax_location ) {
- @cust_tax_location = qsearch({ table => 'cust_tax_location',
- hashref => $hashref,
- order_by => 'LIMIT 50',
- });
- last unless scalar(@keys);
- delete $hashref->{ shift @keys };
-}
-
-my %max = ( city => 4, county => 6, state => 5);
-foreach my $location (@cust_tax_location) {
- foreach ( qw( city county state ) ) {
- my $length = length($location->$_);
- $max{$_} = ($length > $max{$_}) ? $length : $max{$_};
- }
-}
-foreach ( qw( city county state ) ) {
- $max{$_} = $location{$_} if $location{$_} > $max{$_};
- $max{$_}++;
-}
-
-my $header = '&nbsp;&nbsp;';
-$header .= $_. '&nbsp;' x ( $max{lc($_)} - length($_) )
- foreach qw( City County State );
-$header .= "In city?";
-
-my $style = "font-family:monospace;";
-
-</%init>
diff --git a/httemplate/misc/cust_main-merge.html b/httemplate/misc/cust_main-merge.html
deleted file mode 100755
index 4decbef7a..000000000
--- a/httemplate/misc/cust_main-merge.html
+++ /dev/null
@@ -1,40 +0,0 @@
-% if ( $error ) {
-% $cgi->param('error', $error);
-<% $cgi->redirect(popurl(1). "merge_cust.html?". $cgi->query_string ) %>
-% } else {
-<% include('/elements/header-popup.html', "Customer merged") %>
- <SCRIPT TYPE="text/javascript">
- window.top.location.href = '<% $p %>view/cust_main.cgi?<% $new_custnum %>';
-%# parent.nd(1) ?
- </SCRIPT>
- </BODY>
-</HTML>
-% }
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Merge customer');
-
-my $error = '';
-
-$cgi->param('custnum') =~ /^(\d+)$/ or die "illegal custnum";
-my $custnum = $1;
-
-my $new_custnum;
-if ( $cgi->param('new_custnum') =~ /^(\d+)$/ ) {
- $new_custnum = $1;
-
- my $cust_main = qsearchs( {
- 'table' => 'cust_main',
- 'hashref' => { 'custnum' => $custnum },
- 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
- } );
- die "No customer # $custnum" unless $cust_main;
-
- $error = $cust_main->merge($new_custnum);
-
-} else {
- $error = 'Select a customer to merge into';
-}
-
-</%init>
diff --git a/httemplate/misc/delete-domain_record.cgi b/httemplate/misc/delete-domain_record.cgi
index 200365d2f..08eedde5f 100755
--- a/httemplate/misc/delete-domain_record.cgi
+++ b/httemplate/misc/delete-domain_record.cgi
@@ -1,7 +1,7 @@
% if ( $error ) {
% errorpage($error);
% } else {
-<% $cgi->redirect($p. "view/svc_domain.cgi?". $domain_record->svcnum. '#dns') %>
+<% $cgi->redirect($p. "view/svc_domain.cgi?". $domain_record->svcnum) %>
% }
<%init>
diff --git a/httemplate/misc/email-customers.html b/httemplate/misc/email-customers.html
index 759c8bf94..0ec8bb9df 100644
--- a/httemplate/misc/email-customers.html
+++ b/httemplate/misc/email-customers.html
@@ -29,7 +29,6 @@
% if ( $cgi->param('action') ) {
<TABLE BGCOLOR="#cccccc" CELLSPACING=0>
- <INPUT TYPE="hidden" NAME="msgnum" VALUE="<% $cgi->param('msgnum') %>">
% if ( $msg_template ) {
<% include('/elements/tr-fixed.html',
diff --git a/httemplate/misc/merge_cust.html b/httemplate/misc/merge_cust.html
deleted file mode 100644
index ad075be2f..000000000
--- a/httemplate/misc/merge_cust.html
+++ /dev/null
@@ -1,72 +0,0 @@
-<% include('/elements/header-popup.html', 'Merge customer' ) %>
-
-<% include('/elements/error.html') %>
-
-<FORM NAME="cust_merge_popup" ID="cust_merge_popup" ACTION="<% popurl(1) %>cust_main-merge.html" METHOD=POST onSubmit="submit_merge(); return false;">
-
-<SCRIPT TYPE="text/javascript">
-
-var submit_interval_id;
-function submit_merge() {
- document.getElementById('confirm_merge_cust_button').disabled = 'true';
- smart_new_custnum_search(document.getElementById('new_custnum_search'));
- submit_interval_id = setInterval( do_submit_merge, 100);
-}
-
-function do_submit_merge() {
-
- if ( new_custnum_search_active )
- return;
-
- document.getElementById('confirm_merge_cust_button').disabled = '';
-
- clearInterval(submit_interval_id);
-
- if ( document.cust_merge_popup.new_custnum.value != '' ) {
- document.cust_merge_popup.submit();
- }
-
-}
-
-</SCRIPT>
-
-</SCRIPT>
-
-<INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>">
-
-<TABLE BORDER="0" CELLSPACING="2" STYLE="margin-left:auto; margin-right:auto">
- <% include('/elements/tr-search-cust_main.html',
- 'label' => 'Merge into: ',
- 'field' => 'new_custnum',
- 'find_button' => 1,
- 'curr_value' => scalar($cgi->param('new_custnum')),
- )
- %>
-</TABLE>
-
-<P ALIGN="CENTER">
-%#have merge button start out disabled and enable after you select a target cust
-<INPUT TYPE="submit" NAME="confirm_merge_cust_button" ID="confirm_merge_cust_button" VALUE="Merge customer">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT TYPE="BUTTON" VALUE="Don't merge" onClick="parent.cClick();">
-
-</FORM>
-</BODY>
-</HTML>
-
-<%init>
-
-$cgi->param('custnum') =~ /^(\d+)$/ or die 'illegal custnum';
-my $custnum = $1;
-
-my $curuser = $FS::CurrentUser::CurrentUser;
-
-die "access denied" unless $curuser->access_right('Merge customer');
-
-my $cust_main = qsearchs( {
- 'table' => 'cust_main',
- 'hashref' => { 'custnum' => $custnum },
- 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
-} );
-die "No customer # $custnum" unless $cust_main;
-
-</%init>
-
diff --git a/httemplate/misc/order_pkg.html b/httemplate/misc/order_pkg.html
index b232debd7..8479a7573 100644
--- a/httemplate/misc/order_pkg.html
+++ b/httemplate/misc/order_pkg.html
@@ -9,14 +9,14 @@
function enable_order_pkg () {
if ( document.OrderPkgForm.pkgpart.selectedIndex > 0 ) {
- document.OrderPkgForm.submitButton.disabled = false;
+ document.OrderPkgForm.submit.disabled = false;
if ( document.OrderPkgForm.pkgpart.options[document.OrderPkgForm.pkgpart.selectedIndex].getAttribute('data-can_discount') == 1 ) {
document.OrderPkgForm.discountnum.disabled = false;
} else {
document.OrderPkgForm.discountnum.disabled = true;
}
} else {
- document.OrderPkgForm.submitButton.disabled = true;
+ document.OrderPkgForm.submit.disabled = true;
document.OrderPkgForm.discountnum.disabled = true;
}
}
@@ -38,19 +38,34 @@
)
%>
+%# false laziness w/edit/quick-charge.html
<TR>
<TH ALIGN="right">Start date </TD>
<TD COLSPAN=6>
- <% include('/elements/input-date-field.html',{
- 'name' => 'start_date',
- 'format' => $date_format,
- 'value' => $start_date,
- 'noinit' => 1,
- }) %>
+ <INPUT TYPE = "text"
+ NAME = "start_date"
+ SIZE = 32
+ ID = "start_date_text"
+ VALUE = "<% $start_date %>"
+ >
+ <IMG SRC = "../images/calendar.png"
+ ID = "start_date_button"
+ STYLE = "cursor: pointer"
+ TITLE = "Select date"
+ >
<FONT SIZE=-1>(leave blank to start immediately)</FONT>
</TD>
</TR>
+<SCRIPT TYPE="text/javascript">
+ Calendar.setup({
+ inputField: "start_date_text",
+ ifFormat: "<% $date_format %>",
+ button: "start_date_button",
+ align: "BR"
+ });
+</SCRIPT>
+
% if ( $cust_main->payby =~ /^(CARD|CHEK)$/ ) {
% my $what = lc(FS::payby->shortname($cust_main->payby));
<TR>
@@ -84,30 +99,10 @@
)
%>
-<TR>
- <TH ALIGN="right">Contract end date </TD>
- <TD COLSPAN=6>
- <% include('/elements/input-date-field.html',{
- 'name' => 'contract_end',
- 'format' => $date_format,
- 'value' => '',
- 'noinit' => 1,
- }) %>
- </TD>
-</TR>
-
</TABLE>
-<% include( '/elements/standardize_locations.html',
- 'form' => "OrderPkgForm",
- 'onlyship' => 1,
- 'no_company' => 1,
- 'callback' => 'document.OrderPkgForm.submit();',
- )
-%>
-
<BR>
-<INPUT NAME="submitButton" TYPE="button" VALUE="Order Package" onClick = "this.disabled=true; standardize_locations();" <% $pkgpart ? '' : 'DISABLED' %>>
+<INPUT NAME="submit" TYPE="submit" VALUE="Order Package" <% $pkgpart ? '' : 'DISABLED' %>>
</FORM>
</BODY>
diff --git a/httemplate/misc/unprovision.cgi b/httemplate/misc/unprovision.cgi
index 6f2c23815..4ab15fdc0 100755
--- a/httemplate/misc/unprovision.cgi
+++ b/httemplate/misc/unprovision.cgi
@@ -1,8 +1,6 @@
%if ( $error ) {
% errorpage($error);
-%} elsif ( $pkgnum ) {
-<% $cgi->redirect(popurl(2)."search/cust_pkg_svc.html?svcpart=$svcpart;pkgnum=$pkgnum") %>
-%} else { # $custnum should always exist
+%} else {
<% $cgi->redirect(popurl(2)."view/cust_main.cgi?$custnum") %>
%}
<%init>
@@ -11,28 +9,18 @@ die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Unprovision customer service');
#untaint svcnum
-my @svcnums;
-my ($pkgnum, $svcpart, $custnum);
-if( $cgi->param('svcnum') ) {
- @svcnums = grep { $_ } map { /^(\d+)$/ && $1 } $cgi->param('svcnum');
- $pkgnum = $cgi->param('pkgnum');
- $svcpart = $cgi->param('svcpart');
- $custnum = $cgi->param('custnum');
-}
-else {
- @svcnums = map { /^(\d+)$/ && $1 } $cgi->keywords;
-}
+my($query) = $cgi->keywords;
+$query =~ /^(\d+)$/;
+my $svcnum = $1;
-my $error = '';
-foreach my $svcnum (@svcnums) {
+#my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$svcnum});
+#die "Unknown svcnum!" unless $svc_acct;
- my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
- die "Unknown svcnum!" unless $cust_svc;
+my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
+die "Unknown svcnum!" unless $cust_svc;
- $custnum ||= $cust_svc->cust_pkg->custnum;
+my $custnum = $cust_svc->cust_pkg->custnum;
- $error .= $cust_svc->cancel;
-
-}
+my $error = $cust_svc->cancel;
</%init>
diff --git a/httemplate/misc/xmlhttp-cust_main-address_standardize.html b/httemplate/misc/xmlhttp-cust_main-address_standardize.html
index d0627cd59..3b9e142f5 100644
--- a/httemplate/misc/xmlhttp-cust_main-address_standardize.html
+++ b/httemplate/misc/xmlhttp-cust_main-address_standardize.html
@@ -28,7 +28,6 @@ if ( $sub eq 'address_standardize' ) {
} );
foreach my $pre ( '', 'ship_' ) {
- next unless ($pre || !$arg{onlyship});
my($zip5, $zip4) = split('-',$arg{$pre.'zip'});
diff --git a/httemplate/misc/xmlhttp-cust_main-search.cgi b/httemplate/misc/xmlhttp-cust_main-search.cgi
index 481bea264..615a4bb1e 100644
--- a/httemplate/misc/xmlhttp-cust_main-search.cgi
+++ b/httemplate/misc/xmlhttp-cust_main-search.cgi
@@ -22,9 +22,7 @@
% } elsif ( $sub eq 'smart_search' ) {
%
% my $string = $cgi->param('arg');
-% my @cust_main = smart_search( 'search' => $string,
-% 'no_fuzzy_on_exact' => 1, #pref?
-% );
+% my @cust_main = smart_search( 'search' => $string );
% my $return = [ map [ $_->custnum, $_->name ], @cust_main ];
%
<% objToJson($return) %>