Changeset 999 for WAeUP_SRP/trunk/skins


Ignore:
Timestamp:
6 Dec 2006, 10:46:32 (18 years ago)
Author:
joachim
Message:

edit app_ac_pin if not set (logged_in.py)
set default to all states (search students)

Location:
WAeUP_SRP/trunk/skins
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_academics/academics_contents.pt

    r502 r999  
    5353
    5454<!-- a content_lib macro -->
    55 <!-- $Id$ -->
     55<!-- from content_lib_display_contents_column.pt academics_contents.pt -->
    5656
    5757<!-- List contents in 'items' in the specified number of columns
     
    5959
    6060<tal:block
    61   define="tmp_format format|nothing;
     61  define="no_ajax not:nothing;
     62          tmp_format format|nothing;
    6263          tmp_sort_by sort_by|nothing;
    6364          tmp_direction direction|nothing;
     
    118119      <td align="left" valign="top">
    119120       <tal:block define="no_form not:nothing;
     121                          no_ajax no_ajax|nothing;
    120122         info python:here.getContentInfo(item, level=1, cpsmcat=cpsmcat);">
    121123         <metal:block use-macro="here/content_lib_info_summary/macros/info_summary" />
     
    133135        <tal:block condition="batch_items">
    134136<!-- a content_lib macro -->
    135 <!-- $Id$ -->
     137<!-- from content_lib_info_detail_tab.pt -->
    136138
    137139<!-- Final display of items in a column using the given format -->
     
    150152                                     ('Manager', 'WorkspaceManager'), here);
    151153">
    152   <div id="ajax_psm" style="display:none" tal:condition="python:not no_form">
     154  <div id="ajax_psm" style="display:none" tal:condition="python:not no_form and not no_ajax">
    153155      ajax feedback
    154156  </div>
     
    170172  XXX Deactivated for CPS 3.4.0, will be re-enabled for 3.4.1
    171173
    172   <tal:block tal:condition="python:not no_form and sort_by is None"
     174  <tal:block tal:condition="python:not no_form and not no_ajax and sort_by is None"
    173175               tal:define="ajax_working_msg python:cpsmcat('ajax_working');
    174176                           ajax_working_msg python:ajax_working_msg.replace('\'', '\\\'');
  • WAeUP_SRP/trunk/skins/waeup_custom/logged_in.py

    r998 r999  
    4545member = mtool.getAuthenticatedMember()
    4646
    47 if True or not redirect_url or redirect_url.endswith('/logged_out'):
    48     if not is_anon:
    49         if "Student" in member.getRoles():
    50             to_waeup_student_home = True
    51             #info = context.getStudentInfo()
    52             #student = info['student']
    53             students = context.portal_url.getPortalObject().campus.students
    54             student = getattr(students,str(member))
    55             student_app = getattr(student,'application')
    56             student_pume = getattr(student,'pume',None)
    57             s_review_state = wftool.getInfoFor(student,'review_state',None)
    58             a_review_state = wftool.getInfoFor(student_app,'review_state',None)
    59             #if info['review_state'] in ("student_created","admitted") and\
    60             #wftool.getInfoFor(info['app'],'review_state',None) == 'created' :
    61             if s_review_state in ("student_created","admitted") and\
    62             a_review_state == 'created' :
    63                 #student.content_status_modify(workflow_action="enter_clearance_pin")
    64                 #wftool.doActionFor(info['app'],'open')
    65                 wftool.doActionFor(student_app,'open')
    66                 #wftool.doActionFor(info['pume'],'close')
    67                 #if info['pume'] is not None:
    68                 if student_pume is not None:
    69                   #wftool.doActionFor(info['pume'],'close')
    70                   wftool.doActionFor(student_pume,'close')
     47if not is_anon:
     48    if "Student" in member.getRoles():
     49        to_waeup_student_home = True
     50        students = context.portal_url.getPortalObject().campus.students
     51        student = getattr(students,str(member))
     52        student_app = getattr(student,'application')
     53        student_pume = getattr(student,'pume',None)
     54        s_review_state = wftool.getInfoFor(student,'review_state',None)
     55        a_review_state = wftool.getInfoFor(student_app,'review_state',None)
     56        app_doc = student_app.getContent()
     57        #from Products.zdb import set_trace
     58        #set_trace()
     59        if s_review_state in ("student_created","admitted") and\
     60        a_review_state == 'created' :
     61            wftool.doActionFor(student_app,'open')
     62            if student_pume is not None:
     63              wftool.doActionFor(student_pume,'close')
     64            da = {}
     65            pin = request.get('pin')
     66            if not pin:
     67                jamb_reg_no = app_doc.jamb_reg_no
     68                for reg_no in (jamb_reg_no,jamb_reg_no.lower(),jamb_reg_no.upper()):
     69                    res = context.portal_pins(student=reg_no)
     70                    if len(res) > 0:
     71                        break
     72                if len(res) > 0:
     73                    p = res[0].pin
     74                    if len(p) > 10:
     75                        pin = "%s-%s-%s" % (p[:3],p[3:4],p[4:])
     76                    else:
     77                        pin = p
     78            da['app_ac_pin'] = pin
     79            da['app_ac_date'] = current
     80            app_doc.edit(mapping = da)
     81        elif s_review_state in ("admitted") and a_review_state == 'opened' and\
     82        not app_doc.app_ac_pin:
     83            jamb_reg_no = app_doc.jamb_reg_no
     84            for reg_no in (jamb_reg_no,jamb_reg_no.lower(),jamb_reg_no.upper()):
     85                res = context.portal_pins(student=reg_no)
     86                if len(res) > 0:
     87                    break
     88            if len(res) > 0:
     89                p = res[0].pin
     90                if len(p) > 10:
     91                    pin = "%s-%s-%s" % (p[:3],p[3:4],p[4:])
     92                else:
     93                    pin = p
    7194                da = {}
    72                 pin = request.get('pin')
    73                 app_doc = student_app.getContent()
    74                 if not pin:
    75                     app_doc = student_app.getContent()
    76                     jamb_reg_no = app_doc.jamb_reg_no
    77                     res = context.portal_pins(student=jamb_reg_no)
    78                     if len(res) == 1:
    79                         p = res[0].pin
    80                         if len(p) > 10:
    81                             pin = "%s-%s-%s" % (p[:3],p[3:4],p[4:])
    82                         else:
    83                             pin = p
    84 ##                email = request.get('email')
    85                 #app_doc = info['app_doc']
    8695                da['app_ac_pin'] = pin
    87 ##                da['app_email'] = email
    88                 da['app_ac_date'] = current
    8996                app_doc.edit(mapping = da)
    90 ##                dc = {}
    91 ##                dc['clr_ac_pin'] = pin
    92 ##                dc['entry_date'] = current
    93 ##                dc['session'] = "%s" % current.year()
    94 ##                dc['lga'] = app_doc.jamb_lga
    95 ##                info['clear_doc'].edit(mapping = dc)
    96         elif "Manager" in member.getRoles():
    97             pass
    98         else:
    99             to_member_home, to_workspaces = checkRedirect(portal, mtool)
    100     if (not to_member_home) and (not to_workspaces):
    101         redirect_to_portal = True
    102 else:
    103     redirect_url = unquote(redirect_url)
    104     # One can be redirected from an http page while the login is done from an
    105     # https page. This is a fix for #1205.
    106     # A better option here would be to replace the previous portal_absolute_url
    107     # prefix in the redirect_url by the current portal absolute URL.
    108     if not redirect_url.startswith(portal_absolute_url):
    109         if not is_anon:
    110             to_member_home, to_workspaces = checkRedirect(portal, mtool)
    111         if (not to_member_home) and (not to_workspaces):
    112             redirect_to_portal = True
     97    elif "Manager" in member.getRoles():
     98        pass
     99    else:
     100        to_member_home, to_workspaces = checkRedirect(portal, mtool)
     101if (not to_member_home) and (not to_workspaces):
     102    redirect_to_portal = True
    113103
    114104if to_waeup_student_home:
  • WAeUP_SRP/trunk/skins/waeup_pins/batch_view.pt

    r930 r999  
    2626        <br />
    2727       
    28         <span tal:condition="python:member.id in ('admin','perry')">       
     28        <span tal:condition="python:member.id in ('admin','joachim')">       
    2929        <h3>Unused</h3>
    3030        <table>
  • WAeUP_SRP/trunk/skins/waeup_student/check_admission.py

    r997 r999  
    4848elif psm == 'valid':
    4949    s_id = ds.get('s_id')
     50<<<<<<< .mine
     51    if is_anon and not s_id:
     52        return context.check_admission_pin_form(rendered = res,
     53                                 psm = "You are not allowed to do this in this context",
     54                                 #psm = "%s, %s" % (psm,ds),
     55                                 firstlayout = True,
     56                                 lastlayout = True,
     57                                 ds = ds,
     58                                 )
     59    elif not is_anon:
     60        return context.check_admission_pin_form(rendered = res,
     61                                 psm = "You are logged in",
     62                                 #psm = "%s, %s" % (psm,ds),
     63                                 firstlayout = True,
     64                                 lastlayout = True,
     65                                 ds = ds,
     66                                 )
     67=======
    5068    if is_anon and not s_id:
    5169        return context.check_admission_pin_form(rendered = res,
     
    6482                                 ds = ds,
    6583                                 )
     84>>>>>>> .r998
    6685## 
    6786##    email = ds.get('app_email')
  • WAeUP_SRP/trunk/skins/waeup_student/search_students.py

    r985 r999  
    5050validate = request.has_key("cpsdocument_edit_button")
    5151default = {'search_mode': 'name',
    52         'review_state': 'clearance_requested',
     52        'review_state': 'all',
    5353        'search_string': ''
    5454        }
  • WAeUP_SRP/trunk/skins/waeup_student/student_index.py

    r903 r999  
    1616redirect = request.RESPONSE.redirect
    1717pm = context.portal_membership
     18member = pm.getAuthenticatedMember()
    1819
    1920if context.isStaff():
     
    2526        return context.clearance_view()
    2627    elif context.portal_type == 'Student':
    27         return redirect("%s/student_view" % context.absolute_url())
     28        return redirect("%s/student_view" % context.absolute_url())
    2829    return redirect("%s/waeup_document_view" % context.absolute_url())
    2930if context.isStudent():
    30     info = context.getStudentInfo()
    31     student = info['student']
     31    students = context.portal_url.getPortalObject().campus.students
     32    student = getattr(students,str(member))
    3233    return redirect("%s/student_view" % student.absolute_url())
    3334
Note: See TracChangeset for help on using the changeset viewer.