erp_app 3.1.5 → 3.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. data/app/controllers/erp_app/desktop/job_tracker/base_controller.rb +6 -1
  2. data/app/controllers/erp_app/mobile/user_management/base_controller.rb +0 -3
  3. data/app/models/application.rb +1 -1
  4. data/app/views/erp_app/desktop/base/index.erb +11 -6
  5. data/app/views/erp_app/mobile/base/index.erb +37 -32
  6. data/app/views/erp_app/mobile/login/index.erb +1 -2
  7. data/app/views/erp_app/organizer/base/index.erb +6 -0
  8. data/db/data_migrations/20120411180756_create_user_management_mobile_application.rb +5 -7
  9. data/db/data_migrations/20130411200351_add_job_tracker_mobile_app.rb +16 -0
  10. data/db/migrate/20120920145259_add_job_tracker.rb +11 -7
  11. data/db/migrate/20130410182333_update_mobile_application.rb +27 -0
  12. data/lib/erp_app/version.rb +1 -1
  13. data/lib/generators/compass_ae_mobile/compass_ae_mobile_generator.rb +5 -2
  14. data/lib/generators/mobile_application/mobile_application_generator.rb +0 -2
  15. data/lib/generators/mobile_application/templates/controllers/controller_template.erb +1 -1
  16. data/lib/generators/mobile_application/templates/migrate/migration_template.erb +2 -2
  17. data/lib/generators/mobile_application/templates/public/app.js.erb +23 -34
  18. data/public/images/erp_app/mobile/green_light.png +0 -0
  19. data/public/images/erp_app/mobile/red_light.png +0 -0
  20. data/public/images/erp_app/mobile/yellow_light.png +0 -0
  21. data/public/javascripts/erp_app/desktop/applications/job_tracker/jobs_grid.js +2 -2
  22. data/public/javascripts/erp_app/login/mobile.js +55 -48
  23. data/public/javascripts/erp_app/mobile/app.js +71 -43
  24. data/public/javascripts/erp_app/mobile/applications/job_tracker/app.js +177 -0
  25. data/public/javascripts/erp_app/mobile/applications/job_tracker/model/job.js +15 -0
  26. data/public/javascripts/erp_app/mobile/applications/job_tracker/store/jobs.js +16 -0
  27. data/public/javascripts/erp_app/mobile/applications/job_tracker/store/view/templates.js +22 -0
  28. data/public/javascripts/erp_app/mobile/applications/user_management/app.js +103 -159
  29. data/public/javascripts/erp_app/mobile/applications/user_management/app/view/templates.js +32 -22
  30. data/public/stylesheets/erp_app/mobile/applications/user_management/main.css +20 -4
  31. data/public/stylesheets/erp_app/mobile/mobile.css +35 -324
  32. data/public/stylesheets/erp_app/shared/compass-ext-all.css +5 -11
  33. data/spec/dummy/db/data_migrations/20110109173616_create_capability_scope_types.erp_tech_svcs.rb +15 -0
  34. data/spec/dummy/db/data_migrations/20110525001935_add_usd_currency.erp_base_erp_svcs.rb +12 -0
  35. data/spec/dummy/db/data_migrations/20110609150135_add_iso_codes.erp_base_erp_svcs.rb +19 -0
  36. data/spec/dummy/db/data_migrations/20110728201729_erp_app_setup.erp_app.rb +252 -0
  37. data/spec/dummy/db/data_migrations/20110728201733_update_preferences.erp_app.rb +53 -0
  38. data/spec/dummy/db/data_migrations/20110802200222_schedule_delete_expired_sessions_job.erp_tech_svcs.rb +16 -0
  39. data/spec/dummy/db/data_migrations/20110816161238_create_desktop_app_audit_log_viewer.erp_app.rb +21 -0
  40. data/spec/dummy/db/data_migrations/20110817160743_add_file_manager_application.erp_app.rb +32 -0
  41. data/spec/dummy/db/data_migrations/20110913145838_setup_compass_ae_instance.erp_base_erp_svcs.rb +12 -0
  42. data/spec/dummy/db/data_migrations/20111108183739_add_default_capabilities.erp_app.rb +23 -0
  43. data/spec/dummy/db/data_migrations/20111108183740_add_new_contact_widgets.erp_app.rb +42 -0
  44. data/spec/dummy/db/data_migrations/20111111144706_setup_audit_log_types.erp_tech_svcs.rb +22 -0
  45. data/spec/dummy/db/data_migrations/20120229160222_add_userinfo_widget.erp_app.rb +29 -0
  46. data/spec/dummy/db/data_migrations/20120405193721_create_party_and_role_type_for_communication_events.erp_app.rb +11 -0
  47. data/spec/dummy/db/data_migrations/20120411180756_create_user_management_mobile_application.erp_app.rb +19 -0
  48. data/spec/dummy/db/data_migrations/20120418164215_create_configuration_management_desktop_application.erp_app.rb +23 -0
  49. data/spec/dummy/db/data_migrations/20121116155018_create_group_relationship_and_role_types.erp_tech_svcs.rb +20 -0
  50. data/spec/dummy/db/data_migrations/20121130201859_upgrade_remove_system_mgmt_app.erp_app.rb +16 -0
  51. data/spec/dummy/db/data_migrations/20121130212146_note_capabilities.erp_tech_svcs.rb +24 -0
  52. data/spec/dummy/db/data_migrations/20121218175028_create_security_management_desktop_application.erp_app.rb +23 -0
  53. data/spec/dummy/db/data_migrations/20130422153811_upgrade_compass_ae_instances_data.erp_base_erp_svcs.rb +19 -0
  54. data/spec/dummy/db/data_migrations/20130422153812_add_guid_to_instances.erp_base_erp_svcs.rb +10 -0
  55. data/spec/dummy/db/data_migrations/20130422153813_create_job_tracker_desktop_application.erp_app.rb +23 -0
  56. data/spec/dummy/db/data_migrations/20130422153814_created_tracked_jobs.erp_app.rb +15 -0
  57. data/spec/dummy/db/data_migrations/20130422153815_add_job_tracker_mobile_app.erp_app.rb +17 -0
  58. data/spec/dummy/db/migrate/20130105135833_base_erp_services.erp_base_erp_svcs.rb +461 -0
  59. data/spec/dummy/db/migrate/20130105135834_base_tech_services.erp_tech_svcs.rb +271 -0
  60. data/spec/dummy/db/migrate/20130105135835_create_has_attribute_tables.erp_tech_svcs.rb +39 -0
  61. data/spec/dummy/db/migrate/20130105135836_create_groups.erp_tech_svcs.rb +19 -0
  62. data/spec/dummy/db/migrate/20130105135837_upgrade_security.erp_tech_svcs.rb +54 -0
  63. data/spec/dummy/db/migrate/20130105135838_upgrade_security2.erp_tech_svcs.rb +270 -0
  64. data/spec/dummy/db/migrate/20130105135839_base_app_framework.erp_app.rb +276 -0
  65. data/spec/dummy/db/migrate/20130422153805_add_txn_status.erp_base_erp_svcs.rb +37 -0
  66. data/spec/dummy/db/migrate/20130422153806_upgrade_compass_ae_instances.erp_base_erp_svcs.rb +34 -0
  67. data/spec/dummy/db/migrate/20130422153807_add_uuid_compass_ae_instance.erp_base_erp_svcs.rb +17 -0
  68. data/spec/dummy/db/migrate/20130422153808_add_long_lat_to_address.erp_base_erp_svcs.rb +16 -0
  69. data/spec/dummy/db/migrate/20130422153809_add_queue_to_delayed_jobs.erp_tech_svcs.rb +14 -0
  70. data/spec/dummy/db/migrate/20130422153810_add_job_tracker.erp_app.rb +20 -0
  71. data/spec/dummy/db/migrate/20130422153811_update_mobile_application.erp_app.rb +28 -0
  72. data/spec/dummy/db/schema.rb +883 -0
  73. data/spec/dummy/db/spec.sqlite3 +0 -0
  74. data/spec/dummy/log/adam.log +1 -0
  75. data/spec/dummy/log/spec.log +107402 -0
  76. metadata +98 -46
  77. data/app/views/erp_app/mobile/user_management/base/index.html.erb +0 -28
  78. data/lib/generators/mobile_application/templates/INSTALL +0 -25
  79. data/lib/generators/mobile_application/templates/views/index.html.erb +0 -28
  80. data/public/images/icons/add/Thumbs.db +0 -0
  81. data/public/images/icons/calendar/Thumbs.db +0 -0
  82. data/public/images/icons/copy/Thumbs.db +0 -0
  83. data/public/images/icons/cut/Thumbs.db +0 -0
  84. data/public/images/icons/delete/Thumbs.db +0 -0
  85. data/public/images/icons/edit/Thumbs.db +0 -0
  86. data/public/images/icons/folder/Thumbs.db +0 -0
  87. data/public/images/icons/gear/Thumbs.db +0 -0
  88. data/public/images/icons/globe/Thumbs.db +0 -0
  89. data/public/images/icons/grid/Thumbs.db +0 -0
  90. data/public/images/icons/help/Thumbs.db +0 -0
  91. data/public/images/icons/information/Thumbs.db +0 -0
  92. data/public/images/icons/key/Thumbs.db +0 -0
  93. data/public/images/icons/log_out/Thumbs.db +0 -0
  94. data/public/images/icons/mail/Thumbs.db +0 -0
  95. data/public/images/icons/new/Thumbs.db +0 -0
  96. data/public/images/icons/next/Thumbs.db +0 -0
  97. data/public/images/icons/open/Thumbs.db +0 -0
  98. data/public/images/icons/paste/Thumbs.db +0 -0
  99. data/public/images/icons/picture/Thumbs.db +0 -0
  100. data/public/images/icons/presentation/Thumbs.db +0 -0
  101. data/public/images/icons/preview/Thumbs.db +0 -0
  102. data/public/images/icons/previous/Thumbs.db +0 -0
  103. data/public/images/icons/print/Thumbs.db +0 -0
  104. data/public/images/icons/properties/Thumbs.db +0 -0
  105. data/public/images/icons/redo/Thumbs.db +0 -0
  106. data/public/images/icons/refresh/Thumbs.db +0 -0
  107. data/public/images/icons/remove/Thumbs.db +0 -0
  108. data/public/images/icons/rename/Thumbs.db +0 -0
  109. data/public/images/icons/save/Thumbs.db +0 -0
  110. data/public/images/icons/search/Thumbs.db +0 -0
  111. data/public/images/icons/send/Thumbs.db +0 -0
  112. data/public/images/icons/settings/Thumbs.db +0 -0
  113. data/public/images/icons/synchronize/Thumbs.db +0 -0
  114. data/public/images/icons/undo/Thumbs.db +0 -0
  115. data/public/images/icons/upload/Thumbs.db +0 -0
  116. data/public/images/icons/user/Thumbs.db +0 -0
  117. data/public/images/icons/zoom_in/Thumbs.db +0 -0
  118. data/public/images/icons/zoom_out/Thumbs.db +0 -0
  119. data/public/javascripts/erp_app/ckeditor/plugins/jwplayer/jwplayer/Thumbs.db +0 -0
