annotate app/view/window/MessungCreate.js @ 1126:f1d234a7adc7

merged.
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 24 May 2016 10:41:07 +0200
parents 859e2e9859cd
children 5e3d4136ecfb
rev   line source
621
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
3 *
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU GPL (v>=3)
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
7 */
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
8
891
8054232535ba More JSduck
Dustin Demuth <dustin@intevation.de>
parents: 890
diff changeset
9 /**
875
13c0e64e1873 Applied Patch which was presented in the Workshop: Title of a Messung-Window contains more details
Dustin Demuth <dustin@intevation.de>
parents: 709
diff changeset
10 * Window to create a Messung
621
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
11 */
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
12 Ext.define('Lada.view.window.MessungCreate', {
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
13 extend: 'Ext.window.Window',
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
14 alias: 'widget.messungcreate',
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
15
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
16 requires: [
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
17 'Lada.view.form.Messung'
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
18 ],
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
19
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
20 collapsible: true,
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
21 maximizable: true,
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
22 autoshow: true,
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
23 autoscroll: true,
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
24 layout: 'fit',
688
6a6d1b02a1a3 constrain windows to viewport
Dustin Demuth <dustin@intevation.de>
parents: 644
diff changeset
25 constrain: true,
621
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
26
875
13c0e64e1873 Applied Patch which was presented in the Workshop: Title of a Messung-Window contains more details
Dustin Demuth <dustin@intevation.de>
parents: 709
diff changeset
27 probe: null,
621
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
28 record: null,
644
71e8b84d7829 Reload grids on messung or ort changed/added.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 621
diff changeset
29 grid: null,
621
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
30
890
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 875
diff changeset
31 /**
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 875
diff changeset
32 * This function initialises the Window
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 875
diff changeset
33 */
621
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
34 initComponent: function() {
875
13c0e64e1873 Applied Patch which was presented in the Workshop: Title of a Messung-Window contains more details
Dustin Demuth <dustin@intevation.de>
parents: 709
diff changeset
35 this.probe = this.record;
13c0e64e1873 Applied Patch which was presented in the Workshop: Title of a Messung-Window contains more details
Dustin Demuth <dustin@intevation.de>
parents: 709
diff changeset
36 if (this.probe === null) {
13c0e64e1873 Applied Patch which was presented in the Workshop: Title of a Messung-Window contains more details
Dustin Demuth <dustin@intevation.de>
parents: 709
diff changeset
37 Ext.Msg.alert('Zu der Messung existiert keine Probe!');
13c0e64e1873 Applied Patch which was presented in the Workshop: Title of a Messung-Window contains more details
Dustin Demuth <dustin@intevation.de>
parents: 709
diff changeset
38 this.callParent(arguments);
13c0e64e1873 Applied Patch which was presented in the Workshop: Title of a Messung-Window contains more details
Dustin Demuth <dustin@intevation.de>
parents: 709
diff changeset
39 return;
13c0e64e1873 Applied Patch which was presented in the Workshop: Title of a Messung-Window contains more details
Dustin Demuth <dustin@intevation.de>
parents: 709
diff changeset
40 }
13c0e64e1873 Applied Patch which was presented in the Workshop: Title of a Messung-Window contains more details
Dustin Demuth <dustin@intevation.de>
parents: 709
diff changeset
41
13c0e64e1873 Applied Patch which was presented in the Workshop: Title of a Messung-Window contains more details
Dustin Demuth <dustin@intevation.de>
parents: 709
diff changeset
42 var messstelle = Ext.data.StoreManager.get('messstellen')
13c0e64e1873 Applied Patch which was presented in the Workshop: Title of a Messung-Window contains more details
Dustin Demuth <dustin@intevation.de>
parents: 709
diff changeset
43 .getById(this.probe.get('mstId'));
13c0e64e1873 Applied Patch which was presented in the Workshop: Title of a Messung-Window contains more details
Dustin Demuth <dustin@intevation.de>
parents: 709
diff changeset
44
13c0e64e1873 Applied Patch which was presented in the Workshop: Title of a Messung-Window contains more details
Dustin Demuth <dustin@intevation.de>
parents: 709
diff changeset
45 this.title = 'Neue Messung zu Probe: '
13c0e64e1873 Applied Patch which was presented in the Workshop: Title of a Messung-Window contains more details
Dustin Demuth <dustin@intevation.de>
parents: 709
diff changeset
46 + this.probe.get('probeIdAlt')
13c0e64e1873 Applied Patch which was presented in the Workshop: Title of a Messung-Window contains more details
Dustin Demuth <dustin@intevation.de>
parents: 709
diff changeset
47 + ' Mst: ' + messstelle.get('messStelle')
13c0e64e1873 Applied Patch which was presented in the Workshop: Title of a Messung-Window contains more details
Dustin Demuth <dustin@intevation.de>
parents: 709
diff changeset
48 + ' hinzufügen.';
13c0e64e1873 Applied Patch which was presented in the Workshop: Title of a Messung-Window contains more details
Dustin Demuth <dustin@intevation.de>
parents: 709
diff changeset
49
621
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
50 this.buttons = [{
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
51 text: 'Schließen',
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
52 scope: this,
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
53 handler: this.close
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
54 }];
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
55 this.width = 700;
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
56
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
57 // 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
58 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
59 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
60 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
61 },
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 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
63 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
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 });
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
66
621
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
67 this.items = [{
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
68 border: 0,
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
69 autoScroll: true,
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
70 items: [{
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
71 xtype: 'messungform'
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
72 }]
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
73 }];
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
74 this.callParent(arguments);
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
75 },
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
76
890
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 875
diff changeset
77 /**
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 875
diff changeset
78 * Initialise the Data of this Window
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 875
diff changeset
79 */
621
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
80 initData: function() {
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
81 this.clearMessages();
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
82 var messung = Ext.create('Lada.model.Messung', {
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
83 probeId: this.record.get('id')
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
84 });
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
85 this.down('messungform').setRecord(messung);
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
86 },
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
87
890
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 875
diff changeset
88 /**
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 875
diff changeset
89 * 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
90 * @param errors These Errors shall be shown
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 875
diff changeset
91 * @param warnings These Warning shall be shown
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 875
diff changeset
92 */
621
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
93 setMessages: function(errors, warnings) {
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
94 //todo this is a stub
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
95 },
890
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 875
diff changeset
96
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 875
diff changeset
97 /**
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 875
diff changeset
98 * 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
99 */
621
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
100 clearMessages: function() {
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
101 //todo this is a stub
707
c632c7c34029 added disable/enableChildren Method
Dustin Demuth <dustin@intevation.de>
parents: 688
diff changeset
102 },
c632c7c34029 added disable/enableChildren Method
Dustin Demuth <dustin@intevation.de>
parents: 688
diff changeset
103
890
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 875
diff changeset
104 /**
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 875
diff changeset
105 * Disable the Childelements of this Window
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 875
diff changeset
106 */
707
c632c7c34029 added disable/enableChildren Method
Dustin Demuth <dustin@intevation.de>
parents: 688
diff changeset
107 disableChildren: function(){
c632c7c34029 added disable/enableChildren Method
Dustin Demuth <dustin@intevation.de>
parents: 688
diff changeset
108 //intentionally!
c632c7c34029 added disable/enableChildren Method
Dustin Demuth <dustin@intevation.de>
parents: 688
diff changeset
109 return true;
c632c7c34029 added disable/enableChildren Method
Dustin Demuth <dustin@intevation.de>
parents: 688
diff changeset
110 },
c632c7c34029 added disable/enableChildren Method
Dustin Demuth <dustin@intevation.de>
parents: 688
diff changeset
111
890
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 875
diff changeset
112 /**
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 875
diff changeset
113 * Enable the Childelements of this Window
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 875
diff changeset
114 */
707
c632c7c34029 added disable/enableChildren Method
Dustin Demuth <dustin@intevation.de>
parents: 688
diff changeset
115 enableChildren: function(){
c632c7c34029 added disable/enableChildren Method
Dustin Demuth <dustin@intevation.de>
parents: 688
diff changeset
116 //intentionally!
c632c7c34029 added disable/enableChildren Method
Dustin Demuth <dustin@intevation.de>
parents: 688
diff changeset
117 return true;
1027
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
118 },
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
119
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
120 /**
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
121 * Enable to reset the statusgrid
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
122 */
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
123 enableStatusReset: function() {
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
124 //intentionally!
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
125 return true;
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
126 },
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
127
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
128 /**
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
129 * Disable to reset the statusgrid
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
130 */
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
131 disableStatusReset: function() {
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
132 //intentionally!
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
133 return true;
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
134 },
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
135 /**
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
136 * Enable to edit the statusgrid
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
137 */
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
138 enableStatusEdit: function() {
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
139 //intentionally!
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
140 return true;
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
141 },
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
142
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
143 /**
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
144 * Disable to edit the statusgrid
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
145 */
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
146 disableStatusEdit: function() {
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
147 //intentionally!
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
148 return true;
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
149 }
621
c3c8a3be5117 Added messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
150 });

http://lada.wald.intevation.org