@@ -211,10 +211,10 @@ ClassMethod GetModifiedItemsBeforeSave(internalName, Location, Output modifiedIt
211
211
{
212
212
kill modifiedItems
213
213
set productionName = $piece (internalName ," ." ,1 ,*-1 )
214
+ set productionConfig = ##class (Ens.Config.Production ).%OpenId (productionName )
214
215
if ..IsEnsPortal () {
215
216
// If editing from SMP, get the modified items by looking at %IsModified on the items in the production in memory.
216
217
// No way to know if an item has been added or deleted, so ignore it.
217
- set productionConfig = ##class (Ens.Config.Production ).%OpenId (productionName )
218
218
if $isobject (productionConfig ) {
219
219
set modifiedItem = $$$NULLOREF
220
220
for i =1 :1 :productionConfig .Items .Count () {
@@ -244,8 +244,15 @@ ClassMethod GetModifiedItemsBeforeSave(internalName, Location, Output modifiedIt
244
244
set modifiedItems (modifiedInternalName ) = " M"
245
245
}
246
246
} else {
247
- // If editing/adding/deleting from Studio, get the modified items by comparing the XDATA in Location with the XDATA in the compiled class.
248
- // FUTURE: implement this to support Studio
247
+ // FUTURE: get the actually modified items by comparing the XDATA in Location with the XDATA in the compiled class
248
+ // If making changes from Studio, list every item in the production.
249
+ if $isobject (productionConfig ) {
250
+ set modifiedItems (..CreateInternalName (productionName ,,,1 )) = " M"
251
+ for i =1 :1 :productionConfig .Items .Count () {
252
+ set item = productionConfig .Items .GetAt (i )
253
+ set modifiedItems (..CreateInternalName (productionName , item .Name , item .ClassName , 0 )) = " M"
254
+ }
255
+ }
249
256
}
250
257
// populate data for use in OnAfterSave
251
258
kill ^IRIS .Temp (" sscProd" ,$job ," modifiedItems" )
@@ -290,8 +297,16 @@ ClassMethod GetModifiedItemsAfterSave(internalName, Output modifiedItems)
290
297
merge modifiedItems = ^IRIS .Temp (" sscProd" ,$job ," modifiedItems" )
291
298
}
292
299
} else {
293
- // If editing/adding/deleting from Studio, get the modified items from a percent variable set in OnBeforeSave.
294
- // FUTURE: implement this to support Studio.
300
+ // If editing in the IDE, list every item in the production.
301
+ // FUTURE: get the actually modified items using the temp global set in OnBeforeSave
302
+ set productionConfig = ##class (Ens.Config.Production ).%OpenId (productionName )
303
+ if $isobject (productionConfig ) {
304
+ set modifiedItems (..CreateInternalName (productionName ,,,1 )) = " M"
305
+ for i =1 :1 :productionConfig .Items .Count () {
306
+ set item = productionConfig .Items .GetAt (i )
307
+ set modifiedItems (..CreateInternalName (productionName , item .Name , item .ClassName , 0 )) = " M"
308
+ }
309
+ }
295
310
}
296
311
}
297
312
0 commit comments