@@ -15,7 +15,12 @@ module ErpApp
15
15
 
16
16
  render :json => {:total_count => total_count, :success => true,
17
17
  :jobs => job_trackers.collect { |tracker| tracker.to_hash(
18
- :only => [:id, :job_name, :last_run_at, :next_run_at, :job_klass, :run_time], :additional_values => {:scheduled => (tracker.scheduled?)}) }}
18
+ :only => [:id, :job_name, :job_klass, :run_time],
19
+ :additional_values => {
20
+ :scheduled => (tracker.scheduled?),
21
+ :last_run_at => (tracker.last_run_at.nil? ? '' : tracker.last_run_at.strftime("%m-%d-%Y %H:%M:%S")),
22
+ :next_run_at => (tracker.next_run_at.nil? ? '' : tracker.next_run_at.strftime("%m-%d-%Y %H:%M:%S")),
23
+ }) }}
19
24
  end
20
25
 
21
26
  def schedule
@@ -2,9 +2,6 @@ module ErpApp
2
2
  module Mobile
3
3
  module UserManagement
4
4
  class BaseController < ::ErpApp::Mobile::BaseController
5
- def index
6
- @application = MobileApplication.find_by_internal_identifier('user_management')
7
- end
8
5
 
9
6
  def users
10
7
  users = User.all.collect do |user|
