erp_app 3.1.5 → 3.1.6
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.
- data/app/controllers/erp_app/desktop/job_tracker/base_controller.rb +6 -1
- data/app/controllers/erp_app/mobile/user_management/base_controller.rb +0 -3
- data/app/models/application.rb +1 -1
- data/app/views/erp_app/desktop/base/index.erb +11 -6
- data/app/views/erp_app/mobile/base/index.erb +37 -32
- data/app/views/erp_app/mobile/login/index.erb +1 -2
- data/app/views/erp_app/organizer/base/index.erb +6 -0
- data/db/data_migrations/20120411180756_create_user_management_mobile_application.rb +5 -7
- data/db/data_migrations/20130411200351_add_job_tracker_mobile_app.rb +16 -0
- data/db/migrate/20120920145259_add_job_tracker.rb +11 -7
- data/db/migrate/20130410182333_update_mobile_application.rb +27 -0
- data/lib/erp_app/version.rb +1 -1
- data/lib/generators/compass_ae_mobile/compass_ae_mobile_generator.rb +5 -2
- data/lib/generators/mobile_application/mobile_application_generator.rb +0 -2
- data/lib/generators/mobile_application/templates/controllers/controller_template.erb +1 -1
- data/lib/generators/mobile_application/templates/migrate/migration_template.erb +2 -2
- data/lib/generators/mobile_application/templates/public/app.js.erb +23 -34
- data/public/images/erp_app/mobile/green_light.png +0 -0
- data/public/images/erp_app/mobile/red_light.png +0 -0
- data/public/images/erp_app/mobile/yellow_light.png +0 -0
- data/public/javascripts/erp_app/desktop/applications/job_tracker/jobs_grid.js +2 -2
- data/public/javascripts/erp_app/login/mobile.js +55 -48
- data/public/javascripts/erp_app/mobile/app.js +71 -43
- data/public/javascripts/erp_app/mobile/applications/job_tracker/app.js +177 -0
- data/public/javascripts/erp_app/mobile/applications/job_tracker/model/job.js +15 -0
- data/public/javascripts/erp_app/mobile/applications/job_tracker/store/jobs.js +16 -0
- data/public/javascripts/erp_app/mobile/applications/job_tracker/store/view/templates.js +22 -0
- data/public/javascripts/erp_app/mobile/applications/user_management/app.js +103 -159
- data/public/javascripts/erp_app/mobile/applications/user_management/app/view/templates.js +32 -22
- data/public/stylesheets/erp_app/mobile/applications/user_management/main.css +20 -4
- data/public/stylesheets/erp_app/mobile/mobile.css +35 -324
- data/public/stylesheets/erp_app/shared/compass-ext-all.css +5 -11
- data/spec/dummy/db/data_migrations/20110109173616_create_capability_scope_types.erp_tech_svcs.rb +15 -0
- data/spec/dummy/db/data_migrations/20110525001935_add_usd_currency.erp_base_erp_svcs.rb +12 -0
- data/spec/dummy/db/data_migrations/20110609150135_add_iso_codes.erp_base_erp_svcs.rb +19 -0
- data/spec/dummy/db/data_migrations/20110728201729_erp_app_setup.erp_app.rb +252 -0
- data/spec/dummy/db/data_migrations/20110728201733_update_preferences.erp_app.rb +53 -0
- data/spec/dummy/db/data_migrations/20110802200222_schedule_delete_expired_sessions_job.erp_tech_svcs.rb +16 -0
- data/spec/dummy/db/data_migrations/20110816161238_create_desktop_app_audit_log_viewer.erp_app.rb +21 -0
- data/spec/dummy/db/data_migrations/20110817160743_add_file_manager_application.erp_app.rb +32 -0
- data/spec/dummy/db/data_migrations/20110913145838_setup_compass_ae_instance.erp_base_erp_svcs.rb +12 -0
- data/spec/dummy/db/data_migrations/20111108183739_add_default_capabilities.erp_app.rb +23 -0
- data/spec/dummy/db/data_migrations/20111108183740_add_new_contact_widgets.erp_app.rb +42 -0
- data/spec/dummy/db/data_migrations/20111111144706_setup_audit_log_types.erp_tech_svcs.rb +22 -0
- data/spec/dummy/db/data_migrations/20120229160222_add_userinfo_widget.erp_app.rb +29 -0
- data/spec/dummy/db/data_migrations/20120405193721_create_party_and_role_type_for_communication_events.erp_app.rb +11 -0
- data/spec/dummy/db/data_migrations/20120411180756_create_user_management_mobile_application.erp_app.rb +19 -0
- data/spec/dummy/db/data_migrations/20120418164215_create_configuration_management_desktop_application.erp_app.rb +23 -0
- data/spec/dummy/db/data_migrations/20121116155018_create_group_relationship_and_role_types.erp_tech_svcs.rb +20 -0
- data/spec/dummy/db/data_migrations/20121130201859_upgrade_remove_system_mgmt_app.erp_app.rb +16 -0
- data/spec/dummy/db/data_migrations/20121130212146_note_capabilities.erp_tech_svcs.rb +24 -0
- data/spec/dummy/db/data_migrations/20121218175028_create_security_management_desktop_application.erp_app.rb +23 -0
- data/spec/dummy/db/data_migrations/20130422153811_upgrade_compass_ae_instances_data.erp_base_erp_svcs.rb +19 -0
- data/spec/dummy/db/data_migrations/20130422153812_add_guid_to_instances.erp_base_erp_svcs.rb +10 -0
- data/spec/dummy/db/data_migrations/20130422153813_create_job_tracker_desktop_application.erp_app.rb +23 -0
- data/spec/dummy/db/data_migrations/20130422153814_created_tracked_jobs.erp_app.rb +15 -0
- data/spec/dummy/db/data_migrations/20130422153815_add_job_tracker_mobile_app.erp_app.rb +17 -0
- data/spec/dummy/db/migrate/20130105135833_base_erp_services.erp_base_erp_svcs.rb +461 -0
- data/spec/dummy/db/migrate/20130105135834_base_tech_services.erp_tech_svcs.rb +271 -0
- data/spec/dummy/db/migrate/20130105135835_create_has_attribute_tables.erp_tech_svcs.rb +39 -0
- data/spec/dummy/db/migrate/20130105135836_create_groups.erp_tech_svcs.rb +19 -0
- data/spec/dummy/db/migrate/20130105135837_upgrade_security.erp_tech_svcs.rb +54 -0
- data/spec/dummy/db/migrate/20130105135838_upgrade_security2.erp_tech_svcs.rb +270 -0
- data/spec/dummy/db/migrate/20130105135839_base_app_framework.erp_app.rb +276 -0
- data/spec/dummy/db/migrate/20130422153805_add_txn_status.erp_base_erp_svcs.rb +37 -0
- data/spec/dummy/db/migrate/20130422153806_upgrade_compass_ae_instances.erp_base_erp_svcs.rb +34 -0
- data/spec/dummy/db/migrate/20130422153807_add_uuid_compass_ae_instance.erp_base_erp_svcs.rb +17 -0
- data/spec/dummy/db/migrate/20130422153808_add_long_lat_to_address.erp_base_erp_svcs.rb +16 -0
- data/spec/dummy/db/migrate/20130422153809_add_queue_to_delayed_jobs.erp_tech_svcs.rb +14 -0
- data/spec/dummy/db/migrate/20130422153810_add_job_tracker.erp_app.rb +20 -0
- data/spec/dummy/db/migrate/20130422153811_update_mobile_application.erp_app.rb +28 -0
- data/spec/dummy/db/schema.rb +883 -0
- data/spec/dummy/db/spec.sqlite3 +0 -0
- data/spec/dummy/log/adam.log +1 -0
- data/spec/dummy/log/spec.log +107402 -0
- metadata +98 -46
- data/app/views/erp_app/mobile/user_management/base/index.html.erb +0 -28
- data/lib/generators/mobile_application/templates/INSTALL +0 -25
- data/lib/generators/mobile_application/templates/views/index.html.erb +0 -28
- data/public/images/icons/add/Thumbs.db +0 -0
- data/public/images/icons/calendar/Thumbs.db +0 -0
- data/public/images/icons/copy/Thumbs.db +0 -0
- data/public/images/icons/cut/Thumbs.db +0 -0
- data/public/images/icons/delete/Thumbs.db +0 -0
- data/public/images/icons/edit/Thumbs.db +0 -0
- data/public/images/icons/folder/Thumbs.db +0 -0
- data/public/images/icons/gear/Thumbs.db +0 -0
- data/public/images/icons/globe/Thumbs.db +0 -0
- data/public/images/icons/grid/Thumbs.db +0 -0
- data/public/images/icons/help/Thumbs.db +0 -0
- data/public/images/icons/information/Thumbs.db +0 -0
- data/public/images/icons/key/Thumbs.db +0 -0
- data/public/images/icons/log_out/Thumbs.db +0 -0
- data/public/images/icons/mail/Thumbs.db +0 -0
- data/public/images/icons/new/Thumbs.db +0 -0
- data/public/images/icons/next/Thumbs.db +0 -0
- data/public/images/icons/open/Thumbs.db +0 -0
- data/public/images/icons/paste/Thumbs.db +0 -0
- data/public/images/icons/picture/Thumbs.db +0 -0
- data/public/images/icons/presentation/Thumbs.db +0 -0
- data/public/images/icons/preview/Thumbs.db +0 -0
- data/public/images/icons/previous/Thumbs.db +0 -0
- data/public/images/icons/print/Thumbs.db +0 -0
- data/public/images/icons/properties/Thumbs.db +0 -0
- data/public/images/icons/redo/Thumbs.db +0 -0
- data/public/images/icons/refresh/Thumbs.db +0 -0
- data/public/images/icons/remove/Thumbs.db +0 -0
- data/public/images/icons/rename/Thumbs.db +0 -0
- data/public/images/icons/save/Thumbs.db +0 -0
- data/public/images/icons/search/Thumbs.db +0 -0
- data/public/images/icons/send/Thumbs.db +0 -0
- data/public/images/icons/settings/Thumbs.db +0 -0
- data/public/images/icons/synchronize/Thumbs.db +0 -0
- data/public/images/icons/undo/Thumbs.db +0 -0
- data/public/images/icons/upload/Thumbs.db +0 -0
- data/public/images/icons/user/Thumbs.db +0 -0
- data/public/images/icons/zoom_in/Thumbs.db +0 -0
- data/public/images/icons/zoom_out/Thumbs.db +0 -0
- data/public/javascripts/erp_app/ckeditor/plugins/jwplayer/jwplayer/Thumbs.db +0 -0
|
@@ -1,46 +1,74 @@
|
|
|
1
1
|
Ext.application({
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
name: 'compass_ae_mobile',
|
|
3
|
+
useLoadMask: true,
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
5
|
+
launch: function () {
|
|
6
|
+
var items = [
|
|
7
|
+
{
|
|
8
|
+
itemId: 'home',
|
|
9
|
+
xtype: 'tabpanel',
|
|
10
|
+
tabBarPosition: 'bottom',
|
|
11
|
+
items: [
|
|
12
|
+
{
|
|
13
|
+
itemId:'applications',
|
|
14
|
+
xtype: 'container',
|
|
15
|
+
cls: 'applications-background',
|
|
16
|
+
title: 'Applications',
|
|
17
|
+
iconCls: 'home',
|
|
18
|
+
layout: 'fit',
|
|
19
|
+
items: {
|
|
20
|
+
xtype: 'dataview',
|
|
21
|
+
itemSelector: 'div.thumb-wrap',
|
|
22
|
+
store: {
|
|
23
|
+
fields: ['iconCls', 'name', 'itemId'],
|
|
24
|
+
data: mobileApplicationsData
|
|
25
|
+
},
|
|
26
|
+
itemTpl: [
|
|
27
|
+
'<div id="applications">',
|
|
28
|
+
'<div class="thumb-wrap">',
|
|
29
|
+
'<div class="thumb {iconCls}">',
|
|
30
|
+
'</div>',
|
|
31
|
+
'<span class="title">{name}</span>',
|
|
32
|
+
'</div>',
|
|
33
|
+
'</div>'
|
|
34
|
+
],
|
|
35
|
+
listeners:{
|
|
36
|
+
'itemtap':function(me, index, targe, record, e, options){
|
|
37
|
+
var itemId = record.get('itemId'),
|
|
38
|
+
container = this.up('#mainContainer');
|
|
39
|
+
app = container.down(itemId);
|
|
40
|
+
container.setActiveItem(app);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
xtype: 'button',
|
|
47
|
+
title: 'Logout',
|
|
48
|
+
iconCls: 'reply',
|
|
49
|
+
listeners:{
|
|
50
|
+
activate:function(){
|
|
51
|
+
var me = this;
|
|
52
|
+
Ext.Msg.confirm('Warning', 'Are you sure you want to logout?', function(btn){
|
|
53
|
+
if(btn == 'yes'){
|
|
54
|
+
window.location = '/session/sign_out?login_url=/erp_app/mobile/login';
|
|
55
|
+
}
|
|
56
|
+
else{
|
|
57
|
+
me.up('tabpanel').setActiveItem('#applications');
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
Ext.create("Ext.Container", {
|
|
68
|
+
itemId: 'mainContainer',
|
|
69
|
+
layout: 'card',
|
|
70
|
+
fullscreen: true,
|
|
71
|
+
items: items.concat(mobileApplications)
|
|
72
|
+
});
|
|
73
|
+
}
|
|
46
74
|
});
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
Ext.define('Compass.ErpApp.Mobile.JobTracker.Application', {
|
|
2
|
+
extend: 'Ext.Carousel',
|
|
3
|
+
xtype: 'compass-erpapp-mobile-jobtracker-application',
|
|
4
|
+
selectedJob: null,
|
|
5
|
+
config: {
|
|
6
|
+
layout: 'card',
|
|
7
|
+
listeners: {
|
|
8
|
+
activate: function () {
|
|
9
|
+
this.setActiveItem(0);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
scheduleJob: function () {
|
|
15
|
+
var me = this;
|
|
16
|
+
this.setMasked({xtype: 'loadmask', message: 'scheduling job...'});
|
|
17
|
+
|
|
18
|
+
Ext.Ajax.request({
|
|
19
|
+
url: '/erp_app/desktop/job_tracker/schedule',
|
|
20
|
+
method: 'POST',
|
|
21
|
+
params: {
|
|
22
|
+
id: this.selectedJob.get('id'),
|
|
23
|
+
authenticity_token:Compass.ErpApp.AuthentictyToken
|
|
24
|
+
},
|
|
25
|
+
success: function (response) {
|
|
26
|
+
me.setMasked(false);
|
|
27
|
+
var obj = Ext.decode(response.responseText);
|
|
28
|
+
if (obj.success) {
|
|
29
|
+
me.store.load();
|
|
30
|
+
me.setActiveItem(0);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
Ext.Msg.alert('Error', 'Error scheduling job.');
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
failure: function (response) {
|
|
37
|
+
me.setMasked(false);
|
|
38
|
+
Ext.Msg.alert('Error', 'Error scheduling job.');
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
unScheduleJob: function () {
|
|
44
|
+
var me = this;
|
|
45
|
+
this.setMasked({xtype: 'loadmask', message: 'Unscheduling job...'});
|
|
46
|
+
|
|
47
|
+
Ext.Ajax.request({
|
|
48
|
+
url: '/erp_app/desktop/job_tracker/unschedule',
|
|
49
|
+
method: 'POST',
|
|
50
|
+
params: {
|
|
51
|
+
id: this.selectedJob.get('id'),
|
|
52
|
+
authenticity_token:Compass.ErpApp.AuthentictyToken
|
|
53
|
+
},
|
|
54
|
+
success: function (response) {
|
|
55
|
+
me.setMasked(false);
|
|
56
|
+
var obj = Ext.decode(response.responseText);
|
|
57
|
+
if (obj.success) {
|
|
58
|
+
me.store.load();
|
|
59
|
+
me.setActiveItem(0);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
Ext.Msg.alert('Error', 'Error unscheduling job.');
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
failure: function (response) {
|
|
66
|
+
me.setMasked(false);
|
|
67
|
+
Ext.Msg.alert('Error', 'Error unscheduling job.');
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
constructor: function (config) {
|
|
73
|
+
this.store = Ext.create('Compass.ErpApp.Mobile.JobTracker.Store.Jobs', {
|
|
74
|
+
storeId: 'jobtracker-jobstore'
|
|
75
|
+
});
|
|
76
|
+
this.store.load();
|
|
77
|
+
|
|
78
|
+
config['items'] = [
|
|
79
|
+
{
|
|
80
|
+
|
|
81
|
+
xtype: 'toolbar',
|
|
82
|
+
ui: 'light',
|
|
83
|
+
iconMask:true,
|
|
84
|
+
docked: 'top',
|
|
85
|
+
items: [
|
|
86
|
+
{
|
|
87
|
+
text: 'Home',
|
|
88
|
+
ui: 'back',
|
|
89
|
+
handler: function (btn) {
|
|
90
|
+
btn.up('#mainContainer').setActiveItem('#home');
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
iconCls: 'refresh',
|
|
95
|
+
iconMask: true,
|
|
96
|
+
handler: function (btn) {
|
|
97
|
+
btn.up('compass-erpapp-mobile-jobtracker-application').store.load();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
|
|
104
|
+
xtype: 'list',
|
|
105
|
+
store: 'jobtracker-jobstore',
|
|
106
|
+
onItemDisclosure: true,
|
|
107
|
+
itemTpl: [
|
|
108
|
+
'<tpl if="!scheduled">',
|
|
109
|
+
'<div style="float:right"><img src="/images/erp_app/mobile/yellow_light.png" /></div>',
|
|
110
|
+
'<tpl elseif="next_run_at > new Date()">',
|
|
111
|
+
'<div style="float:right"><img src="/images/erp_app/mobile/green_light.png" /></div>',
|
|
112
|
+
'<tpl else>',
|
|
113
|
+
'<div style="float:right"><img src="/images/erp_app/mobile/red_light.png" /></div>',
|
|
114
|
+
'</tpl>',
|
|
115
|
+
'<div class="contact"><strong>{job_name}</strong></div>',
|
|
116
|
+
'<tpl if="Ext.isEmpty(last_run_at)">',
|
|
117
|
+
'<div>Last run: N/A</div>',
|
|
118
|
+
'<tpl else>',
|
|
119
|
+
'<div>Last run: {last_run_at:date("m/d/Y g:i:s")}</div>',
|
|
120
|
+
'</tpl>',
|
|
121
|
+
'<tpl if="Ext.isEmpty(next_run_at)">',
|
|
122
|
+
'<div>Next run: N/A</div>',
|
|
123
|
+
'<tpl else>',
|
|
124
|
+
'<div>Next run: {next_run_at:date("m/d/Y g:i:s")}</div>',
|
|
125
|
+
'</tpl>'],
|
|
126
|
+
listeners: {
|
|
127
|
+
disclose: function (me, record, target, e, eOpts) {
|
|
128
|
+
var app = me.up('compass-erpapp-mobile-jobtracker-application'),
|
|
129
|
+
details = app.down('#details');
|
|
130
|
+
details.setHtml(Compass.ErpApp.Mobile.JobTracker.Templates.jobDetails.apply(record.getData()));
|
|
131
|
+
app.setActiveItem(details);
|
|
132
|
+
app.selectedJob = record;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
itemId: 'details',
|
|
138
|
+
items: [
|
|
139
|
+
{
|
|
140
|
+
xtype: 'toolbar',
|
|
141
|
+
docked: 'top',
|
|
142
|
+
items: [
|
|
143
|
+
{
|
|
144
|
+
text: 'Schedule',
|
|
145
|
+
handler: function (btn) {
|
|
146
|
+
var app = btn.up('compass-erpapp-mobile-jobtracker-application');
|
|
147
|
+
if(Ext.isEmpty(app.selectedJob)){
|
|
148
|
+
Ext.Msg.alert('Error', 'No job selected');
|
|
149
|
+
}
|
|
150
|
+
else{
|
|
151
|
+
app.scheduleJob();
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
text: 'UnSchedule',
|
|
157
|
+
handler: function (btn) {
|
|
158
|
+
var app = btn.up('compass-erpapp-mobile-jobtracker-application');
|
|
159
|
+
if(Ext.isEmpty(app.selectedJob)){
|
|
160
|
+
Ext.Msg.alert('Error', 'No job selected');
|
|
161
|
+
}
|
|
162
|
+
else{
|
|
163
|
+
app.unScheduleJob();
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
],
|
|
170
|
+
layout: 'fit',
|
|
171
|
+
autoScroll: true
|
|
172
|
+
}
|
|
173
|
+
];
|
|
174
|
+
|
|
175
|
+
this.callParent([config]);
|
|
176
|
+
}
|
|
177
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Ext.define('Compass.ErpApp.Mobile.JobTracker.Job',{
|
|
2
|
+
extend:'Ext.data.Model',
|
|
3
|
+
config:{
|
|
4
|
+
fields:[
|
|
5
|
+
{name: 'id', type:'integer'},
|
|
6
|
+
{name: 'job_name', type:'string'},
|
|
7
|
+
{name: 'job_klass', type:'string'},
|
|
8
|
+
{name: 'run_time', type:'string'},
|
|
9
|
+
{name: 'last_run_at', type:'date', dateFormat:'m-d-Y g:i:s'},
|
|
10
|
+
{name: 'next_run_at', type:'date', dateFormat:'m-d-Y g:i:s'},
|
|
11
|
+
{name: 'scheduled', type:'boolean'}
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Ext.define('Compass.ErpApp.Mobile.JobTracker.Store.Jobs', {
|
|
2
|
+
extend: 'Ext.data.Store',
|
|
3
|
+
config: {
|
|
4
|
+
model: 'Compass.ErpApp.Mobile.JobTracker.Job',
|
|
5
|
+
proxy:{
|
|
6
|
+
autoLoad: true,
|
|
7
|
+
url:'/erp_app/desktop/job_tracker/jobs',
|
|
8
|
+
type:'ajax',
|
|
9
|
+
reader:{
|
|
10
|
+
type:'json',
|
|
11
|
+
rootProperty:'jobs'
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Compass.ErpApp.Mobile.JobTracker.Templates = {};
|
|
2
|
+
Compass.ErpApp.Mobile.JobTracker.Templates.jobDetails = new Ext.XTemplate(
|
|
3
|
+
'<div class="profile">',
|
|
4
|
+
'<p>',
|
|
5
|
+
'<span class="label">Job Name</span>',
|
|
6
|
+
'<span class="value">{job_name}</span>',
|
|
7
|
+
'</p>',
|
|
8
|
+
'<p>',
|
|
9
|
+
'<span class="label">Last Run At</span>',
|
|
10
|
+
'<span class="value">{last_run_at:date("m/d/Y g:i:s")}</span>',
|
|
11
|
+
'</p>',
|
|
12
|
+
'<p>',
|
|
13
|
+
'<span class="label">Next Run At</span>',
|
|
14
|
+
'<span class="value">{next_run_at:date("m/d/Y g:i:s")}</span>',
|
|
15
|
+
'</p>',
|
|
16
|
+
'<p>',
|
|
17
|
+
'<span class="label">Runtime</span>',
|
|
18
|
+
'<span class="value">{run_time}</span>',
|
|
19
|
+
'</p>',
|
|
20
|
+
'</div>',
|
|
21
|
+
'<br/>',
|
|
22
|
+
'<div id="resetPasswdBtnHolder"></div>');
|
|
@@ -1,168 +1,112 @@
|
|
|
1
|
-
Ext.
|
|
1
|
+
Ext.define('Compass.ErpApp.Mobile.UserManagement.Application', {
|
|
2
|
+
extend: 'Ext.Carousel',
|
|
3
|
+
xtype: 'compass-erpapp-mobile-usermanagement-application',
|
|
4
|
+
selectedUser: null,
|
|
5
|
+
config: {
|
|
6
|
+
listeners: {
|
|
7
|
+
activate: function () {
|
|
8
|
+
this.setActiveItem(0);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
},
|
|
2
12
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
launch: function () {
|
|
7
|
-
Ext.create('Compass.ErpApp.Mobile.UserManagement.Store.Users',{
|
|
8
|
-
storeId:'usermanagement-usersstore'
|
|
9
|
-
}).load();
|
|
10
|
-
|
|
11
|
-
var center = null;
|
|
12
|
-
if(Ext.os.deviceType == 'Phone'){
|
|
13
|
-
center = {
|
|
14
|
-
layout:'card',
|
|
15
|
-
itemId:'userList',
|
|
16
|
-
title: 'Find User',
|
|
17
|
-
iconCls: 'search',
|
|
18
|
-
items:[
|
|
19
|
-
{
|
|
20
|
-
xtype: 'list',
|
|
21
|
-
store: 'usermanagement-usersstore',
|
|
22
|
-
itemTpl: '<div class="contact"><strong>{username}</strong></div>',
|
|
23
|
-
grouped: true,
|
|
24
|
-
indexBar: true,
|
|
25
|
-
listeners:{
|
|
26
|
-
itemdoubletap:function(view, index, target, record, e, eOpts){
|
|
27
|
-
e.stopEvent();
|
|
28
|
-
var userList = view.up('#userList');
|
|
29
|
-
userList.add({
|
|
30
|
-
layout:'fit',
|
|
31
|
-
tpl:Compass.ErpApp.Mobile.UserManagement.Templates.userDetails,
|
|
32
|
-
data:record.getData(),
|
|
33
|
-
items:[{
|
|
34
|
-
xtype:'toolbar',
|
|
35
|
-
ui:'light',
|
|
36
|
-
docked:'top',
|
|
37
|
-
items:[
|
|
38
|
-
{
|
|
39
|
-
text:'Back',
|
|
40
|
-
ui:'back',
|
|
41
|
-
handler:function(btn){
|
|
42
|
-
userList.setActiveItem(userList.items.first());
|
|
43
|
-
userList.removeAt(1);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
]
|
|
47
|
-
}]
|
|
48
|
-
});
|
|
49
|
-
userList.setActiveItem(userList.items.last());
|
|
13
|
+
resetPassword: function () {
|
|
14
|
+
var me = this;
|
|
15
|
+
this.setMasked({xtype: 'loadmask', message: 'Resetting password...'});
|
|
50
16
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
Ext.Msg.alert("Success", "Password reset and email sent.");
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
failure:function(response, opts){
|
|
70
|
-
Ext.Msg.alert("Error", "Error re-setting password.");
|
|
71
|
-
}
|
|
72
|
-
});
|
|
17
|
+
Ext.Ajax.request({
|
|
18
|
+
url: '/users/reset_password',
|
|
19
|
+
params: {
|
|
20
|
+
login: this.selectedUser.get('email'),
|
|
21
|
+
login_to: '/erp_app/mobile/login',
|
|
22
|
+
authenticity_token:Compass.ErpApp.AuthentictyToken
|
|
23
|
+
},
|
|
24
|
+
success: function (response, opts) {
|
|
25
|
+
me.setMasked(false);
|
|
26
|
+
var obj = Ext.decode(response.responseText);
|
|
27
|
+
if (obj.success) {
|
|
28
|
+
Ext.Msg.alert("Success", "Password reset and email sent.");
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
Ext.Msg.alert("Error", "Error re-setting password.");
|
|
73
32
|
}
|
|
74
|
-
|
|
33
|
+
},
|
|
34
|
+
failure: function (response, opts) {
|
|
35
|
+
me.setMasked(false);
|
|
36
|
+
Ext.Msg.alert("Error", "Error re-setting password.");
|
|
75
37
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
success:function(response, opts){
|
|
116
|
-
var obj = Ext.decode(response.responseText);
|
|
117
|
-
if(obj.success){
|
|
118
|
-
Ext.Msg.alert("Success", "Password reset and email sent.");
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
failure:function(response, opts){
|
|
122
|
-
Ext.Msg.alert("Error", "Error re-setting password.");
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
constructor: function (config) {
|
|
42
|
+
Ext.create('Compass.ErpApp.Mobile.UserManagement.Store.Users', {
|
|
43
|
+
storeId: 'usermanagement-usersstore'
|
|
44
|
+
}).load();
|
|
45
|
+
|
|
46
|
+
config['items'] = [
|
|
47
|
+
{
|
|
48
|
+
|
|
49
|
+
xtype: 'toolbar',
|
|
50
|
+
ui: 'light',
|
|
51
|
+
docked: 'top',
|
|
52
|
+
items: [
|
|
53
|
+
{
|
|
54
|
+
text: 'Home',
|
|
55
|
+
ui: 'back',
|
|
56
|
+
handler: function (btn) {
|
|
57
|
+
btn.up('#mainContainer').setActiveItem('#home');
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
|
|
64
|
+
xtype: 'list',
|
|
65
|
+
store: 'usermanagement-usersstore',
|
|
66
|
+
itemTpl: '<div class="contact"><strong>{username}</strong></div>',
|
|
67
|
+
grouped: true,
|
|
68
|
+
indexBar: true,
|
|
69
|
+
listeners: {
|
|
70
|
+
itemdoubletap: function (view, index, target, record, e, eOpts) {
|
|
71
|
+
e.stopEvent();
|
|
72
|
+
var carousel = view.up('carousel'),
|
|
73
|
+
details = carousel.down('#details');
|
|
74
|
+
details.setHtml(Compass.ErpApp.Mobile.UserManagement.Templates.userDetails.apply(record.getData()));
|
|
75
|
+
carousel.setActiveItem(details);
|
|
76
|
+
carousel.selectedUser = record;
|
|
123
77
|
}
|
|
124
|
-
});
|
|
125
78
|
}
|
|
126
|
-
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
itemId: 'details',
|
|
82
|
+
items: [
|
|
83
|
+
{
|
|
84
|
+
xtype: 'toolbar',
|
|
85
|
+
docked: 'top',
|
|
86
|
+
items: [
|
|
87
|
+
{
|
|
88
|
+
text: 'Reset Password',
|
|
89
|
+
handler: function (btn) {
|
|
90
|
+
var carousel = btn.up('carousel');
|
|
91
|
+
|
|
92
|
+
if (Ext.isEmpty(carousel.selectedUser)) {
|
|
93
|
+
Ext.Msg.alert('Error', 'No user selected');
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
carousel.resetPassword();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
layout: 'fit',
|
|
104
|
+
autoScroll: true
|
|
127
105
|
}
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
itemId:'userDetails',
|
|
132
|
-
style:'padding:5px;'
|
|
133
|
-
}
|
|
134
|
-
]
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
106
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
{
|
|
144
|
-
xtype:'toolbar',
|
|
145
|
-
ui:'light',
|
|
146
|
-
docked:'top',
|
|
147
|
-
items:[
|
|
148
|
-
{
|
|
149
|
-
text:'Home',
|
|
150
|
-
ui:'back',
|
|
151
|
-
handler:function(btn){
|
|
152
|
-
window.location = '/erp_app/mobile';
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
text:'Logout',
|
|
157
|
-
ui:'round',
|
|
158
|
-
handler:function(btn){
|
|
159
|
-
window.location = '/session/sign_out?login_url=/erp_app/mobile/login';
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
]
|
|
163
|
-
},
|
|
164
|
-
center
|
|
165
|
-
]
|
|
166
|
-
});
|
|
167
|
-
}
|
|
107
|
+
|
|
108
|
+
];
|
|
109
|
+
|
|
110
|
+
this.callParent([config]);
|
|
111
|
+
}
|
|
168
112
|
});
|