Changeset 3903


Ignore:
Timestamp:
3 Feb 2009, 08:19:08 (16 years ago)
Author:
Henrik Bettermann
Message:

resolve #605

Location:
WAeUP_SRP/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/patches/PatchCPSUserFolderUserFolder.py

    r3673 r3903  
    125125                    break
    126126            allowed = set(('CourseAdviser', 'SectionManager'))
    127         elif real_object.portal_type == "Student" and "CourseAdvisers" in groups:
    128             #we need some special processing since CourseAdvisers are only
    129             #specified per StudyLevel
    130             certificate_obj = getCertificateObject(self,st_entry)
    131             if certificate_obj is None:
    132                 #from pdb import set_trace;set_trace()
    133                 break
    134             allowed = set(('CourseAdviser', 'SectionManager'))
    135             for context_obj in certificate_obj.objectValues():
    136                 dynamic_roles = set(self.getRolesInContext(context_obj))
    137                 intersect = dynamic_roles & allowed
    138                 if intersect:
    139                     roles.extend(list(intersect))
    140             break
    141127        else:
    142128            res = self.portal_catalog(portal_type="Department",id=st_entry.department)
     
    149135        if intersect:
    150136            roles.extend(list(intersect))
     137        #from pdb import set_trace;set_trace()           
     138
     139        if real_object.portal_type == "Student" and "CourseAdvisers" in groups:
     140            #we need some special processing since CourseAdvisers are only
     141            #specified per StudyLevel
     142            certificate_obj = getCertificateObject(self,st_entry)
     143            if certificate_obj is None:
     144                #from pdb import set_trace;set_trace()
     145                break
     146            allowed = set(('CourseAdviser', 'SectionManager'))
     147            for context_obj in certificate_obj.objectValues():
     148                dynamic_roles = set(self.getRolesInContext(context_obj))
     149                intersect2 = dynamic_roles & allowed
     150                if intersect2:
     151                    roles.extend(list(intersect2))
     152
    151153        break
    152154    return roles
  • WAeUP_SRP/trunk/skins/waeup_student/get_searchable_student_states.py

    r1871 r3903  
    1717roles = member.getRolesInContext(context)
    1818voc = context.portal_vocabularies.searchable_student_states
    19 
    2019if key is not None:
    2120    return voc.get(key)
     21voc_filtered = [('all', 'all states')]
    2222if "ClearanceOfficers" in member.getGroups():
    23     return [item for item in voc.items() if item[0].startswith('clear') or
    24                                          item[0] in ("all",)]
    25 elif "CourseAdvisers" in member.getGroups():
    26     return [item for item in voc.items() if item[0].startswith('courses') or
    27                                          item[0] in ("all",)]
    28 return voc.items()
     23    voc_filtered += [item for item in voc.items() if item[0].startswith('clear')]
     24if "CourseAdvisers" in member.getGroups():
     25    voc_filtered += [item for item in voc.items() if item[0].startswith('courses')]
     26
     27if len(voc_filtered) > 1:
     28    return voc_filtered
     29else:
     30    return voc.items()
    2931
    3032
Note: See TracChangeset for help on using the changeset viewer.