@@ -6,7 +6,7 @@ class Application < ActiveRecord::Base
6
6
  has_and_belongs_to_many :app_containers
7
7
  has_and_belongs_to_many :widgets
8
8
 
9
- validates_uniqueness_of :javascript_class_name
9
+ validates_uniqueness_of :javascript_class_name, :allow_nil => true
10
10
  validates_uniqueness_of :internal_identifier, :scope => :type, :case_sensitive => false
11
11
 
12
12
  def locate_resources(resource_type)
@@ -56,10 +56,10 @@
56
56
  <!--javascript-->
57
57
  <%= include_extjs(:theme => @desktop.get_preference(:extjs_theme), :debug => (Rails.env != 'production')) %>
58
58
  <%= static_javascript_include_tag("extjs/overrides.js")%>
59
-
59
+
60
60
  <%= static_javascript_include_tag("erp_app/utility.js")%>
61
61
  <%= static_javascript_include_tag("erp_app/desktop/ext_ux_desktop_module.js")%>
62
-
62
+
63
63
  <%= static_javascript_include_tag('erp_app/widgets.js')%>
64
64
  <%= include_widgets%>
65
65
  <!-- shared application resources -->
@@ -90,7 +90,7 @@
90
90
  <!-- end application resources -->
91
91
  <!-- compass extensions -->
