erp_app 3.1.9 → 3.1.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. data/lib/erp_app/application_resource_loader/desktop_organizer_loader.rb +1 -1
  2. data/lib/erp_app/application_resource_loader/mobile_loader.rb +1 -1
  3. data/lib/erp_app/application_resource_loader/shared_loader.rb +1 -1
  4. data/lib/erp_app/version.rb +1 -1
  5. data/public/javascripts/erp_app/shared/dynamic_editable_grid.js +14 -1
  6. data/public/javascripts/erp_app/shared/dynamic_editable_grid_loader_panel.js +2 -1
  7. data/public/javascripts/erp_app/shared/encryption/encryption.js +145 -0
  8. data/spec/dummy/db/data_migrations/{20110525001935_add_usd_currency.erp_base_erp_svcs.rb → 20130422163128_add_usd_currency.erp_base_erp_svcs.rb} +0 -0
  9. data/spec/dummy/db/data_migrations/{20110609150135_add_iso_codes.erp_base_erp_svcs.rb → 20130422163129_add_iso_codes.erp_base_erp_svcs.rb} +0 -0
  10. data/spec/dummy/db/data_migrations/20130422163130_setup_compass_ae_instance.erp_base_erp_svcs.rb +21 -0
  11. data/spec/dummy/db/data_migrations/20130422163131_upgrade_compass_ae_instances_data.erp_base_erp_svcs.rb +19 -0
  12. data/spec/dummy/db/data_migrations/20130422163132_add_guid_to_instances.erp_base_erp_svcs.rb +10 -0
  13. data/spec/dummy/db/data_migrations/{20110109173616_create_capability_scope_types.erp_tech_svcs.rb → 20130422163133_create_capability_scope_types.erp_tech_svcs.rb} +0 -0
  14. data/spec/dummy/db/data_migrations/{20110802200222_schedule_delete_expired_sessions_job.erp_tech_svcs.rb → 20130422163134_schedule_delete_expired_sessions_job.erp_tech_svcs.rb} +0 -0
  15. data/spec/dummy/db/data_migrations/{20111111144706_setup_audit_log_types.erp_tech_svcs.rb → 20130422163135_setup_audit_log_types.erp_tech_svcs.rb} +0 -0
  16. data/spec/dummy/db/data_migrations/{20121116155018_create_group_relationship_and_role_types.erp_tech_svcs.rb → 20130422163136_create_group_relationship_and_role_types.erp_tech_svcs.rb} +0 -0
  17. data/spec/dummy/db/data_migrations/{20121130212146_note_capabilities.erp_tech_svcs.rb → 20130422163137_note_capabilities.erp_tech_svcs.rb} +0 -0
  18. data/spec/dummy/db/data_migrations/{20110728201729_erp_app_setup.erp_app.rb → 20130422163138_erp_app_setup.erp_app.rb} +0 -0
  19. data/spec/dummy/db/data_migrations/{20110728201733_update_preferences.erp_app.rb → 20130422163139_update_preferences.erp_app.rb} +0 -0
  20. data/spec/dummy/db/data_migrations/{20110816161238_create_desktop_app_audit_log_viewer.erp_app.rb → 20130422163140_create_desktop_app_audit_log_viewer.erp_app.rb} +4 -1
  21. data/spec/dummy/db/data_migrations/{20110817160743_add_file_manager_application.erp_app.rb → 20130422163141_add_file_manager_application.erp_app.rb} +0 -0
  22. data/spec/dummy/db/data_migrations/{20111108183739_add_default_capabilities.erp_app.rb → 20130422163142_add_default_capabilities.erp_app.rb} +0 -0
  23. data/spec/dummy/db/data_migrations/{20111108183740_add_new_contact_widgets.erp_app.rb → 20130422163143_add_new_contact_widgets.erp_app.rb} +0 -0
  24. data/spec/dummy/db/data_migrations/{20120229160222_add_userinfo_widget.erp_app.rb → 20130422163144_add_userinfo_widget.erp_app.rb} +0 -0
  25. data/spec/dummy/db/data_migrations/{20120405193721_create_party_and_role_type_for_communication_events.erp_app.rb → 20130422163145_create_party_and_role_type_for_communication_events.erp_app.rb} +0 -0
  26. data/spec/dummy/db/data_migrations/20130422163146_create_user_management_mobile_application.erp_app.rb +17 -0
  27. data/spec/dummy/db/data_migrations/{20120418164215_create_configuration_management_desktop_application.erp_app.rb → 20130422163147_create_configuration_management_desktop_application.erp_app.rb} +4 -0
  28. data/spec/dummy/db/data_migrations/20130422163148_create_job_tracker_desktop_application.erp_app.rb +23 -0
  29. data/spec/dummy/db/data_migrations/20130422163149_created_tracked_jobs.erp_app.rb +15 -0
  30. data/spec/dummy/db/data_migrations/{20121130201859_upgrade_remove_system_mgmt_app.erp_app.rb → 20130422163150_upgrade_remove_system_mgmt_app.erp_app.rb} +0 -0
  31. data/spec/dummy/db/data_migrations/{20121218175028_create_security_management_desktop_application.erp_app.rb → 20130422163151_create_security_management_desktop_application.erp_app.rb} +6 -0
  32. data/spec/dummy/db/data_migrations/20130422163152_add_job_tracker_mobile_app.erp_app.rb +17 -0
  33. data/spec/dummy/db/migrate/{20130107214535_base_erp_services.erp_base_erp_svcs.rb → 20130422163121_base_erp_services.erp_base_erp_svcs.rb} +27 -2
  34. data/spec/dummy/db/migrate/20130422163122_add_txn_status.erp_base_erp_svcs.rb +37 -0
  35. data/spec/dummy/db/migrate/20130422163123_upgrade_compass_ae_instances.erp_base_erp_svcs.rb +34 -0
  36. data/spec/dummy/db/migrate/20130422163124_add_uuid_compass_ae_instance.erp_base_erp_svcs.rb +17 -0
  37. data/spec/dummy/db/migrate/20130422163125_add_long_lat_to_address.erp_base_erp_svcs.rb +16 -0
  38. data/spec/dummy/db/migrate/{20130107214536_base_tech_services.erp_tech_svcs.rb → 20130422163126_base_tech_services.erp_tech_svcs.rb} +0 -0
  39. data/spec/dummy/db/migrate/{20130107214537_create_has_attribute_tables.erp_tech_svcs.rb → 20130422163127_create_has_attribute_tables.erp_tech_svcs.rb} +0 -0
  40. data/spec/dummy/db/migrate/{20130107214538_create_groups.erp_tech_svcs.rb → 20130422163128_create_groups.erp_tech_svcs.rb} +0 -0
  41. data/spec/dummy/db/migrate/{20130107214539_upgrade_security.erp_tech_svcs.rb → 20130422163129_upgrade_security.erp_tech_svcs.rb} +0 -0
  42. data/spec/dummy/db/migrate/{20130107214540_upgrade_security2.erp_tech_svcs.rb → 20130422163130_upgrade_security2.erp_tech_svcs.rb} +5 -0
  43. data/spec/dummy/db/migrate/20130422163131_add_queue_to_delayed_jobs.erp_tech_svcs.rb +14 -0
  44. data/spec/dummy/db/migrate/{20130107214541_base_app_framework.erp_app.rb → 20130422163132_base_app_framework.erp_app.rb} +0 -0
  45. data/spec/dummy/db/migrate/20130422163133_add_job_tracker.erp_app.rb +20 -0
  46. data/spec/dummy/db/migrate/20130422163134_update_mobile_application.erp_app.rb +28 -0
  47. data/spec/dummy/db/schema.rb +67 -7
  48. data/spec/dummy/db/spec.sqlite3 +0 -0
  49. data/spec/dummy/log/{development.log → adam.log} +0 -0
  50. data/spec/dummy/log/spec.log +101885 -23623
  51. metadata +86 -63
  52. data/spec/dummy/db/data_migrations/20110913145838_setup_compass_ae_instance.erp_base_erp_svcs.rb +0 -12
  53. data/spec/dummy/db/data_migrations/20120109173616_create_download_capability_type.erp_tech_svcs.rb +0 -14
  54. data/spec/dummy/db/data_migrations/20120411180756_create_user_management_mobile_application.erp_app.rb +0 -19
