annotate app/view/window/GenProbenFromMessprogramm.js @ 1191:62f374ea7ab7

Use UTC date in messprogramm to generate probe objects.
author Raimund Renkert <raimund.renkert@intevation.de>
date Wed, 07 Sep 2016 17:16:26 +0200
parents b98e3af27424
children 39d98891881c
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
891
8054232535ba More JSduck
Dustin Demuth <dustin@intevation.de>
parents: 890
diff changeset
9 /**
760
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,
818
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 812
diff changeset
24 parentWindow: null,
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
25
890
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 882
diff changeset
26 /**
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 882
diff changeset
27 * This function initialises the Window
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 882
diff changeset
28 */
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
29 initComponent: function() {
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
30 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
31
818
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 812
diff changeset
32 // add listeners to change the window appearence when it becomes inactive
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 812
diff changeset
33 this.on({
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 812
diff changeset
34 activate: function(){
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 812
diff changeset
35 this.getEl().removeCls('window-inactive');
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 812
diff changeset
36 },
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 812
diff changeset
37 deactivate: function(){
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 812
diff changeset
38 this.getEl().addCls('window-inactive');
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 812
diff changeset
39 }
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 812
diff changeset
40 });
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 812
diff changeset
41
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
42 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
43 var me = this;
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
44 this.buttons = [{
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
45 text: i18n.getMsg('cancel'),
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
46 scope: this,
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
47 handler: this.close
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
48 }, {
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
49 text: i18n.getMsg('generateproben'),
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
50 handler: function() {
1191
62f374ea7ab7 Use UTC date in messprogramm to generate probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1162
diff changeset
51 var startDate = new Date(me.down('datefield[name=start]').getValue());
62f374ea7ab7 Use UTC date in messprogramm to generate probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1162
diff changeset
52 var startUTC = Date.UTC(
62f374ea7ab7 Use UTC date in messprogramm to generate probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1162
diff changeset
53 startDate.getFullYear(), startDate.getMonth(), startDate.getDate());
62f374ea7ab7 Use UTC date in messprogramm to generate probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1162
diff changeset
54 var endDate = new Date(me.down('datefield[name=end]').getValue());
62f374ea7ab7 Use UTC date in messprogramm to generate probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1162
diff changeset
55 var endUTC = Date.UTC(
62f374ea7ab7 Use UTC date in messprogramm to generate probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1162
diff changeset
56 endDate.getFullYear(), endDate.getMonth(), endDate.getDate());
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
57 var jsondata = {
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
58 id: me.record.id,
1191
62f374ea7ab7 Use UTC date in messprogramm to generate probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1162
diff changeset
59 start: startUTC,
62f374ea7ab7 Use UTC date in messprogramm to generate probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1162
diff changeset
60 end: endUTC
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
61 };
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
62
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
63 Ext.Ajax.request({
999
f73ca04d73a7 Refactored Server URL
Dustin Demuth <dustin@intevation.de>
parents: 920
diff changeset
64 url: 'lada-server/rest/probe/messprogramm',
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
65 method: 'POST',
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
66 jsonData: jsondata,
809
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
67 success: function(response) {
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
68 var json = Ext.JSON.decode(response.responseText);
1162
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
69 var radio = Ext.ComponentQuery.query('modeswitcher')[0].down('radiofield[inputValue=proben]');
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
70 radio.setValue(true);
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
71
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
72 var contentPanel = Ext.ComponentQuery.query('panel[name=main]')[0].down('panel[name=contentpanel]');
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
73 contentPanel.removeAll(); //clear the panel: make space for new grids
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
74 var gridstore = Ext.create('Lada.store.Proben');
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
75 var frgrid = Ext.create('Lada.view.grid.ProbeList', {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
76 plugins: [{
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
77 ptype: 'gridrowexpander',
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
78 gridType: 'Lada.view.grid.Messung',
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
79 expandOnDblClick: false,
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
80 gridConfig: {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
81 bottomBar: false
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
82 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
83 }]
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
84 });
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
85
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
86 var columns = [{
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
87 header: i18n.getMsg('prnId'),
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
88 dataIndex: 'probeIdAlt'
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
89 }, {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
90 header: i18n.getMsg('netzbetreiberId'),
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
91 dataIndex: 'netzbetreiberId',
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
92 renderer: function(value) {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
93 var r = '';
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
94 if (!value || value === '') {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
95 r = 'Error';
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
96 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
97 var store = Ext.data.StoreManager.get('netzbetreiber');
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
98 var record = store.getById(value);
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
99 if (record) {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
100 r = record.get('netzbetreiber');
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
101 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
102 return r;
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
103 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
104 }, {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
105 header: i18n.getMsg('mstId'),
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
106 dataIndex: 'mstId',
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
107 renderer: function(value) {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
108 var r = '';
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
109 if (!value || value === '') {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
110 r = 'Error';
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
111 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
112 var store = Ext.data.StoreManager.get('messstellen');
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
113 var record = store.getById(value);
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
114 if (record) {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
115 r = record.get('messStelle');
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
116 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
117 return r;
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
118 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
119 }, {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
120 header: i18n.getMsg('datenbasisId'),
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
121 dataIndex: 'datenbasisId',
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
122 renderer: function(value) {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
123 var r = '';
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
124 if (!value || value === '') {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
125 r = value;
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
126 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
127 var store = Ext.data.StoreManager.get('datenbasis');
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
128 var record = store.getById(value);
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
129 if (record) {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
130 r = record.get('datenbasis');
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
131 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
132 return r;
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
133 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
134 }, {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
135 header: i18n.getMsg('baId'),
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
136 dataIndex: 'baId',
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
137 renderer: function(value) {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
138 var r = '';
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
139 if (!value || value === '') {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
140 r = '';
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
141 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
142 var store = Ext.create('Ext.data.Store', {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
143 fields: ['betriebsartId', 'betriebsart'],
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
144 data: [{
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
145 'betriebsartId': '1',
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
146 'betriebsart': 'Normal-/Routinebetrieb'
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
147 }, {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
148 'betriebsartId': '2',
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
149 'betriebsart': 'Störfall/Intensivbetrieb'
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
150 }]
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
151 });
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
152 var record = store.getById(value);
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
153 if (record) {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
154 r = record.get('betriebsart');
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
155 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
156 return r;
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
157 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
158 }, {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
159 header: i18n.getMsg('probenartId'),
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
160 dataIndex: 'probenartId',
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
161 renderer: function(value) {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
162 var r = '';
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
163 if (!value || value === '') {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
164 r = value;
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
165 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
166 var store = Ext.data.StoreManager.get('probenarten');
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
167 var record = store.getById(value);
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
168 if (record) {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
169 r = record.get('probenart');
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
170 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
171 return r;
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
172 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
173 }, {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
174 header: i18n.getMsg('sollVon'),
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
175 dataIndex: 'solldatumBeginn',
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
176 renderer: function(value) {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
177 console.log(value);
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
178 if (!value) {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
179 return '';
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
180 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
181 return Ext.Date.format(value, 'd.m.Y');
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
182 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
183 }, {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
184 header: i18n.getMsg('sollBis'),
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
185 dataIndex: 'solldatumEnde',
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
186 renderer: function(value) {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
187 if (!value) {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
188 return '';
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
189 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
190 return Ext.Date.format(value, 'd.m.Y');
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
191 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
192 }];
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
193 frgrid.reconfigure(gridstore, columns);
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
194
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
195 gridstore.loadData(json.data);
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
196 contentPanel.add(frgrid);
809
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
197 Ext.Msg.show({
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
198 title: i18n.getMsg('success'),
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
199 autoScroll: true,
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
200 msg: me.evalResponse(json),
882
f1e964b3aad6 Trailing Commas
Dustin Demuth <dustin@intevation.de>
parents: 861
diff changeset
201 buttons: Ext.Msg.OK
809
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
202 });
859
6249b731d438 Close messprogramm windows on probe generation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 855
diff changeset
203 me.close();
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
204 },
809
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
205 failure: function(response) {
855
dff2798390f8 Better Error handling
Dustin Demuth <dustin@intevation.de>
parents: 834
diff changeset
206 var json = null;
dff2798390f8 Better Error handling
Dustin Demuth <dustin@intevation.de>
parents: 834
diff changeset
207 try {
dff2798390f8 Better Error handling
Dustin Demuth <dustin@intevation.de>
parents: 834
diff changeset
208 json = Ext.JSON.decode(response.responseText);
dff2798390f8 Better Error handling
Dustin Demuth <dustin@intevation.de>
parents: 834
diff changeset
209 }
dff2798390f8 Better Error handling
Dustin Demuth <dustin@intevation.de>
parents: 834
diff changeset
210 catch(err){
dff2798390f8 Better Error handling
Dustin Demuth <dustin@intevation.de>
parents: 834
diff changeset
211 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.generic.title'),
dff2798390f8 Better Error handling
Dustin Demuth <dustin@intevation.de>
parents: 834
diff changeset
212 Lada.getApplication().bundle.getMsg('err.msg.response.body'));
dff2798390f8 Better Error handling
Dustin Demuth <dustin@intevation.de>
parents: 834
diff changeset
213 }
809
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
214 if (json) {
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
215 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
216 formPanel.setMessages(json.errors, json.warnings);
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
217 }
920
f220ba587c89 Adopted Client to SSO, detect a Sessiontimeout and reload the application
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
218 /*
f220ba587c89 Adopted Client to SSO, detect a Sessiontimeout and reload the application
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
219 SSO will send a 302 if the Client is not authenticated
f220ba587c89 Adopted Client to SSO, detect a Sessiontimeout and reload the application
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
220 unfortunately this seems to be filtered by the browser.
f220ba587c89 Adopted Client to SSO, detect a Sessiontimeout and reload the application
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
221 We assume that a 302 was send when the follwing statement
f220ba587c89 Adopted Client to SSO, detect a Sessiontimeout and reload the application
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
222 is true.
f220ba587c89 Adopted Client to SSO, detect a Sessiontimeout and reload the application
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
223 */
f220ba587c89 Adopted Client to SSO, detect a Sessiontimeout and reload the application
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
224 if (response.status == 0 && response.responseText === "") {
812
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
225 Ext.MessageBox.confirm('Erneutes Login erforderlich',
920
f220ba587c89 Adopted Client to SSO, detect a Sessiontimeout and reload the application
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
226 'Ihre Session ist abgelaufen.<br/>'+
812
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
227 'Für ein erneutes Login muss die Anwendung neu geladen werden.<br/>' +
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
228 'Alle ungesicherten Daten gehen dabei verloren.<br/>' +
920
f220ba587c89 Adopted Client to SSO, detect a Sessiontimeout and reload the application
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
229 'Soll die Anwendung jetzt neu geladen werden?', this.reload);
812
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
230 }
920
f220ba587c89 Adopted Client to SSO, detect a Sessiontimeout and reload the application
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
231 // further error handling
f220ba587c89 Adopted Client to SSO, detect a Sessiontimeout and reload the application
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
232 if(json.message){
812
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
233 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.generic.title')
809
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
234 +' #'+json.message,
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
235 Lada.getApplication().bundle.getMsg(json.message));
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
236 } else {
812
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
237 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.generic.title'),
809
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
238 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
239 }
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
240 } else {
812
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
241 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.generic.title'),
809
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
242 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
243 }
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
244 }
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
245 });
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
246 }
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
247 }];
834
2214aea9fd3a Patched correct file of r. 832
Dustin Demuth <dustin@intevation.de>
parents: 833
diff changeset
248 this.width = 350;
2214aea9fd3a Patched correct file of r. 832
Dustin Demuth <dustin@intevation.de>
parents: 833
diff changeset
249 this.height = 250;
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
250
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
251 // 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
252 this.on({
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
253 activate: function(){
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
254 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
255 },
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
256 deactivate: function(){
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
257 this.getEl().addCls('window-inactive');
818
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 812
diff changeset
258 },
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 812
diff changeset
259 close: function () {
860
03f39ddae596 Restructured Filterresultgrid button-dock, added button to generate Proben from a selection of messprogramme.
Dustin Demuth <dustin@intevation.de>
parents: 855
diff changeset
260 if (this.parentWindow) {
03f39ddae596 Restructured Filterresultgrid button-dock, added button to generate Proben from a selection of messprogramme.
Dustin Demuth <dustin@intevation.de>
parents: 855
diff changeset
261 this.parentWindow.probenWindow = null;
03f39ddae596 Restructured Filterresultgrid button-dock, added button to generate Proben from a selection of messprogramme.
Dustin Demuth <dustin@intevation.de>
parents: 855
diff changeset
262 }
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
263 }
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
264 });
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
265
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
266 // 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
267 // 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
268 // 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
269 this.items = [{
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
270 border: 0,
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
271 autoScroll: true,
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
272 items: [{
807
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
273 xtype: 'panel',
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
274 border: 0,
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
275 margin: 5,
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
276 layout: 'fit',
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
277 html: '<p>'
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
278 + i18n.getMsg('nameofmessprogramm')
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
279 + '<br/>'
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
280 + this.record.get('name')
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
281 + '</p>'
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
282 }, {
807
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
283 xtype: 'panel',
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
284 border: 0,
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
285 margin: 5,
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
286 layout: 'fit',
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
287 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
288 }, {
1105
953b359748bb change time range format in GenProbenFromMessprogramm
Michael Stanko <mstanko@bfs.de>
parents: 999
diff changeset
289 xtype: 'datefield',
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
290 fieldLabel: i18n.getMsg('from'),
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
291 labelWidth: 90,
807
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
292 margin: 5,
1105
953b359748bb change time range format in GenProbenFromMessprogramm
Michael Stanko <mstanko@bfs.de>
parents: 999
diff changeset
293 width: 200,
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
294 name: 'start',
1105
953b359748bb change time range format in GenProbenFromMessprogramm
Michael Stanko <mstanko@bfs.de>
parents: 999
diff changeset
295 format: 'd.m.Y',
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
296 period: 'start'
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
297 }, {
1105
953b359748bb change time range format in GenProbenFromMessprogramm
Michael Stanko <mstanko@bfs.de>
parents: 999
diff changeset
298 xtype: 'datefield',
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
299 fieldLabel: i18n.getMsg('to'),
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
300 labelWidth: 90,
807
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
301 margin: 5,
1105
953b359748bb change time range format in GenProbenFromMessprogramm
Michael Stanko <mstanko@bfs.de>
parents: 999
diff changeset
302 width: 200,
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
303 name: 'end',
1105
953b359748bb change time range format in GenProbenFromMessprogramm
Michael Stanko <mstanko@bfs.de>
parents: 999
diff changeset
304 format: 'd.m.Y',
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
305 period: 'end'
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
306 }]
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
307 }];
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
308 this.callParent(arguments);
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
309 },
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
310
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
311 /**
890
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 882
diff changeset
312 * Initiatlise the Data
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
313 */
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
314 initData: function() {
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
315 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
316 me = this;
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
317 },
809
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
318
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
319 /**
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
320 * 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
321 */
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
322 evalResponse: function(response) {
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
323 var i18n = Lada.getApplication().bundle;
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
324 var r = '';
812
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
325 r += response.data.length;
809
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
326 r += ' ' + i18n.getMsg('probecreated');
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
327 r += '<br/>';
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
328 return r;
812
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
329 },
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
330
890
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 882
diff changeset
331 /**
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 882
diff changeset
332 * Reload the Application
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 882
diff changeset
333 */
812
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
334 reload: function(btn) {
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
335 if (btn === 'yes') {
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
336 location.reload();
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
337 }
809
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
338 }
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
339 });

http://lada.wald.intevation.org