comparison app.js @ 715:605bc34b45a0

Disable the Fertig-Flag Checkbox in a Messung when the User is not the owner. Do not enable Form-Children when readonly is set to true. Parse login-response in app.js
author Dustin Demuth <dustin@intevation.de>
date Wed, 08 Apr 2015 15:28:25 +0200
parents 60a3e9809ea4
children b400629a2575
comparison
equal deleted inserted replaced
714:a8da0a5bacf9 715:605bc34b45a0
16 Ext.application({ 16 Ext.application({
17 17
18 // Name of the application. Do not change as this name is used in 18 // Name of the application. Do not change as this name is used in
19 // references! 19 // references!
20 name: 'Lada', 20 name: 'Lada',
21
22 username: '',
23 userroles: '',
24 logintime: '',
21 25
22 // Setting up translations. This is done using a ext-plgin which can be 26 // Setting up translations. This is done using a ext-plgin which can be
23 // found on https://github.com/elmasse/Ext.i18n.Bundle 27 // found on https://github.com/elmasse/Ext.i18n.Bundle
24 requires: [ 28 requires: [
25 'Lada.override.Table', 29 'Lada.override.Table',
96 } 100 }
97 Ext.MessageBox.alert('Kommunikation mit dem Lada Server fehlgeschlagen', 101 Ext.MessageBox.alert('Kommunikation mit dem Lada Server fehlgeschlagen',
98 'Es konnte keine erfolgreiche Verbindung zum lada server aufgebaut werden.'); 102 'Es konnte keine erfolgreiche Verbindung zum lada server aufgebaut werden.');
99 }, 103 },
100 104
101 onLoginSuccess: function() { 105 onLoginSuccess: function(response) {
102 /* Strip out the openid query params to look nicers. */ 106 /* Strip out the openid query params to look nicers. */
103 window.history.pushState(this.name, this.name, window.location.pathname); 107 window.history.pushState(this.name, this.name, window.location.pathname);
104 108
105 Ext.create('Lada.view.Viewport'); 109 Ext.create('Lada.view.Viewport');
106 110
107 /* Todo maybe parse username and such from login service response */ 111 /* Parse Username and Timestamp */
112 var json = Ext.decode(response.responseText);
113 this.username = json.data.username;
114 this.userroles = json.data.roles;
115 this.logintime = json.data.servertime;
116
108 Ext.create('Lada.store.Datenbasis', { 117 Ext.create('Lada.store.Datenbasis', {
109 storeId: 'datenbasis' 118 storeId: 'datenbasis'
110 }); 119 });
111 Ext.create('Lada.store.Messeinheiten', { 120 Ext.create('Lada.store.Messeinheiten', {
112 storeId: 'messeinheiten' 121 storeId: 'messeinheiten'

http://lada.wald.intevation.org