deferreds[cacheKey].push(deferred);
if (needFetch) {
- crmApi(entity, 'getfields', {action: action, options: {get_options: 'all'}})
+ crmApi(entity, 'getfields', {action: action, sequential: 1, options: {get_options: 'all'}})
.then(
// on success:
function(fields) {
- cache[cacheKey] = fields.values;
+ cache[cacheKey] = _.indexBy(fields.values, 'name');
angular.forEach(deferreds[cacheKey], function(dfr) {
- dfr.resolve(fields.values);
+ dfr.resolve(cache[cacheKey]);
});
delete deferreds[cacheKey];
},
>
<option value="">{{ts('Automatic')}}</option>
- <option ng-repeat="(locTypeId,locType) in model.fields.location_type_id.options | orderBy:'locType'"
- ng-value="locTypeId">{{locType}}</option>
+ <option ng-repeat="locType in model.fields.location_type_id.options"
+ ng-value="locType.key">{{locType.value}}</option>
</select>
</div>
ng-model="model.mailing.email_selection_method"
required
>
- <option ng-repeat="(selMetId,selMet) in model.fields.email_selection_method.options | orderBy:'selMet'"
- ng-value="selMetId">{{selMet}}</option>
+ <option ng-repeat="selMet in model.fields.email_selection_method.options"
+ ng-value="selMet.key">{{selMet.value}}</option>
</select>
</div>