Changeset 2664


Ignore:
Timestamp:
15 Nov 2007, 14:35:05 (17 years ago)
Author:
Henrik Bettermann
Message:

fix course registration for returning students

Location:
WAeUP_SRP/base
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/WAeUPTables.py

    r2632 r2664  
    10571057                                             import_record.Lastname)
    10581058                data['jamb_reg_no'] = import_record.Entryregno
    1059             #else:
    1060             #    study_course = getattr(student_object,'study_course',None)
    1061             #    current_level = data.get('level',None)
    1062             #    data['registered_courses'] = []
    1063             #    if study_course and current_level and current_level in study_course.objectIds():
    1064             #        level_obj = getattr(study_course,current_level)
    1065             #        courses = []
    1066             #        for c in level_obj.objectIds():
    1067             #            if c.endswith('_co'):
    1068             #                courses.append(c[:-3])
    1069             #            else:
    1070             #                courses.append(c)
    1071             #        data['registered_courses'] = courses
    10721059            self.addRecord(**data)
    10731060        if pghandler: pghandler.finish()
     
    11011088            elif event_type == 'sys_del_object':
    11021089                self.deleteRecord(student_id)
    1103                 #import pdb;pdb.set_trace()
    1104         #elif pt == 'StudentCourseResult' and mt == 'CPS Proxy Folder':
    1105         #    if event_type not in ("sys_add_object","sys_del_object"):
    1106         #        return
    1107         #    level_session = getattr(object.aq_parent.getContent(),'session','unknown')
    1108         #    if level_session not in (self.getSessionId()[-2:],'2006/2007'):
    1109         #        return
    1110         #    course_id = object.getId()
    1111         #    if course_id.endswith('_co'):
    1112         #        course_id = course_id[:-3]
    1113         #    student_id = object.absolute_url_path().split('/')[-4]
    1114         #    res = students_catalog(id = student_id)
    1115         #    if not res:
    1116         #        return
    1117         #    student_rec = res[0]
    1118         #    registered_courses = getattr(student_rec,'registered_courses',None)
    1119         #    if not registered_courses:
    1120         #        registered_courses = []
    1121         #    if event_type == "sys_add_object":
    1122         #        if course_id not in registered_courses:
    1123         #            registered_courses.append(course_id)
    1124         #        else:
    1125         #            return
    1126         #    elif registered_courses and event_type == "sys_del_object":
    1127         #        removed = False
    1128         #        while course_id in registered_courses:
    1129         #            removed = True
    1130         #            registered_courses.remove(course_id)
    1131         #        if not removed:
    1132         #            return
    1133         #    data['id'] = student_id
    1134         #    data['registered_courses'] = registered_courses
    1135         #    self.modifyRecord(record = student_rec, **data)
    1136         #    return
    11371090        if pt not in self.affected_types.keys():
    11381091            return
  • WAeUP_SRP/base/skins/waeup_epayment/pay_by_sc.py

    r2619 r2664  
    125125        wftool.doActionFor(student,next_transition)
    126126
    127     #if next_session == context.getSessionId()[-2:]:
    128     #    wftool.doActionFor(student,'pay_school_fee')
    129     #else:
    130     #    study_course = getattr(student,'study_course')
    131     #    #wftool.doActionFor(study_course,'open')
    132     #    study_course_doc = study_course.getContent()
    133     #    next_level = "%s" % (int(s_brain.level) + 100)
    134     #    study_course_doc.edit(mapping= {'current_level': next_level,
    135     #                                    'current_session': next_session,})
    136 
    137127    logger.info('%s paid school fee by scratch card' % student_id)
    138128else:
  • WAeUP_SRP/base/skins/waeup_epayment/pay_interswitch.py

    r2619 r2664  
    4444fee_dict = context.getSchoolFee(sbrain)
    4545fulltime = sbrain.mode.endswith('_ft')
    46 #new =  sbrain.entry_session == context.getSessionId()[-2:]
    4746new = sbrain.review_state == 'cleared_and_validated'
    4847returning = sbrain.review_state == 'returning'
  • WAeUP_SRP/base/skins/waeup_student/create_level.py

    r2611 r2664  
    6565    results = context.results_import(matric_no = student.matric_no)
    6666l = []
     67
     68
     69# fetch carry_over courses from results_import   
    6770if student.session in ('6', '06') and results:
    6871    carry_overs = results
     
    106109        d['session_id'] = session_id
    107110        records.append(d)
     111# fetch carry_over courses from the course_results catalog         
     112# else
    108113
     114# fetch session courses from the certificate 
    109115res = context.portal_catalog(portal_type="Certificate", id = cert_id)
    110116if res:
  • WAeUP_SRP/base/skins/waeup_student/getNextInfo.py

    r2656 r2664  
    4242    info['next_session_id'] = next_session_id = "%02d" % (int(session_id)+1)
    4343    if int(session_id) > 4:
     44        info['next_transition'] = "pay_school_fee"
    4445        info['next_verdict'] = ''
    4546        if verdict in ('A','B',):
     
    4748        else:
    4849            info['next_level_id'] = level_id
    49         if int(session_id) > int(context.getSessionId()[0]) -2:
    50             info['next_transition'] = "pay_school_fee"
    5150    else:
    5251        info['next_level_id'] = "%s" % (int(level_id) + 100)
  • WAeUP_SRP/base/skins/waeup_student/getStudyCourseInfo.py

    r2640 r2664  
    8181
    8282current_level = sbrain.level
    83 set_trace
    8483levels = context.objectIds()
    8584review_state = wftool.getInfoFor(context,'review_state',None)
    86 student_review_state = context.getStudentReviewState()
     85student_review_state = sbrain.review_state
    8786if review_state != 'content_addable' and student_review_state == 'school_fee_paid': #and context.isStudent():
    8887    wftool.doActionFor(context,'close_for_edit')
    89 may_register = (student_review_state in ('school_fee_paid',)) and\
    90                 current_level not in levels and\
    91                 (previous_verdict in ('A','B','C','F','J','L','M') or\
    92                 sbrain.level == '100' or\
     88   
     89has_paid = student_review_state == 'school_fee_paid'
     90
     91may_register = has_paid and\
     92               current_level not in levels and\
     93               (previous_verdict in ('A','B','C','F','J','L','M') or\
     94               sbrain.level == '100' or\
    9395               (sbrain.mode.startswith('de') and sbrain.level == '200'))
     96
     97
    9498levels.sort()
    9599info['create_level'] = None
  • WAeUP_SRP/base/skins/waeup_student/getStudyLevelInfo.py

    r2649 r2664  
    4646info['is_ca'] = is_ca = context.isCourseAdviser()
    4747info['student'] = student = context.students_catalog(id=student_id)[0]
    48 info['review_state'] = review_state = context.getStudentReviewState()
     48info['review_state'] = review_state = student.review_state
    4949info['view_only'] =  review_state != "school_fee_paid"
    50 info['show_check_boxes'] =  (is_ca and review_state in ('school_fee_paid',)) or\
    51                             (is_student and context.getStudentReviewState() == "school_fee_paid") or\
     50
     51
     52has_paid =  review_state == 'school_fee_paid'
     53
     54info['show_check_boxes'] =  (is_ca and has_paid) or\
     55                            (is_student and has_paid) or\
    5256                            (is_so)
     57
     58
    5359info['choosen_ids'] = request.get('ids',[])
    5460info['status_info'] = ""
     
    7783info['credits_exceeded'] = credits_total > max_credits
    7884current_session = student.session
    79 info['submission_allowed']= not info['credits_exceeded'] and\
    80     current_session == context.getSessionId()[0]
     85
     86info['submission_allowed']= review_state in  ('school_fee_paid','returning') and has_paid
     87info['validation_allowed']= review_state == 'courses_registered'
     88info['rejection_allowed']= review_state in ('courses_registered', 'courses_validated',)
     89
     90
    8191# carry_overs.sort(cmp_semester_id)
    8292info['carry_overs'] = carry_overs
     
    8696info['normal3'] = normal3
    8797
    88 info['data_missing'] = not info['normal1'] and not info['normal2'] and not info['normal3'] 
     98info['data_missing'] = not info['normal1'] and not info['normal2'] and not info['normal3']
    8999info['spillover'] = student.level > student.end_level
    90100
  • WAeUP_SRP/base/skins/waeup_student/study_level_view.pt

    r2649 r2664  
    148148   
    149149     
    150       <table tal:condition="python: is_student and review_state == 'school_fee_paid'" width="100%" cellspacing="0" cellpadding="2"
     150      <table tal:condition="python: is_student and info['submission_allowed']" width="100%" cellspacing="0" cellpadding="2"
    151151             class="folderButtons">
    152152        <tr>
     
    164164                     
    165165              <br /><br />
    166               <input tal:condition="info/submission_allowed"
     166              <input tal:condition="not: info/credits_exceeded"
    167167                     type="submit" name="register_courses:method"
    168168                     class="context" value="Submit to Course Adviser"
     
    210210                     class="context" value="Update"
    211211                     />
    212               <input tal:condition="python: review_state == 'school_fee_paid'" type="submit" name="register_courses:method"
     212              <input tal:condition="info/submission_allowed" type="submit" name="register_courses:method"
    213213                     class="context" value="Submit" /> 
    214               <input tal:condition="python: review_state == 'courses_registered'" type="submit" name="validate_courses:method"
     214              <input tal:condition="info/validation_allowed" type="submit" name="validate_courses:method"
    215215                     class="context" value="Validate" />
    216               <input tal:condition="python: review_state in ('courses_registered', 'courses_validated',)" type="submit" name="reject_courses:method"
     216              <input tal:condition="info/rejection_allowed" type="submit" name="reject_courses:method"
    217217                     class="context" value="Reject" />
    218218                     
     
    230230          <td align="left" valign="top" rowspan="3"></td>
    231231          <td align="left" valign="top">
    232               <input tal:condition="python: review_state == 'school_fee_paid'"
     232              <input tal:condition="python: info['submission_allowed']"
    233233                     type="button" value="Select all" class="context"
    234234                     onclick="someJavaScriptFunctionThatWillBeReplaced"
     
    237237                     % (cpsmcat('button_select_all'), cpsmcat('button_deselect_all'))"
    238238                     />
    239               <input tal:condition="python: review_state == 'school_fee_paid'"
     239              <input tal:condition="python: info['submission_allowed']"
    240240                     type="submit" name="delete_course_result:method" value="Delete selected"
    241241                     class="destructive" i18n:attributes="value"
     
    243243                     ('Do you really want to delete the courses selected?', )"
    244244                     />
    245               <input tal:condition="python: review_state == 'school_fee_paid'"
     245              <input tal:condition="python: info['submission_allowed']"
    246246                     type="submit" name="refresh_level:method"
    247247                     class="context" value="Update"
    248248                     />
    249               <input tal:condition="python: review_state == 'school_fee_paid'" type="submit" name="register_courses:method"
     249              <input tal:condition="info/submission_allowed" type="submit" name="register_courses:method"
    250250                     class="context" value="Submit" /> 
    251               <input tal:condition="python: review_state == 'courses_registered'" type="submit" name="validate_courses:method"
     251              <input tal:condition="info/validation_allowed" type="submit" name="validate_courses:method"
    252252                     class="context" value="Validate" />
    253               <input tal:condition="python: review_state in ('courses_registered', 'courses_validated',)" type="submit" name="reject_courses:method"
     253              <input tal:condition="info/rejection_allowed" type="submit" name="reject_courses:method"
    254254                     class="context" value="Reject" />
    255255                     
Note: See TracChangeset for help on using the changeset viewer.