Changeset 2160 for WAeUP_SRP


Ignore:
Timestamp:
24 Aug 2007, 09:47:46 (17 years ago)
Author:
Henrik Bettermann
Message:

assume role also in state 'entered'

Location:
WAeUP_SRP/trunk/skins/waeup_student
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_student/apply_pume.py

    r2159 r2160  
    4444    else:
    4545        mode = "create"
    46 validate = create or edit or apply_pume or manage
     46validate = create or edit or apply_pume
     47
     48if manage:
     49    validate = False
    4750
    4851lt = context.portal_layouts
     
    5861            object[field] = getattr(brains[0],field,None)
    5962        if not object['passport']:
    60             object['passport'] = ''
     63                object['passport'] = ''
    6164        if object['status'] == "submitted":
    6265            submitted = True
     
    6770    mode = "view_slip"
    6871    logger.info('%s/%s views application slip' % (member,reg_no))
     72
    6973res,psm,ds = lt.renderLayout(layout_id= 'application',
    7074                             schema_id= 'application',
     
    9195                                   ds = ds,
    9296                                  )
    93 elif psm == '':
     97elif psm == '' and not manage:
    9498    return context.apply_pume_form(rendered = res,
    9599                                   psm = None,
     
    97101                                   mode = mode,
    98102                                  )
    99 elif psm == 'valid':
     103elif psm == 'valid' or (psm == '' and manage):
    100104    pass
    101105data = {}
     
    105109        data[field] = dm.get(field)
    106110data['reg_no'] = reg_no
     111
     112
     113
    107114if apply_pume:
    108115    if submitted:
     
    193200        logger.info('%s/%s entered application record' % (member,reg_no))
    194201
    195    
     202
     203try:   
     204    passport_uploaded = bool(data['passport'])
     205except:
     206    passport_uploaded = False
    196207
    197208return context.apply_pume_form(rendered = res,
     
    199210                            #psm = "%s, %s" % (psm,ds),
    200211                            mode = mode,
    201                             show_submit =  bool(data['passport']),
     212                            show_submit = passport_uploaded,
    202213                            ds = ds,
    203214                            )
  • WAeUP_SRP/trunk/skins/waeup_student/apply_pume_manage.py

    r2158 r2160  
    1 ## Script (Python) "apply_pume"
     1## Script (Python) "apply_pume_manage"
    22##bind container=container
    33##bind context=context
     
    3939lt = context.portal_layouts
    4040
    41 reg_no = request.get('reg_no','')
    42 new_reg_no = request.get('new_reg_no','')
     41reg_no = request.get('reg_no','').upper()
     42new_reg_no = request.get('new_reg_no','').upper()
    4343
    4444if reset:
  • WAeUP_SRP/trunk/skins/waeup_student/apply_pume_manage_form.pt

    r2159 r2160  
    7171            enctype="multipart/form-data" class="workflow"
    7272            tal:attributes="action string:${context/absolute_url}/apply_pume"
     73            tal:condition="rendered_main"
    7374            >
    7475        <input type="hidden" name="reg_no"
     
    7879               class="standalone"
    7980               name="manage"
    80                value="Assume the Applicant's Role"
     81               value="Assume Applicant's Role"
    8182               />             
    8283        </form>         
Note: See TracChangeset for help on using the changeset viewer.