annotate app/view/window/GenProbenFromMessprogramm.js @ 995:fb424948de02

Merged heads
author Dustin Demuth <dustin@intevation.de>
date Thu, 07 Jan 2016 16:20:48 +0100
parents f220ba587c89
children f73ca04d73a7
rev   line source
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
3 *
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU GPL (v>=3)
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
7 */
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
8
891
8054232535ba More JSduck
Dustin Demuth <dustin@intevation.de>
parents: 890
diff changeset
9 /**
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
10 * Window to generate Proben from a Messprogramm
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
11 */
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
12 Ext.define('Lada.view.window.GenProbenFromMessprogramm', {
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
13 extend: 'Ext.window.Window',
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
14 alias: 'widget.genpfm',
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
15
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
16 collapsible: true,
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
17 maximizable: true,
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
18 autoShow: true,
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
19 autoScroll: true,
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
20 layout: 'fit',
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
21 constrain: true,
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
22
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
23 record: null,
818
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 812
diff changeset
24 parentWindow: null,
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
25
890
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 882
diff changeset
26 /**
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 882
diff changeset
27 * This function initialises the Window
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 882
diff changeset
28 */
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
29 initComponent: function() {
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
30 var i18n = Lada.getApplication().bundle;
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
31
818
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 812
diff changeset
32 // add listeners to change the window appearence when it becomes inactive
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 812
diff changeset
33 this.on({
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 812
diff changeset
34 activate: function(){
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 812
diff changeset
35 this.getEl().removeCls('window-inactive');
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 812
diff changeset
36 },
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 812
diff changeset
37 deactivate: function(){
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 812
diff changeset
38 this.getEl().addCls('window-inactive');
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 812
diff changeset
39 }
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 812
diff changeset
40 });
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 812
diff changeset
41
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
42 this.title = i18n.getMsg('gpfm.window.title');
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
43 var me = this;
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
44 this.buttons = [{
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
45 text: i18n.getMsg('cancel'),
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
46 scope: this,
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
47 handler: this.close
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
48 }, {
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
49 text: i18n.getMsg('generateproben'),
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
50 handler: function() {
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
51 var jsondata = {
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
52 id: me.record.id,
761
975183ab775e Sending Date as timestamp
Dustin Demuth <dustin@intevation.de>
parents: 760
diff changeset
53 start: new Date(me.down('datetime [name=start]').getValue()).valueOf(),
975183ab775e Sending Date as timestamp
Dustin Demuth <dustin@intevation.de>
parents: 760
diff changeset
54 end: new Date(me.down('datetime [name=end]').getValue()).valueOf()
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
55 };
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
56
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
57
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
58 Ext.Ajax.request({
831
e3bd911b576b Fixed url for 'proben generieren' request.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 819
diff changeset
59 url: 'lada-server/probe/messprogramm',
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
60 method: 'POST',
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
61 jsonData: jsondata,
809
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
62 success: function(response) {
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
63 var json = Ext.JSON.decode(response.responseText);
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
64 Ext.Msg.show({
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
65 title: i18n.getMsg('success'),
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
66 autoScroll: true,
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
67 msg: me.evalResponse(json),
882
f1e964b3aad6 Trailing Commas
Dustin Demuth <dustin@intevation.de>
parents: 861
diff changeset
68 buttons: Ext.Msg.OK
809
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
69 });
859
6249b731d438 Close messprogramm windows on probe generation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 855
diff changeset
70 me.close();
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
71 },
809
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
72 failure: function(response) {
855
dff2798390f8 Better Error handling
Dustin Demuth <dustin@intevation.de>
parents: 834
diff changeset
73 var json = null;
dff2798390f8 Better Error handling
Dustin Demuth <dustin@intevation.de>
parents: 834
diff changeset
74 try {
dff2798390f8 Better Error handling
Dustin Demuth <dustin@intevation.de>
parents: 834
diff changeset
75 json = Ext.JSON.decode(response.responseText);
dff2798390f8 Better Error handling
Dustin Demuth <dustin@intevation.de>
parents: 834
diff changeset
76 }
dff2798390f8 Better Error handling
Dustin Demuth <dustin@intevation.de>
parents: 834
diff changeset
77 catch(err){
dff2798390f8 Better Error handling
Dustin Demuth <dustin@intevation.de>
parents: 834
diff changeset
78 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.generic.title'),
dff2798390f8 Better Error handling
Dustin Demuth <dustin@intevation.de>
parents: 834
diff changeset
79 Lada.getApplication().bundle.getMsg('err.msg.response.body'));
dff2798390f8 Better Error handling
Dustin Demuth <dustin@intevation.de>
parents: 834
diff changeset
80 }
809
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
81 if (json) {
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
82 if(json.errors.totalCount > 0 || json.warnings.totalCount > 0){
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
83 formPanel.setMessages(json.errors, json.warnings);
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
84 }
920
f220ba587c89 Adopted Client to SSO, detect a Sessiontimeout and reload the application
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
85 /*
f220ba587c89 Adopted Client to SSO, detect a Sessiontimeout and reload the application
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
86 SSO will send a 302 if the Client is not authenticated
f220ba587c89 Adopted Client to SSO, detect a Sessiontimeout and reload the application
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
87 unfortunately this seems to be filtered by the browser.
f220ba587c89 Adopted Client to SSO, detect a Sessiontimeout and reload the application
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
88 We assume that a 302 was send when the follwing statement
f220ba587c89 Adopted Client to SSO, detect a Sessiontimeout and reload the application
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
89 is true.
f220ba587c89 Adopted Client to SSO, detect a Sessiontimeout and reload the application
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
90 */
f220ba587c89 Adopted Client to SSO, detect a Sessiontimeout and reload the application
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
91 if (response.status == 0 && response.responseText === "") {
812
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
92 Ext.MessageBox.confirm('Erneutes Login erforderlich',
920
f220ba587c89 Adopted Client to SSO, detect a Sessiontimeout and reload the application
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
93 'Ihre Session ist abgelaufen.<br/>'+
812
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
94 'Für ein erneutes Login muss die Anwendung neu geladen werden.<br/>' +
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
95 'Alle ungesicherten Daten gehen dabei verloren.<br/>' +
920
f220ba587c89 Adopted Client to SSO, detect a Sessiontimeout and reload the application
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
96 'Soll die Anwendung jetzt neu geladen werden?', this.reload);
812
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
97 }
920
f220ba587c89 Adopted Client to SSO, detect a Sessiontimeout and reload the application
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
98 // further error handling
f220ba587c89 Adopted Client to SSO, detect a Sessiontimeout and reload the application
Dustin Demuth <dustin@intevation.de>
parents: 891
diff changeset
99 if(json.message){
812
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
100 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.generic.title')
809
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
101 +' #'+json.message,
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
102 Lada.getApplication().bundle.getMsg(json.message));
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
103 } else {
812
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
104 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.generic.title'),
809
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
105 Lada.getApplication().bundle.getMsg('err.msg.generic.body'));
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
106 }
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
107 } else {
812
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
108 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.generic.title'),
809
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
109 Lada.getApplication().bundle.getMsg('err.msg.response.body'));
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
110 }
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
111 }
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
112 });
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
113 }
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
114 }];
834
2214aea9fd3a Patched correct file of r. 832
Dustin Demuth <dustin@intevation.de>
parents: 833
diff changeset
115 this.width = 350;
2214aea9fd3a Patched correct file of r. 832
Dustin Demuth <dustin@intevation.de>
parents: 833
diff changeset
116 this.height = 250;
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
117
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
118 // add listeners to change the window appearence when it becomes inactive
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
119 this.on({
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
120 activate: function(){
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
121 this.getEl().removeCls('window-inactive');
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
122 },
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
123 deactivate: function(){
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
124 this.getEl().addCls('window-inactive');
818
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 812
diff changeset
125 },
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 812
diff changeset
126 close: function () {
860
03f39ddae596 Restructured Filterresultgrid button-dock, added button to generate Proben from a selection of messprogramme.
Dustin Demuth <dustin@intevation.de>
parents: 855
diff changeset
127 if (this.parentWindow) {
03f39ddae596 Restructured Filterresultgrid button-dock, added button to generate Proben from a selection of messprogramme.
Dustin Demuth <dustin@intevation.de>
parents: 855
diff changeset
128 this.parentWindow.probenWindow = null;
03f39ddae596 Restructured Filterresultgrid button-dock, added button to generate Proben from a selection of messprogramme.
Dustin Demuth <dustin@intevation.de>
parents: 855
diff changeset
129 }
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
130 }
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
131 });
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
132
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
133 // InitialConfig is the config object passed to the constructor on
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
134 // creation of this window. We need to pass it throuh to the form as
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
135 // we need the "Id" param to load the correct item.
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
136 this.items = [{
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
137 border: 0,
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
138 autoScroll: true,
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
139 items: [{
807
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
140 xtype: 'panel',
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
141 border: 0,
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
142 margin: 5,
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
143 layout: 'fit',
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
144 html: '<p>'
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
145 + i18n.getMsg('nameofmessprogramm')
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
146 + '<br/>'
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
147 + this.record.get('name')
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
148 + '</p>'
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
149 }, {
807
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
150 xtype: 'panel',
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
151 border: 0,
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
152 margin: 5,
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
153 layout: 'fit',
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
154 html: '<p>' + i18n.getMsg('messprogtimeperiod') + '</p>'
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
155 }, {
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
156 xtype: 'datetime',
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
157 fieldLabel: i18n.getMsg('from'),
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
158 labelWidth: 90,
807
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
159 margin: 5,
834
2214aea9fd3a Patched correct file of r. 832
Dustin Demuth <dustin@intevation.de>
parents: 833
diff changeset
160 width: 300,
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
161 name: 'start',
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
162 format: 'd.m.Y H:i',
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
163 period: 'start'
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
164 }, {
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
165 xtype: 'datetime',
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
166 fieldLabel: i18n.getMsg('to'),
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
167 labelWidth: 90,
807
18697326c862 Less ugly
Dustin Demuth <dustin@intevation.de>
parents: 761
diff changeset
168 margin: 5,
834
2214aea9fd3a Patched correct file of r. 832
Dustin Demuth <dustin@intevation.de>
parents: 833
diff changeset
169 width: 300,
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
170 name: 'end',
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
171 format: 'd.m.Y H:i',
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
172 period: 'end'
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
173 }]
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
174 }];
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
175 this.callParent(arguments);
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
176 },
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
177
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
178 /**
890
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 882
diff changeset
179 * Initiatlise the Data
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
180 */
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
181 initData: function() {
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
182 var i18n = Lada.getApplication().bundle;
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
183 me = this;
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
184 },
809
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
185
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
186 /**
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
187 * Parse ServerResponse when Proben have been generated
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
188 */
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
189 evalResponse: function(response) {
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
190 var i18n = Lada.getApplication().bundle;
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
191 var r = '';
812
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
192 r += response.data.length;
809
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
193 r += ' ' + i18n.getMsg('probecreated');
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
194 r += '<br/>';
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
195 r += i18n.getMsg('probeids');
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
196 var i;
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
197 for (i in response.data){
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
198 r += '<br/>';
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
199 r += response.data[i].probeIdAlt
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
200 }
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
201 return r;
812
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
202 },
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
203
890
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 882
diff changeset
204 /**
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 882
diff changeset
205 * Reload the Application
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 882
diff changeset
206 */
812
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
207 reload: function(btn) {
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
208 if (btn === 'yes') {
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
209 location.reload();
188a9faf96e0 Added Errorhandling for AJAX-Requests, especially Authentication Issues.
Dustin Demuth <dustin@intevation.de>
parents: 809
diff changeset
210 }
809
3bc19188fc3a Added some todos, Enhanced Proge-Generation Success Msg.
Dustin Demuth <dustin@intevation.de>
parents: 807
diff changeset
211 }
760
2e7e1a8bf79f Added a Window and Buttons to generate Proben from a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
212 });

http://lada.wald.intevation.org