@@ -18,7 +18,7 @@ module ErpApp
18
18
 
19
19
  def locate_resource_files(resource_type)
20
20
  engine_dirs = Rails::Application::Railties.engines.map{|p| p.config.root.to_s}
21
- root_and_engines_dirs = ([Rails.root] | engine_dirs)
21
+ root_and_engines_dirs = (engine_dirs | [Rails.root])
22
22
 
23
23
  application_files = []
24
24
  root_and_engines_dirs.each do |engine_dir|
@@ -18,7 +18,7 @@ module ErpApp
18
18
 
19
19
  def locate_resource_files(resource_type)
20
20
  engine_dirs = Rails::Application::Railties.engines.map{|p| p.config.root.to_s}
21
- root_and_engines_dirs = ([Rails.root] | engine_dirs)
21
+ root_and_engines_dirs = (engine_dirs | [Rails.root])
22
22
 
23
23
  application_files = []
24
24
  root_and_engines_dirs.each do |engine_dir|
@@ -6,7 +6,7 @@ module ErpApp
6
6
 
7
7
  def locate_shared_files(resource_type, folder='shared')
8
8
  engine_dirs = Rails::Application::Railties.engines.map{|p| p.config.root.to_s}
9
- root_and_engines_dirs = ([Rails.root] | engine_dirs)
9
+ root_and_engines_dirs = (engine_dirs | [Rails.root])
10
10
 
