summaryrefslogtreecommitdiff
path: root/httemplate/elements
diff options
context:
space:
mode:
authorivan <ivan>2009-12-31 02:20:33 +0000
committerivan <ivan>2009-12-31 02:20:33 +0000
commit2e928dafa3cf6383ea9e97f48af61af05e5a292a (patch)
tree107c9908948a9c5463ffcb80add9323245d6fa54 /httemplate/elements
parent0d2d8c0b11b715fa7ba1d889e04637194d97e275 (diff)
prospecting: proper contact error handling when you add a prospect
Diffstat (limited to 'httemplate/elements')
-rw-r--r--httemplate/elements/contact.html56
-rw-r--r--httemplate/elements/menu.html7
2 files changed, 27 insertions, 36 deletions
diff --git a/httemplate/elements/contact.html b/httemplate/elements/contact.html
index 38703bfef..2023a6cfe 100644
--- a/httemplate/elements/contact.html
+++ b/httemplate/elements/contact.html
@@ -4,42 +4,18 @@
<TABLE>
<TR>
- <TD>
- <INPUT TYPE = "text"
- NAME = "<%$name%>_first"
- ID = "<%$id%>_id"
- VALUE = "<% $contact->first |h %>"
- <% $onchange %>
- ><BR>
- <FONT SIZE="-2">First name</FONT>
- </TD>
- <TD>
- <INPUT TYPE = "text"
- NAME = "<%$name%>_last"
- ID = "<%$id%>_id"
- VALUE = "<% $contact->get('last') |h %>"
- <% $onchange %>
- ><BR>
- <FONT SIZE="-2">Last name</FONT>
- </TD>
- <TD>
- <INPUT TYPE = "text"
- NAME = "<%$name%>_title"
- ID = "<%$id%>_id"
- VALUE = "<% $contact->title |h %>"
- <% $onchange %>
- ><BR>
- <FONT SIZE="-2">Title/Position</FONT>
- </TD>
- <TD>
- <INPUT TYPE = "text"
- NAME = "<%$name%>_comment"
- ID = "<%$id%>_id"
- VALUE = "<% $contact->comment |h %>"
- <% $onchange %>
- ><BR>
- <FONT SIZE="-2">Comment</FONT>
- </TD>
+% foreach my $field ( @fields ) {
+ <TD>
+ <INPUT TYPE = "text"
+ NAME = "<%$name%>_<%$field%>"
+ ID = "<%$id%>_<%$field%>"
+ VALUE = "<% scalar($cgi->param($name."_$field"))
+ || $contact->get($field) |h %>"
+ <% $onchange %>
+ ><BR>
+ <FONT SIZE="-2"><% $label{$field} %></FONT>
+ </TD>
+% }
</TR>
</TABLE>
@@ -69,4 +45,12 @@ if ( $curr_value ) {
$contact = new FS::contact {};
}
+tie my %label, 'Tie::IxHash',
+ 'first' => 'First name',
+ 'last' => 'Last name',
+ 'title' => 'Title/Position',
+ 'comment' => 'Comment',
+;
+my @fields = keys %label;
+
</%init>
diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html
index 167559d0b..573741e21 100644
--- a/httemplate/elements/menu.html
+++ b/httemplate/elements/menu.html
@@ -60,6 +60,11 @@ my $curuser = $FS::CurrentUser::CurrentUser;
#XXX Active tickets not assigned to a customer
+tie my %report_prospects, 'Tie::IxHash',
+ 'List prospects' => [ $fsurl. 'search/prospect_main.html', '' ],
+ 'Advanced prospect reports' => [ $fsurl. 'search/report_prospect_main.html', '' ],
+;
+
tie my %report_customers_lists, 'Tie::IxHash',
'by customer number' => [ $fsurl. 'search/cust_main.cgi?browse=custnum', '' ],
'by last name' => [ $fsurl. 'search/cust_main.cgi?browse=last', '' ],
@@ -251,6 +256,8 @@ if($curuser->access_right('Financial reports')) {
} # else $report_financial contains nothing.
tie my %report_menu, 'Tie::IxHash';
+$report_menu{'Prospects'} = [ \%report_prospects, 'Prospect reports' ]
+ if $curuser->access_right('List prospects');
$report_menu{'Customers'} = [ \%report_customers, 'Customer reports' ]
if $curuser->access_right('List customers');
$report_menu{'Invoices'} = [ \%report_invoices, 'Invoice reports' ]