caboose-cms 0.5.180 → 0.5.181

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MzkxMDQwNTU4NjM2ODY0MGUwNzMxZDhiNzVlMDEwZDEyNDM0NjU4Yw==
4
+ MjEwZDBiYWFlZjVhMGI0MTk1YzQyZWE1NDdhZTVjNzdhNzU4ZDE1Yg==
5
5
  data.tar.gz: !binary |-
6
- MzhiYTRkOTJkY2NiOTlhYmU1NmJiNGNkNmE2M2U0ZjI4YTY5MTRkNw==
6
+ N2E3NWNjYTEwZjIyOWEwMmUxYzk0OWI1ZjYxM2E4OWNlMWZkODBhMw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YjgyNWY5NzdjNzU1NzliYTQyNmE2OWY5ZGY2NzdkMWM4ZGQ0Yzk2YWVkYWI3
10
- NmFkZmY2ZTBmZGIzMGRmNmE2ZTAzNGU5ODM1NTM5YjhhYjc3NTZjMjE4MmU3
11
- YzgzMGVhMDZlMDBjNjk0Yjc2M2Y5NzYwNjA1NTVkZmY5YmUwMTY=
9
+ ZTg3MzQxNDlkZmVmYmU1M2E1NmIzMDUxZDRlZjZhZmZhMWRkNGY3YzExMDlj
10
+ Y2EyZGYxYmZjZTVhNTc0OGE1Yzg0NWRjNWJkOWY3MTc1N2JiNzdkZWZmZTli
11
+ MmE2NjkxODYyN2U5OTE2MGIwOWM4YThiM2JhNmMxMWQwM2E1YWY=
12
12
  data.tar.gz: !binary |-
