From c1bb4ddb71147d0571bd301a6d8c452fdf0e1bc9 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 31 Jan 2006 04:26:54 +0000 Subject: move header() to include(/elements/header.html) so it can be changed in one place, thanks to Scott Edwards --- httemplate/misc/cust_main-import.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/misc/cust_main-import.cgi') diff --git a/httemplate/misc/cust_main-import.cgi b/httemplate/misc/cust_main-import.cgi index 6b36f478d..484855005 100644 --- a/httemplate/misc/cust_main-import.cgi +++ b/httemplate/misc/cust_main-import.cgi @@ -1,5 +1,5 @@ -<%= header('Batch Customer Import') %> +<%= include("/elements/header.html",'Batch Customer Import') %>
Import a CSV file containing customer records.

Default file format is CSV, with the following field order: cust_pkg.setup, dayphone, first, last, address1, address2, city, state, zip, comments

-- cgit v1.2.1 From 04cbf1d986eabf7fdcc22ff95b95da17e5f4bf63 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 15 Aug 2006 14:20:51 +0000 Subject: add a new, extended CSV import format --- httemplate/misc/cust_main-import.cgi | 102 ++++++++++++++++++++--------------- 1 file changed, 58 insertions(+), 44 deletions(-) (limited to 'httemplate/misc/cust_main-import.cgi') diff --git a/httemplate/misc/cust_main-import.cgi b/httemplate/misc/cust_main-import.cgi index 484855005..2ad4d95b4 100644 --- a/httemplate/misc/cust_main-import.cgi +++ b/httemplate/misc/cust_main-import.cgi @@ -1,51 +1,65 @@ - <%= include("/elements/header.html",'Batch Customer Import') %> + -Import a CSV file containing customer records.

-Default file format is CSV, with the following field order: cust_pkg.setup, dayphone, first, last, address1, address2, city, state, zip, comments

-<% - #false laziness with edit/cust_main.cgi - my @agents = qsearch( 'agent', {} ); - die "No agents created!" unless @agents; - my $agentnum = $agents[0]->agentnum; #default to first +Import a CSV file containing customer records. +

+ + + +Extended file format is CSV, with the following field order: agent_custid, refnum[1], last, first, address1, address2, city, state, zip, country, daytime, night, ship_last, ship_first, ship_address1, ship_address2, ship_city, ship_state, ship_zip, ship_country, payinfo, paycvv, paydate, invoicing_list, pkgpart, username, _password +

- if ( scalar(@agents) == 1 ) { +[1] This field has special treatment upon import: If a string is passed instead +of an integer, the string is searched for and if necessary auto-created in the +target table. +

+ +<%= &ntable("#cccccc") %> + +<%= include('/elements/tr-select-agent.html', '', #$agentnum, + 'label' => "Agent", + 'empty_label' => 'Select agent', + ) %> - -<% } else { %> -

Agent

-<% } %> - -<% - my @referrals = qsearch('part_referral',{}); - die "No advertising sources created!" unless @referrals; - my $refnum = $referrals[0]->refnum; #default to first - - if ( scalar(@referrals) == 1 ) { + + + Format + + + + + + + CSV filename + + + +<% #include('/elements/tr-select-part_referral.html') %> - -<% } else { %> -

Advertising source

-<% } %> - - First package:

- - CSV Filename:

- - - - + + + + +

+ + + + +<%= include('/elements/footer.html') %> -- cgit v1.2.1 From 3ce7691203a7737406bf2d4442f7fd84b81f847e Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 23 Aug 2006 22:25:39 +0000 Subject: Will things ever be the same again? It's the final masonize --- httemplate/misc/cust_main-import.cgi | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'httemplate/misc/cust_main-import.cgi') diff --git a/httemplate/misc/cust_main-import.cgi b/httemplate/misc/cust_main-import.cgi index 2ad4d95b4..f7a8d8b52 100644 --- a/httemplate/misc/cust_main-import.cgi +++ b/httemplate/misc/cust_main-import.cgi @@ -1,4 +1,4 @@ -<%= include("/elements/header.html",'Batch Customer Import') %> +<% include("/elements/header.html",'Batch Customer Import') %>
@@ -16,9 +16,9 @@ of an integer, the string is searched for and if necessary auto-created in the target table.

-<%= &ntable("#cccccc") %> +<% &ntable("#cccccc") %> -<%= include('/elements/tr-select-agent.html', '', #$agentnum, +<% include('/elements/tr-select-agent.html', '', #$agentnum, 'label' => "Agent", 'empty_label' => 'Select agent', ) @@ -38,18 +38,20 @@ target table. CSV filename +% #include('/elements/tr-select-part_referral.html') +% -<% #include('/elements/tr-select-part_referral.html') -%> -Extended file format is CSV, with the following field order: agent_custid, refnum[1], last, first, address1, address2, city, state, zip, country, daytime, night, ship_last, ship_first, ship_address1, ship_address2, ship_city, ship_state, ship_zip, ship_country, payinfo, paycvv, paydate, invoicing_list, pkgpart, username, _password +Extended file format is CSV, with the following field order: agent_custid, refnum[1]<%$req%>, last<%$req%>, first<%$req%>, address1<%$req%>, address2, city<%$req%>, state<%$req%>, zip<%$req%>, country, daytime, night, ship_last, ship_first, ship_address1, ship_address2, ship_city, ship_state, ship_zip, ship_country, payinfo<%$req%>, paycvv, paydate<%$req%>, invoicing_list, pkgpart, username[2], _password[2] +

+ +<%$req%> Required fields

[1] This field has special treatment upon import: If a string is passed instead @@ -16,6 +19,9 @@ of an integer, the string is searched for and if necessary auto-created in the target table.

+[2] username and _password are required if pkgpart is specified. +

+ <% &ntable("#cccccc") %> <% include('/elements/tr-select-agent.html', '', #$agentnum, @@ -65,3 +71,6 @@ target table. <% include('/elements/footer.html') %> +<%once> +my $req = qq!*!; + -- cgit v1.2.1