summaryrefslogtreecommitdiff
path: root/httemplate/edit/cust_location-censustract.html
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2014-12-05 18:12:09 -0800
committerMark Wells <mark@freeside.biz>2014-12-05 18:12:09 -0800
commit56d10a0d13cc291eb5ee6197c35b10407794f89c (patch)
treeb366470fe4158d9a924ce1b227f357cef28e1497 /httemplate/edit/cust_location-censustract.html
parentde75ffb000acb9e09518a5eb12b3cbfffa12e814 (diff)
477 report: detect errors and fix them more easily, #32499, from #24047
Diffstat (limited to 'httemplate/edit/cust_location-censustract.html')
-rwxr-xr-xhttemplate/edit/cust_location-censustract.html66
1 files changed, 66 insertions, 0 deletions
diff --git a/httemplate/edit/cust_location-censustract.html b/httemplate/edit/cust_location-censustract.html
new file mode 100755
index 000000000..bdb9823fa
--- /dev/null
+++ b/httemplate/edit/cust_location-censustract.html
@@ -0,0 +1,66 @@
+<% include('/elements/header-popup.html', "Edit Census Tract") %>
+
+<% include('/elements/error.html') %>
+
+<FORM NAME="EditLocationForm"
+ACTION="<% $p %>edit/process/cust_location-censustract.html" METHOD=POST>
+<INPUT TYPE="hidden" NAME="locationnum" VALUE="<% $locationnum %>">
+
+<% ntable('#cccccc') %>
+<& /elements/location.html,
+ 'object' => $cust_location,
+ 'no_asterisks' => 1,
+ 'enable_censustract' => 1,
+ 'disabled' => 'DISABLED',
+&>
+<& /elements/standardize_locations.html,
+ 'form' => 'EditLocationForm',
+ 'callback' => 'document.EditLocationForm.submit();',
+ 'with_census' => 1,
+ 'with_census_functions' => 1,
+&>
+</TABLE>
+
+<BR>
+<SCRIPT TYPE="text/javascript">
+<&| /elements/onload.js &>
+ document.getElementById('enter_censustract').disabled = false;
+</&>
+function go() {
+ confirm_censustract();
+}
+
+function submit_abort() {
+ nd(1);
+}
+</SCRIPT>
+<INPUT TYPE="button" NAME="submitButton" VALUE="Submit" onclick="go()">
+</FORM>
+</BODY>
+</HTML>
+
+<%init>
+
+my $conf = new FS::Conf;
+
+my $curuser = $FS::CurrentUser::CurrentUser;
+
+# it's the same access right you'd need to do this by editing packages
+die "access denied"
+ unless $curuser->access_right('Change customer package');
+
+my $locationnum = scalar($cgi->param('locationnum'));
+my $cust_location = qsearchs({
+ 'select' => 'cust_location.*',
+ 'table' => 'cust_location',
+ 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
+ 'hashref' => { 'locationnum' => $locationnum },
+ 'extra_sql' => ' AND '. $curuser->agentnums_sql,
+ }) or die "unknown locationnum $locationnum";
+
+# unlike the regular one, this allows editing disabled locations
+
+my $cust_main = qsearchs('cust_main', { 'custnum' => $cust_location->custnum })
+ or die "can't get cust_main record for custnum ". $cust_location->custnum;
+
+</%init>