diff options
author | ivan <ivan> | 2001-07-30 07:36:04 +0000 |
---|---|---|
committer | ivan <ivan> | 2001-07-30 07:36:04 +0000 |
commit | 51984ac3d3da3006809c6866fdecd4ad83610731 (patch) | |
tree | ac16f533c25a1947eee7bee226fed5638c42bd94 /bin | |
parent | 9c2016b3a564d439960420114ce6f4cab3bf723b (diff) |
templates!!!
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/fs-setup | 39 | ||||
-rwxr-xr-x | bin/masonize | 70 | ||||
-rwxr-xr-x | bin/pod2x | 8 |
3 files changed, 112 insertions, 5 deletions
diff --git a/bin/fs-setup b/bin/fs-setup index c1e87c8d6..1113966f8 100755 --- a/bin/fs-setup +++ b/bin/fs-setup @@ -1,6 +1,6 @@ #!/usr/bin/perl -Tw # -# $Id: fs-setup,v 1.37 2001-06-03 14:16:11 ivan Exp $ +# $Id: fs-setup,v 1.38 2001-07-30 07:36:04 ivan Exp $ # # ivan@sisd.com 97-nov-8,9 # @@ -32,7 +32,10 @@ # fix radius attributes ivan@sisd.com 98-sep-27 # # $Log: fs-setup,v $ -# Revision 1.37 2001-06-03 14:16:11 ivan +# Revision 1.38 2001-07-30 07:36:04 ivan +# templates!!! +# +# Revision 1.37 2001/06/03 14:16:11 ivan # allow empty refund reasons # # Revision 1.36 2001/04/15 12:56:31 ivan @@ -177,12 +180,24 @@ separated by whitespace. END my @attributes = map { s/\-/_/g; $_; } split(" ",&getvalue); +print "\n\n", <<END, ":"; +Do you wish to enable the tracking of a second, separate shipping/service +address? +END +my $ship = &_yesno; + sub getvalue { my($x)=scalar(<STDIN>); chop $x; $x; } +sub _yesno { + print " [y/N]:"; + my $x = scalar(<STDIN>); + $x =~ /^y/i; +} + ### my($char_d) = 80; #default maxlength for text fields @@ -214,6 +229,12 @@ my($dbdef) = new DBIx::DBSchema ( map { ); } (keys %tables) ); +#remove ship_ from cust_main +unless ($ship) { + my $cust_main = $dbdef->table('cust_main'); + $cust_main->delcolumn($_) foreach ( grep /^ship_/, $cust_main->columns ); +} + #add radius attributes to svc_acct my($svc_acct)=$dbdef->table('svc_acct'); @@ -452,6 +473,20 @@ sub tables_hash_hack { 'daytime', 'varchar', 'NULL', 20, 'night', 'varchar', 'NULL', 20, 'fax', 'varchar', 'NULL', 12, + 'ship_last', 'varchar', 'NULL', $char_d, +# 'ship_middle', 'varchar', 'NULL', $char_d, + 'ship_first', 'varchar', 'NULL', $char_d, + 'ship_company', 'varchar', 'NULL', $char_d, + 'ship_address1', 'varchar', 'NULL', $char_d, + 'ship_address2', 'varchar', 'NULL', $char_d, + 'ship_city', 'varchar', 'NULL', $char_d, + 'ship_county', 'varchar', 'NULL', $char_d, + 'ship_state', 'varchar', 'NULL', $char_d, + 'ship_zip', 'varchar', 'NULL', 10, + 'ship_country', 'char', 'NULL', 2, + 'ship_daytime', 'varchar', 'NULL', 20, + 'ship_night', 'varchar', 'NULL', 20, + 'ship_fax', 'varchar', 'NULL', 12, 'payby', 'char', '', 4, 'payinfo', 'varchar', 'NULL', 16, #'paydate', @date_type, diff --git a/bin/masonize b/bin/masonize new file mode 100755 index 000000000..475c9a6bf --- /dev/null +++ b/bin/masonize @@ -0,0 +1,70 @@ +#!/usr/bin/perl + +foreach $file ( split(/\n/, `find . -depth -print | grep cgi\$`) ) { + open(F,$file) or die "can't open $file for reading: $!"; + @file = <F>; + #print "$file ". scalar(@file). "\n"; + close $file; + system("chmod u+w $file"); + open(W,">$file") or die "can't open $file for writing: $!"; + select W; $| = 1; select STDOUT; + $all = join('',@file); + + $mode = 'html'; + while ( length($all) ) { + + if ( $mode eq 'html' ) { + + if ( $all =~ /^(.+?)(<%=?.*)$/s && $1 !~ /<%/s ) { + print W $1; + $all = $2; + next; + } elsif ( $all =~ /^<%=(.*)$/s ) { + print W '<%'; + $all = $1; + $mode = 'perlv'; + #die; + next; + } elsif ( $all =~ /^<%(.*)$/s ) { + print W "\n"; + $all = $1; + $mode = 'perlc'; + next; + } elsif ( $all !~ /<%/s ) { + print W $all; + last; + } else { + warn length($all); die; + } + die; + + } elsif ( $mode eq 'perlv' ) { + + if ( $all =~ /^(.*?%>)(.*)$/s ) { + print W $1; + $all=$2; + $mode = 'html'; + next; + } + die 'unterminated <%= ???'; + + } elsif ( $mode eq 'perlc' ) { + + if ( $all =~ /^([^\n]*?)%>(.*)$/s ) { + print W "%$1\n"; + $all=$2; + $mode='html'; + next; + } + if ( $all =~ /^([^\n]*)\n(.*)$/s ) { + print W "%$1\n"; + $all=$2; + next; + } + + } else { die }; + + } + + close W; +} @@ -6,12 +6,14 @@ my $site_perl = "./FS"; #my $catman = "./catman"; #my $catman = "./htdocs/docs/man"; -my $html = "./htdocs/docs/man"; +#my $html = "./htdocs/docs/man"; +my $html = "./httemplate/docs/man"; $|=1; -die "Can't find $site_perl and $catman" - unless [ -d $site_perl ] && [ -d $catman ] && [ -d $html ]; +die "Can't find $site_perl" unless -d $site_perl; +#die "Can't find $catman" unless -d $catman; +die "Can't find $html" unless -d $html; foreach my $file ( glob("$site_perl/*.pm"), |