Ignore:
Timestamp:
28 Mar 2007, 02:35:25 (18 years ago)
Author:
uli
Message:

Incorporated changeset 1593:1652 of trunk into uli-branch.

Location:
WAeUP_SRP/branches/uli/skins/waeup_student
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/branches/uli/skins/waeup_student/add_course_result.py

    r1593 r1653  
    3838    if d['title'] == 'unknown':
    3939        err = "No such course!"
    40         logger.info('%s tried to add StudentCourseResult object %s for non-existing course' % (member,course_id))
     40        #logger.info('%s tried to add StudentCourseResult object %s for non-existing course' % (member,course_id))
    4141        break
    4242    if context.hasObject(course_id):
    4343        err = "Course already exists!"
    44         logger.info('%s tried to add StudentCourseResult object %s which is already in course list' % (member,course_id))
     44        #logger.info('%s tried to add StudentCourseResult object %s which is already in course list' % (member,course_id))
    4545        break
    4646    if context.hasObject("%s_co" % course_id):
    4747        err = "Course already exists as carryover course!"
    48         logger.info('%s tried to add StudentCourseResult object %s which already exists as carryover course' % (member,course_id))
     48        #logger.info('%s tried to add StudentCourseResult object %s which already exists as carryover course' % (member,course_id))
    4949        break
    5050    break
     
    5454    #args['error'] = err
    5555    args['portal_status_message'] = err
    56     url = "%s?%s" % (context.absolute_url(),urlencode(args))
     56    url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args)
    5757    return request.RESPONSE.redirect(url)
    5858
     
    6666args['course_id'] = course_id
    6767
    68 logger.info('%s added StudentCourseResult object %s' % (member,course_id))
     68logger.info('%s added StudentCourseResult object %s for %s' % (member,course_id,context.getStudentId()))
    6969
    70 args = {}
    7170psm = "You successfully added course %s!" % course_id
    7271args['portal_status_message'] = psm
    73 url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args)
     72if action_after_validate:
     73    url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args)
     74else:
     75    url = context.absolute_url() + '?' + urlencode(args)
    7476return REQUEST.RESPONSE.redirect(url)
    7577
  • WAeUP_SRP/branches/uli/skins/waeup_student/change_password.py

    r1593 r1653  
    44
    55"""
     6
     7return
     8
     9
     10
     11
     12
     13
     14
     15
    616request = context.REQUEST
    717import DateTime,logging
  • WAeUP_SRP/branches/uli/skins/waeup_student/clearance_edit.py

    r1593 r1653  
    120120        wftool.doActionFor(info['clear'],'open')
    121121        wftool.doActionFor(info['student'],'reject_clearance')
    122         action = "/contact_student_form"
     122        action = "/external_contact_student_form"
    123123        psm = "Student's clearance request has been rejected! Please fill and submit the form below!"
    124124        subject = "Clearance request rejected"
  • WAeUP_SRP/branches/uli/skins/waeup_student/contact_student_form.pt

    r1593 r1653  
    2828      <input type="hidden" name="probtype" type="text" id="probtype"
    2929             tal:attributes="value subject"/>     
     30      <input type="hidden" name="action" type="text" id="action"
     31             tal:attributes="value continue"/> 
    3032             
    3133      <table width="100%" border="0" cellspacing="5" cellpadding="0">
  • WAeUP_SRP/branches/uli/skins/waeup_student/course_registration_slip.pt

    r1593 r1653  
    1919     
    2020      <div tal:condition="validated">
    21         - validated by Course Adviser -
     21        - validated by Course Adviser -
     22      <span tal:condition="info/doc/validated_by|nothing" tal:omit-tag="">
     23        <span tal:replace="info/doc/validated_by" /> on <span tal:replace="info/doc/validation_date" />
     24      </span>
    2225      </div>
    2326      <div tal:condition="not: validated">
  • WAeUP_SRP/branches/uli/skins/waeup_student/create_level.py

    r1593 r1653  
    3131current_level = student.level
    3232in_progress =  request.get('in_progress','not started')
     33level_created =  request.get('level_created','xxx')
     34create_level =  request.get('create_level',None)
    3335
    34 if context.hasObject(current_level):
    35     response.redirect("%s/%s" % (context.absolute_url(),current_level))
     36if context.hasObject(current_level) and create_level :
     37    logger.info('%s", level %s already exists' % (student.id,current_level))
    3638    return
    3739
    38 if in_progress in ('not started','started'):
    39     session.set('in_progress','started')
    40     view = context.in_progress_view(refresh=3,page='create_level?in_progress=started')
    41     response.setHeader('Content-type','text/html; charset=ISO-8859-15')
    42     response.setHeader('Content-length','%d' % (len(view)))
    43     response.setStatus('OK')
    44     response.write(view)
    45     response.write('')
    46     if in_progress == 'started':
    47         return
     40##if in_progress in ('not started','started'):
     41##    session.set('in_progress','started')
     42##    view = context.in_progress_view(refresh=20,page='create_level?in_progress=started')
     43##    response.setHeader('Content-type','text/html; charset=ISO-8859-15')
     44##    response.setHeader('Content-length','%d' % (len(view)))
     45##    response.setStatus('OK')
     46##    response.write(view)
     47##    response.write('')
     48##    if in_progress == 'started':
     49##        return
    4850   
    49 
    50 context.invokeFactory('StudentStudyLevel',"%s" % current_level)
    51 level = getattr(context,"%s" % current_level)
    52 context.portal_workflow.doActionFor(level,'open')
    53 study_session = context.getSessionString()
    54 level.getContent().edit(mapping={'session': study_session})
    55 context.portal_workflow.doActionFor(level,'close_for_edit')
     51if level_created == current_level:
     52    level = getattr(context,"%s" % current_level)
     53else:
     54    context.invokeFactory('StudentStudyLevel',"%s" % current_level)
     55    level = getattr(context,"%s" % current_level)
     56    context.portal_workflow.doActionFor(level,'open')
     57    study_session = context.getSessionString()
     58    level.getContent().edit(mapping={'session': study_session})
     59    context.portal_workflow.doActionFor(level,'close_for_edit')
     60    response.redirect("%s?level_created=%s" % (context.absolute_url(),current_level))
    5661results = context.results_import(matric_no = student.matric_no)
    5762if results:
     
    9095        context.portal_workflow.doActionFor(course_result,'open')
    9196        course_result.getContent().edit(mapping=d)
    92 res = context.portal_catalog(portal_type="Certificate", id = cert_id)
    93 l = []
    94 if res:
    95     cert = res[0]
    96     path = cert.getPath()
    97     query = Eq("path",path) &\
    98             Eq('portal_type','CertificateCourse') &\
    99             Eq('SearchableText', "%s" % student.level)
    100     courses = aq_portal(query)
    101     for c in courses:
    102         d = context.getCourseInfo(c.getId)
    103         cr_id = level.invokeFactory('StudentCourseResult',c.getId)
    104         course_result = getattr(level,cr_id)
    105         context.portal_workflow.doActionFor(course_result,'open')
    106         d['core_or_elective'] = getattr(c.getObject().getContent(),'core_or_elective')
    107         course_result.getContent().edit(mapping=d)
    108 return
     97level['create_course_results'](cert_id,current_level)
     98##res = context.portal_catalog(portal_type="Certificate", id = cert_id)
     99##l = []
     100##if res:
     101##    cert = res[0]
     102##    path = cert.getPath()
     103##    #set_trace()
     104##    query = Eq("path","%s/%s" % (path,current_level)) &\
     105##            Eq('portal_type','CertificateCourse')
     106##    courses = aq_portal(query)
     107##    for c in courses:
     108##        d = context.getCourseInfo(c.getId)
     109##        cr_id = level.invokeFactory('StudentCourseResult',c.getId)
     110##        course_result = getattr(level,cr_id)
     111##        context.portal_workflow.doActionFor(course_result,'open')
     112##        d['core_or_elective'] = getattr(c.getObject().getContent(),'core_or_elective')
     113##        course_result.getContent().edit(mapping=d)
     114       
     115return response.redirect("%s/%s" % (context.absolute_url(),current_level))
     116
  • WAeUP_SRP/branches/uli/skins/waeup_student/delete_course_result.py

    r1593 r1653  
    1414
    1515from Products.CMFCore.utils import getToolByName
     16from AccessControl import Unauthorized
     17
    1618here = context
    1719from urllib import urlencode
     
    3032            real_ids.append(id)
    3133    if real_ids:
    32         context.manage_delObjects(real_ids)
    33         logger.info('%s deleted StudentCourseResult object %s' % (member,id))
    34         message = 'psm_item(s)_deleted'
     34        try:
     35            context.manage_delObjects(real_ids)
     36            logger.info('%s deleted StudentCourseResult object %s for %s' % (member,id,context.getStudentId()))
     37            message = 'psm_item(s)_deleted'
     38        except Unauthorized:
     39            logger.info('%s has no permission to delete StudentCourseResult objects for %s' % (member,context.getStudentId()))
     40            message = 'no item(s) deleted'
    3541else:
    3642    message = 'psm_select_at_least_one_document'
    37    
     43
    3844args = {}
    3945args['portal_status_message'] = message
    40 url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args)
     46
     47if action_after_validate:
     48    url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args)
     49else:
     50    url = context.absolute_url() + '?' + urlencode(args)
    4151if REQUEST is not None:
    42     return REQUEST.RESPONSE.redirect(url)   
     52    return REQUEST.RESPONSE.redirect(url)
  • WAeUP_SRP/branches/uli/skins/waeup_student/getSessionResults.py

    r1593 r1653  
    101101#set_trace()
    102102verdict_voc = context.portal_vocabularies.verdicts
    103 verdict_code = student_from_cat.get('verdict',None)
     103verdict_code = student_from_cat.verdict
    104104if verdict_code:
    105105    info['verdict'] = verdict = verdict_voc.get(verdict_code,'N/A').upper()
  • WAeUP_SRP/branches/uli/skins/waeup_student/getStudyCourseInfo.py

    r1593 r1653  
    2525info = {}
    2626info['is_so'] = context.isSectionOfficer()
    27 info['action'] = "%s" % context.campus.absolute_url()
     27info['action'] = "%s" % context.absolute_url()
    2828info['choosen_ids'] = request.get('ids',[])
    2929course  = info['doc'] = context.getContent()
     
    5757may_register = (student_review_state in ('school_fee_paid',)) and\
    5858               current_level not in levels and\
    59                (sbrain.verdict in ('A','B') or sbrain.jamb_reg_no.startswith('6'))
     59               (sbrain.verdict in ('A','B','C') or sbrain.jamb_reg_no.startswith('6'))
    6060
    6161levels.sort()
  • WAeUP_SRP/branches/uli/skins/waeup_student/getStudyLevelInfo.py

    r1593 r1653  
    4040    return 0.0
    4141
    42 def cmp_semester(a,b):
    43     if a['semester'] == b['semester']:
     42def cmp_semester_id(a,b):
     43    s1 = "%(semester)s%(id)s" % a
     44    s2 = "%(semester)s%(id)s" % b
     45    if s1 == s2:
    4446        return 0
    45     if a['semester'] > b['semester']:
     47    if s1 > s2:
    4648        return 1
    4749    return -1
     
    104106        normal.append(d)
    105107info['credits_total'] = credits_total
    106 carry_overs.sort(cmp_semester)
     108carry_overs.sort(cmp_semester_id)
    107109info['carry_overs'] = carry_overs
    108 normal.sort(cmp_semester)
     110normal.sort(cmp_semester_id)
    109111info['normal'] = normal
    110112
  • WAeUP_SRP/branches/uli/skins/waeup_student/layout_personal_view.pt

    r1201 r1653  
    99      <td><span class="dlabel">Student ID</span>:
    1010      </td>
    11       <td tal:condition="nothing">
     11      <td>
    1212         <span tal:replace="context/getStudentId" />
    1313      </td>     
  • WAeUP_SRP/branches/uli/skins/waeup_student/mail2student.py

    r1593 r1653  
    55##bind script=script
    66##bind subpath=traverse_subpath
    7 ##parameters=co_name=None,co_email=None,student_email=None,probtype=None,commt=None
     7##parameters=co_name=None,co_email=None,student_email=None,probtype=None,commt=None, action=None
    88##title=
    99##
    1010# $Id: mail2admin.py 869 2006-11-15 13:46:49Z henrik $
     11
     12from urllib import urlencode
    1113
    1214mhost = context.MailHost
     
    2729#prop.email_from_address should be used for To:
    2830REQUEST = context.REQUEST
    29 url_tuple = REQUEST.HTTP_REFERER.split('?')
    30 if len(url_tuple) == 2:
    31     url_tuple[1] ='portal_status_message=Your message has been sent!'
    32 else:
    33     url_tuple.append('portal_status_message=Your message has been sent!')
    34 redirect_url = "?".join(url_tuple)
    35 REQUEST.set('rurl', redirect_url) # to see the result in the error log
     31
     32#url_tuple = REQUEST.HTTP_REFERER.split('?')
     33#if len(url_tuple) == 2:
     34#    url_tuple[1] ='portal_status_message=Your message has been sent!'
     35#else:
     36#    url_tuple.append('portal_status_message=Your message has been sent!')
     37#redirect_url = "?".join(url_tuple)
     38#REQUEST.set('rurl', redirect_url) # to see the result in the error log
     39
    3640msg = message % (
    3741     co_name,
     
    3943     student_email,
    4044     co_email,
    41      'henrik@waeup.org',
     45     'waeup@saoas.org',
    4246#    'js@aixtraware.de',
    4347     co_email,
     
    4751mhost.send(msg)
    4852
    49 REQUEST = context.REQUEST
    50 RESPONSE = REQUEST.RESPONSE
    5153
    52 RESPONSE.redirect(redirect_url)
     54#REQUEST = context.REQUEST
     55#RESPONSE = REQUEST.RESPONSE
     56#RESPONSE.redirect(redirect_url)
     57
     58args = {}
     59psm = "Your message has been sent!"
     60args['portal_status_message'] = psm
     61if action:
     62    url = context.absolute_url() + '/' + action + '?' + urlencode(args)
     63else:
     64    url = context.absolute_url() +'?' + urlencode(args)
     65return REQUEST.RESPONSE.redirect(url)
     66
     67
     68
  • WAeUP_SRP/branches/uli/skins/waeup_student/refresh_level.py

    r1593 r1653  
    112112psm = "Course list updated!"
    113113args['portal_status_message'] = psm
    114 url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args)
     114if action_after_validate:
     115    url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args)
     116else:
     117    url = context.absolute_url() + '?' + urlencode(args)
    115118return REQUEST.RESPONSE.redirect(url)
  • WAeUP_SRP/branches/uli/skins/waeup_student/register_courses.py

    r1593 r1653  
    1919        pass
    2020
    21 from urllib import urlencode       
     21from urllib import urlencode
    2222
    2323request = context.REQUEST
     
    4747psm = "You successfully submitted your course list!"
    4848args['portal_status_message'] = psm
    49 url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args)
     49if action_after_validate:
     50    url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args)
     51else:
     52    url = context.absolute_url() + '?' + urlencode(args)
    5053return REQUEST.RESPONSE.redirect(url)
  • WAeUP_SRP/branches/uli/skins/waeup_student/reject_courses.py

    r1593 r1653  
    4646args['continue'] = action_after_validate
    4747args['portal_status_message'] = psm
    48 url = context.absolute_url() + '/' + action_after_reject + '?' + urlencode(args)
     48if action_after_reject:
     49    url = context.absolute_url() + '/' + action_after_reject + '?' + urlencode(args)
     50else:
     51    url = context.absolute_url() + '?' + urlencode(args)
    4952return REQUEST.RESPONSE.redirect(url)
  • WAeUP_SRP/branches/uli/skins/waeup_student/statistics_new_view.pt

    r1532 r1653  
    3333            <th align="right">CR</th>
    3434            <th align="right">VC</th>
    35             <th align="right">SFP</th>
     35            <th align="right">SFP+</th>
    3636          </tr>
    3737          <tr tal:repeat="d departments"
     
    7474        <tr><td>CR: </td> <td>Clearance requested</td></tr>
    7575        <tr><td>VC: </td> <td>Validated and cleared</td></tr>
    76         <tr><td>SFP: </td> <td>School fee paid</td></tr>
     76        <tr><td>SFP+: </td> <td>School fee paid and further</td></tr>
    7777        </table>
    7878      </span>
  • WAeUP_SRP/branches/uli/skins/waeup_student/statistics_ret_view.pt

    r1593 r1653  
    3434            <th >Faculty</th>
    3535            <th align="right">RET</th>
    36             <th align="right">SFP</th>
     36            <th align="right">SFP+</th>
    3737          </tr>
    3838          <tr tal:define="d python:departments[0]"
     
    6060        <table>
    6161        <tr><td>RET:</td> <td>Returning students who have logged in</td></tr>
    62         <tr><td>SFP:</td> <td>Returning students who already paid their school fee</td></tr>
     62        <tr><td>SFP:</td> <td>Returning students who paid their school fee</td></tr>
    6363        </table>       
    6464      </span>
  • WAeUP_SRP/branches/uli/skins/waeup_student/study_course_view.pt

    r1518 r1653  
    6666            tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
    6767            <td align="left" valign="middle" style="width: 5px;"
    68                 tal:condition="python: 0 and is_so">
     68                tal:condition="python:is_so">
    6969              <input type="checkbox" name="ids:list" value="" id="" class="noborder"
    7070                     tal:condition="is_so"
     
    8484               summary="contents of the folder"
    8585               class="folderButtons">
    86           <tr>
     86          <tr tal:condition="python: is_so and info['items']">
    8787            <td align="left" valign="top" rowspan="3"></td>
    8888            <td align="left" valign="top">
    89               <span tal:condition="python:0 and is_so">
    90                 <input type="button" value="button_select_all" class="context"
     89              <input type="button" value="button_select_all" class="context"
    9190                       onclick="someJavaScriptFunctionThatWillBeReplaced"
    9291                       i18n:attributes="value"
     
    9493                       % (cpsmcat('button_select_all'), cpsmcat('button_deselect_all'))"
    9594                       />
    96                 <input type="submit" name="folder_delete:method" value="button_delete"
    97                        class="destructive" i18n:attributes="value"
    98                        tal:attributes="onclick python:'return window.confirm(\'%s\')' %
    99                        (cpsmcat('description_confirm_delete'), )"
    100                        />
    101               </span>
     95              <input type="submit" name="folder_delete:method" value="button_delete"
     96                     class="destructive" i18n:attributes="value"
     97                     tal:attributes="onclick python:'return window.confirm(\'%s\')' %
     98                     (cpsmcat('description_confirm_delete'), )"
     99                     />
    102100            </td>
    103101          </tr>
  • WAeUP_SRP/branches/uli/skins/waeup_student/study_level_view.pt

    r1593 r1653  
    6464        <br />
    6565      <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!
     66        <font color="red">Your faculty has not yet provided the list of courses for your certificate. Please contact your faculty!</font>
     67        <br /><br />
    6768      </div>
    6869        <table class="contentListing" width="100%" id="folder_content"
     
    109110                       class="context" value="Update"
    110111                       />
     112                     
     113                       
    111114                <br /><br />
    112115                <input tal:condition="info/normal"
    113116                       type="submit" name="register_courses:method"
    114117                       class="context" value="Submit" />
     118                       
     119                <input type="hidden" name="action_after_validate" type="text" id="action_after_validate"
     120                       tal:attributes="value string:study_level_view"/> 
     121                       
     122                <br /><br />
     123               
     124                <strong>Note:</strong> 'Update' checks for all courses in your certificate and will add them to your course list irrespective of
     125                prior deletion, i.e. already deleted courses will show up again.
     126               
     127                Please use this function only if you are sure that your faculty has added courses which are not yet on your course list.                               
     128                       
    115129            </td>
    116130          </tr>
     
    142156                <input tal:condition="python: review_state in ('courses_registered', 'courses_validated',)" type="submit" name="reject_courses:method"
    143157                       class="context" value="Reject" />
     158                       
     159                <input type="hidden" name="action_after_validate" type="text" id="action_after_validate"
     160                       tal:attributes="value string:study_level_view"/>                         
     161                <input type="hidden" name="action_after_reject" type="text" id="action_after_reject"
     162                       tal:attributes="value string:contact_student_form"/>                         
    144163
    145164            </td>
     
    176195                       
    177196                <input type="hidden" name="action_after_validate" type="text" id="action_after_validate"
    178                        tal:attributes="value string:/study_level_view"/>                         
     197                       tal:attributes="value string:study_level_view"/>                         
    179198                <input type="hidden" name="action_after_reject" type="text" id="action_after_reject"
    180                        tal:attributes="value string:/contact_student_form"/>   
     199                       tal:attributes="value string:contact_student_form"/>   
    181200                                             
    182201
     
    199218                     />
    200219              <input type="hidden" name="action_after_validate" type="text" id="action_after_validate"
    201                        tal:attributes="value string:/study_level_view"/>                       
     220                       tal:attributes="value string:study_level_view"/>                       
    202221            </td>               
    203222        </table>
  • WAeUP_SRP/branches/uli/skins/waeup_student/validate_courses.py

    r1593 r1653  
    1313"""
    1414from Products.CMFCore.WorkflowCore import WorkflowException
     15import DateTime
     16current = DateTime.DateTime()
    1517try:
    1618    from Products.zdb import set_trace
     
    3032student_id = context.getStudentId()
    3133student = getattr(students_folder,student_id)
     34level_doc = context.getContent()
     35if level_doc.portal_type == 'StudentStudyLevel':
     36    level_doc.edit(mapping={'validated_by': member_id,
     37                            'validation_date': current,})
    3238try:
    3339    wftool.doActionFor(student,'validate_courses')
Note: See TracChangeset for help on using the changeset viewer.