|
35 | 35 | var Data = xtens.module("data");
|
36 | 36 | var Sample = xtens.module("sample");
|
37 | 37 | var DataFile = xtens.module("datafile");
|
| 38 | + var AddressInformation = xtens.module("addressinformation"); |
38 | 39 | var VIEW_OVERVIEW = Privileges.VIEW_OVERVIEW;
|
39 | 40 | var ModalDialog = xtens.module("xtensbootstrap").Views.ModalDialog;
|
40 | 41 |
|
|
167 | 168 | return pr.id === data.type;
|
168 | 169 | });
|
169 | 170 |
|
| 171 | + var address = new AddressInformation.Model({id: data.owner_address}); |
| 172 | + var addressDeferred = address.fetch(); |
170 | 173 |
|
171 |
| - if (that.modal) { |
172 |
| - that.modal.hide(); |
173 |
| - } |
174 |
| - var modal = new ModalDialog({ |
175 |
| - template: JST["views/templates/address-modal.ejs"], |
176 |
| - data: { __: i18n, project: project[0], data: data} |
177 |
| - }); |
| 174 | + $.when(addressDeferred).then(function(addressRes) { |
| 175 | + if (that.modal) { |
| 176 | + that.modal.hide(); |
| 177 | + } |
| 178 | + var modal = new ModalDialog({ |
| 179 | + template: JST["views/templates/address-modal.ejs"], |
| 180 | + data: { __: i18n, project: project[0], data: data, address: addressRes} |
| 181 | + }); |
178 | 182 |
|
179 |
| - that.$modal.append(modal.render().el); |
180 |
| - modal.show(); |
| 183 | + that.$modal.append(modal.render().el); |
| 184 | + modal.show(); |
181 | 185 |
|
182 |
| - that.$('.query-modal').on('hidden.bs.modal', function (e) { |
183 |
| - modal.remove(); |
184 |
| - $('.modal-backdrop').remove(); |
| 186 | + that.$('.query-modal').on('hidden.bs.modal', function (e) { |
| 187 | + modal.remove(); |
| 188 | + $('.modal-backdrop').remove(); |
| 189 | + }); |
185 | 190 | });
|
186 | 191 |
|
187 | 192 | } );
|
|
219 | 224 | }
|
220 | 225 | var flattenedFields = this.dataType.getFlattenedFields(); // get the names of all the madatafields but those within loops;
|
221 | 226 | this.columns = this.insertModelSpecificColumns(this.dataType.get("model"), xtens.session.get('canAccessPersonalData'));
|
222 |
| - this.columns.push({"title": i18n("owner"), "data": "owner.lastName", "className": "owner"}); |
| 227 | + this.columns.push({"title": i18n("owner"), "data": "owner_surname", "className": "owner"}); |
223 | 228 |
|
224 | 229 | this.numLeft=this.columns.length;
|
225 | 230 |
|
|
0 commit comments