92
92
  <%=include_code_mirror_library%>
93
- <style type="text/css">
93
+ <style type="text/css">
94
94
  .CodeMirror {
95
95
  border: 1px solid #eee;
96
96
  }
@@ -155,7 +155,7 @@
155
155
  iconCls:"icon-key",
156
156
  handler:b.onLogout,
157
157
  scope:b
158
- },
158
+ },
159
159
  {
160
160
  text:"About",
161
161
  iconCls:"icon-info",
@@ -199,7 +199,7 @@
199
199
  "<tr><td>{name}</td><td>{version}</td></tr>",
200
200
  '</tpl>',
201
201
  "</table>");
202
-
202
+
203
203
  var aboutWindow = Ext.create('Ext.window.Window',{
204
204
  title: 'About Your Compass AE Instance',
205
205
  height: 200,
@@ -221,7 +221,7 @@
221
221
  var compassDesktop;
222
222
  Ext.onReady(function () {
223
223
  compassDesktop = new MyDesktop.App();
224
-
224
+
225
225
  setTimeout(function(){
226
226
  Ext.get('loading').remove();
227
227
  Ext.get('loading-mask').fadeOut({remove:true});
@@ -231,6 +231,11 @@
231
231
  }, 250);
232
232
  });
233
233
 
234
+ window.onbeforeunload = function(){
235
+ return ' If you navigate away from this page without' +
236
+ ' first saving your data, the changes will be' +
237
+ ' lost.';
238
+ }
234
239
  </script>
235
240
  <div id="loading-mask"></div>
236
241
  <div id="loading">
@@ -1,38 +1,43 @@
1
1
  <!DOCTYPE html>
2
2
  <html xmlns="http://www.w3.org/1999/xhtml">
3
- <head>
4
- <title>CompassAE Mobile</title>
5
- <%=include_sencha_touch :debug => (Rails.env != 'production')%>
6
- <%=static_javascript_include_tag('erp_app/utility.js')%>
7
- <%=static_javascript_include_tag('erp_app/mobile/mobile_base.js')%>
8
- <%#=setup_js_authentication(@user, @desktop)%>
9
- <%=create_authenticity_token_sencha_touch_field%>
3
+ <head>
4
+ <title>CompassAE Mobile</title>
5
+ <%= include_sencha_touch :debug => (Rails.env != 'production') %>
6
+ <%= static_javascript_include_tag('erp_app/utility.js') %>
7
+ <%= static_javascript_include_tag('erp_app/mobile/mobile_base.js') %>
8
+ <%= create_authenticity_token_sencha_touch_field %>
9
+ <%= add_authenticity_token_to_extjs %>
10
10
 
11
- <!--stylesheets-->
12
- <%= static_stylesheet_link_tag('erp_app/mobile/mobile.css') %>
13
- <!--end stylesheets-->
11
+ <!--stylesheets-->
12
+ <%= static_stylesheet_link_tag('erp_app/mobile/mobile.css') %>
13
+ <!--end stylesheets-->
14
14
 
15
- <script type="text/javascript">
16
- var mobileApplications = [];
17
- <%
18
- @mobile.applications.each do |application|
19
- %>
20
- mobileApplications.push({
21
- text:'<%=application.description%>',
22
- iconCls:'<%=application.icon%>',
23
- ui:'round',
24
- handler:function(){
25
- window.location = '<%=application.base_url%>'
26
- }
27
- });
28
- <%
29
- end
30
- %>
31
- </script>
15
+ <% @mobile.applications.each do |application| %>
16
+ <%= static_javascript_include_tag(application.locate_resources('javascripts')) %>
17
+ <%= static_stylesheet_link_tag(application.locate_resources('stylesheets')) %>
18
+ <% end %>
32
19
 
33
- <%= static_javascript_include_tag("erp_app/mobile/app.js")%>
34
- </head>
35
- <body>
36
- <%= setSessionTimeout %>
37
- </body>
20
+ <script type="text/javascript">
21
+ var mobileApplications = [], mobileApplicationsData = [];
22
+ <%
23
+ @mobile.applications.each do |application|
24
+ %>
25
+
26
+ mobileApplications.push({xtype: '<%=application.xtype%>', itemId: '<%=application.internal_identifier%>'});
27
+ mobileApplicationsData.push({
28
+ iconCls: '<%=application.icon%>',
29
+ name: '<%=application.description%>',
30
+ itemId: '#<%=application.internal_identifier%>'
31
+ });
32
+
33
+ <%
34
+ end
35
+ %>
36
+ </script>
37
+
38
+ <%= static_javascript_include_tag("erp_app/mobile/app.js") %>
39
+ </head>
40
+ <body>
41
+ <%= setSessionTimeout %>
42
+ </body>
38
43
  </html>
@@ -2,10 +2,9 @@
2
2
  <html xmlns="http://www.w3.org/1999/xhtml">
3
3
  <head>
4
4
  <title>CompassAE Mobile</title>
5
- <%=include_sencha_touch :debug => true%>
5
+ <%=include_sencha_touch :debug => (Rails.env != 'production') %>
6
6
  <%=static_javascript_include_tag('erp_app/utility.js')%>
7
7
  <%=static_javascript_include_tag('erp_app/mobile/mobile_base.js')%>
8
- <%#=setup_js_authentication(@user, @desktop)%>
9
8
  <script type="text/javascript">
10
9
  Compass.ErpApp.Mobile.AuthentictyToken = '<%=form_authenticity_token%>';
11
10
  Compass.ErpApp.Mobile.LoginTo = '/erp_app/mobile/'
@@ -40,6 +40,12 @@
40
40
  organizerLayout.setupLogoutButton();
41
41
  organizerLayout.setup();
42
42
  });
