Inventory add/edit/delete group buttons now working. Inventory detail form now maintains values independently so common fields such as Name and Description do not get overridden by Group Add/Edit modal dialog.

This commit is contained in:
chouseknecht
2013-06-03 12:59:35 -04:00
parent b19e1dd97a
commit eca7b3888f
6 changed files with 101 additions and 37 deletions

View File

@@ -208,9 +208,17 @@ angular.module('InventoryHelper', [ 'RestServices', 'Utilities', 'OrganizationLi
.success( function(data, status, headers, config) {
LoadBreadCrumbs({ path: '/inventories/' + $routeParams.id, title: data.name });
for (var fld in form.fields) {
if (data[fld]) {
scope[fld] = data[fld];
scope.master[fld] = scope[fld];
if (form.fields[fld].realName) {
if (data[form.fields[fld].realName]) {
scope[fld] = data[form.fields[fld].realName];
scope.master[fld] = scope[fld];
}
}
else {
if (data[fld]) {
scope[fld] = data[fld];
scope.master[fld] = scope[fld];
}
}
if (form.fields[fld].type == 'lookup' && data.summary_fields[form.fields[fld].sourceModel]) {
scope[form.fields[fld].sourceModel + '_' + form.fields[fld].sourceField] =