|
99 |
}) |
99 |
}) |
100 |
}], |
100 |
}], |
101 |
widgets: [{ |
101 |
widgets: [{ |
|
|
102 |
type: MultiInput, |
103 |
name: 'schools', |
104 |
label: _('Schools'), |
105 |
initialValue: [this.selectedSchool], |
106 |
subtypes: [{ |
107 |
type: TextBox, |
108 |
}] |
109 |
}, { |
102 |
type: TextBox, |
110 |
type: TextBox, |
103 |
name: 'firstname', |
111 |
name: 'firstname', |
104 |
label: _('Firstname'), |
112 |
label: _('Firstname'), |
|
234 |
} |
242 |
} |
235 |
this.umcpCommand('schoolwizards/classes', {'school': school}).then(lang.hitch(this, function(response) { |
243 |
this.umcpCommand('schoolwizards/classes', {'school': school}).then(lang.hitch(this, function(response) { |
236 |
var classes = array.map(response.result, function(item) { |
244 |
var classes = array.map(response.result, function(item) { |
237 |
return item.label; |
245 |
return { |
|
|
246 |
id: tools.explodeDn(item.id, true)[0], |
247 |
label: item.label |
248 |
} |
238 |
}); |
249 |
}); |
239 |
var widget = this.getWidget('item', 'school_classes'); |
250 |
var widget = this.getWidget('item', 'school_classes'); |
240 |
widget.set('staticValues', classes); |
251 |
widget.set('staticValues', classes); |
241 |
if (this.loadedValues) { |
252 |
if (this.loadedValues) { |
242 |
var value = (this.loadedValues.school_classes[school] || [null])[0]; |
253 |
widget.set('value', (this.loadedValues.school_classes[school] || [null])[0]); |
243 |
if (value) { |
|
|
244 |
value = value.indexOf(school + '-') === -1 ? value : value.slice(school.length + 1); |
245 |
} |
246 |
widget.set('value', value); |
247 |
} |
254 |
} |
248 |
})); |
255 |
})); |
249 |
} |
256 |
} |