diff options
Diffstat (limited to 'httemplate')
| -rw-r--r-- | httemplate/elements/searchbar-cust_main.html | 2 | ||||
| -rw-r--r-- | httemplate/search/contact.html | 30 | ||||
| -rwxr-xr-x | httemplate/search/cust_main.html | 13 | ||||
| -rw-r--r-- | httemplate/search/elements/options_cust_contacts.html | 36 | ||||
| -rwxr-xr-x | httemplate/search/report_cust_main.html | 8 |
5 files changed, 83 insertions, 6 deletions
diff --git a/httemplate/elements/searchbar-cust_main.html b/httemplate/elements/searchbar-cust_main.html index 5bfef484a..7f8f9d850 100644 --- a/httemplate/elements/searchbar-cust_main.html +++ b/httemplate/elements/searchbar-cust_main.html @@ -26,7 +26,7 @@ my $curuser = $FS::CurrentUser::CurrentUser; my $menu_position = $curuser->option('menu_position') || 'top'; my $cust_width = 246; -my $cust_label = '(cust #, name, company'; +my $cust_label = '(cust #, name, company, email'; if ( $conf->exists('address1-search') ) { $cust_label .= ', address'; $cust_width += 56; diff --git a/httemplate/search/contact.html b/httemplate/search/contact.html index 759f09521..5f02fef2f 100644 --- a/httemplate/search/contact.html +++ b/httemplate/search/contact.html @@ -29,6 +29,30 @@ my $email_sub = sub { join(', ', map $_->emailaddress, @contact_email); }; +my $work_phone_sub = sub { + my $contact = shift; + my $phone_type = qsearchs('phone_type', { 'typename' => 'Work' }); + #can't because contactnum is in the wrong field + my @contact_workphone = qsearch('contact_phone', { 'contactnum' => $contact->contact_contactnum, 'phonetypenum' => $phone_type->phonetypenum } ); + join(', ', map $_->phonenum, @contact_workphone); +}; + +my $mobile_phone_sub = sub { + my $contact = shift; + my $phone_type = qsearchs('phone_type', { 'typename' => 'Mobile' }); + #can't because contactnum is in the wrong field + my @contact_mobilephone = qsearch('contact_phone', { 'contactnum' => $contact->contact_contactnum, 'phonetypenum' => $phone_type->phonetypenum } ); + join(', ', map $_->phonenum, @contact_mobilephone); +}; + +my $home_phone_sub = sub { + my $contact = shift; + my $phone_type = qsearchs('phone_type', { 'typename' => 'Home' }); + #can't because contactnum is in the wrong field + my @contact_homephone = qsearch('contact_phone', { 'contactnum' => $contact->contact_contactnum, 'phonetypenum' => $phone_type->phonetypenum } ); + join(', ', map $_->phonenum, @contact_homephone); +}; + my $link; #for closure in this sub, we'll define it later my $contact_classname_sub = sub { my $contact = shift; @@ -44,9 +68,9 @@ my $contact_classname_sub = sub { $X_contact->contact_classname; }; -my @header = ( 'First', 'Last', 'Title', 'Email', 'Type' ); -my @fields = ( 'first', 'last', 'title', $email_sub, $contact_classname_sub ); -my @links = ( '', '', '', '', '', ); +my @header = ( 'First', 'Last', 'Title', 'Email', 'Work Phone', 'Mobile Phone', 'Home Phone', 'Type' ); +my @fields = ( 'first', 'last', 'title', $email_sub, $work_phone_sub, $mobile_phone_sub, $home_phone_sub, $contact_classname_sub ); +my @links = ( '', '', '', '', '', '', '', '', ); my $company_link = ''; diff --git a/httemplate/search/cust_main.html b/httemplate/search/cust_main.html index 22996a20c..30162506f 100755 --- a/httemplate/search/cust_main.html +++ b/httemplate/search/cust_main.html @@ -72,11 +72,20 @@ for my $param (qw( classnum refnum pkg_classnum )) { $search_hash{$param} = [ $cgi->param($param) ]; } -#tags my $params = $cgi->Vars; + +#contacts +$search_hash{'contacts'} = { + map { $_ => $cgi->param($_), } + grep { /^(contacts_*)/ && $cgi->param($_) } + keys %$params +}; + +#tags $search_hash{'tagnum'} = [ map { /^tagnum(\d+)/ && $1 } - grep { /^tagnum(\d+)/ && $cgi->param($_) } keys %$params + grep { /^tagnum(\d+)/ && $cgi->param($_) } + keys %$params ]; ### diff --git a/httemplate/search/elements/options_cust_contacts.html b/httemplate/search/elements/options_cust_contacts.html new file mode 100644 index 000000000..cfbf834b0 --- /dev/null +++ b/httemplate/search/elements/options_cust_contacts.html @@ -0,0 +1,36 @@ + <TR> + <TH ALIGN="right" VALIGN="center"><% mt('First name') |h %></TH> + <TD><INPUT TYPE="text" NAME="<%$field_prefix%>firstname" SIZE=54></TD> + </TR> + + <TR> + <TH ALIGN="right" VALIGN="center"><% mt('Last name') |h %></TH> + <TD><INPUT TYPE="text" NAME="<%$field_prefix%>lastname" SIZE=54></TD> + </TR> + + <TR> + <TH ALIGN="right" VALIGN="center"><% mt('Email') |h %></TH> + <TD><INPUT TYPE="text" NAME="<%$field_prefix%>email" SIZE=54></TD> + </TR> + + <TR> + <TH ALIGN="right" VALIGN="center"><% mt('Home Phone') |h %></TH> + <TD><INPUT TYPE="text" NAME="<%$field_prefix%>homephone" SIZE=54></TD> + </TR> + + <TR> + <TH ALIGN="right" VALIGN="center"><% mt('Work Phone') |h %></TH> + <TD><INPUT TYPE="text" NAME="<%$field_prefix%>workphone" SIZE=54></TD> + </TR> + + <TR> + <TH ALIGN="right" VALIGN="center"><% mt('Mobile Phone') |h %></TH> + <TD><INPUT TYPE="text" NAME="<%$field_prefix%>mobilephone" SIZE=54></TD> + </TR> + +<%init> + +my %opt = @_; +my $field_prefix = $opt{'pre_fix'} ? $opt{'pre_fix'} : ''; + +</%init>
\ No newline at end of file diff --git a/httemplate/search/report_cust_main.html b/httemplate/search/report_cust_main.html index 14e784454..0a6726215 100755 --- a/httemplate/search/report_cust_main.html +++ b/httemplate/search/report_cust_main.html @@ -166,6 +166,14 @@ </TABLE> <BR> + <FONT CLASS="fsinnerbox-title"><% emt('Contacts search options') %></FONT> + <TABLE CLASS="fsinnerbox"> + <& elements/options_cust_contacts.html, + 'pre_fix' => 'contacts_', + &> + </TABLE> + <BR> + <FONT CLASS="fsinnerbox-title"><% emt('Billing search options') %></FONT> <TABLE CLASS="fsinnerbox"> |
