|
26 |
* /usr/share/common-licenses/AGPL-3; if not, see |
26 |
* /usr/share/common-licenses/AGPL-3; if not, see |
27 |
* <http://www.gnu.org/licenses/>. |
27 |
* <http://www.gnu.org/licenses/>. |
28 |
*/ |
28 |
*/ |
29 |
/*global define, window*/ |
29 |
/*global define*/ |
30 |
|
30 |
|
31 |
define([ |
31 |
define([ |
32 |
"dojo/_base/declare", |
32 |
"dojo/_base/declare", |
|
42 |
|
42 |
|
43 |
necessaryUdmValues: ["displayName", "mailPrimaryAddress", "firstname", "lastname"], |
43 |
necessaryUdmValues: ["displayName", "mailPrimaryAddress", "firstname", "lastname"], |
44 |
|
44 |
|
45 |
_queryTimer: null, |
|
|
46 |
|
47 |
_queryCache: null, |
48 |
|
49 |
_userImageNodes: {}, |
45 |
_userImageNodes: {}, |
50 |
|
46 |
|
51 |
grid: null, |
47 |
grid: null, |
52 |
|
48 |
|
53 |
setPicture: function(item) { |
49 |
setPicture: function(item) { |
54 |
if (this._queryTimer) { |
50 |
var url = lang.replace('/univention/command/udm/properties/users/user/jpegPhoto.jpg?dn={0}', [encodeURIComponent(item.$dn$)]); |
55 |
this.grid.moduleStore.get(item.$dn$); |
51 |
put(this._userImageNodes[item.$dn$], {style: lang.replace('background-image: url("{0}")', [url])}); |
56 |
} else { |
|
|
57 |
this._queryCache = this.grid.moduleStore.transaction(); |
58 |
this._queryTimer = window.setTimeout(lang.hitch(this, "_setPictures"), 100); |
59 |
this.grid.moduleStore.get(item.$dn$); |
60 |
} |
61 |
}, |
62 |
|
63 |
_setPictures: function() { |
64 |
this._queryTimer = null; |
65 |
this._queryCache.commit().then(lang.hitch(this, function(data) { |
66 |
array.forEach(data, function(item){ |
67 |
if (item.jpegPhoto) { |
68 |
//put(this._userImageNodes[item.$dn$], "+img.umcGridTileIcon[src=data:image/jpeg;base64," + item.jpegPhoto + "]"); |
69 |
put(this._userImageNodes[item.$dn$], "+div.umcGridTileIcon[style=background-image: url(data:image/jpeg;base64," + item.jpegPhoto + ")]"); |
70 |
} |
71 |
}, this); |
72 |
})); |
73 |
}, |
52 |
}, |
74 |
|
53 |
|
75 |
_getInitials: function(item) { |
54 |
_getInitials: function(item) { |