[freeside-commits] freeside/httemplate/elements contact.html, 1.3, 1.4 menu.html, 1.98, 1.99

Ivan,,, ivan at wavetail.420.am
Wed Oct 13 18:14:29 PDT 2010


Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory wavetail.420.am:/tmp/cvs-serv4104/httemplate/elements

Modified Files:
	contact.html menu.html 
Log Message:
more contact work and preliminary business card upload

Index: menu.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/menu.html,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -w -d -r1.98 -r1.99
--- menu.html	10 Oct 2010 19:11:15 -0000	1.98
+++ menu.html	14 Oct 2010 01:14:27 -0000	1.99
@@ -364,11 +364,13 @@
   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' ]

Index: contact.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/contact.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -d -r1.3 -r1.4
--- contact.html	20 May 2010 08:10:18 -0000	1.3
+++ contact.html	14 Oct 2010 01:14:27 -0000	1.4
@@ -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%>"
+                 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 @@
   $contact = new FS::contact {};
 }
 
+my %size = ( 'title' => 12 );
+
 tie my %label, 'Tie::IxHash',
   'first'  => 'First name',
   'last'    => 'Last name',
   'title'   => 'Title/Position',
-  'comment' => 'Comment',
+  '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>



More information about the freeside-commits mailing list