annotate app/view/window/GenProbenFromMessprogramm.js @ 1186:a1c480be0b79 schema-update

Load status_kombi store on application launch.
author Raimund Renkert <raimund.renkert@intevation.de>
date Wed, 31 Aug 2016 15:59:28 +0200
parents b98e3af27424
children 62f374ea7ab7
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() {
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
51 var jsondata = {
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
52 id: me.record.id,
1118
ea5774447e49 Fixed typo in ExtJs selector.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1105
diff changeset
53 start: new Date(me.down('datefield[name=start]').getValue()).valueOf(),
ea5774447e49 Fixed typo in ExtJs selector.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1105
diff changeset
54 end: new Date(me.down('datefield[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
55 };
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
56
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
57
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
58 Ext.Ajax.request({
999
f73ca04d73a7 Refactored Server URL
Dustin Demuth <dustin@intevation.de>
parents: 920
diff changeset
59 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
60 method: 'POST',
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
61 jsonData: jsondata,
809
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
62 success: function(response) {
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);
1162
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
64 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
65 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
66
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
67 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
68 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
69 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
70 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
71 plugins: [{
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
72 ptype: 'gridrowexpander',
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
73 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
74 expandOnDblClick: false,
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
75 gridConfig: {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
76 bottomBar: false
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
77 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
78 }]
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
79 });
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
80
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
81 var columns = [{
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
82 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
83 dataIndex: 'probeIdAlt'
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 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
86 dataIndex: 'netzbetreiberId',
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
87 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
88 var r = '';
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
89 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
90 r = 'Error';
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
91 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
92 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
93 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
94 if (record) {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
95 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
96 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
97 return r;
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
98 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
99 }, {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
100 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
101 dataIndex: 'mstId',
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
102 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
103 var r = '';
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
104 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
105 r = 'Error';
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
106 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
107 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
108 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
109 if (record) {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
110 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
111 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
112 return r;
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
113 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
114 }, {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
115 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
116 dataIndex: 'datenbasisId',
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
117 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
118 var r = '';
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
119 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
120 r = value;
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
121 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
122 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
123 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
124 if (record) {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
125 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
126 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
127 return r;
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
128 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
129 }, {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
130 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
131 dataIndex: 'baId',
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
132 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
133 var r = '';
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
134 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
135 r = '';
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
136 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
137 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
138 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
139 data: [{
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
140 'betriebsartId': '1',
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
141 '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
142 }, {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
143 'betriebsartId': '2',
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
144 '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
145 }]
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
146 });
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
147 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
148 if (record) {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
149 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
150 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
151 return r;
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
152 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
153 }, {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
154 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
155 dataIndex: 'probenartId',
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
156 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
157 var r = '';
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
158 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
159 r = value;
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
160 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
161 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
162 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
163 if (record) {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
164 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
165 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
166 return r;
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
167 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
168 }, {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
169 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
170 dataIndex: 'solldatumBeginn',
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
171 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
172 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
173 if (!value) {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
174 return '';
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
175 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
176 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
177 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
178 }, {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
179 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
180 dataIndex: 'solldatumEnde',
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
181 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
182 if (!value) {
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
183 return '';
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
184 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
185 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
186 }
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
187 }];
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
188 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
189
b98e3af27424 Show generated objects in grid when using messprogramm to create proben
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1118
diff changeset
190 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
191 contentPanel.add(frgrid);
809
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
192 Ext.Msg.show({
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
193 title: i18n.getMsg('success'),
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
194 autoScroll: true,
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
195 msg: me.evalResponse(json),
882
f1e964b3aad6 Trailing Commas
Dustin Demuth <dustin@intevation.de>
parents: 861
diff changeset
196 buttons: Ext.Msg.OK
809
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
197 });
859
6249b731d438 Close messprogramm windows on probe generation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 855
diff changeset
198 me.close();
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
199 },
809
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
200 failure: function(response) {
855
dff2798390f8 Better Error handling
Dustin Demuth <dustin@intevation.de>
parents: 834
diff changeset
201 var json = null;
dff2798390f8 Better Error handling
Dustin Demuth <dustin@intevation.de>
parents: 834
diff changeset
202 try {
dff2798390f8 Better Error handling
Dustin Demuth <dustin@intevation.de>
parents: 834
diff changeset
203 json = Ext.JSON.decode(response.responseText);
dff2798390f8 Better Error handling
Dustin Demuth <dustin@intevation.de>
parents: 834
diff changeset
204 }
dff2798390f8 Better Error handling
Dustin Demuth <dustin@intevation.de>
parents: 834
diff changeset
205 catch(err){
dff2798390f8 Better Error handling
Dustin Demuth <dustin@intevation.de>
parents: 834
diff changeset
206 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.generic.title'),
dff2798390f8 Better Error handling
Dustin Demuth <dustin@intevation.de>
parents: 834
diff changeset
207 Lada.getApplication().bundle.getMsg('err.msg.response.body'));
dff2798390f8 Better Error handling
Dustin Demuth <dustin@intevation.de>
parents: 834
diff changeset
208 }
809
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
209 if (json) {
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
210 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
211 formPanel.setMessages(json.errors, json.warnings);
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
212 }
920
f220ba587c89 Adopted Client to SSO, detect a Sessiontimeout and reload the application
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
213 /*
f220ba587c89 Adopted Client to SSO, detect a Sessiontimeout and reload the application
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
214 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
215 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
216 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
217 is true.
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 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
220 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
221 'Ihre Session ist abgelaufen.<br/>'+
812
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
222 '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
223 '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
224 '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
225 }
920
f220ba587c89 Adopted Client to SSO, detect a Sessiontimeout and reload the application
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
226 // further error handling
f220ba587c89 Adopted Client to SSO, detect a Sessiontimeout and reload the application
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
227 if(json.message){
812
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
228 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
229 +' #'+json.message,
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
230 Lada.getApplication().bundle.getMsg(json.message));
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
231 } else {
812
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
232 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
233 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
234 }
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
235 } else {
812
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
236 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
237 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
238 }
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
239 }
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
240 });
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
241 }
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
242 }];
834
2214aea9fd3a Patched correct file of r. 832
Dustin Demuth <dustin@intevation.de>
parents: 833
diff changeset
243 this.width = 350;
2214aea9fd3a Patched correct file of r. 832
Dustin Demuth <dustin@intevation.de>
parents: 833
diff changeset
244 this.height = 250;
760
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 // 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
247 this.on({
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
248 activate: function(){
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
249 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
250 },
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
251 deactivate: function(){
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
252 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
253 },
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
254 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
255 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
256 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
257 }
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
258 }
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
259 });
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
260
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
261 // 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
262 // 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
263 // 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
264 this.items = [{
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
265 border: 0,
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
266 autoScroll: true,
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
267 items: [{
807
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
268 xtype: 'panel',
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
269 border: 0,
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
270 margin: 5,
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
271 layout: 'fit',
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
272 html: '<p>'
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
273 + i18n.getMsg('nameofmessprogramm')
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
274 + '<br/>'
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
275 + this.record.get('name')
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
276 + '</p>'
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
277 }, {
807
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
278 xtype: 'panel',
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
279 border: 0,
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
280 margin: 5,
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
281 layout: 'fit',
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
282 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
283 }, {
1105
953b359748bb change time range format in GenProbenFromMessprogramm
Michael Stanko <mstanko@bfs.de>
parents: 999
diff changeset
284 xtype: 'datefield',
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
285 fieldLabel: i18n.getMsg('from'),
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
286 labelWidth: 90,
807
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
287 margin: 5,
1105
953b359748bb change time range format in GenProbenFromMessprogramm
Michael Stanko <mstanko@bfs.de>
parents: 999
diff changeset
288 width: 200,
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
289 name: 'start',
1105
953b359748bb change time range format in GenProbenFromMessprogramm
Michael Stanko <mstanko@bfs.de>
parents: 999
diff changeset
290 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
291 period: 'start'
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
292 }, {
1105
953b359748bb change time range format in GenProbenFromMessprogramm
Michael Stanko <mstanko@bfs.de>
parents: 999
diff changeset
293 xtype: 'datefield',
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
294 fieldLabel: i18n.getMsg('to'),
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
295 labelWidth: 90,
807
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
296 margin: 5,
1105
953b359748bb change time range format in GenProbenFromMessprogramm
Michael Stanko <mstanko@bfs.de>
parents: 999
diff changeset
297 width: 200,
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
298 name: 'end',
1105
953b359748bb change time range format in GenProbenFromMessprogramm
Michael Stanko <mstanko@bfs.de>
parents: 999
diff changeset
299 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
300 period: 'end'
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
301 }]
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
302 }];
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
303 this.callParent(arguments);
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
304 },
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
305
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
306 /**
890
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 882
diff changeset
307 * Initiatlise the Data
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
308 */
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
309 initData: function() {
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
310 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
311 me = this;
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
312 },
809
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
313
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
314 /**
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
315 * 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
316 */
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
317 evalResponse: function(response) {
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
318 var i18n = Lada.getApplication().bundle;
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
319 var r = '';
812
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
320 r += response.data.length;
809
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
321 r += ' ' + i18n.getMsg('probecreated');
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
322 r += '<br/>';
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
323 return r;
812
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
324 },
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
325
890
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 882
diff changeset
326 /**
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 882
diff changeset
327 * Reload the Application
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 882
diff changeset
328 */
812
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
329 reload: function(btn) {
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
330 if (btn === 'yes') {
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
331 location.reload();
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
332 }
809
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
333 }
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
334 });

http://lada.wald.intevation.org