43
+
44
+ window.onbeforeunload = function(){
45
+ return ' If you navigate away from this page without' +
46
+ ' first saving your data, the changes will be' +
47
+ ' lost.';
48
+ }
43
49
  </script>
44
50
  <%= setSessionTimeout %>
45
51
  </body>
@@ -1,14 +1,12 @@
1
1
  class CreateUserManagementMobileApplication
2
2
 
3
3
  def self.up
4
- app = MobileApplication.create(
5
- :description => 'User Management',
6
- :icon => 'icon-user',
7
- :internal_identifier => 'user_management',
8
- :base_url => '/erp_app/mobile/user_management/index'
4
+ MobileApplication.create(
5
+ :description => 'User Management',
6
+ :icon => 'icon-user',
7
+ :internal_identifier => 'user_management',
8
+ :xtype => 'compass-erpapp-mobile-usermanagement-application'
9
9
  )
10
-
11
- app.save
12
10
  end
13
11
 
14
12
  def self.down
@@ -0,0 +1,16 @@
1
+ class AddJobTrackerMobileApp
2
+
3
+ def self.up
4
+ MobileApplication.create(
5
+ :description => 'Jobs',
6
+ :icon => 'icon-tasks',
7
+ :internal_identifier => 'job_tracker',
8
+ :xtype => 'compass-erpapp-mobile-jobtracker-application'
9
+ )
10
+ end
11
+
12
+ def self.down
13
+ MobileApplication.destroy_all("internal_identifier = 'job_tracker'")
14
+ end
15
+
16
+ end
@@ -1,15 +1,19 @@
1
1
  class AddJobTracker < ActiveRecord::Migration
2
2
  def up
3
- create_table :job_trackers do |t|
4
- t.string :job_name
5
- t.string :job_klass
6
- t.string :run_time
7
- t.datetime :last_run_at
8
- t.datetime :next_run_at
3
+ unless table_exists?(:job_trackers)
4
+ create_table :job_trackers do |t|
5
+ t.string :job_name
6
+ t.string :job_klass
7
+ t.string :run_time
8
+ t.datetime :last_run_at
9
+ t.datetime :next_run_at
10
+ end
9
11
  end
10
12
  end
11
13
 
12
14
  def down
13
- drop_table :job_trackers
15
+ if table_exists?(:job_trackers)
16
+ drop_table :job_trackers
17
+ end
14
18
  end
15
19
  end
@@ -0,0 +1,27 @@
1
+ class UpdateMobileApplication < ActiveRecord::Migration
2
+ def up
3
+ unless columns(:applications).collect { |c| c.name }.include?('xtype')
4
+ rename_column :applications, :base_url, :xtype
5
+
6
+ user_management = MobileApplication.find_by_internal_identifier('user_management')
7
+ if user_management.nil?
8
+ MobileApplication.create(
9
+ :description => 'User Mgmt',
10
+ :icon => 'icon-user',
11
+ :internal_identifier => 'user_management',
12
+ :xtype => 'compass-erpapp-mobile-usermanagement-application'
13
+ )
14
+ else
15
+ user_management.description = 'User Mgmt'
16
+ user_management.xtype = 'compass-erpapp-mobile-usermanagement-application'
17
+ user_management.save
18
+ end
19
+ end
20
+ end
21
+
22
+ def down
23
+ if columns(:applications).collect { |c| c.name }.include?('xtype')
24
+ rename_column :applications, :xtype, :base_url
25
+ end
26
+ end
27
+ end
@@ -2,7 +2,7 @@ module ErpApp
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 3
4
4
  MINOR = 1
5
- TINY = 5
5
+ TINY = 6
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].compact.join('.')
8
8
  end
