Changeset 352 for trunk/grails-app/services
- Timestamp:
- Feb 12, 2010, 12:14:23 PM (15 years ago)
- Location:
- trunk/grails-app/services
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/services/AssetService.groovy
r350 r352 12 12 def criteria = AssetSubItem.createCriteria() 13 13 def possibleAssetSubItems = criteria.list() { 14 isNull("parentItem") 14 and { 15 eq('isActive', true) 16 isNull("parentItem") 17 } 15 18 } 16 19 } -
trunk/grails-app/services/AssetSubItemService.groovy
r350 r352 2 2 3 3 boolean transactional = false 4 5 /** 6 * Determines and returns sorted list of possible parent items. 7 * @param assetSubItemInstance The instance to prepare the list for. 8 * @returns A list of the possible parentItems. 9 */ 10 def possibleParentItems(assetSubItemInstance) { 11 def criteria = AssetSubItem.createCriteria() 12 def possibleParentItems = criteria.list() { 13 and { 14 eq('isActive', true) 15 ne('id', assetSubItemInstance.id) 16 assetSubItemInstance.subItems.each() { notEqual('id', it.id) } 17 } 18 } 19 possibleParentItems.sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } 20 } 4 21 5 22 def delete(params) {
Note: See TracChangeset
for help on using the changeset viewer.