Mercurial > lada > lada-client
annotate app/view/window/SetStatus.js @ 1181:52bf58630e58 schema-update
Updated model.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Wed, 31 Aug 2016 15:54:12 +0200 |
parents | 66d4b392bc5f |
children | d5b9a5c75872 |
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 = [{ |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
34 xtype: 'panel', |
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 }] |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
67 }] |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
68 }, { |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
69 xtype: 'panel', |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
70 hidden: true, |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
71 margin: '5, 5, 5, 5', |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
72 overflow: 'auto', |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
73 name: 'result' |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
74 }, { |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
75 xtype: 'progressbar', |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
76 margin: '5, 5, 5, 5', |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
77 hidden: true, |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
78 text: 'Verarbeite Statusänderungen' |
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 this.buttons = [{ |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
81 text: i18n.getMsg('statusSetzen'), |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
82 name: 'start', |
1114
66d4b392bc5f
Adapt icon for button to Rev 05948135ce75.
Tom Gottfried <tom@intevation.de>
parents:
1099
diff
changeset
|
83 icon: 'resources/img/mail-mark-notjunk.png', |
1082
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
84 handler: this.setStatus |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
85 }, { |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
86 text: i18n.getMsg('cancel'), |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
87 name: 'abort', |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
88 handler: this.closeWindow |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
89 }, { |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
90 text: i18n.getMsg('close'), |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
91 name: 'close', |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
92 hidden: true, |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
93 handler: this.closeWindow |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
94 }]; |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
95 |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
96 this.callParent(arguments); |
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 /** |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
100 * @private |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
101 * A handler for a Abort-Button |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
102 */ |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
103 closeWindow: function(button) { |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
104 var win = button.up('window'); |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
105 win.close(); |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
106 }, |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
107 |
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 * @private |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
110 * A handler to setStatus on Bulk. |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
111 */ |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
112 setStatus: function(button) { |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
113 var win = button.up('window'); |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
114 win.down('panel').disable(); |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
115 win.down('button[name=start]').disable(); |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
116 win.down('button[name=abort]').disable(); |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
117 var progress = win.down('progressbar'); |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
118 progress.show(); |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
119 win.send(); |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
120 }, |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
121 |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
122 send: function() { |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
123 var i18n = Lada.getApplication().bundle; |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
124 var me = this; |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
125 var progress = me.down('progressbar'); |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
126 var progressText = progress.getText(); |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
127 var count = 0; |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
128 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
|
129 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
|
130 messungsId: this.selection[i].get('id'), |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
131 erzeuger: this.down('combobox').getValue(), |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
132 datum: new Date(), |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
133 statusWert: this.down('statuswert').getValue(), |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
134 text: this.down('textarea').getValue() |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
135 }); |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
136 Ext.Ajax.request({ |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
137 url: 'lada-server/rest/status', |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
138 method: 'POST', |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
139 jsonData: data.raw, |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
140 success: function(response) { |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
141 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
|
142 me.resultMessage += '<strong>' + i18n.getMsg('messung') + ': '; |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
143 var sel = me.selection[count]; |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
144 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
|
145 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
|
146 count++; |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
147 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
|
148 if (count === me.selection.length) { |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
149 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
|
150 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
|
151 me.down('button[name=start]').hide(); |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
152 me.down('button[name=abort]').hide(); |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
153 me.down('button[name=close]').show(); |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
154 result.setSize(values.getWidth(), values.getHeight()); |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
155 result.getEl().setHTML(me.resultMessage); |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
156 result.show(); |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
157 values.hide(); |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
158 } |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
159 }, |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
160 failure: function(response) { |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
161 console.log(response); |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
162 count++; |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
163 progress.updateProgress(count / me.selection.length); |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
164 if (count === me.selection.length) { |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
165 me.close(); |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
166 } |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
167 } |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
168 }); |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
169 } |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
170 } |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
171 }); |
dbd435256f77
Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
172 |