Ticket #2363: t2363_cf-order_011.diff
| File t2363_cf-order_011.diff, 2.8 kB (added by osimons, 5 months ago) |
|---|
-
0.11/customfieldadmin/api.py
old new 94 94 if create: 95 95 last = len(self.get_custom_fields(env)) 96 96 env.config.set('ticket-custom', customfield['name'] + '.order', 97 customfield.get('order',0) or last )97 customfield.get('order',0) or last-1) 98 98 elif customfield.has_key('order') and customfield['order']: 99 99 # Exists and have value - note: will not update order conflicting with other fields 100 100 if str(customfield['order']).isdigit(): -
0.11/customfieldadmin/customfieldadmin.py
old new 89 89 in req.args.keys() 90 90 if key.startswith('order_')]) 91 91 values = dict([(val, True) for val in order.values()]) 92 if len(order) != len(values): 93 raise TracError, 'Order numbers must be unique.' 92 # Disabled testing for uniqueness of order field 93 # if len(order) != len(values): 94 # raise TracError, 'Order numbers must be unique.' 94 95 cf = cfapi.get_custom_fields(self.env) 95 96 for cur_cf in cf: 96 97 cur_cf['order'] = order[cur_cf['name']] -
0.11/customfieldadmin/templates/customfieldadmin.html
old new 138 138 <td>${cf.type}</td> 139 139 <td>${cf.label}</td> 140 140 <td class="default"> 141 <select name="order_${cf.name}" >142 <option py:for=" other in cfadmin.customfields"143 selected="${ other.order==cf.order and 'selected' or None}">144 ${ other.order}141 <select name="order_${cf.name}" py:with="count = len(cfadmin.customfields)"> 142 <option py:for="num in range(count)" 143 selected="${num==cf.order and 'selected' or None}"> 144 ${num} 145 145 </option> 146 <!--! Extra option in case value is outside regular range --> 147 <option py:if="cf.order not in range(count)" 148 selected="selected">${cf.order}</option> 146 149 </select> 147 150 </td> 148 151 </tr>
