Ignore:
Timestamp:
1 Oct 2006, 10:21:09 (18 years ago)
Author:
Henrik Bettermann
Message:

batch of fixes to open the frontend for the first time

File:
1 edited

Legend:

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

    r599 r603  
    2222info['wf_states'] = student_wf_states
    2323info['wf_states'][0] = " ----- "
    24 mtool = context.portal_membership
    25 member = mtool.getAuthenticatedMember()
    2624lt = context.portal_layouts
    2725pr = context.portal_registration
    2826path_info = request.get('PATH_INFO').split('/')
    29 roles = member.getRoles()
    30 is_manager = 'Manager' in roles or 'SectionManager' in roles
     27is_manager = context.isManager
    3128validate = request.has_key("cpsdocument_edit_button")
    3229items = []
    33 default = {'search_mode': 'name', 
    34         'review_state': 'admission_applied ',
     30default = {'search_mode': 'name',
     31        'review_state': 'created',
    3532        'search_string': ''
    3633        }
    37        
     34
    3835rend,psm,ds = lt.renderLayout(layout_id= 'student_search',
    3936                      schema_id= 'student_search',
     
    5754with_review = state != "all"
    5855if not term and not with_review:
    59     psm = "You must specify a search string when searching in 'All States'"
     56    psm = "You must specify a search string when searching 'all states'."
    6057    err = True
    6158elif '*' in term:
    6259    psm = "you cannot use the '*' alone"
    6360    err = True
    64 if err: 
     61if err:
    6562    return context.students_manager_view(rendered = rend,
    6663                             psm = psm,
     
    7370res = []
    7471portal_type_query = {'query':['Student','StudentApplication','StudentPersonal']}
    75 st_queries = ('jamb_id','matric_no','name')
     72st_queries = ('jamb_reg_no','matric_no','name')
    7673onlyreview = with_review and not term
    7774if onlyreview:
     
    8683        res = catalog(portal_type='Student',
    8784                      id = term.strip())
    88 elif what in st_queries: 
    89     if what == "jamb_id":
     85elif what in st_queries:
     86    if what == "jamb_reg_no":
    9087        pt = 'StudentApplication'
    9188        st = "%s*" % term.strip().lower()
     
    10299        except:
    103100            return context.students_manager_view(rendered = rend,
    104                                  psm = 'Searchstring "%s" not allowed' % term,
     101                                 psm = 'Search string "%s" not allowed.' % term,
    105102                                 #psm = "%s, %s" % (psm,ds),
    106103                                 students = items,
     
    117114                                 is_manager = is_manager,
    118115                                 )
    119            
     116
    120117if res:
    121118    for r in res:
Note: See TracChangeset for help on using the changeset viewer.