11
11
  # get shared resources (global js and css)
12
12
  shared_files = []
@@ -2,7 +2,7 @@ module ErpApp
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 3
4
4
  MINOR = 1
5
- TINY = 9
5
+ TINY = 10
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].compact.join('.')
8
8
  end
@@ -60,9 +60,9 @@ Ext.define("Compass.ErpApp.Shared.DynamicEditableGrid",{
60
60
  },
61
61
 
62
62
  constructor : function(config) {
63
+ var plugins = [];
63
64
  if(config['editable']){
64
65
  var tbar = {};
65
- var plugins = [];
66
66
  this.editing = Ext.create('Ext.grid.plugin.RowEditing', {
67
67
  clicksToMoveEditor: 1
68
68
  });
@@ -111,6 +111,19 @@ Ext.define("Compass.ErpApp.Shared.DynamicEditableGrid",{
111
111
  }
112
112
  }
113
113
 
114
+ if(config['cell_editable']){
115
+ this.cell_editing = Ext.create('Ext.grid.plugin.CellEditing', {
116
+ clicksToEdit: 2
117
+ });
118
+
119
+ plugins.push(this.cell_editing);
120
+
121
+ config = Ext.apply({
122
+ plugins:plugins,
123
+ selType: 'cellmodel'
124
+ }, config);
125
+ }
126
+
114
127
  config = Ext.apply({
115
128
  layout:'fit',
116
129
  frame: false,
@@ -15,7 +15,8 @@ Ext.define("Compass.ErpApp.Shared.DynamicEditableGridLoaderPanel",{
15
15
  editable:config['editable'],
16
16
  url:config['dataUrl'],
17
17
  page:config['page'],
18
- remoteSort:config['remoteSort'],
18
+ cell_editable:config['cell_editable'],
19
+ remoteSort:config['remoteSort'],
19
20
  pageSize:config['pageSize'],
20
21
  displayMsg:config['displayMsg'],
21
22
  emptyMsg:config['emptyMsg'],
@@ -0,0 +1,145 @@
1
+ Ext.ns("Compass.ErpApp.Utility.Encryption");
2
+
3
+ Compass.ErpApp.Utility.Encryption.MD5 = function(s,raw,hexcase,chrsz) {
4
+ raw = raw || false;
5
+ hexcase = hexcase || false;
6
+ chrsz = chrsz || 8;
7
+
8
+ function safe_add(x, y){
9
+ var lsw = (x & 0xFFFF) + (y & 0xFFFF);
10
+ var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
11
+ return (msw << 16) | (lsw & 0xFFFF);
12
+ }
13
+ function bit_rol(num, cnt){
14
+ return (num << cnt) | (num >>> (32 - cnt));
15
+ }
16
+ function md5_cmn(q, a, b, x, s, t){
17
+ return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
18
+ }
19
+ function md5_ff(a, b, c, d, x, s, t){
20
+ return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
21
+ }
22
+ function md5_gg(a, b, c, d, x, s, t){
23
+ return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
24
+ }
25
+ function md5_hh(a, b, c, d, x, s, t){
26
+ return md5_cmn(b ^ c ^ d, a, b, x, s, t);
27
+ }
28
+ function md5_ii(a, b, c, d, x, s, t){
29
+ return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
30
+ }
31
+
32
+ function core_md5(x, len){
33
+ x[len >> 5] |= 0x80 << ((len) % 32);
34
+ x[(((len + 64) >>> 9) << 4) + 14] = len;
35
+
36
+ var a = 1732584193,
37
+ b = -271733879,
38
+ c = -1732584194,
39
+ d = 271733878;
40
+
41
+ for(var i = 0; i < x.length; i += 16){
42
+ var olda = a,
43
+ oldb = b,
44
+ oldc = c,
45
+ oldd = d;
46
+
47
+ a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
48
+ d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
49
+ c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);
50
+ b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
51
+ a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
52
+ d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);
53
+ c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
54
+ b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
55
+ a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);
56
+ d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
57
+ c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
58
+ b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
59
+ a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);
60
+ d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
61
+ c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
62
+ b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);
63
+ a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
64
+ d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
65
+ c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);
66
+ b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
67
+ a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
68
+ d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);
69
+ c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
70
+ b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
71
+ a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);
72
+ d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
73
+ c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
74
+ b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);
75
+ a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
76
+ d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
77
+ c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);
78
+ b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
79
+ a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
80
+ d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
81
+ c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);
82
+ b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
83
+ a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
84
+ d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);
85
+ c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
86
+ b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
87
+ a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);
88
+ d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
89
+ c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
90
+ b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);
91
+ a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
92
+ d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
93
+ c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);
94
+ b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
95
+ a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
96
+ d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);
97
+ c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
98
+ b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
99
+ a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);
100
+ d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
101
+ c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
102
+ b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
103
+ a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);
104
+ d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
105
+ c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
106
+ b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);
107
+ a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
108
+ d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
109
+ c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);
110
+ b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
111
+ a = safe_add(a, olda);
112
+ b = safe_add(b, oldb);
113
+ c = safe_add(c, oldc);
114
+ d = safe_add(d, oldd);
115
+ }
116
+ return [a, b, c, d];
117
+ }
118
+ function str2binl(str){
119
+ var bin = [],
120
+ mask = (1 << chrsz) - 1;
121
+ for(var i = 0; i < str.length * chrsz; i += chrsz) {
122
+ bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32);
123
+ }
124
+ return bin;
125
+ }
126
+ function binl2str(bin){
127
+ var str = "",
128
+ mask = (1 << chrsz) - 1;
129
+ for(var i = 0; i < bin.length * 32; i += chrsz) {
130
+ str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask);
131
+ }
132
+ return str;
133
+ }
134
+
135
+ function binl2hex(binarray){
136
+ var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef",
137
+ str = "";
138
+ for(var i = 0; i < binarray.length * 4; i++) {
139
+ str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) + hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);
140
+ }
141
+ return str;
142
+ }
143
+
144
+ return (raw ? binl2str(core_md5(str2binl(s), s.length * chrsz)) : binl2hex(core_md5(str2binl(s), s.length * chrsz)) );
145
+ };
@@ -0,0 +1,21 @@
1
+ # This migration comes from erp_base_erp_svcs (originally 20110913145838)
2
+ class SetupCompassAeInstance
3
+
4
+ def self.up
5
+ c = CompassAeInstance.new
6
+ c.description = 'Base CompassAE Instance'
7
+ c.internal_identifier = 'base'
8
+ c.version = '3.1'
9
+ c.save
10
+
11
+ rt = RoleType.new
12
+ rt.description = 'CompassAE Instance Owner'
13
+ rt.internal_identifier = 'compass_ae_instance_owner'
14
+ rt.save
15
+ end
16
+
17
+ def self.down
18
+ #remove data here
19
+ end
20
+
21
+ end
@@ -0,0 +1,19 @@
1
+ # This migration comes from erp_base_erp_svcs (originally 20130211555555)
2
+ class UpgradeCompassAeInstancesData < ActiveRecord::Migration
3
+ def self.up
4
+ if CompassAeInstance.find_by_internal_identifier('base').nil?
5
+ c = CompassAeInstance.order('id ASC').first
6
+ c.description = 'Base CompassAE Instance'
7
+ c.internal_identifier = 'base'
8
+ c.schema = 'public'
9
+ c.save
10
+ end
11
+
12
+ if RoleType.find_by_internal_identifier('compass_ae_instance_owner').nil?
13
+ rt = RoleType.new
14
+ rt.description = 'CompassAE Instance Owner'
15
+ rt.internal_identifier = 'compass_ae_instance_owner'
16
+ rt.save
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,10 @@
1
+ # This migration comes from erp_base_erp_svcs (originally 20130404201756)
2
+ class AddGuidToInstances
3
+
4
+ def self.up
5
+ CompassAeInstance.all.each do |instance|
6
+ instance.setup_guid
7
+ end
8
+ end
9
+
10
+ end
@@ -12,7 +12,10 @@ class CreateDesktopAppAuditLogViewer
12
12
  app.preference_types << PreferenceType.iid('desktop_shortcut')
