diff options
Diffstat (limited to 'httemplate')
-rw-r--r-- | httemplate/edit/cust_main-contacts.html | 4 | ||||
-rw-r--r-- | httemplate/edit/msg_template.html | 1 | ||||
-rw-r--r-- | httemplate/edit/process/cust_main-contacts.html | 4 | ||||
-rw-r--r-- | httemplate/elements/contact.html | 44 | ||||
-rw-r--r-- | httemplate/view/cust_main/contacts_new.html | 49 |
5 files changed, 75 insertions, 27 deletions
diff --git a/httemplate/edit/cust_main-contacts.html b/httemplate/edit/cust_main-contacts.html index cd83a29..9f06546 100644 --- a/httemplate/edit/cust_main-contacts.html +++ b/httemplate/edit/cust_main-contacts.html @@ -4,7 +4,7 @@ 'post_url' => popurl(1). 'process/cust_main-contacts.html', 'no_pkey_display' => 1, 'labels' => { - 'contactnum' => 'Contact', + 'contactnum' => ' ', #'Contact', #'locationnum' => ' ', }, 'fields' => [ @@ -13,7 +13,7 @@ 'colspan' => 6, 'm2m_method' => 'cust_contact', 'm2m_dstcol' => 'contactnum', - 'm2_label' => 'Contact', + 'm2_label' => ' ', #'Contact', 'm2_error_callback' => $m2_error_callback, }, ], diff --git a/httemplate/edit/msg_template.html b/httemplate/edit/msg_template.html index 06cac44..6c9d2f4 100644 --- a/httemplate/edit/msg_template.html +++ b/httemplate/edit/msg_template.html @@ -209,6 +209,7 @@ my %substitutions = ( '$company_name' => 'Our company name', '$company_address'=> 'Our company address', '$company_phonenum' => 'Our phone number', + '$selfservice_server_base_url' => 'Base URL of customer self-service', ], 'contact' => [ # duplicate this for shipping '$name' => 'Company and contact name', diff --git a/httemplate/edit/process/cust_main-contacts.html b/httemplate/edit/process/cust_main-contacts.html index ed874a5..d902dee 100644 --- a/httemplate/edit/process/cust_main-contacts.html +++ b/httemplate/edit/process/cust_main-contacts.html @@ -12,7 +12,9 @@ %> <%init> -my @contact_fields = qw( classnum first last title comment emailaddress ); +my @contact_fields = qw( + classnum first last title comment emailaddress selfservice_access +); foreach my $phone_type ( qsearch({table=>'phone_type', order_by=>'weight'}) ) { push @contact_fields, 'phonetypenum'.$phone_type->phonetypenum; } diff --git a/httemplate/elements/contact.html b/httemplate/elements/contact.html index 8abce05..979c26b 100644 --- a/httemplate/elements/contact.html +++ b/httemplate/elements/contact.html @@ -45,14 +45,30 @@ % } <TD> - <INPUT TYPE = "text" - NAME = "<%$name%>_<%$field%>" - ID = "<%$id%>_<%$field%>" - SIZE = "<% $size{$field} || 15 %>" - VALUE = "<% scalar($cgi->param($name."_$field")) - || $value |h %>" - <% $onchange %> - ><BR> +% if ( $field eq 'selfservice_access' ) { + <SELECT NAME = "<%$name%>_<%$field%>" + ID = "<%$id%>_<%$field%>" + > + <OPTION VALUE="">Disabled +% if ( $value || $self_base_url ) { + <OPTION VALUE="Y" <% $value eq 'Y' ? 'SELECTED' : '' %>>Enabled +% if ( $value eq 'Y' && $self_base_url ) { + <OPTION VALUE="R">Re-email +% } +% } + </SELECT> + +% } else { + <INPUT TYPE = "text" + NAME = "<%$name%>_<%$field%>" + ID = "<%$id%>_<%$field%>" + SIZE = "<% $size{$field} || 14 %>" + VALUE = "<% scalar($cgi->param($name."_$field")) + || $value |h %>" + <% $onchange %> + > +% } + <BR> <FONT SIZE="-1"><% $label{$field} %></FONT> </TD> % } @@ -64,6 +80,9 @@ my( %opt ) = @_; +my $conf = new FS::Conf; +my $self_base_url = $conf->config('selfservice_server-base_url'); + my $name = $opt{'element_name'} || $opt{'field'} || 'contactnum'; my $id = $opt{'id'} || 'contactnum'; @@ -90,10 +109,11 @@ if ( $curr_value ) { my %size = ( 'title' => 12 ); tie my %label, 'Tie::IxHash', - 'first' => 'First name', - 'last' => 'Last name', - 'title' => 'Title/Position', - 'emailaddress' => 'Email', + 'first' => 'First name', + 'last' => 'Last name', + 'title' => 'Title/Position', + 'emailaddress' => 'Email', + 'selfservice_access' => 'Self-service' ; my $first = 0; diff --git a/httemplate/view/cust_main/contacts_new.html b/httemplate/view/cust_main/contacts_new.html index a851d99..f73483a 100644 --- a/httemplate/view/cust_main/contacts_new.html +++ b/httemplate/view/cust_main/contacts_new.html @@ -1,31 +1,56 @@ <BR> <FONT CLASS="fsinnerbox-title">Contacts</FONT> <A HREF="<%$p%>edit/cust_main-contacts.html?<% $cust_main->custnum %>">Edit contacts</A> -<TABLE CLASS="fsinnerbox"> + +<& /elements/table-grid.html &> +% my $bgcolor1 = '#eeeeee'; +% my $bgcolor2 = '#ffffff'; +% my $bgcolor = $bgcolor2; +<TR> + <TH CLASS="grid" ALIGN="left" BGCOLOR="#cccccc">Type</TH> + <TH CLASS="grid" ALIGN="left" BGCOLOR="#cccccc">Contact</TH> + <TH CLASS="grid" ALIGN="left" BGCOLOR="#cccccc">Email</TH> + <TH CLASS="grid" ALIGN="left" BGCOLOR="#cccccc">Self-service</TH> +% foreach my $phone_type (@phone_type) { + <TH CLASS="grid" ALIGN="left" BGCOLOR="#cccccc"><% $phone_type->typename |h %> phone</TD> +% } +</TR> + % foreach my $contact ( @contacts ) { -% #XXX maybe this should be a table with alternating colors instead <TR> - <TD ALIGN="right"><% $contact->contact_classname %> Contact</TD> - <TD BGCOLOR="#FFFFFF"><% $contact->line %></TD> + <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $contact->contact_classname |h %></TD> + <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $contact->line |h %></TD> % my @contact_email = $contact->contact_email; -% if (@contact_email) { - <TD ALIGN="right"> Email</TD> - <TD BGCOLOR="#FFFFFF"><% join(', ', map $_->emailaddress, @contact_email) %></TD> -% } + <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% join(', ', map $_->emailaddress, @contact_email) %></TD> + + <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"> +% if ( $contact->selfservice_access ) { + Enabled +%# <FONT SIZE="-1"><A HREF="XXX">disable</A> +%# <A HREF="XXX">re-email</A></FONT> +% } else { + Disabled +%# <FONT SIZE="-1"><A HREF="XXX">enable</A></FONT> +% } + </TD> % foreach my $phone_type (@phone_type) { % my $contact_phone = % qsearchs('contact_phone', { % 'contactnum' => $contact->contactnum, % 'phonetypenum' => $phone_type->phonetypenum, -% }) -% or next; - <TD ALIGN="right"> <% $phone_type->typename %> phone</TD> - <TD BGCOLOR="#FFFFFF"><% $contact_phone->phonenum_pretty |h %></TD> +% }); + <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $contact_phone ? $contact_phone->phonenum_pretty : '' |h %></TD> % } </TR> + +% if ( $bgcolor eq $bgcolor1 ) { +% $bgcolor = $bgcolor2; +% } else { +% $bgcolor = $bgcolor1; +% } % } </TABLE> <%once> |