summaryrefslogtreecommitdiff
path: root/httemplate/elements
diff options
context:
space:
mode:
authorivan <ivan>2010-10-14 01:14:27 +0000
committerivan <ivan>2010-10-14 01:14:27 +0000
commit7bbe939d139be7edd77378cfc9a2c3ec6287749d (patch)
tree4c43f97b729880ae191cc630d9402b843ca76870 /httemplate/elements
parentf839709351aee1f9488e9a26496adc564aa5b8e5 (diff)
more contact work and preliminary business card upload
Diffstat (limited to 'httemplate/elements')
-rw-r--r--httemplate/elements/contact.html55
-rw-r--r--httemplate/elements/menu.html4
2 files changed, 50 insertions, 9 deletions
diff --git a/httemplate/elements/contact.html b/httemplate/elements/contact.html
index a7a33b1f0..eea3694e3 100644
--- a/httemplate/elements/contact.html
+++ b/httemplate/elements/contact.html
@@ -5,12 +5,38 @@
<TABLE>
<TR>
% foreach my $field ( @fields ) {
+%
+% my $value = '';
+% if ( $field =~ /^phonetypenum(\d+)$/ ) {
+% my $contact_phone = qsearchs('contact_phone', {
+% 'contactnum' => $curr_value,
+% 'phonetypenum' => $1,
+% });
+% if ( $contact_phone ) {
+% $value = $contact_phone->phonenum;
+% $value .= 'x'.$contact_phone->extension
+% if $contact_phone->extension;
+% $value = '+'. $contact_phone->countrycode. " $value"
+% if $contact_phone->countrycode
+% && $contact_phone->countrycode ne '1';
+% }
+% } elsif ( $field eq 'emailaddress' ) {
+% #XXX multiple not yet supported
+% my $contact_email = qsearchs('contact_email', {
+% 'contactnum' => $curr_value,
+% });
+% $value = $contact_email->emailaddress if $contact_email;
+% } else {
+% $value = $contact->get($field);
+% }
+
<TD>
- <INPUT TYPE = "text"
- NAME = "<%$name%>_<%$field%>"
- ID = "<%$id%>_<%$field%>"
+ <INPUT TYPE = "text"
+ NAME = "<%$name%>_<%$field%>"
+ ID = "<%$id%>_<%$field%>"
+ SIZE = "<% $size{$field} || 15 %>"
VALUE = "<% scalar($cgi->param($name."_$field"))
- || $contact->get($field) |h %>"
+ || $value |h %>"
<% $onchange %>
><BR>
<FONT SIZE="-1"><% $label{$field} %></FONT>
@@ -45,12 +71,25 @@ if ( $curr_value ) {
$contact = new FS::contact {};
}
+my %size = ( 'title' => 12 );
+
tie my %label, 'Tie::IxHash',
- 'first' => 'First name',
- 'last' => 'Last name',
- 'title' => 'Title/Position',
- 'comment' => 'Comment',
+ 'first' => 'First name',
+ 'last' => 'Last name',
+ 'title' => 'Title/Position',
+ 'emailaddress' => 'Email',
;
+
+my $first = 0;
+foreach my $phone_type ( qsearch({table=>'phone_type', order_by=>'weight'}) ) {
+ next if $phone_type->typename eq 'Home';
+ my $f = 'phonetypenum'.$phone_type->phonetypenum;
+ $label{$f} = $phone_type->typename. ' phone';
+ $size{$f} = $first++ ? 11 : 15;
+}
+
+$label{'comment'} = 'Comment';
+
my @fields = keys %label;
</%init>
diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html
index 09b8e7405..cc52aaef8 100644
--- a/httemplate/elements/menu.html
+++ b/httemplate/elements/menu.html
@@ -364,11 +364,13 @@ $tools_menu{'Process payment batches'} = [ $fsurl.'search/pay_batch.cgi?magic=_d
if ( $conf->exists('batch-enable') || $conf->config('batch-enable_payby') )
&& $curuser->access_right('Process batches');
$tools_menu{'Process invoice batches'} = [ $fsurl.'search/bill_batch.cgi' ]
- if ( $conf->exists('invoice_print_pdf') );
+ if $conf->exists('invoice_print_pdf');
$tools_menu{'Job Queue'} = [ $fsurl.'search/queue.html', 'View pending job queue' ]
if $curuser->access_right('Job queue');
$tools_menu{'Ticketing'} = [ \%tools_ticketing, 'Ticketing tools' ]
if $conf->config('ticket_system');
+$tools_menu{'Business card scan'} = [ $fsurl.'edit/prospect_main-upload.html' ]
+ if $curuser->access_right('New prospect');
$tools_menu{'Time Queue'} = [ $fsurl.'search/report_timeworked.html', 'View pending support time' ]
if $curuser->access_right('Time queue');
$tools_menu{'Attachments'} = [ $fsurl.'browse/cust_attachment.html', 'View customer attachments' ]