Mercurial > lada > lada-client
annotate app/view/window/MessungEdit.js @ 1172:9b157a8eecf1
Changed MKommentar Text into type textarea
author | Evi Huber <ehuber@bfs.de> |
---|---|
date | Tue, 05 Jul 2016 09:16:20 +0200 |
parents | d3cf992099a0 |
children | 5e3d4136ecfb |
rev | line source |
---|---|
576
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
2 * Software engineering by Intevation GmbH |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
3 * |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
4 * This file is Free Software under the GNU GPL (v>=3) |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
6 * the documentation coming with IMIS-Labordaten-Application for details. |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
7 */ |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
8 |
891 | 9 /** |
590
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
581
diff
changeset
|
10 * Window to edit a Messung |
576
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
11 */ |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
12 Ext.define('Lada.view.window.MessungEdit', { |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
13 extend: 'Ext.window.Window', |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
14 alias: 'widget.messungedit', |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
15 |
581
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
576
diff
changeset
|
16 requires: [ |
590
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
581
diff
changeset
|
17 'Lada.view.form.Messung', |
595
a81dafe06d1d
Add status to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
590
diff
changeset
|
18 'Lada.view.grid.Messwert', |
a81dafe06d1d
Add status to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
590
diff
changeset
|
19 'Lada.view.grid.Status', |
597
d2ce1c4c3aad
Add messung kommentare to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
595
diff
changeset
|
20 'Lada.view.grid.MKommentar' |
581
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
576
diff
changeset
|
21 ], |
576
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
22 |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
23 collapsible: true, |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
24 maximizable: true, |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
25 autoshow: true, |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
26 autoscroll: true, |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
27 layout: 'fit', |
688
6a6d1b02a1a3
constrain windows to viewport
Dustin Demuth <dustin@intevation.de>
parents:
687
diff
changeset
|
28 constrain: true, |
690
e88381fb3bdb
Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
688
diff
changeset
|
29 |
e88381fb3bdb
Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
688
diff
changeset
|
30 probe: null, |
e88381fb3bdb
Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
688
diff
changeset
|
31 parentWindow: null, |
576
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
32 record: null, |
644
71e8b84d7829
Reload grids on messung or ort changed/added.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
613
diff
changeset
|
33 grid: null, |
576
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
34 |
890
def27cdd0dfa
Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents:
875
diff
changeset
|
35 /** |
def27cdd0dfa
Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents:
875
diff
changeset
|
36 * This function initialises the Window |
def27cdd0dfa
Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents:
875
diff
changeset
|
37 */ |
590
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
581
diff
changeset
|
38 initComponent: function() { |
576
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
39 if (this.record === null) { |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
40 Ext.Msg.alert('Keine valide Messung ausgewählt!'); |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
41 this.callParent(arguments); |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
42 return; |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
43 } |
690
e88381fb3bdb
Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
688
diff
changeset
|
44 if (this.probe === null) { |
e88381fb3bdb
Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
688
diff
changeset
|
45 Ext.Msg.alert('Zu der Messung existiert keine Probe!'); |
e88381fb3bdb
Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
688
diff
changeset
|
46 this.callParent(arguments); |
e88381fb3bdb
Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
688
diff
changeset
|
47 return; |
e88381fb3bdb
Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
688
diff
changeset
|
48 } |
875
13c0e64e1873
Applied Patch which was presented in the Workshop: Title of a Messung-Window contains more details
Dustin Demuth <dustin@intevation.de>
parents:
845
diff
changeset
|
49 |
576
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
50 this.buttons = [{ |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
51 text: 'Schließen', |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
52 scope: this, |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
53 handler: this.close |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
54 }]; |
709
6f6d2df00130
Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents:
707
diff
changeset
|
55 |
6f6d2df00130
Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents:
707
diff
changeset
|
56 // add listeners to change the window appearence when it becomes inactive |
6f6d2df00130
Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents:
707
diff
changeset
|
57 this.on({ |
6f6d2df00130
Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents:
707
diff
changeset
|
58 activate: function(){ |
6f6d2df00130
Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents:
707
diff
changeset
|
59 this.getEl().removeCls('window-inactive'); |
6f6d2df00130
Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents:
707
diff
changeset
|
60 }, |
6f6d2df00130
Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents:
707
diff
changeset
|
61 deactivate: function(){ |
6f6d2df00130
Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents:
707
diff
changeset
|
62 this.getEl().addCls('window-inactive'); |
6f6d2df00130
Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents:
707
diff
changeset
|
63 } |
6f6d2df00130
Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents:
707
diff
changeset
|
64 }); |
6f6d2df00130
Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents:
707
diff
changeset
|
65 |
576
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
66 this.width = 700; |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
67 this.height = Ext.getBody().getViewSize().height - 30; |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
68 |
845
613ad3263e59
Load messgroessen with messmethode filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
824
diff
changeset
|
69 var mStore = Ext.data.StoreManager.get('messgroessen'); |
613ad3263e59
Load messgroessen with messmethode filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
824
diff
changeset
|
70 mStore.proxy.extraParams = {mmtId: this.record.get('mmtId')}; |
613ad3263e59
Load messgroessen with messmethode filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
824
diff
changeset
|
71 mStore.load(); |
613ad3263e59
Load messgroessen with messmethode filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
824
diff
changeset
|
72 |
576
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
73 this.items = [{ |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
74 border: 0, |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
75 autoScroll: true, |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
76 items: [{ |
581
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
576
diff
changeset
|
77 xtype: 'messungform', |
611
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
597
diff
changeset
|
78 margin: 5, |
590
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
581
diff
changeset
|
79 recordId: this.record.get('id') |
613
f959205ab173
reverted changes on messungenedit.js
Dustin Demuth <dustin@intevation.de>
parents:
611
diff
changeset
|
80 }, { |
576
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
81 xtype: 'fset', |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
82 name: 'messwerte', |
590
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
581
diff
changeset
|
83 title: 'Messwerte', |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
581
diff
changeset
|
84 padding: '5, 5', |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
581
diff
changeset
|
85 margin: 5, |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
581
diff
changeset
|
86 items: [{ |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
581
diff
changeset
|
87 xtype: 'messwertgrid', |
1163
d3cf992099a0
Change height of MessungsGrid and MesswertGrid
Evi Huber <ehuber@bfs.de>
parents:
1148
diff
changeset
|
88 minHeight:'110', |
845
613ad3263e59
Load messgroessen with messmethode filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
824
diff
changeset
|
89 recordId: this.record.get('id'), |
613ad3263e59
Load messgroessen with messmethode filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
824
diff
changeset
|
90 messgroesseStore: mStore |
613
f959205ab173
reverted changes on messungenedit.js
Dustin Demuth <dustin@intevation.de>
parents:
611
diff
changeset
|
91 }] |
576
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
92 }, { |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
93 xtype: 'fset', |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
94 name: 'messungstatus', |
595
a81dafe06d1d
Add status to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
590
diff
changeset
|
95 title: 'Status', |
a81dafe06d1d
Add status to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
590
diff
changeset
|
96 padding: '5, 5', |
a81dafe06d1d
Add status to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
590
diff
changeset
|
97 margin: 5, |
a81dafe06d1d
Add status to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
590
diff
changeset
|
98 items: [{ |
a81dafe06d1d
Add status to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
590
diff
changeset
|
99 xtype: 'statusgrid', |
a81dafe06d1d
Add status to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
590
diff
changeset
|
100 recordId: this.record.get('id') |
a81dafe06d1d
Add status to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
590
diff
changeset
|
101 }] |
576
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
102 }, { |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
103 xtype: 'fset', |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
104 name: 'messungskommentare', |
597
d2ce1c4c3aad
Add messung kommentare to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
595
diff
changeset
|
105 title: 'Kommentare', |
d2ce1c4c3aad
Add messung kommentare to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
595
diff
changeset
|
106 padding: '5, 5', |
d2ce1c4c3aad
Add messung kommentare to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
595
diff
changeset
|
107 margin: 5, |
d2ce1c4c3aad
Add messung kommentare to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
595
diff
changeset
|
108 items: [{ |
d2ce1c4c3aad
Add messung kommentare to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
595
diff
changeset
|
109 xtype: 'mkommentargrid', |
d2ce1c4c3aad
Add messung kommentare to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
595
diff
changeset
|
110 recordId: this.record.get('id') |
d2ce1c4c3aad
Add messung kommentare to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
595
diff
changeset
|
111 }] |
576
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
112 }] |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
113 }]; |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
114 this.callParent(arguments); |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
115 }, |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
116 |
890
def27cdd0dfa
Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents:
875
diff
changeset
|
117 /** |
def27cdd0dfa
Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents:
875
diff
changeset
|
118 * Initialise the Data of this Window |
def27cdd0dfa
Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents:
875
diff
changeset
|
119 */ |
576
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
120 initData: function() { |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
121 this.clearMessages(); |
693 | 122 var that = this; |
576
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
123 Ext.ClassManager.get('Lada.model.Messung').load(this.record.get('id'), { |
696
b0f1dcdf981d
Made the unhandled Errors more talkativew
Dustin Demuth <dustin@intevation.de>
parents:
693
diff
changeset
|
124 failure: function(record, response) { |
590
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
581
diff
changeset
|
125 // TODO |
712 | 126 console.log('An unhandled Failure occured. See following Response and Record'); |
696
b0f1dcdf981d
Made the unhandled Errors more talkativew
Dustin Demuth <dustin@intevation.de>
parents:
693
diff
changeset
|
127 console.log(response); |
590
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
581
diff
changeset
|
128 console.log(record); |
576
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
129 }, |
590
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
581
diff
changeset
|
130 success: function(record, response) { |
690
e88381fb3bdb
Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
688
diff
changeset
|
131 var me = this; |
1142
255d550e74f4
Use the correct record to compare treemodified field.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1036
diff
changeset
|
132 if (this.parentWindow.record.get('treeModified') < record.get('parentModified')) { |
690
e88381fb3bdb
Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
688
diff
changeset
|
133 Ext.Msg.show({ |
e88381fb3bdb
Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
688
diff
changeset
|
134 title: 'Probe nicht aktuell!', |
712 | 135 msg: 'Die zugehörige Probe wurde verändert.\n' + |
136 'Möchten Sie zu der Probe zurückkehren und neu laden?\n' + | |
137 'Ohne das erneute Laden der Probe wird das Speichern' + | |
696
b0f1dcdf981d
Made the unhandled Errors more talkativew
Dustin Demuth <dustin@intevation.de>
parents:
693
diff
changeset
|
138 ' der Messung nicht möglich sein.', |
690
e88381fb3bdb
Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
688
diff
changeset
|
139 buttons: Ext.Msg.OKCANCEL, |
e88381fb3bdb
Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
688
diff
changeset
|
140 icon: Ext.Msg.WARNING, |
e88381fb3bdb
Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
688
diff
changeset
|
141 closable: false, |
e88381fb3bdb
Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
688
diff
changeset
|
142 fn: function(button) { |
e88381fb3bdb
Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
688
diff
changeset
|
143 if (button === 'ok') { |
e88381fb3bdb
Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
688
diff
changeset
|
144 me.close(); |
e88381fb3bdb
Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
688
diff
changeset
|
145 me.parentWindow.initData(); |
e88381fb3bdb
Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
688
diff
changeset
|
146 } |
e88381fb3bdb
Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
688
diff
changeset
|
147 else { |
e88381fb3bdb
Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
688
diff
changeset
|
148 me.record.set('treeModified', me.probe.get('treeModified')); |
693 | 149 that.disableForm(); |
690
e88381fb3bdb
Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
688
diff
changeset
|
150 } |
e88381fb3bdb
Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
688
diff
changeset
|
151 } |
e88381fb3bdb
Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
688
diff
changeset
|
152 }); |
e88381fb3bdb
Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
688
diff
changeset
|
153 } |
590
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
581
diff
changeset
|
154 this.down('messungform').setRecord(record); |
690
e88381fb3bdb
Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
688
diff
changeset
|
155 this.record = record; |
1148
9934dc780701
Set title when all substrings are given.
Tom Gottfried <tom@intevation.de>
parents:
1142
diff
changeset
|
156 |
9934dc780701
Set title when all substrings are given.
Tom Gottfried <tom@intevation.de>
parents:
1142
diff
changeset
|
157 var messstelle = Ext.data.StoreManager.get('messstellen') |
9934dc780701
Set title when all substrings are given.
Tom Gottfried <tom@intevation.de>
parents:
1142
diff
changeset
|
158 .getById(this.probe.get('mstId')); |
9934dc780701
Set title when all substrings are given.
Tom Gottfried <tom@intevation.de>
parents:
1142
diff
changeset
|
159 this.setTitle('Messung: ' + this.record.get('nebenprobenNr') |
9934dc780701
Set title when all substrings are given.
Tom Gottfried <tom@intevation.de>
parents:
1142
diff
changeset
|
160 + ' zu Probe: ' + this.probe.get('probeIdAlt') |
9934dc780701
Set title when all substrings are given.
Tom Gottfried <tom@intevation.de>
parents:
1142
diff
changeset
|
161 + ' Mst: ' + messstelle.get('messStelle') |
9934dc780701
Set title when all substrings are given.
Tom Gottfried <tom@intevation.de>
parents:
1142
diff
changeset
|
162 + ' editieren.'); |
9934dc780701
Set title when all substrings are given.
Tom Gottfried <tom@intevation.de>
parents:
1142
diff
changeset
|
163 |
590
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
581
diff
changeset
|
164 var json = Ext.decode(response.response.responseText); |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
581
diff
changeset
|
165 if (json) { |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
581
diff
changeset
|
166 this.setMessages(json.errors, json.warnings); |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
581
diff
changeset
|
167 } |
1036
5ed859241fc9
Use owner to set the RO status for the messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1017
diff
changeset
|
168 if (this.record.get('readonly') === true || |
5ed859241fc9
Use owner to set the RO status for the messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1017
diff
changeset
|
169 this.record.get('owner') === false) { |
710
f204f30b824a
Handle readonly mode and refresh operations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
709
diff
changeset
|
170 this.disableForm(); |
f204f30b824a
Handle readonly mode and refresh operations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
709
diff
changeset
|
171 } |
f204f30b824a
Handle readonly mode and refresh operations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
709
diff
changeset
|
172 else { |
f204f30b824a
Handle readonly mode and refresh operations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
709
diff
changeset
|
173 this.enableForm(); |
f204f30b824a
Handle readonly mode and refresh operations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
709
diff
changeset
|
174 } |
965
a2c2039bb5d9
Disabled StatusGrid Edit when StatusEdit ist false, Load StatuswerteStore differently, removed a bunch of trailing commas
Dustin Demuth <dustin@intevation.de>
parents:
891
diff
changeset
|
175 //Check if it is allowed to edit Status |
a2c2039bb5d9
Disabled StatusGrid Edit when StatusEdit ist false, Load StatuswerteStore differently, removed a bunch of trailing commas
Dustin Demuth <dustin@intevation.de>
parents:
891
diff
changeset
|
176 if (this.record.get('statusEdit') === true) { |
a2c2039bb5d9
Disabled StatusGrid Edit when StatusEdit ist false, Load StatuswerteStore differently, removed a bunch of trailing commas
Dustin Demuth <dustin@intevation.de>
parents:
891
diff
changeset
|
177 this.enableStatusEdit(); |
a2c2039bb5d9
Disabled StatusGrid Edit when StatusEdit ist false, Load StatuswerteStore differently, removed a bunch of trailing commas
Dustin Demuth <dustin@intevation.de>
parents:
891
diff
changeset
|
178 } |
a2c2039bb5d9
Disabled StatusGrid Edit when StatusEdit ist false, Load StatuswerteStore differently, removed a bunch of trailing commas
Dustin Demuth <dustin@intevation.de>
parents:
891
diff
changeset
|
179 else { |
a2c2039bb5d9
Disabled StatusGrid Edit when StatusEdit ist false, Load StatuswerteStore differently, removed a bunch of trailing commas
Dustin Demuth <dustin@intevation.de>
parents:
891
diff
changeset
|
180 this.disableStatusEdit(); |
a2c2039bb5d9
Disabled StatusGrid Edit when StatusEdit ist false, Load StatuswerteStore differently, removed a bunch of trailing commas
Dustin Demuth <dustin@intevation.de>
parents:
891
diff
changeset
|
181 } |
997
c943340176d4
Disable the statusresetbutton
Dustin Demuth <dustin@intevation.de>
parents:
996
diff
changeset
|
182 //Check if it is allowed to reset Status: done in Messungform |
576
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
183 }, |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
184 scope: this |
611
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
597
diff
changeset
|
185 }); |
693 | 186 }, |
187 | |
890
def27cdd0dfa
Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents:
875
diff
changeset
|
188 /** |
def27cdd0dfa
Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents:
875
diff
changeset
|
189 * Disable the Forms in this Window. |
def27cdd0dfa
Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents:
875
diff
changeset
|
190 * Also disable this Windows Children |
def27cdd0dfa
Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents:
875
diff
changeset
|
191 */ |
712 | 192 disableForm: function() { |
693 | 193 this.down('messungform').setReadOnly(true); |
194 this.disableChildren(); | |
195 }, | |
196 | |
890
def27cdd0dfa
Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents:
875
diff
changeset
|
197 /** |
def27cdd0dfa
Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents:
875
diff
changeset
|
198 * Enable the Forms in this Window. |
def27cdd0dfa
Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents:
875
diff
changeset
|
199 * Also enble this Windows Children |
def27cdd0dfa
Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents:
875
diff
changeset
|
200 */ |
712 | 201 enableForm: function() { |
693 | 202 this.down('messungform').setReadOnly(false); |
203 this.enableChildren(); | |
204 }, | |
205 | |
890
def27cdd0dfa
Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents:
875
diff
changeset
|
206 /** |
def27cdd0dfa
Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents:
875
diff
changeset
|
207 * Disable the Chilelements of this window |
def27cdd0dfa
Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents:
875
diff
changeset
|
208 */ |
712 | 209 disableChildren: function() { |
693 | 210 this.down('fset[name=messwerte]').down('messwertgrid').setReadOnly(true); |
824
fab0b7be5aca
add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents:
712
diff
changeset
|
211 this.down('fset[name=messwerte]').down('messwertgrid').readOnly = true; |
693 | 212 this.down('fset[name=messungskommentare]').down('mkommentargrid').setReadOnly(true); |
824
fab0b7be5aca
add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents:
712
diff
changeset
|
213 this.down('fset[name=messungskommentare]').down('mkommentargrid').readOnly = true; |
1017
d8e74bd89d6b
Fixed Activation of StatusReset Button
Dustin Demuth <dustin@intevation.de>
parents:
997
diff
changeset
|
214 //this.disableStatusEdit(); |
d8e74bd89d6b
Fixed Activation of StatusReset Button
Dustin Demuth <dustin@intevation.de>
parents:
997
diff
changeset
|
215 //this.disableStatusReset(); |
693 | 216 }, |
217 | |
890
def27cdd0dfa
Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents:
875
diff
changeset
|
218 /** |
def27cdd0dfa
Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents:
875
diff
changeset
|
219 * Enable the Childelements of this window |
def27cdd0dfa
Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents:
875
diff
changeset
|
220 */ |
712 | 221 enableChildren: function() { |
693 | 222 this.down('fset[name=messwerte]').down('messwertgrid').setReadOnly(false); |
824
fab0b7be5aca
add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents:
712
diff
changeset
|
223 this.down('fset[name=messwerte]').down('messwertgrid').readOnly = false; |
965
a2c2039bb5d9
Disabled StatusGrid Edit when StatusEdit ist false, Load StatuswerteStore differently, removed a bunch of trailing commas
Dustin Demuth <dustin@intevation.de>
parents:
891
diff
changeset
|
224 this.down('fset[name=messungskommentare]').down('mkommentargrid').setReadOnly(false); |
a2c2039bb5d9
Disabled StatusGrid Edit when StatusEdit ist false, Load StatuswerteStore differently, removed a bunch of trailing commas
Dustin Demuth <dustin@intevation.de>
parents:
891
diff
changeset
|
225 this.down('fset[name=messungskommentare]').down('mkommentargrid').readOnly = false; |
1017
d8e74bd89d6b
Fixed Activation of StatusReset Button
Dustin Demuth <dustin@intevation.de>
parents:
997
diff
changeset
|
226 //this.enableStatusEdit(); |
d8e74bd89d6b
Fixed Activation of StatusReset Button
Dustin Demuth <dustin@intevation.de>
parents:
997
diff
changeset
|
227 //this.enableStatusReset(); |
965
a2c2039bb5d9
Disabled StatusGrid Edit when StatusEdit ist false, Load StatuswerteStore differently, removed a bunch of trailing commas
Dustin Demuth <dustin@intevation.de>
parents:
891
diff
changeset
|
228 }, |
a2c2039bb5d9
Disabled StatusGrid Edit when StatusEdit ist false, Load StatuswerteStore differently, removed a bunch of trailing commas
Dustin Demuth <dustin@intevation.de>
parents:
891
diff
changeset
|
229 |
a2c2039bb5d9
Disabled StatusGrid Edit when StatusEdit ist false, Load StatuswerteStore differently, removed a bunch of trailing commas
Dustin Demuth <dustin@intevation.de>
parents:
891
diff
changeset
|
230 /** |
996
bf7bb9583a40
Statusworkflow: More work on the reset Button
Dustin Demuth <dustin@intevation.de>
parents:
965
diff
changeset
|
231 * Enable to reset the statusgrid |
bf7bb9583a40
Statusworkflow: More work on the reset Button
Dustin Demuth <dustin@intevation.de>
parents:
965
diff
changeset
|
232 */ |
bf7bb9583a40
Statusworkflow: More work on the reset Button
Dustin Demuth <dustin@intevation.de>
parents:
965
diff
changeset
|
233 enableStatusReset: function() { |
bf7bb9583a40
Statusworkflow: More work on the reset Button
Dustin Demuth <dustin@intevation.de>
parents:
965
diff
changeset
|
234 this.down('fset[name=messungstatus]').down('statusgrid').setResetable(true); |
bf7bb9583a40
Statusworkflow: More work on the reset Button
Dustin Demuth <dustin@intevation.de>
parents:
965
diff
changeset
|
235 }, |
bf7bb9583a40
Statusworkflow: More work on the reset Button
Dustin Demuth <dustin@intevation.de>
parents:
965
diff
changeset
|
236 |
bf7bb9583a40
Statusworkflow: More work on the reset Button
Dustin Demuth <dustin@intevation.de>
parents:
965
diff
changeset
|
237 /** |
bf7bb9583a40
Statusworkflow: More work on the reset Button
Dustin Demuth <dustin@intevation.de>
parents:
965
diff
changeset
|
238 * Disable to reset the statusgrid |
bf7bb9583a40
Statusworkflow: More work on the reset Button
Dustin Demuth <dustin@intevation.de>
parents:
965
diff
changeset
|
239 */ |
bf7bb9583a40
Statusworkflow: More work on the reset Button
Dustin Demuth <dustin@intevation.de>
parents:
965
diff
changeset
|
240 disableStatusReset: function() { |
bf7bb9583a40
Statusworkflow: More work on the reset Button
Dustin Demuth <dustin@intevation.de>
parents:
965
diff
changeset
|
241 this.down('fset[name=messungstatus]').down('statusgrid').setResetable(false); |
bf7bb9583a40
Statusworkflow: More work on the reset Button
Dustin Demuth <dustin@intevation.de>
parents:
965
diff
changeset
|
242 }, |
bf7bb9583a40
Statusworkflow: More work on the reset Button
Dustin Demuth <dustin@intevation.de>
parents:
965
diff
changeset
|
243 /** |
965
a2c2039bb5d9
Disabled StatusGrid Edit when StatusEdit ist false, Load StatuswerteStore differently, removed a bunch of trailing commas
Dustin Demuth <dustin@intevation.de>
parents:
891
diff
changeset
|
244 * Enable to edit the statusgrid |
a2c2039bb5d9
Disabled StatusGrid Edit when StatusEdit ist false, Load StatuswerteStore differently, removed a bunch of trailing commas
Dustin Demuth <dustin@intevation.de>
parents:
891
diff
changeset
|
245 */ |
996
bf7bb9583a40
Statusworkflow: More work on the reset Button
Dustin Demuth <dustin@intevation.de>
parents:
965
diff
changeset
|
246 enableStatusEdit: function() { |
693 | 247 this.down('fset[name=messungstatus]').down('statusgrid').setReadOnly(false); |
824
fab0b7be5aca
add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents:
712
diff
changeset
|
248 this.down('fset[name=messungstatus]').down('statusgrid').readOnly = false; |
965
a2c2039bb5d9
Disabled StatusGrid Edit when StatusEdit ist false, Load StatuswerteStore differently, removed a bunch of trailing commas
Dustin Demuth <dustin@intevation.de>
parents:
891
diff
changeset
|
249 }, |
a2c2039bb5d9
Disabled StatusGrid Edit when StatusEdit ist false, Load StatuswerteStore differently, removed a bunch of trailing commas
Dustin Demuth <dustin@intevation.de>
parents:
891
diff
changeset
|
250 |
a2c2039bb5d9
Disabled StatusGrid Edit when StatusEdit ist false, Load StatuswerteStore differently, removed a bunch of trailing commas
Dustin Demuth <dustin@intevation.de>
parents:
891
diff
changeset
|
251 /** |
a2c2039bb5d9
Disabled StatusGrid Edit when StatusEdit ist false, Load StatuswerteStore differently, removed a bunch of trailing commas
Dustin Demuth <dustin@intevation.de>
parents:
891
diff
changeset
|
252 * Disable to edit the statusgrid |
a2c2039bb5d9
Disabled StatusGrid Edit when StatusEdit ist false, Load StatuswerteStore differently, removed a bunch of trailing commas
Dustin Demuth <dustin@intevation.de>
parents:
891
diff
changeset
|
253 */ |
996
bf7bb9583a40
Statusworkflow: More work on the reset Button
Dustin Demuth <dustin@intevation.de>
parents:
965
diff
changeset
|
254 disableStatusEdit: function() { |
965
a2c2039bb5d9
Disabled StatusGrid Edit when StatusEdit ist false, Load StatuswerteStore differently, removed a bunch of trailing commas
Dustin Demuth <dustin@intevation.de>
parents:
891
diff
changeset
|
255 this.down('fset[name=messungstatus]').down('statusgrid').setReadOnly(true); |
a2c2039bb5d9
Disabled StatusGrid Edit when StatusEdit ist false, Load StatuswerteStore differently, removed a bunch of trailing commas
Dustin Demuth <dustin@intevation.de>
parents:
891
diff
changeset
|
256 this.down('fset[name=messungstatus]').down('statusgrid').readOnly = true; |
a2c2039bb5d9
Disabled StatusGrid Edit when StatusEdit ist false, Load StatuswerteStore differently, removed a bunch of trailing commas
Dustin Demuth <dustin@intevation.de>
parents:
891
diff
changeset
|
257 }, |
576
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
258 |
890
def27cdd0dfa
Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents:
875
diff
changeset
|
259 /** |
def27cdd0dfa
Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents:
875
diff
changeset
|
260 * Instructs the fields / forms listed in this method to set a message. |
def27cdd0dfa
Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents:
875
diff
changeset
|
261 * @param errors These Errors shall be shown |
def27cdd0dfa
Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents:
875
diff
changeset
|
262 * @param warnings These Warning shall be shown |
def27cdd0dfa
Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents:
875
diff
changeset
|
263 */ |
576
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
264 setMessages: function(errors, warnings) { |
707
c632c7c34029
added disable/enableChildren Method
Dustin Demuth <dustin@intevation.de>
parents:
696
diff
changeset
|
265 this.down('messungform').setMessages(errors, warnings); |
576
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
266 }, |
890
def27cdd0dfa
Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents:
875
diff
changeset
|
267 |
def27cdd0dfa
Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents:
875
diff
changeset
|
268 /** |
def27cdd0dfa
Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents:
875
diff
changeset
|
269 * Instructs the fields / forms listed in this method to clear their messages. |
def27cdd0dfa
Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents:
875
diff
changeset
|
270 */ |
576
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
271 clearMessages: function() { |
707
c632c7c34029
added disable/enableChildren Method
Dustin Demuth <dustin@intevation.de>
parents:
696
diff
changeset
|
272 this.down('messungform').clearMessages(); |
576
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
273 } |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
274 |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
275 }); |