kuali_toolbox 0.41 → 0.42
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/transform_CSV_to_HR_XML +31 -2
- data/lib/kuali_toolbox/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4247d6c4bb00a266d556c58051c2d0ee70a24322
|
4
|
+
data.tar.gz: 649bddc5ccb7ffd32fda70571c8ae511fa3cd51e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c0bb722051db60343b7cd4f42b18512d1a362bbd974bd5a904eb7a056f08154fd70e66619300ae842b1e3f5473955e01dc2497a28ff269362fe113bbef925f0
|
7
|
+
data.tar.gz: 223df77e098c555ca51d5180d0a4ebfb377ab572356864a877074a19c22dc78482e30e7f58de8ef6f5fbbdf09213b270795d79fcc6379615d42813aafe5c75d7
|
data/bin/transform_CSV_to_HR_XML
CHANGED
@@ -189,7 +189,7 @@ def buildAffiliations(row)
|
|
189
189
|
|
190
190
|
if (!emp.empty?)
|
191
191
|
emp[:primaryEmployment] = true
|
192
|
-
aff[:employment] = []
|
192
|
+
aff[:employment] = [];
|
193
193
|
aff[:employment].push(emp);
|
194
194
|
end
|
195
195
|
if (!aff.empty?)
|
@@ -295,6 +295,20 @@ def addToListIfNotIncluded(item, list)
|
|
295
295
|
end
|
296
296
|
end
|
297
297
|
|
298
|
+
def mergeEmployment(record, newAffiliation)
|
299
|
+
if (!newAffiliation[:employment].nil?)
|
300
|
+
newAffiliation[:employment].each do |employmentInfo|
|
301
|
+
if (record[:employment].nil?)
|
302
|
+
record[:employment] = []
|
303
|
+
end
|
304
|
+
if (!record[:employment].find{ |x| x[:primaryEmployment] }.nil?)
|
305
|
+
employmentInfo[:primaryEmployment] = false
|
306
|
+
end
|
307
|
+
record[:employment].push(employmentInfo)
|
308
|
+
end
|
309
|
+
end
|
310
|
+
end
|
311
|
+
|
298
312
|
opt = parse_command_line_options (File.basename $0), ARGF.argv
|
299
313
|
|
300
314
|
text_parse_errors = []
|
@@ -315,8 +329,23 @@ CSV.open(opt[:csv_filename], opt[:csv_options]) do |csv|
|
|
315
329
|
if (!newAffiliation.nil? && record[:affiliations].nil?)
|
316
330
|
record[:affiliations] = []
|
317
331
|
end
|
318
|
-
|
332
|
+
duplicateAffil = record[:affiliations].find{ |affil| affil[:affiliationType] == newAffiliation[:affiliationType] && affil[:campus] == newAffiliation[:campus]};
|
333
|
+
if (duplicateAffil.nil?)
|
334
|
+
if (newAffiliation[:default] && !record[:affiliations].find{ |x| x[:default] }.nil?)
|
335
|
+
newAffiliation[:default] = false
|
336
|
+
end
|
337
|
+
mergeEmployment(record, newAffiliation)
|
319
338
|
record[:affiliations].push(newAffiliation)
|
339
|
+
else
|
340
|
+
duplicateAffil[:employment].each do |employmentInfo|
|
341
|
+
newAffiliation[:employment].each do |newEmployment|
|
342
|
+
if (employmentInfo.select{ |key, value| key != :primaryEmployment} != newEmployment.select{ |key, value| key != :primaryEmployment})
|
343
|
+
e = Struct.new(:message).new("WARNING:Duplicate employment info for single affiliation. Skipping extra employment info on #{$.}");
|
344
|
+
puts e.message;
|
345
|
+
text_parse_errors.push e;
|
346
|
+
end
|
347
|
+
end
|
348
|
+
end
|
320
349
|
end
|
321
350
|
|
322
351
|
record[:names] = addToListIfNotIncluded(buildName(row), record[:names])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kuali_toolbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.42'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- KualiCo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: builder
|