13
13
  app.preference_types << PreferenceType.iid('autoload_application')
14
14
  app.save
15
-
15
+
16
+ admin_user = User.find_by_username('admin')
17
+ admin_user.desktop.applications << app
18
+ admin_user.desktop.save
16
19
  end
17
20
 
18
21
  def self.down
@@ -0,0 +1,17 @@
1
+ # This migration comes from erp_app (originally 20120411180756)
2
+ class CreateUserManagementMobileApplication
3
+
4
+ def self.up
5
+ MobileApplication.create(
6
+ :description => 'User Management',
7
+ :icon => 'icon-user',
8
+ :internal_identifier => 'user_management',
9
+ :xtype => 'compass-erpapp-mobile-usermanagement-application'
10
+ )
11
+ end
12
+
13
+ def self.down
14
+ MobileApplication.destroy_all("internal_identifier = 'user_management'")
15
+ end
16
+
17
+ end
@@ -15,6 +15,10 @@ class CreateConfigurationManagementDesktopApplication
15
15
  pt2 = PreferenceType.iid('autoload_application')
16
16
  pt2.preferenced_records << app
17
17
  pt2.save
18
+
19
+ admin_user = User.find_by_username('admin')
20
+ admin_user.desktop.applications << app
21
+ admin_user.desktop.save
18
22
  end