@@ -10,14 +10,17 @@ class CompassAeMobileGenerator < Rails::Generators::NamedBase
10
10
  run "sencha -sdk #{@sdk_path} generate app #{class_name} #{application_path}"
11
11
 
12
12
  %w{app.json build.xml index.html packager.json resources}.each do |file|
13
- remove_file(File.join(application_path, file))
13
+ remove_file File.join(application_path, file)
14
14
  end
15
15
 
16
16
  gsub_file File.join(application_path, 'app.js'), %r[^//<debug>([\s\S])+//</debug>], "Ext.Loader.setPath({'#{class_name}': 'javascripts/#{class_name}/app'});"
17
17
 
18
18
  #replace Main.js
19
- remove_file remove_file(File.join(application_path, 'app', 'view', 'Main.js'))
19
+ remove_file File.join(application_path, 'app', 'view', 'Main.js')
20
20
  template "javascripts/main_template.erb", File.join(application_path, 'app', 'view', 'Main.js')
21
+
22
+ #remove touch library
23
+ remove_file File.join(application_path, 'touch')
21
24
  end
22
25
 
23
26
  def generate_compass_ae_files
@@ -9,8 +9,6 @@ class MobileApplicationGenerator < Rails::Generators::NamedBase
9
9
 
10
10
  #make javascript
11
11
  template "public/app.js.erb", "public/javascripts/erp_app/mobile/applications/#{file_name}/app.js"
12
-
13
- copy_file "views/index.html.erb", "app/views/erp_app/mobile/#{file_name}/base/index.html.erb"
14
12
 
15
13
  #make css folder
16
14
  empty_directory "public/stylesheets/erp_app/mobile/applications/#{file_name}"
@@ -4,7 +4,7 @@ module ErpApp
4
4
  class BaseController < ::ErpApp::Mobile::BaseController
5
5
 
6
6
  def index
7
- @application = MobileApplication.find_by_internal_identifier('<%= file_name%>')
7
+ render :json => {:success => true, :message => 'Hello World'}
8
8
  end
9
9
 
10
10
  end #BaseController
@@ -1,10 +1,10 @@
1
1
  class Create<%=class_name %>MobileApplication
2
2
  def self.up
3
- app = MobileApplication.create(
3
+ MobileApplication.create(
4
4
  :description => '<%=description %>',
5
5
  :icon => '<%=icon %>',
6
6
  :internal_identifier => '<%=file_name %>',
7
- :base_url => '/erp_app/mobile/<%=file_name %>/index'
7
+ :xtype => 'compass-erpapp-mobile-<%= file_name %>-application'
8
8
  )
9
9
  end
10
10
 
@@ -1,35 +1,24 @@
1
- Ext.ns('Compass.ErpApp.Mobile.<%=class_name %>');
2
-
3
- Ext.application({
4
- name: '<%=class_name %>',
5
- useLoadMask: true,
6
- launch: function () {
7
- Ext.create("Ext.Container", {
8
- fullscreen: true,
9
- html:'Your New Mobile Application',
10
- items: [
11
- {
12
- xtype:'toolbar',
13
- ui:'light',
14
- docked:'top',
1
+ Ext.define('Compass.ErpApp.Mobile.<%= class_name %>.Application', {
2
+ extend: 'Ext.Panel',
3
+ xtype: 'compass-erpapp-mobile-<%= file_name %>-application',
4
+ config:{
5
+ tabBarPosition: 'bottom',
15
6
  items:[
16
- {
17
- text:'Home',
18
- ui:'back',
19
- handler:function(btn){
20
- window.location = '/erp_app/mobile';
21
- }
22
- },
23
- {
24
- text:'Logout',
25
- ui:'round',
26
- handler:function(btn){
27
- window.location = '/session/sign_out?login_url=/erp_app/mobile/login';
28
- }
29
- }
30
- ]
31
- }
32
- ]
33
- });
34
- }
35
- });
7
+ {
8
+ xtype: 'toolbar',
9
+ ui: 'light',
10
+ docked: 'top',
11
+ items: [
12
+ {
13
+ text: 'Home',
14
+ ui: 'back',
15
+ handler: function (btn) {
16
+ btn.up('#mainContainer').setActiveItem('#home');
17
+ }
18
+ }
19
+ ]
20
+ }
21
+ ],
22
+ html:'Hello World'
23
+ }
24
+ });
@@ -5,8 +5,8 @@ Ext.define('Compass.ErpApp.Desktop.Applications.JobTracker.Model', {
5
5
  {name: 'job_name', type: 'string'},
6
6
  {name: 'run_time', type: 'string'},
7
7
  {name: 'scheduled', type: 'boolean'},
8
- {name: 'last_run_at', type: 'date', dateFormat: 'c'},
9
- {name: 'next_run_at', type: 'date', dateFormat: 'c'}
8
+ {name: 'last_run_at', type: 'date', dateFormat: 'm-d-Y H:i:s'},
9
+ {name: 'next_run_at', type: 'date', dateFormat: 'm-d-Y H:i:s'}
10
10
  ]
11
11
  });
