annotate app/view/window/SetStatus.js @ 1228:d5b9a5c75872

Enable validation for SetStatus window.
author Tom Gottfried <tom@intevation.de>
date Fri, 28 Oct 2016 13:43:06 +0200
parents 66d4b392bc5f
children 38599f18c863
rev   line source
1082
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
3 *
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU GPL (v>=3)
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
7 */
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
8
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
9 /**
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
10 * This is a simple Window to set the Status for multiple Messungen on bulk.
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
11 */
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
12 Ext.define('Lada.view.window.SetStatus', {
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
13 extend: 'Ext.window.Window',
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
14 alias: 'setstatuswindow',
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
15
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
16 requires: [
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
17 'Lada.view.widget.Status'
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
18 ],
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
19
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
20 grid: null,
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
21 selection: null,
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
22
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
23 modal: true,
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
24 closable: false,
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
25 resultMessage: '',
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
26
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
27 /**
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
28 * This function initialises the Window
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
29 */
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
30 initComponent: function() {
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
31 var i18n = Lada.getApplication().bundle;
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
32 var me = this;
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
33 this.items = [{
1228
d5b9a5c75872 Enable validation for SetStatus window.
Tom Gottfried <tom@intevation.de>
parents: 1114
diff changeset
34 xtype: 'form',
1082
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
35 name: 'valueselection',
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
36 border: 0,
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
37 items: [{
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
38 xtype: 'fieldset',
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
39 title: 'Status für ' + this.selection.length + ' Messung(en) setzen',
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
40 margin: '5, 5, 10, 5',
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
41 items: [{
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
42 xtype: 'combobox',
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
43 store: Ext.data.StoreManager.get('messstellenFiltered'),
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
44 displayField: 'messStelle',
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
45 valueField: 'id',
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
46 allowBlank: false,
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
47 queryMode: 'local',
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
48 editable: false,
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
49 width: 300,
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
50 labelWidth: 100,
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
51 emptyText: 'Wählen Sie einen Erzeuger aus.',
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
52 fieldLabel: i18n.getMsg('statusgrid.header.erzeuger')
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
53 }, {
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
54 xtype: 'statuswert',
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
55 allowBlank: false,
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
56 width: 300,
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
57 labelWidth: 100,
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
58 fieldLabel: i18n.getMsg('statusgrid.header.statusWert')
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
59 }, {
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
60 xtype: 'textarea',
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
61 width: 300,
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
62 height: 100,
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
63 labelWidth: 100,
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
64 fieldLabel: i18n.getMsg('statusgrid.header.text'),
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
65 emptyText: 'Geben Sie einen Kommentar ein.'
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
66 }]
1228
d5b9a5c75872 Enable validation for SetStatus window.
Tom Gottfried <tom@intevation.de>
parents: 1114
diff changeset
67 }],
d5b9a5c75872 Enable validation for SetStatus window.
Tom Gottfried <tom@intevation.de>
parents: 1114
diff changeset
68 buttons: [{
d5b9a5c75872 Enable validation for SetStatus window.
Tom Gottfried <tom@intevation.de>
parents: 1114
diff changeset
69 text: i18n.getMsg('statusSetzen'),
d5b9a5c75872 Enable validation for SetStatus window.
Tom Gottfried <tom@intevation.de>
parents: 1114
diff changeset
70 name: 'start',
d5b9a5c75872 Enable validation for SetStatus window.
Tom Gottfried <tom@intevation.de>
parents: 1114
diff changeset
71 icon: 'resources/img/mail-mark-notjunk.png',
d5b9a5c75872 Enable validation for SetStatus window.
Tom Gottfried <tom@intevation.de>
parents: 1114
diff changeset
72 formBind: true,
d5b9a5c75872 Enable validation for SetStatus window.
Tom Gottfried <tom@intevation.de>
parents: 1114
diff changeset
73 disabled: true,
d5b9a5c75872 Enable validation for SetStatus window.
Tom Gottfried <tom@intevation.de>
parents: 1114
diff changeset
74 handler: this.setStatus
d5b9a5c75872 Enable validation for SetStatus window.
Tom Gottfried <tom@intevation.de>
parents: 1114
diff changeset
75 }, {
d5b9a5c75872 Enable validation for SetStatus window.
Tom Gottfried <tom@intevation.de>
parents: 1114
diff changeset
76 text: i18n.getMsg('cancel'),
d5b9a5c75872 Enable validation for SetStatus window.
Tom Gottfried <tom@intevation.de>
parents: 1114
diff changeset
77 name: 'abort',
d5b9a5c75872 Enable validation for SetStatus window.
Tom Gottfried <tom@intevation.de>
parents: 1114
diff changeset
78 handler: this.closeWindow
1082
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
79 }]
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
80 }, {
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
81 xtype: 'panel',
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
82 hidden: true,
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
83 margin: '5, 5, 5, 5',
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
84 overflow: 'auto',
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
85 name: 'result'
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
86 }, {
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
87 xtype: 'progressbar',
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
88 margin: '5, 5, 5, 5',
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
89 hidden: true,
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
90 text: 'Verarbeite Statusänderungen'
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
91 }];
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
92 this.buttons = [{
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
93 text: i18n.getMsg('close'),
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
94 name: 'close',
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
95 hidden: true,
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
96 handler: this.closeWindow
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
97 }];
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
98
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
99 this.callParent(arguments);
1228
d5b9a5c75872 Enable validation for SetStatus window.
Tom Gottfried <tom@intevation.de>
parents: 1114
diff changeset
100
d5b9a5c75872 Enable validation for SetStatus window.
Tom Gottfried <tom@intevation.de>
parents: 1114
diff changeset
101 // Initially validate to indicate mandatory fields clearly.
d5b9a5c75872 Enable validation for SetStatus window.
Tom Gottfried <tom@intevation.de>
parents: 1114
diff changeset
102 this.down('form').isValid();
1082
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
103 },
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
104
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
105 /**
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
106 * @private
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
107 * A handler for a Abort-Button
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
108 */
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
109 closeWindow: function(button) {
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
110 var win = button.up('window');
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
111 win.close();
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
112 },
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
113
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
114 /**
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
115 * @private
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
116 * A handler to setStatus on Bulk.
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
117 */
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
118 setStatus: function(button) {
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
119 var win = button.up('window');
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
120 win.down('panel').disable();
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
121 win.down('button[name=start]').disable();
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
122 win.down('button[name=abort]').disable();
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
123 var progress = win.down('progressbar');
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
124 progress.show();
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
125 win.send();
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
126 },
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
127
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
128 send: function() {
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
129 var i18n = Lada.getApplication().bundle;
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
130 var me = this;
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
131 var progress = me.down('progressbar');
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
132 var progressText = progress.getText();
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
133 var count = 0;
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
134 for (var i = 0; i < this.selection.length; i++) {
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
135 var data = Ext.create('Lada.model.Status', {
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
136 messungsId: this.selection[i].get('id'),
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
137 erzeuger: this.down('combobox').getValue(),
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
138 datum: new Date(),
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
139 statusWert: this.down('statuswert').getValue(),
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
140 text: this.down('textarea').getValue()
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
141 });
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
142 Ext.Ajax.request({
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
143 url: 'lada-server/rest/status',
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
144 method: 'POST',
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
145 jsonData: data.raw,
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
146 success: function(response) {
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
147 var json = Ext.JSON.decode(response.responseText);
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
148 me.resultMessage += '<strong>' + i18n.getMsg('messung') + ': ';
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
149 var sel = me.selection[count];
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
150 me.resultMessage += sel.get('hauptprobenNr') + ' - ' + sel.get('nebenprobenNr') + '</strong><br><dd>';
1099
7a71723fda83 Added status protocol specific messages.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1082
diff changeset
151 me.resultMessage += i18n.getMsg('status-' + json.message) + '</dd><br>';
1082
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
152 count++;
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
153 progress.updateProgress(count / me.selection.length, progressText + ' (' + count + ')');
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
154 if (count === me.selection.length) {
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
155 var result = me.down('panel[name=result]');
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
156 var values = me.down('panel[name=valueselection]');
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
157 me.down('button[name=start]').hide();
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
158 me.down('button[name=abort]').hide();
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
159 me.down('button[name=close]').show();
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
160 result.setSize(values.getWidth(), values.getHeight());
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
161 result.getEl().setHTML(me.resultMessage);
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
162 result.show();
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
163 values.hide();
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
164 }
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
165 },
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
166 failure: function(response) {
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
167 console.log(response);
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
168 count++;
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
169 progress.updateProgress(count / me.selection.length);
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
170 if (count === me.selection.length) {
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
171 me.close();
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
172 }
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
173 }
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
174 });
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
175 }
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
176 }
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
177 });
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
178

http://lada.wald.intevation.org