19
23
 
20
24
  def self.down
@@ -0,0 +1,23 @@
1
+ # This migration comes from erp_app (originally 20121018143910)
2
+ class CreateJobTrackerDesktopApplication
3
+ def self.up
4
+ app = DesktopApplication.create(
5
+ :description => 'Job Tracker',
6
+ :icon => 'icon-calendar',
7
+ :javascript_class_name => 'Compass.ErpApp.Desktop.Applications.JobTracker',
8
+ :internal_identifier => 'job_tracker',
9
+ :shortcut_id => 'job_tracker-win'
10
+ )
11
+ pt1 = PreferenceType.iid('desktop_shortcut')
12
+ pt1.preferenced_records << app
13
+ pt1.save
14
+
15
+ pt2 = PreferenceType.iid('autoload_application')
16
+ pt2.preferenced_records << app
17
+ pt2.save
18
+ end
19
+
20
+ def self.down
21
+ DesktopApplication.destroy_all(['internal_identifier = ?','job_tracker'])
22
+ end
23
+ end
@@ -0,0 +1,15 @@
1
+ # This migration comes from erp_app (originally 20121018172347)
2
+ class CreatedTrackedJobs
3
+
4
+ def self.up
5
+ JobTracker.create(
6
+ :job_name => 'Delete Expired Sessions',
7
+ :job_klass => 'ErpTechSvcs::Sessions::DeleteExpiredSessionsJob'
8
+ )
9
+ end
10
+
11
+ def self.down
12
+ #remove data here
13
+ end
14
+
15
+ end
@@ -15,6 +15,12 @@ class CreateSecurityManagementDesktopApplication
15
15
  pt2 = PreferenceType.iid('autoload_application')
