Changeset 3833
- Timestamp:
- 06/13/08 10:00:38 (5 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
ticketsubmitpolicyplugin/0.11/setup.py
r3829 r3833 1 1 from setuptools import find_packages, setup 2 2 3 version='0.5. 1'3 version='0.5.2' 4 4 5 5 setup(name='TicketSubmitPolicy', ticketsubmitpolicyplugin/0.11/ticketsubmitpolicy/ticketsubmitpolicy.py
r3829 r3833 54 54 function requires(policy, requiredfield) 55 55 { 56 var element=document.getElementById("field-" + requiredfield); 56 57 57 var field=getValue("field-" + requiredfield); 58 58 … … 65 65 } 66 66 67 }68 else69 {70 element.value = "";71 67 } 72 68 … … 111 107 112 108 } 109 110 function excludeSubmit(policy, excludedfield) 111 { 112 var element=document.getElementById("field-" + excludedfield); 113 if (condition(policy)) 114 { 115 element.value = ""; 116 } 117 return true; 118 } 119 113 120 """ 114 121 … … 117 124 118 125 def onsubmit(self, policy, condition, excludedfield): 119 return 126 excludesubmit = "excludeSubmit(%s, '%s');" % (policy, excludedfield) 127 return excludesubmit 120 128 121 129 def filter_stream(self, stream, policy, condition, excludedfield): … … 404 412 function policytostring(policy) 405 413 { 414 // this should be replaced by a deCamelCase function 415 names = { is: 'is', isNot: 'is not', isIn: 'is in', isNotIn: 'is not in' } 406 416 407 417 var strings = new Array(policy.length); 408 418 for ( var i=0; i != policy.length; i++ ) 409 419 { 410 strings[i] = policy[i].field + ' ' + policy[i].comparitor.name + ' ' + policy[i].value; 420 funcname = names[policy[i].comparitor.name] 421 strings[i] = policy[i].field + ' ' + funcname + ' ' + policy[i].value; 411 422 } 412 423 return strings.join(' and ');
