Changeset 851
- Timestamp:
- Mar 8, 2011, 6:33:40 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/services/TaskService.groovy
r838 r851 388 388 return fail(field:"task", code:"task.failedToSave") 389 389 390 391 if(params.submitAction) { 392 def actionResult 393 def submit_andSetAttentionFlag = { 394 actionResult = setAttentionFlag(taskInstance) 395 if(actionResult.error) 396 return fail(field:"task", code:actionResult.error.code) 397 } 398 def submit_andComplete = { 399 actionResult = complete(taskInstance) 400 if(actionResult.error) 401 return fail(field:"task", code:actionResult.error.code) 402 } 403 404 switch (params.submitAction) { 405 case "submit_default": 406 break 407 case "submit_andSetAttentionFlag": 408 submit_andSetAttentionFlag() 409 break 410 case "submit_andComplete": 411 submit_andComplete() 412 break 413 default: 414 break 415 } // switch. 416 if(result.error) 417 return result 418 } // params.submitAction 419 390 420 // Success. 391 421 return result -
trunk/grails-app/views/entryDetailed/_create.gsp
r838 r851 13 13 <g:hiddenField name="task.id" value="${entryInstance.task.id}" /> 14 14 <g:hiddenField name="entryType.id" value="${entryInstance.entryType.id}" /> 15 <g:hiddenField name="submitAction" value="save" /> 15 16 <div class="dialog"> 16 17 <table> … … 105 106 </div> 106 107 <div class="buttons"> 107 <span class="button"><input class="save" type="submit" value="Create" /></span> 108 <span class="button"> 109 <input class="save" type="submit" value="Save" name="submit_default" /> 110 </span> 111 <span class="button"> 112 <input class="flag" type="button" value="Unresolved" name="submit_andSetAttentionFlag" /> 113 </span> 114 <custom:helpBalloon code="task.status.unresolved" iconSrc="${resource(plugin:'help-balloons', dir:'images', file:'balloon-icon.gif')}" /> 115 <span class="button"> 116 <g:if test="${entryInstance.task.attentionFlag}" > 117 <input class="complete" 118 type="button" 119 value="Resolved" 120 onclick="return confirm('${message(code:'task.clear.attention.flag.on.completion.confirm')}');" 121 name="submit_andComplete"/> 122 </g:if> 123 <g:else> 124 <input class="complete" type="button" value="Resolved" name="submit_andComplete" /> 125 </g:else> 126 </span> 127 <custom:helpBalloon code="task.status.resolved" iconSrc="${resource(plugin:'help-balloons', dir:'images', file:'balloon-icon.gif')}" /> 108 128 </div> 109 129 </g:form> -
trunk/web-app/js/taskShow.js
r850 r851 8 8 createContainer.find(':input[name="comment"]').focus(); 9 9 }); 10 // Register 'submit_*' input button click handlers. 11 createContainer.find('input[name^="submit_"]').click(function(){ 12 createContainer.find(':input[name="submitAction"]').val(jQuery(this).attr('name')); 13 createContainer.find('form:first').submit(); 14 }); 10 15 // Hijack form submit to use our function. 11 var eventData = {listContainer:listContainer, createContainer:createContainer, button:button};16 var eventData = {listContainer:listContainer, createContainer:createContainer, button:button}; 12 17 createContainer.find('form:first').submit(eventData, submitCreateEntryForm); 13 18 // Register the close img click handler.
Note: See TracChangeset
for help on using the changeset viewer.