13
- ZmExMzQ0NzA1ZmFjODY3NWJjMDRlYzc2MWExMzMyOGI5OGJmMjE1YjRkYmUy
14
- MWMzYjJiMDdkMDU0MGY2NWI5MGJmNzhkYmJjZmUzNjg1YWU4ZTYyNjEyODI0
15
- OGUxZDc2MGNmZDk2YTUzNDJjOTFkMTZjMDZhYmRiN2Q3MWY3OWU=
13
+ MjA5OTM5MmNmZDE4NDQyYzgzZGRiMGMxMDRiYjkxYzlhZDZiOTkzZGE3OGQy
14
+ YjViZTBkNDU5MDNmOGZlZWE1Y2JlZjBhM2U5ODY2ZjQyZTRmNzk5NjBhMDY0
15
+ ZmE0NmJjODU3YjgxNjRkOTYxZjQ5NWY3MTc2NWM0YTY5ZDM4OTY=
@@ -204,9 +204,10 @@ OrderController.prototype = {
204
204
 
205
205
  /******************************************************************************/
206
206
 
207
- print_order: function(order_id)
207
+ print_order: function()
208
208
  {
209
- window.open('/admin/orders/' + order_id + '/print');
209
+ var that = this;
210
+ window.open('/admin/orders/' + that.order.id + '/print');
210
211
  },
211
212
 
212
213
  line_items_for_order_package: function(order_package_id)
@@ -28,7 +28,7 @@ module Caboose
28
28
  # See if we're on a forwarding domain
29
29
  elsif d.primary == false && d.forward_to_primary == true
30
30
  pd = d.site.primary_domain
31
- if pd
31
+ if pd && pd.domain != request.host
32
32
  url = "#{request.protocol}#{pd.domain}"
33
33
  if request.fullpath && request.fullpath.strip.length > 0 && request.fullpath.strip != '/'
34
34
  url << request.fullpath
@@ -74,41 +74,21 @@ module Caboose
74
74
 
75
75
  # #{self.card_type} ending in #{self.card_number
76
76
  ba = order.billing_address
77
- billed_to = []
78
- billed_to << [
79
- { :content => "Name", :border_width => 0 },
80
- { :content => "#{ba.first_name} #{ba.last_name}", :border_width => 0}
81
- ]
82
- billed_to << [
83
- { :content => "Address", :border_width => 0 },
84
- { :content => "#{ba.address1}" + (ba.address2.blank? ? '' : "\n#{ba.address2}") + "\n#{ba.city}, #{ba.state} #{ba.zip}", :border_width => 0}
85
- ]
86
- billed_to << [
87
- { :content => "Email", :border_width => 0 },
88
- { :content => "#{c.email}", :border_width => 0}
89
- ]
90
- billed_to << [
91
- { :content => "Phone", :border_width => 0 },
92
- { :content => "#{self.formatted_phone(c.phone)}", :border_width => 0}
77
+ ba_address = "#{ba.address1}" + (ba.address2.blank? ? '' : "\n#{ba.address2}") + "\n#{ba.city}, #{ba.state} #{ba.zip}"
78
+ billed_to = [
79
+ [{ :content => "Name" , :border_width => 0, :width => 55 },{ :content => "#{ba.first_name} #{ba.last_name}" , :border_width => 0, :width => 200 }],
80
+ [{ :content => "Address" , :border_width => 0, :width => 55 },{ :content => ba_address , :border_width => 0, :width => 200 }],
81
+ [{ :content => "Email" , :border_width => 0, :width => 55 },{ :content => "#{c.email}" , :border_width => 0, :width => 200 }],
82
+ [{ :content => "Phone" , :border_width => 0, :width => 55 },{ :content => "#{self.formatted_phone(c.phone)}" , :border_width => 0, :width => 200 }]
93
83
  ]
94
84
 
95
85
  sa = order.shipping_address
96
- shipped_to = []
97
- shipped_to << [
98
- { :content => "Name", :border_width => 0 },
99
- { :content => "#{sa.first_name} #{sa.last_name}", :border_width => 0}
100
- ]
101
- shipped_to << [
102
- { :content => "Address", :border_width => 0 },
103
- { :content => "#{sa.address1}" + (sa.address2.blank? ? '' : "\n#{sa.address2}") + "\n#{sa.city}, #{sa.state} #{sa.zip}", :border_width => 0}
104
- ]
105
- shipped_to << [
106
- { :content => "Email", :border_width => 0 },
107
- { :content => "#{c.email}", :border_width => 0}
108
- ]
109
- shipped_to << [
110
- { :content => "Phone", :border_width => 0 },
111
- { :content => "#{self.formatted_phone(c.phone)}", :border_width => 0}
86
+ sa_address = "#{sa.address1}" + (sa.address2.blank? ? '' : "\n#{sa.address2}") + "\n#{sa.city}, #{sa.state} #{sa.zip}"
87
+ shipped_to = [
88
+ [{ :content => "Name" , :border_width => 0, :width => 55 },{ :content => "#{sa.first_name} #{sa.last_name}" , :border_width => 0, :width => 200 }],
89
+ [{ :content => "Address" , :border_width => 0, :width => 55 },{ :content => sa_address , :border_width => 0, :width => 200 }],
90
+ [{ :content => "Email" , :border_width => 0, :width => 55 },{ :content => "#{c.email}" , :border_width => 0, :width => 200 }],
91
+ [{ :content => "Phone" , :border_width => 0, :width => 55 },{ :content => "#{self.formatted_phone(c.phone)}" , :border_width => 0, :width => 200 }]
112
92
  ]
113
93
 
114
94
  tbl = []
@@ -129,12 +109,12 @@ module Caboose
129
109
 
130
110
  tbl = []
131
111
  tbl << [
132
- { :content => "Package" , :align => :left, :valign => :bottom },
133
- { :content => "Product" , :align => :left, :valign => :bottom, :colspan => 2 },
134
- { :content => "Attributes" , :align => :left, :valign => :bottom },
135
- { :content => "Quantity" , :align => :right, :valign => :bottom },
136
- { :content => "Price" , :align => :right, :valign => :bottom },
137
- { :content => "Amount" , :align => :right, :valign => :bottom }
112
+ { :content => "Package" , :align => :left , :valign => :bottom },
113
+ { :content => "Product" , :align => :left , :valign => :bottom, :colspan => 2 },
114
+ { :content => "Attributes" , :align => :left , :valign => :bottom },
115
+ { :content => "Quantity" , :align => :right , :valign => :bottom },
116
+ { :content => "Price" , :align => :right , :valign => :bottom },
117
+ { :content => "Amount" , :align => :right , :valign => :bottom }
138
118
  ]
139
119
 
140
120
  order.calculate
@@ -212,33 +192,14 @@ module Caboose
212
192
  tbl2 = []
213
193
  tbl3 = []
214
194
 
215
- tbl2 << [
216
- { :content => "Card Type", :width => 127, :border_width => 0 },
217
- { :content => self.card_type, :width => 128, :border_width => 0 }
218
- ]
219
- tbl2 << [
220
- { :content => "Transaction ID", :width => 127, :border_width => 0 },
221
- { :content => trans.transaction_id.to_s, :width => 128, :border_width => 0 }
222
- ]
223
- tbl2 << [
224
- { :content => "Gateway Response", :width => 127, :border_width => 0},
225
- { :content => trans.response_code.to_s, :width => 128, :border_width => 0 }
226
- ]
227
- tbl3 << [
228
- { :content => "Card Number", :width => 127, :border_width => 0},
229
- { :content => "XXXX XXXX XXXX " + self.card_number, :width => 128, :border_width => 0 }
230
- ]
231
- tbl3 << [
232
- { :content => "Transaction Time", :width => 127, :border_width => 0},
233
- { :content => trans.date_processed.strftime("%d %b %Y %H:%M:%S %p"), :width => 128, :border_width => 0 }
234
- ]
235
- tbl3 << [
236
- { :content => "Payment Process", :width => 127, :border_width => 0},
237
- { :content => trans.success ? "Successful" : "Failed", :width => 128, :border_width => 0 }
238
- ]
239
- tbl << [
240
- { :content => "Authorization Details", :colspan => 2, :font_style => :bold }
241
- ]
195
+ tbl2 << [{ :content => "Card Type" , :width => 127, :border_width => 0 },{ :content => self.card_type , :width => 128, :border_width => 0 }]
196
+ tbl2 << [{ :content => "Transaction ID" , :width => 127, :border_width => 0 },{ :content => trans.transaction_id.to_s , :width => 128, :border_width => 0 }]
197
+ tbl2 << [{ :content => "Gateway Response" , :width => 127, :border_width => 0 },{ :content => trans.response_code.to_s , :width => 128, :border_width => 0 }]
198
+ tbl3 << [{ :content => "Card Number" , :width => 127, :border_width => 0 },{ :content => "XXXX XXXX XXXX " + self.card_number , :width => 128, :border_width => 0 }]
199
+ tbl3 << [{ :content => "Transaction Time" , :width => 127, :border_width => 0 },{ :content => trans.date_processed.strftime("%d %b %Y %H:%M:%S %p") , :width => 128, :border_width => 0 }]
200
+ tbl3 << [{ :content => "Payment Process" , :width => 127, :border_width => 0 },{ :content => trans.success ? "Successful" : "Failed" , :width => 128, :border_width => 0 }]
201
+
202
+ tbl << [{ :content => "Authorization Details", :colspan => 2, :font_style => :bold }]
242
203
  tbl << [
243
204
  { :content => tbl2, :width => 255 },
244
205
  { :content => tbl3, :width => 255 }
@@ -67,22 +67,11 @@ module Caboose
67
67
  ba = order.billing_address
68
68
  billed_to = []
69
69
  if ba
70
- billed_to << [
71
- { :content => "Name", :border_width => 0 },
72
- { :content => "#{ba.first_name} #{ba.last_name}", :border_width => 0}
73
- ]
74
- billed_to << [
75
- { :content => "Address", :border_width => 0 },
76
- { :content => "#{ba.address1}" + (ba.address2.blank? ? '' : "\n#{ba.address2}") + "\n#{ba.city}, #{ba.state} #{ba.zip}", :border_width => 0}
77
- ]
78
- billed_to << [
79
- { :content => "Email", :border_width => 0 },
80
- { :content => "#{c.email}", :border_width => 0}
81
- ]
82
- billed_to << [
83
- { :content => "Phone", :border_width => 0 },
84
- { :content => "#{self.formatted_phone(c.phone)}", :border_width => 0}
85
- ]
70
+ ba_address = "#{ba.address1}" + (ba.address2.blank? ? '' : "\n#{ba.address2}") + "\n#{ba.city}, #{ba.state} #{ba.zip}"
71
+ billed_to << [{ :content => "Name" , :border_width => 0, :width => 55 },{ :content => "#{ba.first_name} #{ba.last_name}" , :border_width => 0, :width => 200 }]
72
+ billed_to << [{ :content => "Address" , :border_width => 0, :width => 55 },{ :content => ba_address , :border_width => 0, :width => 200 }]
73
+ billed_to << [{ :content => "Email" , :border_width => 0, :width => 55 },{ :content => "#{c.email}" , :border_width => 0, :width => 200 }]
74
+ billed_to << [{ :content => "Phone" , :border_width => 0, :width => 55 },{ :content => "#{self.formatted_phone(c.phone)}" , :border_width => 0, :width => 200 }]
86
75
  else
87
76
  billed_to << [{ :content => "Name" , :border_width => 0 }]
88
77
  billed_to << [{ :content => "Address" , :border_width => 0 }]
@@ -93,22 +82,11 @@ module Caboose
93
82
  sa = order.shipping_address
94
83
  shipped_to = []
95
84
  if sa
96
- shipped_to << [
97
- { :content => "Name", :border_width => 0 },
98
- { :content => "#{sa.first_name} #{sa.last_name}", :border_width => 0}
99
- ]
100
- shipped_to << [
101
- { :content => "Address", :border_width => 0 },
102
- { :content => "#{sa.address1}" + (sa.address2.blank? ? '' : "\n#{sa.address2}") + "\n#{sa.city}, #{sa.state} #{sa.zip}", :border_width => 0}
103
- ]
104
- shipped_to << [
105
- { :content => "Email", :border_width => 0 },
106
- { :content => "#{c.email}", :border_width => 0}
107
- ]
108
- shipped_to << [
109
- { :content => "Phone", :border_width => 0 },
110
- { :content => "#{self.formatted_phone(c.phone)}", :border_width => 0}
111
- ]
85
+ sa_address = "#{sa.address1}" + (sa.address2.blank? ? '' : "\n#{sa.address2}") + "\n#{sa.city}, #{sa.state} #{sa.zip}"
86
+ shipped_to << [{ :content => "Name" , :border_width => 0, :width => 55 },{ :content => "#{sa.first_name} #{sa.last_name}" , :border_width => 0, :width => 200 }]
87
+ shipped_to << [{ :content => "Address" , :border_width => 0, :width => 55 },{ :content => sa_address , :border_width => 0, :width => 200 }]
88
+ shipped_to << [{ :content => "Email" , :border_width => 0, :width => 55 },{ :content => "#{c.email}" , :border_width => 0, :width => 200 }]
89
+ shipped_to << [{ :content => "Phone" , :border_width => 0, :width => 55 },{ :content => "#{self.formatted_phone(c.phone)}" , :border_width => 0, :width => 200 }]
112
90
  else
113
91
  shipped_to << [{ :content => "Name" , :border_width => 0 }]
114
92
  shipped_to << [{ :content => "Address" , :border_width => 0 }]
@@ -134,15 +112,15 @@ module Caboose
134
112
 
135
113
  tbl = []
136
114
  tbl << [
137
- { :content => "Package" , :align => :left, :valign => :bottom },
138
- { :content => "Product" , :align => :left, :valign => :bottom, :colspan => 2 },
139
- { :content => "Attributes" , :align => :left, :valign => :bottom },
140
- { :content => "Quantity" , :align => :right, :valign => :bottom },
141
- { :content => "Price" , :align => :right, :valign => :bottom },
142
- { :content => "Amount" , :align => :right, :valign => :bottom }
115
+ { :content => "Package" , :align => :left , :valign => :bottom },
116
+ { :content => "Product" , :align => :left , :valign => :bottom , :colspan => 2 },
117
+ { :content => "Attributes" , :align => :left , :valign => :bottom },
118
+ { :content => "Quantity" , :align => :right , :valign => :bottom },
119
+ { :content => "Price" , :align => :right , :valign => :bottom },
120
+ { :content => "Amount" , :align => :right , :valign => :bottom }
143
121
  ]
144
122
 
145
- order.calculate
123
+ #order.calculate
146
124
 
147
125
  order.order_packages.all.each do |pk|
148
126
 
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.5.180'
2
+ VERSION = '0.5.181'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.180
4
+ version: 0.5.181
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-26 00:00:00.000000000 Z
11
+ date: 2015-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg