summaryrefslogtreecommitdiff
path: root/httemplate/search
diff options
context:
space:
mode:
authorivan <ivan>2009-12-28 19:20:25 +0000
committerivan <ivan>2009-12-28 19:20:25 +0000
commit03ceab71dad1e5eb366865d304e5e459cc905ce4 (patch)
tree18b4532289a0237ae694b1ad5c033b25f448bd7c /httemplate/search
parent5950a980cef4968ac59ca8041d2204e6d98e7a3d (diff)
beginning of prospect/CRM/contact work
Diffstat (limited to 'httemplate/search')
-rw-r--r--httemplate/search/prospect_main.html74
-rw-r--r--httemplate/search/report_prospect_main.html32
2 files changed, 106 insertions, 0 deletions
diff --git a/httemplate/search/prospect_main.html b/httemplate/search/prospect_main.html
new file mode 100644
index 000000000..12e3e1812
--- /dev/null
+++ b/httemplate/search/prospect_main.html
@@ -0,0 +1,74 @@
+<% include('elements/search.html',
+ 'title' => 'Prospect Search Results',
+ 'name_singular' => 'prospect',
+ 'query' => $query,
+ 'count_query' => $count_query,
+ 'header' => [ '#',
+ 'Prospect',
+ 'Contact(s)',
+ ],
+ 'fields' => [ 'prospectnum',
+ 'company',
+ sub {
+ my $pm = shift;
+ [ map {
+ [ { 'data' => $_->line, }, ];
+ }
+ $pm->contact
+ ];
+ },
+ ],
+ 'links' => [ '',
+ $link,
+ '', #link to contact edit???
+ ],
+ 'agent_virt' => 1,
+ )
+%>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('List prospects');
+
+my %search_hash = ();
+
+#$search_hash{'query'} = $cgi->keywords;
+
+#scalars
+my @scalars = qw (
+ agentnum
+);
+
+for my $param ( @scalars ) {
+ $search_hash{$param} = scalar( $cgi->param($param) )
+ if $cgi->param($param);
+}
+
+#lists
+#for my $param () {
+# $search_hash{$param} = [ $cgi->param($param) ];
+#}
+
+# parse dates
+#foreach my $field (qw( signupdate )) {
+#
+# my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi, $field);
+#
+# next if $beginning == 0 && $ending == 4294967295;
+# #or $disable{$cgi->param('status')}->{$field};
+#
+# $search_hash{$field} = [ $beginning, $ending ];
+#
+#}
+
+my $query = FS::prospect_main->search(\%search_hash);
+my $count_query = delete($query->{'count_query'});
+#my @extra_headers = @{ delete($query->{'extra_headers'}) };
+#my @extra_fields = @{ delete($query->{'extra_fields'}) };
+
+my $link = sub {
+ my $prospect_main = shift;
+ [ "${p}view/prospect_main.html?", 'prospectnum' ];
+};
+
+</%init>
diff --git a/httemplate/search/report_prospect_main.html b/httemplate/search/report_prospect_main.html
new file mode 100644
index 000000000..5e3834346
--- /dev/null
+++ b/httemplate/search/report_prospect_main.html
@@ -0,0 +1,32 @@
+<% include('/elements/header.html', 'Prospect Report' ) %>
+
+<FORM ACTION="prospect_main.html" METHOD="GET">
+
+ <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
+
+ <TR>
+ <TH BGCOLOR="#e8e8e8" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Search options</FONT></TH>
+ </TR>
+
+ <% include( '/elements/tr-select-agent.html',
+ 'curr_value' => scalar($cgi->param('agentnum')),
+ 'disable_empty' => 0,
+ )
+ %>
+
+ </TABLE>
+
+<BR>
+<INPUT TYPE="submit" VALUE="Get Report">
+
+</FORM>
+
+<% include('/elements/footer.html') %>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('List prospects');
+
+my $conf = new FS::Conf;
+
+</%init>