- Timestamp:
- 8 Nov 2006, 18:32:55 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 4 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/Widgets.py
r783 r794 320 320 ###) 321 321 322 class WAeUPResultsWidget(CPSStringWidget): ###( 323 """ WAeUPResults Widget""" 324 meta_type = "WAeUp Results Widget" 325 326 def prepare(self, datastructure, **kw): ###( 327 """Prepare datastructure from datamodel.""" 328 datamodel = datastructure.getDataModel() 329 v = datamodel[self.fields[0]] 330 #import pdb;pdb.set_trace() 331 clear_doc = self.getStudentInfo()['clear_doc'] 332 vd = getattr(clear_doc,self.fields[0],None) 333 if not vd: 334 vd = {} 335 widget_id = self.getWidgetId() 336 datastructure[widget_id] = vd 337 datastructure[widget_id+'_s'] = '' 338 datastructure[widget_id+'_g'] = '' 339 ###) 340 341 def validate(self, datastructure, **kw): ###( 342 """Validate datastructure and update datamodel.""" 343 #import pdb;pdb.set_trace() 344 widget_id = self.getWidgetId() 345 v = datastructure[widget_id] 346 err = 0 347 s = datastructure[widget_id+'_s'].strip() 348 g = datastructure[widget_id+'_g'].strip() 349 if not s and g: 350 err = "no subject grad for subject %s " % s 351 elif v.has_key(s): 352 err = "grad for subject %s already given" % s 353 elif s and g: 354 v[s] = g 355 if err: 356 datastructure.setError(widget_id, err) 357 else: 358 datamodel = datastructure.getDataModel() 359 datamodel[self.fields[0]] = v 360 datastructure[widget_id+'_s'] = s 361 datastructure[widget_id+'_g'] = g 362 return not err 363 ###) 364 365 def render(self, mode, datastructure, **kw): ###( 366 """Render in mode from datastructure.""" 367 render_method = 'widget_waeup_result_render' 368 meth = getattr(self, render_method, None) 369 if meth is None: 370 raise RuntimeError("Unknown Render Method %s for widget type %s" 371 % (render_method, self.getId())) 372 373 # XXX AT: datastructure has to be set again here, in case we're in edit 374 # or create mode, because a default value has to be provided. 375 #import pdb;pdb.set_trace() 376 datamodel = datastructure.getDataModel() 377 widget_id = self.getWidgetId() 378 v = datamodel[self.fields[0]] 379 datastructure[widget_id] = [{'subject': f, 380 'grade': v[f]} for f in v.keys()] 381 datastructure[widget_id+'_s'] = '' 382 datastructure[widget_id+'_g'] = '' 383 return meth(mode=mode, 384 datastructure=datastructure, 385 ) 386 ###) 387 388 389 InitializeClass(WAeUPResultsWidget) 390 widgetRegistry.register(WAeUPResultsWidget) 391 ###) 392 322 393 class ScratchCardPin: ###( 323 394 """the ScratchCardPin""" … … 410 481 s_id = student.getId() 411 482 if ok == 2: 483 err = "You already used this PIN please login" 412 484 break 413 485 student.getContent().makeStudentMember(s_id,password=pin[4:]) -
WAeUP_SRP/trunk/profiles/default/layouts/student_clearance_fe.xml
r790 r794 116 116 <property name="hidden_readonly_layout_modes"/> 117 117 </widget> 118 <widget name="alr_results" meta_type="WAeUp Results Widget"> 119 <property name="title">Results</property> 120 <property name="fields"> 121 <element value="alr_results"/> 122 </property> 123 <property name="label">Results</property> 124 <property name="label_edit">Results</property> 125 <property name="readonly_layout_modes"/> 126 <property name="hidden_layout_modes"/> 127 <property name="hidden_readonly_layout_modes"/> 128 </widget> 118 129 <widget name="alr_scan" meta_type="Image Widget"> 119 130 <property name="title">Scan of Advanced Level Result</property> … … 341 352 <property name="hidden_readonly_layout_modes"/> 342 353 </widget> 343 <widget name="fst_sit_scan" meta_type="Image Widget"> 354 <widget name="fst_sit_results" meta_type="WAeUp Results Widget"> 355 <property name="title">Results</property> 356 <property name="fields"> 357 <element value="fst_sit_results"/> 358 </property> 359 <property name="label">Results</property> 360 <property name="label_edit">Results</property> 361 <property name="readonly_layout_modes"/> 362 <property name="hidden_layout_modes"/> 363 <property name="hidden_readonly_layout_modes"/> 364 </widget> 365 <widget name="fst_sit_scan" meta_type="Image Widget"> 344 366 <property name="title">Scan of First Sitting Result</property> 345 367 <property name="fields"> … … 654 676 <property name="hidden_readonly_layout_modes"/> 655 677 </widget> 678 <widget name="scd_sit_results" meta_type="WAeUp Results Widget"> 679 <property name="title">Results</property> 680 <property name="fields"> 681 <element value="scd_sit_results"/> 682 </property> 683 <property name="label">Results</property> 684 <property name="label_edit">Results</property> 685 <property name="readonly_layout_modes"/> 686 <property name="hidden_layout_modes"/> 687 <property name="hidden_readonly_layout_modes"/> 688 </widget> 656 689 <widget name="scd_sit_scan" meta_type="Image Widget"> 657 690 <property name="title">Scan of Second Sitting Result</property> … … 765 798 </row> 766 799 <row> 800 <cell name="fst_sit_results"/> 801 </row> 802 <row> 767 803 <cell name="fst_sit_scan"/> 768 804 </row> … … 780 816 </row> 781 817 <row> 818 <cell name="scd_sit_results"/> 819 </row> 820 <row> 782 821 <cell name="scd_sit_scan"/> 783 822 </row> … … 790 829 <row> 791 830 <cell name="alr_date"/> 831 </row> 832 <row> 833 <cell name="alr_results"/> 792 834 </row> 793 835 <row> -
WAeUP_SRP/trunk/profiles/default/schemas/student_clearance.xml
r790 r794 21 21 <field name="fst_sit_date" meta_type="CPS DateTime Field"/> 22 22 <field name="fst_sit_type" meta_type="CPS String Field"/> 23 <field name="fst_sit_results" meta_type="CPS SubObjects Field"/> 23 24 <field name="fst_sit_scan" meta_type="CPS Image Field"/> 24 25 … … 28 29 <field name="scd_sit_date" meta_type="CPS DateTime Field"/> 29 30 <field name="scd_sit_type" meta_type="CPS String Field"/> 31 <field name="scd_sit_results" meta_type="CPS SubObjects Field"/> 30 32 <field name="scd_sit_scan" meta_type="CPS Image Field"/> 31 33 … … 33 35 <field name="alr_no" meta_type="CPS String Field"/> 34 36 <field name="alr_date" meta_type="CPS DateTime Field"/> 37 <field name="alr_results" meta_type="CPS SubObjects Field"/> 35 38 <field name="alr_scan" meta_type="CPS Image Field"/> 36 39 -
WAeUP_SRP/trunk/skins/waeup_student/application_edit.py
r788 r794 41 41 psm = "" 42 42 args = {} 43 action = "/application_edit_view" 43 action = "/application_edit_form" 44 base_url = app.absolute_url() 44 45 if cpsdocument_edit_button: 45 46 if is_valid: … … 52 53 if is_valid: 53 54 action = "/request_clearance" 55 base_url = clear.absolute_url() 54 56 else: 55 57 psm = 'psm_content_error' 56 58 args['portal_status_message'] = psm 57 url = app.absolute_url()+ action + '?' + urlencode(args)59 url = base_url + action + '?' + urlencode(args) 58 60 REQUEST.RESPONSE.redirect(url) -
WAeUP_SRP/trunk/skins/waeup_student/application_edit_form.pt
r788 r794 6 6 request=request, proxy=info['app'], 7 7 use_session=True, no_form=True)"> 8 <metal:body use-macro="here/ main_template/macros/master">8 <metal:body use-macro="here/waeup_content_master/macros/master"> 9 9 <metal:main fill-slot="main"> 10 10 <span tal:condition="not: info">
Note: See TracChangeset for help on using the changeset viewer.