diff options
Diffstat (limited to 'httemplate')
15 files changed, 107 insertions, 1 deletions
diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 9ce55b0b9..83f28d395 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -277,7 +277,13 @@ function areyousure(href, message) { % } % if ( $view eq 'custom' ) { +% if ( $conf->config('cust_main-custom_link') ) { <& cust_main/custom.html, $cust_main &> +% } elsif ( $conf->config('cust_main-custom_content') ) { + <& cust_main/custom_content.html, $cust_main &> +% #} else { +% # warn "custom view without cust_main-custom_link or -custom_content?"; +% } % } </DIV> @@ -326,7 +332,8 @@ $views{emt('Payment History')} = 'payment_history' $views{emt('Change History')} = 'change_history' if $curuser->access_right('View customer history'); $views{$conf->config('cust_main-custom_title') || emt('Custom')} = 'custom' - if $conf->config('cust_main-custom_link'); + if $conf->config('cust_main-custom_link') + || $conf->config('cust_main-custom_content'); $views{emt('Jumbo')} = 'jumbo'; my %viewname = reverse %views; diff --git a/httemplate/view/cust_main/custom_content/.birthdate.html.swp b/httemplate/view/cust_main/custom_content/.birthdate.html.swp Binary files differnew file mode 100644 index 000000000..9571d22cf --- /dev/null +++ b/httemplate/view/cust_main/custom_content/.birthdate.html.swp diff --git a/httemplate/view/cust_main/custom_content/.small_custview.html.swp b/httemplate/view/cust_main/custom_content/.small_custview.html.swp Binary files differnew file mode 100644 index 000000000..a39f52dde --- /dev/null +++ b/httemplate/view/cust_main/custom_content/.small_custview.html.swp diff --git a/httemplate/view/cust_main/custom_content/.spouse_birthdate.html.swp b/httemplate/view/cust_main/custom_content/.spouse_birthdate.html.swp Binary files differnew file mode 100644 index 000000000..0042012f7 --- /dev/null +++ b/httemplate/view/cust_main/custom_content/.spouse_birthdate.html.swp diff --git a/httemplate/view/cust_main/custom_content/.svc_Common.html.swp b/httemplate/view/cust_main/custom_content/.svc_Common.html.swp Binary files differnew file mode 100644 index 000000000..15591b96d --- /dev/null +++ b/httemplate/view/cust_main/custom_content/.svc_Common.html.swp diff --git a/httemplate/view/cust_main/custom_content/.svc_acct.html.swp b/httemplate/view/cust_main/custom_content/.svc_acct.html.swp Binary files differnew file mode 100644 index 000000000..e2db6d5d1 --- /dev/null +++ b/httemplate/view/cust_main/custom_content/.svc_acct.html.swp diff --git a/httemplate/view/cust_main/custom_content/.svc_hardware.html.swp b/httemplate/view/cust_main/custom_content/.svc_hardware.html.swp Binary files differnew file mode 100644 index 000000000..1106f9ed5 --- /dev/null +++ b/httemplate/view/cust_main/custom_content/.svc_hardware.html.swp diff --git a/httemplate/view/cust_main/custom_content/.svc_phone.html.swp b/httemplate/view/cust_main/custom_content/.svc_phone.html.swp Binary files differnew file mode 100644 index 000000000..79b8185e1 --- /dev/null +++ b/httemplate/view/cust_main/custom_content/.svc_phone.html.swp diff --git a/httemplate/view/cust_main/custom_content/birthdate.html b/httemplate/view/cust_main/custom_content/birthdate.html new file mode 100644 index 000000000..1f16963af --- /dev/null +++ b/httemplate/view/cust_main/custom_content/birthdate.html @@ -0,0 +1,15 @@ +<TABLE CLASS="fsinnerbox"> + <& /elements/tr-td-label.html, 'label' => mt('Date of Birth') &> + <TD BGCOLOR="#ffffff"><% $dt ? $dt->strftime($date_format) : '' %></TD> +</TR> +</TABLE> +<%init> +my($cust_main) = @_; +my $conf = new FS::Conf; +my $date_format = ($conf->config('date_format') || "%m/%d/%Y"); +my $dt = $cust_main->birthdate ne '' + ? DateTime->from_epoch( 'epoch' => $cust_main->birthdate, + 'time_zone' =>'floating', + ) + : ''; +</%init> diff --git a/httemplate/view/cust_main/custom_content/small_custview.html b/httemplate/view/cust_main/custom_content/small_custview.html new file mode 100644 index 000000000..b325f2ac7 --- /dev/null +++ b/httemplate/view/cust_main/custom_content/small_custview.html @@ -0,0 +1,8 @@ +<& /elements/small_custview.html, $cust_main &> +<%init> + +my($cust_main) = @_; + +my $conf = new FS::Conf; + +</%init> diff --git a/httemplate/view/cust_main/custom_content/spouse_birthdate.html b/httemplate/view/cust_main/custom_content/spouse_birthdate.html new file mode 100644 index 000000000..c78fd26a5 --- /dev/null +++ b/httemplate/view/cust_main/custom_content/spouse_birthdate.html @@ -0,0 +1,15 @@ +<TABLE CLASS="fsinnerbox"> + <& /elements/tr-td-label.html, 'label' => mt('Spouse Date of Birth') &> + <TD BGCOLOR="#ffffff"><% $dt ? $dt->strftime($date_format) : '' %></TD> +</TR> +</TABLE> +<%init> +my($cust_main) = @_; +my $conf = new FS::Conf; +my $date_format = ($conf->config('date_format') || "%m/%d/%Y"); +my $dt = $cust_main->spouse_birthdate ne '' + ? DateTime->from_epoch( 'epoch' => $cust_main->spouse_birthdate, + 'time_zone' =>'floating', + ) + : ''; +</%init> diff --git a/httemplate/view/cust_main/custom_content/svc_Common.html b/httemplate/view/cust_main/custom_content/svc_Common.html new file mode 100644 index 000000000..519a395c7 --- /dev/null +++ b/httemplate/view/cust_main/custom_content/svc_Common.html @@ -0,0 +1,40 @@ +% foreach my $cust_svc (@cust_svc) { +% my $svc_x = $cust_svc->svc_x; +% #warn $svc_x; +<TABLE CLASS="fsinnerbox"> +% foreach my $field ( grep $svc_x->$_(), @{ $opt{fields} } ) { + <& /elements/tr-td-label.html, 'label' => $labels{$field} &> + <TD BGCOLOR="#ffffff"><% $svc_x->$field() |h %></TD> + </TR> +% } +</TABLE> +% } +<%init> +my($cust_main, %opt) = @_; + +my $table = $opt{table}; +warn $table; +my @cust_svc = (); +foreach my $cust_pkg ( + grep {warn $_->num_cust_svc( 'svcdb'=>$table ); $_->num_cust_svc( 'svcdb'=>$table ); } + $cust_main->all_pkgs +) { + my @wtf = $cust_pkg->cust_svc( 'svcdb'=>$table ); + warn scalar(@wtf); + push @cust_svc, $cust_pkg->cust_svc( 'svcdb'=>$table ); +} + +my %labels; +if ( UNIVERSAL::can("FS::$table", 'table_info') ) { +# $opt{'name'} = "FS::$table"->table_info->{'name'}; + + my $fields = "FS::$table"->table_info->{'fields'}; + %labels = map { $_ => ( ref($fields->{$_}) + ? $fields->{$_}{'label'} + : $fields->{$_} + ); + } + keys %$fields; +} + +</%init> diff --git a/httemplate/view/cust_main/custom_content/svc_acct.html b/httemplate/view/cust_main/custom_content/svc_acct.html new file mode 100644 index 000000000..49b97986d --- /dev/null +++ b/httemplate/view/cust_main/custom_content/svc_acct.html @@ -0,0 +1,7 @@ +<& svc_Common.html, $cust_main, + 'table' => 'svc_acct', + 'fields' => [qw( username _password )], +&> +<%init> +my($cust_main) = @_; +</%init> diff --git a/httemplate/view/cust_main/custom_content/svc_hardware.html b/httemplate/view/cust_main/custom_content/svc_hardware.html new file mode 100644 index 000000000..f5d53a251 --- /dev/null +++ b/httemplate/view/cust_main/custom_content/svc_hardware.html @@ -0,0 +1,7 @@ +<& svc_Common.html, $cust_main, + 'table' => 'svc_hardware', + 'fields' => [qw( ip_addr hw_addr serial )], +&> +<%init> +my($cust_main) = @_; +</%init> diff --git a/httemplate/view/cust_main/custom_content/svc_phone.html b/httemplate/view/cust_main/custom_content/svc_phone.html new file mode 100644 index 000000000..46ec476bc --- /dev/null +++ b/httemplate/view/cust_main/custom_content/svc_phone.html @@ -0,0 +1,7 @@ +<& svc_Common.html, $cust_main, + 'table' => 'svc_phone', + 'fields' => [qw( phonenum )], +&> +<%init> +my($cust_main) = @_; +</%init> |