16
16
  pt2.preferenced_records << app
17
17
  pt2.save
18
+
19
+ admin_user = User.find_by_username('admin')
20
+ if admin_user
21
+ admin_user.desktop.applications << app
22
+ admin_user.desktop.save
23
+ end
18
24
  end
19
25
 
20
26
  def self.down
@@ -0,0 +1,17 @@
1
+ # This migration comes from erp_app (originally 20130411200351)
2
+ class AddJobTrackerMobileApp
3
+
4
+ def self.up
5
+ MobileApplication.create(
6
+ :description => 'Jobs',
7
+ :icon => 'icon-tasks',
8
+ :internal_identifier => 'job_tracker',
9
+ :xtype => 'compass-erpapp-mobile-jobtracker-application'
10
+ )
11
+ end
12
+
13
+ def self.down
14
+ MobileApplication.destroy_all("internal_identifier = 'job_tracker'")
15
+ end
16
+
17
+ end
@@ -4,10 +4,35 @@ class BaseErpServices < ActiveRecord::Migration
4
4
 
5
5
  unless table_exists?(:compass_ae_instances)
6
6
  create_table :compass_ae_instances do |t|
7
+ t.string :description
8
+ t.string :internal_identifier
7
9
  t.decimal :version, :precision => 8, :scale => 3
10
+ t.string :type
11
+ t.string :schema, :default => 'public'
12
+ t.integer :parent_id
8
13
 
9
14
  t.timestamps
10
15
  end
16
+
17
+ add_index :compass_ae_instances, :internal_identifier, :name => "iid_idx"
18
+ add_index :compass_ae_instances, :schema, :name => "schema_idx"
19
+ add_index :compass_ae_instances, :type, :name => "type_idx"
20
+ add_index :compass_ae_instances, :parent_id, :name => "parent_id_idx"
21
+ end
22
+
23
+ unless table_exists?(:compass_ae_instance_party_roles)
24
+ create_table :compass_ae_instance_party_roles do |t|
25
+ t.string :description
26
+ t.integer :compass_ae_instance_id
27
+ t.integer :party_id
28
+ t.integer :role_type_id
29
+
30
+ t.timestamps
31
+ end
32
+
33
+ add_index :compass_ae_instance_party_roles, :compass_ae_instance_id, :name => "compass_ae_instance_id_idx"
34
+ add_index :compass_ae_instance_party_roles, :party_id, :name => "party_id_idx"
35
+ add_index :compass_ae_instance_party_roles, :role_type_id, :name => "role_type_id_idx"
11
36
  end
12
37
 
13
38
  # Create parties table
@@ -18,7 +43,7 @@ class BaseErpServices < ActiveRecord::Migration
18
43
  t.column :business_party_type, :string
19
44
  t.column :list_view_image_id, :integer
20
45
 
21
- #This field is here to provide a direct way to map CompassERP
46
+ #This field is here to provide a direct way to map CompassAE
22
47
  #business parties to unified idenfiers in organizations if they
23
48
  #have been implemented in an enterprise.
24
49
  t.column :enterprise_identifier, :string
@@ -444,7 +469,7 @@ class BaseErpServices < ActiveRecord::Migration
444
469
 
445
470
  def self.down
446
471
  [
447
- :currencies, :money,
472
+ :currencies, :money, :compass_ae_instance_party_roles,
448
473
  :party_search_facts, :phone_numbers, :email_addresses,
449
474
  :postal_addresses, :contact_purposes, :contact_types,
450
475
  :contacts, :individuals, :organizations,