comparison app/controller/grid/Status.js @ 1225:19855757a950

Fix status reset.
author Tom Gottfried <tom@intevation.de>
date Thu, 27 Oct 2016 19:28:41 +0200
parents 4270da0f7d3b
children 3b4dcc83a21b
comparison
equal deleted inserted replaced
1224:5b5d9d7a771a 1225:19855757a950
179 }, 179 },
180 180
181 doReset: function(button) { 181 doReset: function(button) {
182 var i18n = Lada.getApplication().bundle; 182 var i18n = Lada.getApplication().bundle;
183 183
184 var resetStatusValue = 8;
185
186 var s = button.up('window').down('messungform').getCurrentStatus(); 184 var s = button.up('window').down('messungform').getCurrentStatus();
187 var messId = button.up('window').down('messungform').getRecord().get('id'); 185 var messId = button.up('window').down('messungform').getRecord().get('id');
188 186
189 if(!s) { 187 if(!s) {
190 Ext.Msg.alert(i18n.getMsg('err.msg.generic.title'), 188 Ext.Msg.alert(i18n.getMsg('err.msg.generic.title'),
191 i18n.getMsg('err.msg.generic.body')); 189 i18n.getMsg('err.msg.generic.body'));
192 return; 190 return;
193 } 191 }
192
194 //Set Status to 'Resetted' (8) 193 //Set Status to 'Resetted' (8)
195 var kombis = Ext.data.StoreManager.get('statuskombi'); 194 var kombis = Ext.data.StoreManager.get('statuskombi');
196 var stufe = kombis.getById(s.get('statusKombi')).raw.statusStufe.id; 195 var stufe = kombis.getById(s.get('statusKombi')).get('statusStufe').id;
197 var kombiNdx = kombis.findBy(function(record, id) { 196 var kombiNdx = kombis.findBy(function(record, id) {
198 if(record.raw.statusStufe.id === stufe && record.raw.statusWert.id === 8) { 197 return record.get('statusStufe').id === stufe
199 return true; 198 && record.get('statusWert').id === 8
200 }
201 }); 199 });
202 var record = s.copy(); 200 var record = s.copy();
203 record.set('datum', new Date()); 201 record.set('datum', new Date());
204 record.set('statusKombi', kombis.getAt(kombiNdx).get('id')); 202 record.set('statusKombi', kombis.getAt(kombiNdx).get('id'));
205 record.set('id', null); 203 record.set('id', null);

http://lada.wald.intevation.org