Permalink
Browse files

Transformed generic xls generation into xls builder for contacts

  • Loading branch information...
1 parent 9a94d39 commit 6dc442a7cdf494f5f2299eb911e179d815807138 Philipp Ullmann committed Mar 7, 2012
@@ -0,0 +1,42 @@
+xml.instruct!
+xml.Workbook 'xmlns:x' => 'urn:schemas-microsoft-com:office:excel',
+ 'xmlns:ss' => 'urn:schemas-microsoft-com:office:spreadsheet',
+ 'xmlns:html' => 'http://www.w3.org/TR/REC-html40',
+ 'xmlns' => 'urn:schemas-microsoft-com:office:spreadsheet',
+ 'xmlns:o' => 'urn:schemas-microsoft-com:office:office' do
+ xml.Worksheet 'ss:Name' => "Sheet1" do
+ xml.Table do
+ unless @contacts.empty?
+ # Header.
+ xml.Row do
+ columns = %w{job_title name email alt_email phone mobile
+ fax born_on background_info blog linked_in
+ facebook twitter skype date_created date_updated
+ assigned_to access department source do_not_call}
+
+ for column in columns
+ xml.Cell do
+ xml.Data I18n.t(column), 'ss:Type' => 'String'
+ end
+ end
+ end
+
+ # Contact rows.
+ for c in @contacts
+ xml.Row do
+ values = [c.title, c.name, c.email, c.alt_email, c.phone, c.mobile,
+ c.fax, c.born_on, c.background_info, c.blog, c.linkedin,
+ c.facebook, c.twitter, c.skype, c.created_at, c.updated_at,
+ c.assignee.try(:name), c.access, c.department, c.source, c.do_not_call]
+
+ for value in values
+ xml.Cell do
+ xml.Data value, 'ss:Type' => "#{value.respond_to?(:abs) ? 'Number' : 'String'}"
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+end
@@ -11,6 +11,7 @@ de:
about_thank_you: "Danke, dass Sie Fat Free CRM benutzen! Wir schätzen Ihre Hilfe und hoffen, Sie finden Gefallen an der Software."
about_twitter: "Twitter updates"
about_user_group: "Diskussionsgruppe für Benutzer"
+ access: Zugang
account: Firma
account_name: Firmenname
account_permissions_intro: "Standardmäßig haben nur Sie Zugriff auf die Firma. Sie können den Zugriff später ändern."
@@ -126,6 +127,7 @@ de:
before: "vor"
billing_address: "Rechnungsadresse"
blog: "Website/Blog"
+ born_on: "Geboren am"
brief: "kurz"
budget: "Budget"
budget_label: "Budget (€)"
@@ -478,6 +480,7 @@ de:
related: "re:"
remember_me: "Erinnere mich"
reset_password: "Passwort zurücksetzen"
+ reports_to: Berichtet an
revenue: "Umsatz"
revenue_label: "Umsatz (€)"
revenue_number: "%{value} Umsatz"
@@ -261,6 +261,9 @@ en-US:
user: User
username: Username
yahoo: Yahoo IM
+ born_on: Born on
+ reports_to: Reports to
+ access: Access
# Views -> Authenticate.
#----------------------------------------------------------------------------

0 comments on commit 6dc442a

Please sign in to comment.