Changeset 1012
- Timestamp:
- 8 Dec 2006, 12:34:33 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/ScratchCards.py
r1002 r1012 147 147 return unused 148 148 149 security.declareProtected(View,"getNumberOfUsedPins") 150 def getNumberOfUsedPins(self): 151 """return the number of used Pins""" 152 #import pdb;pdb.set_trace() 153 pins_cat = self.portal_pins 154 doc = self.getContent() 155 used = [{'pin': p.pin, 156 'serial': p.serial, 157 'student': p.student, 158 } for p in pins_cat.searchResults(prefix_batch = "%s%d" 159 % (doc.prefix,doc.batch_no), 160 ) if p.student] 161 return len(used) 162 149 163 InitializeClass(ScratchCardBatch) 150 164 -
WAeUP_SRP/trunk/skins/waeup_pins/batch_view.pt
r1009 r1012 27 27 28 28 29 30 <h3><span tal:replace="info/nr_used" /> Pins used out of 31 <span tal:replace="info/batch_doc/no_of_pins" /></h3> 32 29 33 <span tal:replace="structure rendered" /> 30 34 -
WAeUP_SRP/trunk/skins/waeup_pins/search_pins.py
r1006 r1012 22 22 lt = context.portal_layouts 23 23 validate = request.has_key("cpsdocument_edit_button") 24 default = {'search_mode': 'student',} 24 25 rend,psm,ds = lt.renderLayout(layout_id= 'scratch_card_search', 25 26 schema_id= 'student_search', 26 27 context=context, 27 28 mapping=validate and request, 28 ob= {},29 ob=default, 29 30 layout_mode='edit', 30 31 formaction="search_pins", … … 35 36 info['unused'] = info['batch_doc'].getUnusedPins() 36 37 info['used'] = [] 38 info['nr_used'] = info['batch_doc'].getNumberOfUsedPins() 37 39 38 40 if psm == '': … … 46 48 what = ds.get('search_mode') 47 49 term = ds.get('search_string') 50 if term != "": 51 if what == 'student' : 52 items_1 = context.portal_pins(student = term.upper()) 53 items_2 = context.portal_pins(student = term.lower()) 54 items = items_1 + items_2 55 elif what == 'pin': 56 items = context.portal_pins(pin = term.upper()) 57 else: 58 items = [] 59 l = [] 60 students_url = "%s/%s" % (context.portal_url(),'students') 61 pins = [] 62 for i in items: 63 item = {} 64 sno = i['student'] 65 item['student'] = sno 66 item['serial'] = i.serial 67 item['pin'] = i.pin 68 if i.pin in pins: 69 continue 70 pins.append(i.pins) 71 if len(sno)==10: 72 #res = context.portal_catalog(SearchableText=sno,portal_type='StudentApplication') 73 res = context.students_catalog(jamb_reg_no=sno.upper()) 74 if len(res) > 0: 75 item['student_url'] = "%s/campus/students/%s" % (context.portal_url(),res[0].id) 76 item['student_id'] = res[0].id 77 else: 78 item['student_url'] = None 79 item['student_id'] = '' 80 elif sno: 81 item['student_url'] = '%s/campus/students/%s' % (students_url,item['student']) 82 item['student_id'] = student 83 else: 84 item['student_url'] = '' 85 item['student_id'] = "not used" 86 l.append(item) 87 88 info['used'] = l 48 89 49 if what == 'student':50 items_1 = context.portal_pins(student = term.upper())51 items_2 = context.portal_pins(student = term.lower())52 items = items_1 + items_253 elif what == 'pin':54 items = context.portal_pins(pin = term.upper())55 else:56 items = []57 l = []58 students_url = "%s/%s" % (context.portal_url(),'students')59 pins = []60 for i in items:61 item = {}62 sno = i['student']63 item['student'] = sno64 item['serial'] = i.serial65 item['pin'] = i.pin66 if i.pin in pins:67 continue68 pins.append(i.pins)69 if len(sno)==10:70 #res = context.portal_catalog(SearchableText=sno,portal_type='StudentApplication')71 res = context.students_catalog(jamb_reg_no=sno.upper())72 if len(res) > 0:73 item['student_url'] = "%s/campus/students/%s" % (context.portal_url(),res[0].id)74 item['student_id'] = res[0].id75 else:76 item['student_url'] = None77 item['student_id'] = ''78 elif sno:79 item['student_url'] = '%s/campus/students/%s' % (students_url,item['student'])80 item['student_id'] = student81 else:82 item['student_url'] = ''83 item['student_id'] = "not used"84 l.append(item)85 86 info['used'] = l87 90 return context.batch_view(rendered = rend, 88 91 psm = psm, -
WAeUP_SRP/trunk/skins/waeup_student/clearance_edit_form.pt
r939 r1012 10 10 editable python: (is_student and clear_review_state == 'opened' or is_so) and not is_co; 11 11 mode python: test(editable,'edit','view'); 12 layout_id python: test(is_co,'student_clearance','student_clearance_fe'); 12 13 rendered_main python:info['clear_doc'].render(request=request, 13 14 layout_mode = mode, 14 15 schema_id='student_clearance', 15 layout_id= 'student_clearance',16 layout_id=layout_id, 16 17 use_session=True); 17 18 form_action string:clearance_edit;
Note: See TracChangeset for help on using the changeset viewer.