Changeset 987
- Timestamp:
- Oct 25, 2010, 4:23:39 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/studycapturing/PersonAffiliationController.groovy
r959 r987 48 48 static allowedMethods = [save: "POST", update: "POST", delete: "POST"] 49 49 50 /** 51 * Fires after every action and determines the layout of the page 52 */ 53 def afterInterceptor = { model, modelAndView -> 54 println( params ); 55 56 if ( params['dialog'] ) { 57 model.layout = 'dialog'; 58 model.extraparams = [ 'dialog': 'true' ] ; 59 } else { 60 model.layout = 'main'; 61 model.extraparams = [] ; 62 } 63 } 64 50 65 def index = { 51 66 redirect(action: "list", params: params) … … 65 80 def save = { 66 81 def personAffiliationInstance = new PersonAffiliation(params) 82 def extraparams = new LinkedHashMap(); 83 84 if( params[ 'dialog' ] ) { 85 extraparams[ 'dialog' ] = params[ 'dialog' ] 86 } 87 67 88 if (personAffiliationInstance.save(flush: true)) { 68 89 flash.message = "${message(code: 'default.created.message', args: [message(code: 'personAffiliation.label', default: 'Affiliation'), personAffiliationInstance])}" 69 redirect(action: "show", id: personAffiliationInstance.id )90 redirect(action: "show", id: personAffiliationInstance.id, params: extraparams) 70 91 } 71 92 else { … … 98 119 def update = { 99 120 def personAffiliationInstance = PersonAffiliation.get(params.id) 121 122 def extraparams = new LinkedHashMap(); 123 124 if( params[ 'dialog' ] ) { 125 extraparams[ 'dialog' ] = params[ 'dialog' ] 126 } 127 100 128 if (personAffiliationInstance) { 101 129 if (params.version) { … … 111 139 if (!personAffiliationInstance.hasErrors() && personAffiliationInstance.save(flush: true)) { 112 140 flash.message = "${message(code: 'default.updated.message', args: [message(code: 'personAffiliation.label', default: 'Affiliation'), personAffiliationInstance])}" 113 redirect(action: "show", id: personAffiliationInstance.id )141 redirect(action: "show", id: personAffiliationInstance.id, params: extraparams) 114 142 } 115 143 else { … … 119 147 else { 120 148 flash.message = "${message(code: 'default.not.found.message', args: [message(code: 'personAffiliation.label', default: 'Affiliation'), params.id])}" 121 redirect(action: "list" )149 redirect(action: "list", params: extraparams) 122 150 } 123 151 } … … 125 153 def delete = { 126 154 def personAffiliationInstance = PersonAffiliation.get(params.id) 155 156 def extraparams = new LinkedHashMap(); 157 158 if( params[ 'dialog' ] ) { 159 extraparams[ 'dialog' ] = params[ 'dialog' ] 160 } 161 127 162 if (personAffiliationInstance) { 128 163 def affiliationName = personAffiliationInstance.toString() … … 130 165 personAffiliationInstance.delete(flush: true) 131 166 flash.message = "${message(code: 'default.deleted.message', args: [message(code: 'personAffiliation.label', default: 'Affiliation'), affiliationName])}" 132 redirect(action: "list" )167 redirect(action: "list", params: extraparams) 133 168 } 134 169 catch (org.springframework.dao.DataIntegrityViolationException e) { 135 170 flash.message = "${message(code: 'default.not.deleted.message', args: [message(code: 'personAffiliation.label', default: 'Affiliation'), affiliationName])}" 136 redirect(action: "show", id: params.id )171 redirect(action: "show", id: params.id, params: extraparams) 137 172 } 138 173 } 139 174 else { 140 175 flash.message = "${message(code: 'default.not.found.message', args: [message(code: 'personAffiliation.label', default: 'Affiliation'), params.id])}" 141 redirect(action: "list" )176 redirect(action: "list", params: extraparams) 142 177 } 143 178 } -
trunk/grails-app/views/person/edit.gsp
r959 r987 126 126 <td colspan="3" valign="top" class="value ${hasErrors(bean: personInstance, field: 'affiliations', 'errors')}"> 127 127 <g:select name="affiliations" from="${dbnp.studycapturing.PersonAffiliation.list()}" multiple="yes" optionKey="id" size="5" value="${personInstance?.affiliations}" /> 128 </td> 128 129 <g:link controller="personAffiliation" action="list" params="${extraparams}">Edit Affiliations</g:link> 130 </td> 129 131 </tr> 130 132 -
trunk/grails-app/views/person/list.gsp
r959 r987 64 64 <div class="buttons"> 65 65 <span class="button"><g:link class="create" action="create" params="${extraparams}"><g:message code="default.new.label" args="[entityName]" /></g:link></span> 66 </div> 66 <span class="button"><g:link class="otherList" controller="personAffiliation" action="list" params="${extraparams}">Edit Affiliations</g:link></span> 67 </div> 67 68 <div class="paginateButtons"> 68 69 <g:paginate total="${personInstanceTotal}" prev="« Previous" next="» Next" params="${extraparams}" /> -
trunk/grails-app/views/personAffiliation/create.gsp
r959 r987 4 4 <head> 5 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 <meta name="layout" content=" main" />6 <meta name="layout" content="${layout}" /> 7 7 <g:set var="entityName" value="${message(code: 'personAffiliation.label', default: 'PersonAffiliation')}" /> 8 8 <title><g:message code="default.create.label" args="['Affiliation']" /></title> … … 45 45 </div> 46 46 <div class="buttons"> 47 <g:each in="${extraparams}" var="param"> 48 <input type="hidden" name="${param.key}" value="${param.value}"> 49 </g:each> 47 50 <span class="button"><g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}" /></span> 48 <span class="button"><g:link class="cancel" action="list" >Cancel</g:link></span>51 <span class="button"><g:link class="cancel" action="list" params="${extraparams}">Cancel</g:link></span> 49 52 </div> 50 53 </g:form> -
trunk/grails-app/views/personAffiliation/edit.gsp
r959 r987 4 4 <head> 5 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 <meta name="layout" content=" main" />6 <meta name="layout" content="${layout}" /> 7 7 <g:set var="entityName" value="${message(code: 'personAffiliation.label', default: 'PersonAffiliation')}" /> 8 8 <title><g:message code="default.edit.label" args="['Affiliation']" /></title> … … 46 46 </div> 47 47 <div class="buttons"> 48 <g:each in="${extraparams}" var="param"> 49 <input type="hidden" name="${param.key}" value="${param.value}"> 50 </g:each> 48 51 <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span> 49 52 <span class="button"><g:actionSubmit class="cancel" action="show" value="Cancel" /></span> -
trunk/grails-app/views/personAffiliation/list.gsp
r959 r987 4 4 <head> 5 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 <meta name="layout" content=" main" />6 <meta name="layout" content="${layout}" /> 7 7 <g:set var="entityName" value="${message(code: 'personAffiliation.label', default: 'PersonAffiliation')}" /> 8 8 <title><g:message code="default.list.label" args="['Affiliation']" /></title> … … 19 19 <tr> 20 20 21 <g:sortableColumn p roperty="institute" title="${message(code: 'personAffiliation.institute.label', default: 'Institute')}" />22 <g:sortableColumn p roperty="department" title="${message(code: 'personAffiliation.department.label', default: 'Department')}" />21 <g:sortableColumn params="${extraparams}" property="institute" title="${message(code: 'personAffiliation.institute.label', default: 'Institute')}" /> 22 <g:sortableColumn params="${extraparams}" property="department" title="${message(code: 'personAffiliation.department.label', default: 'Department')}" /> 23 23 24 24 </tr> … … 28 28 <tr class="${(i % 2) == 0 ? 'odd' : 'even'}"> 29 29 30 <td><g:link action="show" id="${personAffiliationInstance.id}">${fieldValue(bean: personAffiliationInstance, field: "institute")}</g:link></td>30 <td><g:link params="${extraparams}" action="show" id="${personAffiliationInstance.id}">${fieldValue(bean: personAffiliationInstance, field: "institute")}</g:link></td> 31 31 <td>${fieldValue(bean: personAffiliationInstance, field: "department")}</td> 32 32 </tr> … … 36 36 </div> 37 37 <div class="buttons"> 38 <span class="button"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span> 38 <span class="button"><g:link class="create" params="${extraparams}" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span> 39 <span class="button"><g:link class="otherList" controller="person" action="list" params="${extraparams}">Edit Persons</g:link></span> 39 40 </div> 40 41 <div class="paginateButtons"> 41 <g:paginate total="${personAffiliationInstanceTotal}" prev="« Previous" next="» Next" />42 <g:paginate params="${extraparams}" total="${personAffiliationInstanceTotal}" prev="« Previous" next="» Next" /> 42 43 </div> 43 44 </div> -
trunk/grails-app/views/personAffiliation/show.gsp
r959 r987 4 4 <head> 5 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 <meta name="layout" content=" main" />6 <meta name="layout" content="${layout}" /> 7 7 <g:set var="entityName" value="${message(code: 'personAffiliation.label', default: 'PersonAffiliation')}" /> 8 8 <title><g:message code="default.show.label" args="['Affiliation']" /></title> … … 37 37 <g:form> 38 38 <g:hiddenField name="id" value="${personAffiliationInstance?.id}" /> 39 <g:each in="${extraparams}" var="param"> 40 <input type="hidden" name="${param.key}" value="${param.value}"> 41 </g:each> 42 39 43 <span class="button"><g:actionSubmit class="edit" action="edit" value="${message(code: 'default.button.edit.label', default: 'Edit')}" /></span> 40 44 <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span> 41 <span class="button"><g:link class="backToList" action="list" >Back to list</g:link></span>45 <span class="button"><g:link class="backToList" action="list" params="${extraparams}">Back to list</g:link></span> 42 46 </g:form> 43 47 </div> -
trunk/web-app/css/default_style.css
r980 r987 277 277 font-weight: normal; 278 278 } 279 .buttons input.otherList, .buttons a.otherList { 280 background: transparent url(../plugins/famfamfam-1.0.1/images/icons/application_view_detail.png) 5px 50% no-repeat; 281 padding-left: 28px; 282 } 279 283 280 284 /* Reset the font weight for buttons occurring within the table */ -
trunk/web-app/css/dialog.css
r980 r987 188 188 font-weight: normal; 189 189 } 190 .buttons input.otherList, .buttons a.otherList { 191 background: transparent url(../plugins/famfamfam-1.0.1/images/icons/application_view_detail.png) 5px 50% no-repeat; 192 padding-left: 28px; 193 } 190 194 191 195 /* Reset the font weight for buttons occurring within the table */
Note: See TracChangeset
for help on using the changeset viewer.