[freeside-commits] freeside/httemplate/elements contact.html, 1.1, 1.2 menu.html, 1.75, 1.76

Ivan,,, ivan at wavetail.420.am
Wed Dec 30 18:20:35 PST 2009


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

Modified Files:
	contact.html menu.html 
Log Message:
prospecting: proper contact error handling when you add a prospect

Index: menu.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/menu.html,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -d -r1.75 -r1.76
--- menu.html	29 Dec 2009 01:00:30 -0000	1.75
+++ menu.html	31 Dec 2009 02:20:33 -0000	1.76
@@ -60,6 +60,11 @@
 
 #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 @@
 } # 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'   ]

Index: contact.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/contact.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- contact.html	28 Dec 2009 19:18:19 -0000	1.1
+++ contact.html	31 Dec 2009 02:20:33 -0000	1.2
@@ -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 @@
   $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>



More information about the freeside-commits mailing list