12
12
 
@@ -1,52 +1,59 @@
1
1
  Ext.application({
2
- name: 'compass_ae_mobile_login',
3
- useLoadMask: true,
2
+ name: 'compass_ae_mobile_login',
3
+ useLoadMask: true,
4
4
 
5
- launch: function () {
6
- Ext.create("Ext.form.Panel", {
7
- fullscreen: true,
8
- defaults:{
9
- xtype:'textfield'
10
- },
11
- items: [
12
- {
13
- label:'Username or Email Address',
14
- name:'login',
15
- required:true
16
- },
17
- {
18
- xtype:'passwordfield',
19
- label:'Password',
20
- name:'password',
21
- required:true
22
- },
23
- {
24
- xtype:'button',
25
- text:'Login',
26
- flex:1,
27
- scope:this,
28
- ui:'confirm-round',
29
- style:'margin:0.1em',
30
- handler:function(btn){
31
- var form = btn.up('formpanel');
32
- form.setMasked({
33
- xtype:'loadmask',
34
- message:'Authenticating User...'
35
- });
36
- form.submit({
37
- url:'/session/sign_in',
38
- method:'POST',
39
- success:function(form, result){
40
- form.setMasked(false);
41
- window.location = Compass.ErpApp.Mobile.LoginTo;
5
+ launch: function () {
6
+ Ext.create("Ext.form.Panel", {
7
+ fullscreen: true,
8
+ defaults: {
9
+ xtype: 'textfield'
42
10
  },
43
- failure:function(form, result){
44
- Ext.Msg.alert("Error", "Could not authenticate .");
45
- }
46
- });
47
- }
48
- }
49
- ]
50
- });
51
- }
11
+ items: [
12
+ {
13
+ xtype:'container',
14
+ height:200,
15
+ cls: 'login-logo'
16
+ },
17
+ {
18
+ label: 'Username or Email Address',
19
+ labelAlign: 'top',
20
+ name: 'login',
21
+ required: true
22
+ },
23
+ {
24
+ xtype: 'passwordfield',
25
+ labelAlign: 'top',
26
+ label: 'Password',
27
+ name: 'password',
28
+ required: true
29
+ },
30
+ {
31
+ xtype: 'button',
32
+ text: 'Login',
33
+ flex: 1,
34
+ scope: this,
35
+ ui: 'confirm-round',
36
+ style: 'margin:0.1em',
37
+ handler: function (btn) {
38
+ var form = btn.up('formpanel');
39
+ form.setMasked({
40
+ xtype: 'loadmask',
41
+ message: 'Authenticating User...'
42
+ });
43
+ form.submit({
44
+ url: '/session/sign_in',
45
+ method: 'POST',
46
+ success: function (form, result) {
47
+ form.setMasked(false);
48
+ window.location = Compass.ErpApp.Mobile.LoginTo;
49
+ },
50
+ failure: function (form, result) {
51
+ Ext.Msg.alert("Error", "Could not authenticate .");
52
+ }
53
+ });
54
+ }
55
+ }
56
+ ]
57
+ });
58
+ }
52
59
  });