Changeset 1557 for WAeUP_SRP/trunk


Ignore:
Timestamp:
15 Mar 2007, 16:00:27 (18 years ago)
Author:
joachim
Message:

display a list of students for the CourseAdviser?
fix for issue #115
M profiles/default/vocabularies/searchable_student_states.xml
M skins/waeup_default/isCourseAdviser.py
M skins/waeup_student/search_students.py
M skins/waeup_student/get_searchable_student_states.py
M skins/waeup_student/students_index.py
M skins/waeup_student/search_students_form.pt

don't delete courses twice
M skins/waeup_student/course_result_delete.py

more detailed error messages for invalid PINs fix for issue #108
M Widgets.py

inform student to contact faculty, if no courses are available
fix for #116
M skins/waeup_student/study_level_view.pt

Location:
WAeUP_SRP/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Widgets.py

    r1449 r1557  
    719719            err ='You are not a Student. PIN neither checked nor used.'
    720720            s_logger.info('"%s","tried to use Scratchcard", "%s"' % (s_id,pin_str))
     721        elif len(b) > 1 and b.find('-') > -1:
     722            do = 0
     723            err = 'PIN must not contain the "-"'
     724            s_logger.info('"%s","Invalid PIN-Number, contains -"' % (s_id))
     725        elif n.find('-') > -1:
     726            do = 0
     727            err = 'PIN must not contain the "-"'
     728            s_logger.info('"%s","Invalid PIN-Number, contains -"' % (s_id))
    721729        elif len(n) != 10:
    722730            do = 0
  • WAeUP_SRP/trunk/profiles/default/vocabularies/searchable_student_states.xml

    r1516 r1557  
    1919 <item key="clearance_requested" msgid="">clearance requested</item>
    2020 <item key="cleared_and_validated" msgid="">cleared and validated</item>
     21 <item key="courses_registered" msgid="">courses registered</item>
     22 <item key="courses_validated" msgid="">courses validated</item>
    2123 <item key="content_addable" msgid="">content addable</item>
    2224</object>
  • WAeUP_SRP/trunk/skins/waeup_default/isCourseAdviser.py

    r1515 r1557  
    1616mtool = context.portal_membership
    1717roles = mtool.getAuthenticatedMember().getRolesInContext(context)
     18return str("CourseAdviser" in roles)
    1819return "CourseAdviser" in roles
    1920
  • WAeUP_SRP/trunk/skins/waeup_student/course_result_delete.py

    r1482 r1557  
    1818ret_url = here.absolute_url()
    1919
     20message = ''
    2021if ids:
    21     here.manage_delObjects(ids)
    22     message = 'portal_status_message=psm_item(s)_deleted'
     22    real_ids = []
     23    for id in ids:
     24        if context.hasObject(id):
     25            real_ids.append(id)
     26    if real_ids:
     27        context.manage_delObjects(real_ids)
     28        message = 'portal_status_message=psm_item(s)_deleted'
    2329else:
    2430    message = 'portal_status_message=psm_select_at_least_one_document'
  • WAeUP_SRP/trunk/skins/waeup_student/get_searchable_student_states.py

    r1033 r1557  
    2323    return [item for item in voc.items() if item[0].startswith('clear') or
    2424                                         item[0] in ("all",)]
     25elif "CourseAdvisers" in member.getGroups():
     26    return [item for item in voc.items() if item[0].startswith('courses') or
     27                                         item[0] in ("all",)]
    2528return voc.items()
    2629
  • WAeUP_SRP/trunk/skins/waeup_student/search_students.py

    r1500 r1557  
    6161user_info['faculties'] = []
    6262co_view = False
     63ca_view = False
    6364faculties =  fget('faculties')
    6465departments = fget('departments')
    65 dep_str = fac_str = ''
     66certificate_level = fget('certificate_level')
     67dep_str = fac_str = certificate_level_str = ''
    6668if "ClearanceOfficers" in member.getGroups():
    6769    state = "clearance_requested"
     
    9395        user_info['departments'] = departments
    9496        dep_str = " ".join(departments)
     97elif "CourseAdvisers" in member.getGroups():
     98    state = "courses_registered"
     99    only_review = False
     100    ca_view = True
     101    if certificate_level:
     102        #from Products.zdb import set_trace;set_trace()
     103        certificate_level_str = certificate_level
     104        certificate_level = certificate_level.split()
     105    else:
     106        query = In('portal_type',('StudyLevel',)) &\
     107                 In('localUsersWithRoles', ("user:%s" % member,))
     108        res = evalAdvancedQuery(query)
     109        certificate_level = []
     110        if res:
     111            certificate_level = ['/'.join(f.getPath().split('/')[-2:]) for f in res]
     112        user_info['certificate_level'] = certificate_level
     113        certificate_level_str = " ".join(certificate_level)
    95114default = {'search_mode': 'student_id',
    96115        'review_state': state,
     
    106125                      faculties = fac_str,
    107126                      departments = dep_str,
     127                      certificate_level = certificate_level_str,
    108128                      commit = False,
    109129                      )
     
    200220        end = DateTime().timeTime()
    201221        logger.info('"%s","searchtime","%6.2f"' % (member,end-start))
     222elif ca_view:
     223    only_review = False
     224    with_review = True
     225    if with_timer:
     226        start = DateTime().timeTime()
     227        logger.info('"%s","start 200"' % member)
     228    courses = [cl.split('/')[0] for cl in certificate_level]
     229    levels = [cl.split('/')[1] for cl in certificate_level]
     230    query = In('course',courses) & In('level',levels)
     231    res = aq_students(query)
     232    if with_timer:
     233        end = DateTime().timeTime()
     234        logger.info('"%s","searchtime","%6.2f"' % (member,end-start))
     235        start = DateTime().timeTime()
     236    search_set = [r.id for r in res]
     237    if with_timer:
     238        end = DateTime().timeTime()
     239        logger.info('"%s","searchtime","%6.2f"' % (member,end-start))
    202240if with_timer:
    203241    logger.info('"%s","start 300"' % member)
  • WAeUP_SRP/trunk/skins/waeup_student/search_students_form.pt

    r1531 r1557  
    3535      </span>
    3636      </strong>
    37      
    38              
    3937        <h3> Search Student Section</h3><br />
    4038          You are logged in as member <span tal:replace="info/member|nothing" />
     
    4543          <span tal:condition="info/departments|nothing" tal:omit-tag="">
    4644            and <span tal:repeat="department info/departments|nothing" tal:content="department"/></span>.
     45          <span tal:condition="info/certificate_level|nothing" tal:omit-tag="">
     46            who is CourseAdviser for
     47            <span tal:repeat="cl info/certificate_level" tal:content="cl" />
     48          </span>
    4749          <br /><br />
    4850        <span tal:replace="structure rendered" />
  • WAeUP_SRP/trunk/skins/waeup_student/students_index.py

    r1239 r1557  
    2323students_url = "%s/campus/students" % (context.portal_url())
    2424
    25 if "ClearanceOfficers" in member.getGroups():
     25if "ClearanceOfficers" in member.getGroups() or\
     26   "CourseAdvisers" in member.getGroups():
    2627    return redirect("%s/search_students" % context.portal_url())
    2728if context.isSectionOfficer():
  • WAeUP_SRP/trunk/skins/waeup_student/study_level_view.pt

    r1519 r1557  
    6363        <h4>Session Courses</h4>
    6464        <br />
    65         <table class="contentListing" width="100%" summary="content layout" id="folder_content">     
     65      <div class="" tal:condition="not: info/normal">
     66        Your faculty has not yet provided the list of courses for your certificate. Please contact your faculty!
     67      </div>
     68        <table class="contentListing" width="100%" id="folder_content"
     69               tal:condition="info/normal">     
    6670          <tr tal:repeat="row info/normal"
    6771              tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
     
    106110                       />
    107111                <br /><br />
    108                 <input type="submit" name="register_courses:method"
     112                <input tal:condition="info/normal"
     113                       type="submit" name="register_courses:method"
    109114                       class="context" value="Submit" />
    110115            </td>
Note: See TracChangeset for help on using the changeset viewer.