Changeset 506 for trunk/grails-app
- Timestamp:
- Apr 23, 2010, 12:29:14 PM (15 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/services/CreateDataService.groovy
r447 r506 46 46 47 47 if(appConfigService.exists("baseDataCreated")) { 48 log. error "Base data has already been created, will NOT recreate."48 log.info "Base data previously created." 49 49 return false 50 50 } 51 51 52 log.info "Creating base data. .."52 log.info "Creating base data." 53 53 54 54 // Person and Utils 55 55 createBaseAuthorities() 56 createBasePersonGroupTypes() 56 57 createBasePersonGroups() 57 58 createBaseDefinitions() … … 211 212 } 212 213 214 void createBasePersonGroupTypes() { 215 216 //PersonGroupType. 217 def personGroupTypeInstance 218 personGroupTypeInstance = new PersonGroupType(name:"Team") 219 saveAndTest(personGroupTypeInstance) 220 personGroupTypeInstance = new PersonGroupType(name:"Contractor") 221 saveAndTest(personGroupTypeInstance) 222 personGroupTypeInstance = new PersonGroupType(name:"Project Team") 223 saveAndTest(personGroupTypeInstance) 224 } 225 213 226 void createBasePersonGroups() { 214 //TypeOfPersonGroup215 def personGroupTypeInstance216 personGroupTypeInstance = new PersonGroupType(name:"Team")217 saveAndTest(personGroupTypeInstance)218 personGroupTypeInstance = new PersonGroupType(name:"Contractor")219 saveAndTest(personGroupTypeInstance)220 personGroupTypeInstance = new PersonGroupType(name:"ProjectTeam")221 saveAndTest(personGroupTypeInstance)222 227 223 228 //PersonGroup 224 229 def personGroupInstance 225 226 name:"Electrical")230 personGroupInstance = new PersonGroup(personGroupType:PersonGroupType.get(1), 231 name:"Electrical - General") 227 232 saveAndTest(personGroupInstance) 228 229 name:"Mechanical")233 personGroupInstance = new PersonGroup(personGroupType:PersonGroupType.get(1), 234 name:"Mechanical - General") 230 235 saveAndTest(personGroupInstance) 231 232 name:"Production")236 personGroupInstance = new PersonGroup(personGroupType:PersonGroupType.get(1), 237 name:"Production") 233 238 saveAndTest(personGroupInstance) 234 235 name:"Kewl AirCon Guys")239 personGroupInstance = new PersonGroup(personGroupType:PersonGroupType.get(2), 240 name:"AirCon Contractor") 236 241 saveAndTest(personGroupInstance) 237 238 name:"gnuMims")242 personGroupInstance = new PersonGroup(personGroupType:PersonGroupType.get(3), 243 name:"gnuMims") 239 244 saveAndTest(personGroupInstance) 240 245 } -
trunk/grails-app/views/person/create.gsp
r477 r506 94 94 <g:helpBalloon class="helpballoon" code="person.personGroups" /> 95 95 <custom:checkBoxList name="personGroups" 96 from="${PersonGroup. list().sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) }}"96 from="${PersonGroup.findAllByIsActive(true)}" 97 97 value="${person?.personGroups?.collect{it.id}}" 98 optionKey="id"/> 98 optionKey="id" 99 sortBy="name" 100 linkController="personGroupDetailed" 101 linkAction="show"/> 102 <g:link controller="personGroupDetailed" action="create">+Add Group</g:link> 99 103 </td> 100 104 </tr> -
trunk/grails-app/views/person/edit.gsp
r477 r506 139 139 linkController="personGroupDetailed" 140 140 linkAction="show"/> 141 <g:link controller="personGroupDetailed" action="create">+Add Group</g:link> 141 142 </td> 142 143 </tr> … … 164 165 <div class="buttons"> 165 166 <span class="button"><g:actionSubmit class="save" value="Update" /></span> 167 <span class="button"><g:actionSubmit class="cancel" value="Cancel" action="Show"/></span> 166 168 <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span> 167 169 </div>
Note: See TracChangeset
for help on using the changeset viewer.