RT# 73422 Improve customer contact report
[freeside.git] / httemplate / search / report_contact.html
1 <& /elements/header.html, mt('Contact Report') &>
2
3 <FORM ACTION="contact.html" METHOD="GET">
4
5 <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
6
7   <& /elements/tr-select-agent.html,
8                  'curr_value'    => scalar( $cgi->param('agentnum') ),
9                  'label'         => emt('Contacts for agent: '),
10                  'disable_empty' => 0,
11   &>
12
13   <& /elements/tr-select.html,
14        'label'      => 'Contact source',
15        'field'      => 'contact_source',
16        'options'    => [ 'prospect_main', 'cust_main', '' ],
17        'labels'     => { 'prospect_main' => 'Prospect contacts',
18                          'cust_main'     => 'Customer contacts',
19                          ''              => 'All contacts',
20                        },
21        'curr_value' => scalar( $cgi->param('contact_source') ),
22   &>
23
24 % if ( FS::contact_class->count( 'disabled IS NULL' ) > 0 ) {
25   <& /elements/tr-checkboxes.html,
26     label => 'Contact Type',
27     names_list => [
28       [ 'null' => { label => 'None' } ],
29       map {[ $_->classnum => { label => $_->classname } ]}
30       qsearch( contact_class => { disabled => { op => '!=', value => 'Y' } })
31     ],
32     element_name_prefix => 'contact_classnum_',
33   &>
34 % }
35
36 </FORM>
37
38 </TABLE>
39
40 <BR>
41 <INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
42
43 </FORM>
44
45 <& /elements/footer.html &>
46 <%init>
47
48 die "access denied"
49   unless $FS::CurrentUser::CurrentUser->access_right('List contacts');
50
51 use FS::contact_class;
52 </%init>