oxen_printer 0.4.3 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/components/print_prompt.js.jsx.coffee +4 -41
- data/lib/oxen_printer/version.rb +1 -1
- data/lib/print_engine.rb +16 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37c99502be722289e6083148c2877ccb3198fbf8
|
4
|
+
data.tar.gz: c1568051dd2c3b0447806d332baa8b0d23703e42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae5ec4b4cade465734236dd2b98f133869604e03b9af1e472cc4b735ad249027c6986d09a971ce1e156d780d90caacab07d772c2e3fa60d258c274da8643e929
|
7
|
+
data.tar.gz: 4d5f7dd9d9430541ae9ff394e21525b30051d015815199019cffd6d8c7253d4a6bb895ec3179ad9a25ef5e15e4d2b06b11aa101fb63aa6cb4aac4bfcfd92f0fa
|
@@ -1,41 +1,4 @@
|
|
1
1
|
{ div, form, input, textarea, select, option, label, h4, p, a } = React.DOM
|
2
|
-
#
|
3
|
-
#
|
4
|
-
# ARGS # first value is default
|
5
|
-
#
|
6
|
-
# collation # 'list' | 'record'
|
7
|
-
# paper # 'A4' | 'label' | ...
|
8
|
-
# template # '' | 'slip' | 'quote'
|
9
|
-
# cmd # '' | 'print_label' - a particular method on the printing_class
|
10
|
-
#
|
11
|
-
# PRINTPROMPT
|
12
|
-
# print[medium] # 'display' | 'email' | 'printer' | 'download'
|
13
|
-
# print[output_type] # 'html' | 'pdf' | 'text'
|
14
|
-
# print[printer] # what printer to send output to
|
15
|
-
# print[email_to] # email address
|
16
|
-
# print[message] # body of email
|
17
|
-
# print[range] # which pages should print
|
18
|
-
# print[copies] # number of copies
|
19
|
-
#
|
20
|
-
# PRINTJOB
|
21
|
-
# id,
|
22
|
-
# account_id, # what 'system' / customer
|
23
|
-
# printer_id, # on what printer
|
24
|
-
# printed_by_id, # what id has the printed_by entity
|
25
|
-
# printed_by_type, # what entity - like user
|
26
|
-
# view_template_path, # what template
|
27
|
-
# name, # label the job
|
28
|
-
# printing_class, # what entity provides the data
|
29
|
-
# print_driver, # what 'driver' - like :pdf, :cab, :zebra, :csv, :html, etc
|
30
|
-
# print_format, # data collation - like 'record', 'list'
|
31
|
-
# state, # record the progress
|
32
|
-
# paper, # what material - like 'label32x42', 'A4', etc
|
33
|
-
# copies, # number of identical prints
|
34
|
-
# print_sql, # how to find what will be printed
|
35
|
-
# created_at,
|
36
|
-
# updated_at
|
37
|
-
#
|
38
|
-
#
|
39
2
|
|
40
3
|
class @PrintPrompt extends React.Component
|
41
4
|
constructor: (props) ->
|
@@ -81,7 +44,7 @@ class @PrintPrompt extends React.Component
|
|
81
44
|
@obj.append opt
|
82
45
|
@obj.material_select()
|
83
46
|
.fail (data) ->
|
84
|
-
console.log 'fejl
|
47
|
+
console.log 'fejl ved opslag i printer liste'
|
85
48
|
|
86
49
|
hidePrinterList: (e) =>
|
87
50
|
$('.select-wrapper.printer_list').hide()
|
@@ -149,19 +112,19 @@ class @PrintPrompt extends React.Component
|
|
149
112
|
else
|
150
113
|
w = wrl + "/print"
|
151
114
|
arg = "&collation=#{@state.collation}&template=#{@state.template}&paper=#{@state.paper}"
|
115
|
+
@form = $('#print-dialog form')
|
116
|
+
console.log @form.find('#display').checked
|
117
|
+
return
|
152
118
|
@setState {wurl: w, args: arg}, () =>
|
153
|
-
@form = $('#print-dialog form')
|
154
119
|
jqxhr = $.ajax
|
155
120
|
url: @state.wurl
|
156
121
|
method: "GET"
|
157
122
|
data: @form.serialize() + '&' + @state.args
|
158
123
|
dataType: 'html'
|
159
124
|
.done (data) =>
|
160
|
-
console.log 'done'
|
161
125
|
@animatePrint()
|
162
126
|
$("#print-dialog").closeModal()
|
163
127
|
.fail (data) =>
|
164
|
-
console.log 'fail'
|
165
128
|
@animatePrint()
|
166
129
|
$("#print-dialog").closeModal()
|
167
130
|
|
data/lib/oxen_printer/version.rb
CHANGED
data/lib/print_engine.rb
CHANGED
@@ -110,18 +110,17 @@ module PrintEngine
|
|
110
110
|
pb = options[:printed_by]
|
111
111
|
printer_name = options[:print].delete(:printer) || "default"
|
112
112
|
|
113
|
-
options[:print_job]
|
113
|
+
options[:print_job] ||= {}
|
114
|
+
options[:print_job][:printer_id] ||= self.default_printer(pb,printer_name,options[:print][:paper]).id
|
114
115
|
options[:print_job][:state] = "drafted"
|
115
116
|
options[:print_job][:snap_shot] ||= false
|
116
117
|
options[:print_job][:print_sql] = set_resource_sql(resources,options)
|
117
|
-
options[:print_job] ||= {}
|
118
118
|
options[:print_job][:printing_class] ||= klass
|
119
119
|
options[:print_job][:account_id] ||= pb.account.id
|
120
120
|
options[:print_job][:printed_by_id] = pb.id
|
121
121
|
options[:print_job][:printed_by_type] = pb.class.to_s
|
122
122
|
options[:print_job][:name] ||= "#{klass} print at #{I18n.l Time.now, format: :short_date }"
|
123
123
|
options[:print_job][:copies] ||= 1
|
124
|
-
options[:context] ||= ""
|
125
124
|
options[:print_job][:download] = options[:print][:medium]=="download" || false
|
126
125
|
# options[:print_job][:view_template_path] = find_template( options[:print][:template], options[:print][:paper] ) || options[:print_job][:view_template_path]
|
127
126
|
#
|
@@ -186,6 +185,13 @@ module PrintEngine
|
|
186
185
|
#
|
187
186
|
|
188
187
|
def print_label(options={})
|
188
|
+
|
189
|
+
options[:context] ||= ""
|
190
|
+
options[:print] ||= {}
|
191
|
+
options[:print][:collation] = 'record'
|
192
|
+
options[:print][:paper] ||= 'label'
|
193
|
+
options[:print][:output_type] ||= 'raw'
|
194
|
+
|
189
195
|
options = self.class.set_print_job_defaults [self], options
|
190
196
|
options[:print_job][:print_driver] = options[:print][:print_driver] || :cab
|
191
197
|
options[:print_job][:paper] = options[:print][:paper] || "label"
|
@@ -201,6 +207,13 @@ module PrintEngine
|
|
201
207
|
|
202
208
|
|
203
209
|
def print_record(options={})
|
210
|
+
|
211
|
+
options[:context] ||= ""
|
212
|
+
options[:print] ||= {}
|
213
|
+
options[:print][:collation] = 'record'
|
214
|
+
options[:print][:paper] ||= 'A4'
|
215
|
+
options[:print][:output_type] ||= 'pdf'
|
216
|
+
|
204
217
|
options = self.class.set_print_job_defaults [self], options
|
205
218
|
options[:print_job][:print_driver] = options[:print][:print_driver] || :pdf
|
206
219
|
options[:print_job][:paper] = options[:print][:paper] || "A4"
|