Mercurial > lada > lada-client
annotate app/view/window/GenProbenFromMessprogramm.js @ 809:3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
author | Dustin Demuth <dustin@intevation.de> |
---|---|
date | Fri, 22 May 2015 16:14:14 +0200 |
parents | 18697326c862 |
children | 188a9faf96e0 |
rev | line source |
---|---|
760
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
2 * Software engineering by Intevation GmbH |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
3 * |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
4 * This file is Free Software under the GNU GPL (v>=3) |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
6 * the documentation coming with IMIS-Labordaten-Application for details. |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
7 */ |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
8 |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
9 /* |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
10 * Window to generate Proben from a Messprogramm |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
11 */ |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
12 Ext.define('Lada.view.window.GenProbenFromMessprogramm', { |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
13 extend: 'Ext.window.Window', |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
14 alias: 'widget.genpfm', |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
15 |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
16 collapsible: true, |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
17 maximizable: true, |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
18 autoShow: true, |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
19 autoScroll: true, |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
20 layout: 'fit', |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
21 constrain: true, |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
22 |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
23 record: null, |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
24 |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
25 initComponent: function() { |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
26 var i18n = Lada.getApplication().bundle; |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
27 |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
28 this.title = i18n.getMsg('gpfm.window.title'); |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
29 var me = this; |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
30 this.buttons = [{ |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
31 text: i18n.getMsg('cancel'), |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
32 scope: this, |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
33 handler: this.close |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
34 }, { |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
35 text: i18n.getMsg('generateproben'), |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
36 handler: function() { |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
37 var jsondata = { |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
38 id: me.record.id, |
761
975183ab775e
Sending Date as timestamp
Dustin Demuth <dustin@intevation.de>
parents:
760
diff
changeset
|
39 start: new Date(me.down('datetime [name=start]').getValue()).valueOf(), |
975183ab775e
Sending Date as timestamp
Dustin Demuth <dustin@intevation.de>
parents:
760
diff
changeset
|
40 end: new Date(me.down('datetime [name=end]').getValue()).valueOf() |
760
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
41 }; |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
42 |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
43 |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
44 Ext.Ajax.request({ |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
45 url: '/lada-server/probe/messprogramm', |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
46 method: 'POST', |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
47 headers: { |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
48 'X-OPENID-PARAMS': Lada.openIDParams |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
49 }, |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
50 jsonData: jsondata, |
809
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
51 success: function(response) { |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
52 var json = Ext.JSON.decode(response.responseText); |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
53 console.log(json); |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
54 Ext.Msg.show({ |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
55 title: i18n.getMsg('success'), |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
56 autoScroll: true, |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
57 msg: me.evalResponse(json), |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
58 buttons: Ext.Msg.OK, |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
59 }); |
760
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
60 }, |
809
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
61 failure: function(response) { |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
62 // TODO handle Errors correctly, especially AuthenticationTimeouts |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
63 var json = Ext.JSON.decode(response.responseText); |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
64 if (json) { |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
65 if(json.errors.totalCount > 0 || json.warnings.totalCount > 0){ |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
66 formPanel.setMessages(json.errors, json.warnings); |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
67 } |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
68 |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
69 if(json.message){ |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
70 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title') |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
71 +' #'+json.message, |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
72 Lada.getApplication().bundle.getMsg(json.message)); |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
73 } else { |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
74 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'), |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
75 Lada.getApplication().bundle.getMsg('err.msg.generic.body')); |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
76 } |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
77 } else { |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
78 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'), |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
79 Lada.getApplication().bundle.getMsg('err.msg.response.body')); |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
80 } |
760
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
81 } |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
82 }); |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
83 } |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
84 }]; |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
85 this.width = 400; |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
86 this.height = 300; |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
87 |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
88 // add listeners to change the window appearence when it becomes inactive |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
89 this.on({ |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
90 activate: function(){ |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
91 this.getEl().removeCls('window-inactive'); |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
92 }, |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
93 deactivate: function(){ |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
94 this.getEl().addCls('window-inactive'); |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
95 } |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
96 }); |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
97 |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
98 // InitialConfig is the config object passed to the constructor on |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
99 // creation of this window. We need to pass it throuh to the form as |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
100 // we need the "Id" param to load the correct item. |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
101 this.items = [{ |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
102 border: 0, |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
103 autoScroll: true, |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
104 items: [{ |
807 | 105 xtype: 'panel', |
106 border: 0, | |
107 margin: 5, | |
108 layout: 'fit', | |
109 html: '<p>' | |
110 + i18n.getMsg('nameofmessprogramm') | |
111 + '<br/>' | |
112 + this.record.get('name') | |
113 + '</p>' | |
760
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
114 }, { |
807 | 115 xtype: 'panel', |
116 border: 0, | |
117 margin: 5, | |
118 layout: 'fit', | |
119 html: '<p>' + i18n.getMsg('messprogtimeperiod') + '</p>' | |
760
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
120 }, { |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
121 xtype: 'datetime', |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
122 fieldLabel: i18n.getMsg('from'), |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
123 labelWidth: 90, |
807 | 124 margin: 5, |
760
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
125 name: 'start', |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
126 format: 'd.m.Y H:i', |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
127 period: 'start' |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
128 }, { |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
129 xtype: 'datetime', |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
130 fieldLabel: i18n.getMsg('to'), |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
131 labelWidth: 90, |
807 | 132 margin: 5, |
760
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
133 name: 'end', |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
134 format: 'd.m.Y H:i', |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
135 period: 'end' |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
136 }] |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
137 }]; |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
138 this.callParent(arguments); |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
139 }, |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
140 |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
141 /** |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
142 * Init |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
143 */ |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
144 initData: function() { |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
145 var i18n = Lada.getApplication().bundle; |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
146 me = this; |
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
147 }, |
809
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
148 |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
149 /** |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
150 * Parse ServerResponse when Proben have been generated |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
151 */ |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
152 evalResponse: function(response) { |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
153 var i18n = Lada.getApplication().bundle; |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
154 var r = ''; |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
155 r += response.totalCount; |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
156 r += ' ' + i18n.getMsg('probecreated'); |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
157 r += '<br/>'; |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
158 r += i18n.getMsg('probeids'); |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
159 var i; |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
160 for (i in response.data){ |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
161 r += '<br/>'; |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
162 r += response.data[i].probeIdAlt |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
163 } |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
164 return r; |
3bc19188fc3a
Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents:
807
diff
changeset
|
165 } |
760
2e7e1a8bf79f
Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
166 }); |