Changeset 1515


Ignore:
Timestamp:
3 Mar 2007, 11:45:58 (18 years ago)
Author:
Henrik Bettermann
Message:

CouseAdviser? role modifications

Location:
WAeUP_SRP/trunk
Files:
1 added
1 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/PatchCPSUserFolderUserFolder.py

    r1471 r1515  
    7474            real_object = real_object.im_self
    7575        if hasattr(real_object,'portal_type') and\
    76                    real_object.portal_type not in ("Student","StudentClearance"):
     76                   real_object.portal_type not in ("Student","StudentClearance","StudentStudyLevel"):
    7777            break
    7878        sc = getattr(real_object,'study_course',None)
     
    9898                                                faculty = fac_id,
    9999                                                department = dep_id,
    100                                                 ) 
    101                                                          
    102            
     100                                                )
     101
     102
    103103        res = self.portal_catalog(portal_type="Department",id=dep_id)
    104104        if len(res) != 1:
    105             break       
     105            break
    106106        dynamic_roles = self.getRolesInContext(res[0].getObject())
    107107        for dr in ('ClearanceOfficer','CourseAdviser', 'SectionManager'):
  • WAeUP_SRP/trunk/Students.py

    r1448 r1515  
    2323MAX_TRANS = 1000
    2424import DateTime
    25 import PIL.Image
     25# import PIL.Image
    2626from StringIO import StringIO
    2727
  • WAeUP_SRP/trunk/exportimport.py

    r1433 r1515  
    8989            students.manage_setLocalGroupRoles(groupid = 'ClearanceOfficers',
    9090                                              roles=('SectionReader',))
     91            students.manage_setLocalGroupRoles(groupid = 'CourseAdvisers',
     92                                              roles=('SectionReader',))                                             
    9193            students.manage_setLocalGroupRoles(groupid='MemberAdmins',
    9294                                         roles=('SectionOfficer',))
     
    111113    if waeup_stacking_dir is not None:
    112114        waeup_stacking_dir.manage_setLocalGroupRoles(groupid='MemberAdmins',
    113                                          roles=('SectionOfficer',))                                         
     115                                         roles=('SectionOfficer',))
    114116
    115117##    pm.setLocalGroupRoles(campus.academics,['role:Authenticated',
  • WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_subobject_wf/definition.xml

    r1482 r1515  
    1212  <exit-transition transition_id="open"/>
    1313  <permission-map name="Add portal content" acquired="True">
     14   <permission-role>CourseAdviser</permission-role>
    1415   <permission-role>SectionOfficer</permission-role>
    1516  </permission-map>
    1617  <permission-map name="Delete objects" acquired="False">
     18   <permission-role>CourseAdviser</permission-role>
    1719   <permission-role>Manager</permission-role>
    1820   <permission-role>SectionManager</permission-role>
     
    2123                  acquired="True">
    2224   <permission-role>ClearanceOfficer</permission-role>
     25   <permission-role>CourseAdviser</permission-role>
    2326   <permission-role>SectionOfficer</permission-role>
    2427  </permission-map>
    2528  <permission-map name="View" acquired="True">
     29   <permission-role>CourseAdviser</permission-role>
    2630   <permission-role>SectionOfficer</permission-role>
    2731  </permission-map>
     
    3236  <exit-transition transition_id="open"/>
    3337  <permission-map name="Add portal content" acquired="True">
     38   <permission-role>CourseAdviser</permission-role>
    3439   <permission-role>Owner</permission-role>
    3540   <permission-role>SectionOfficer</permission-role>
    3641  </permission-map>
    3742  <permission-map name="Delete objects" acquired="False">
     43   <permission-role>CourseAdviser</permission-role>
    3844   <permission-role>Manager</permission-role>
    3945   <permission-role>Owner</permission-role>
     
    4349  <permission-map name="Modify portal content"
    4450                  acquired="True">
     51   <permission-role>CourseAdviser</permission-role>
    4552   <permission-role>SectionOfficer</permission-role>
    4653  </permission-map>
    4754  <permission-map name="View" acquired="True">
     55   <permission-role>CourseAdviser</permission-role>
    4856   <permission-role>SectionOfficer</permission-role>
    4957  </permission-map>
     
    101109   <guard-role>SectionManager</guard-role>
    102110   <guard-role>Owner</guard-role>
     111   <guard-role>CourseAdviser</guard-role>
    103112  </guard>
    104113 </transition>
     
    112121   <guard-role>SectionManager</guard-role>
    113122   <guard-role>Owner</guard-role>
     123   <guard-role>CourseAdviser</guard-role>
    114124  </guard>
    115125 </transition>
     
    141151   <guard-role>SectionManager</guard-role>
    142152   <guard-role>Owner</guard-role>
     153   <guard-role>CourseAdviser</guard-role>
    143154  </guard>
    144155 </transition>
  • WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/definition.xml

    r1482 r1515  
    110110 </state>
    111111 <state state_id="courses_registered" title="">
    112   <exit-transition transition_id="notify_change_courses"/>
     112  <exit-transition transition_id="reject_courses"/>
    113113  <exit-transition transition_id="validate_courses"/>
    114114  <permission-map name="View" acquired="True">
     
    118118 </state>
    119119 <state state_id="courses_validated" title="">
     120  <exit-transition transition_id="reject_courses"/>
    120121  <permission-map name="View" acquired="True">
    121122   <permission-role>Owner</permission-role>
     
    226227             new_state="admitted" trigger="USER"
    227228             before_script="" after_script="">
    228 
     229 
    229230  <guard>
    230231   <guard-role>SectionOfficer</guard-role>
     
    237238             new_state="admission_applied" trigger="USER"
    238239             before_script="" after_script="">
    239 
     240 
    240241  <guard>
    241242   <guard-role>SectionOfficer</guard-role>
     
    248249             new_state="cleared_and_validated"
    249250             trigger="USER" before_script="" after_script="">
    250 
     251 
    251252  <guard>
    252253   <guard-role>SectionOfficer</guard-role>
     
    259260             new_state="student_created" trigger="USER"
    260261             before_script="" after_script="">
    261 
     262 
    262263  <guard>
    263264   <guard-role>Manager</guard-role>
     
    271272             new_state="" trigger="USER" before_script=""
    272273             after_script="">
    273 
     274 
    274275  <guard>
    275276   <guard-role>Manager</guard-role>
     
    283284             new_state="deferred" trigger="USER"
    284285             before_script="" after_script="">
    285 
     286 
    286287  <guard>
    287288   <guard-role>SectionOfficer</guard-role>
     
    294295             new_state="application_pin_entered"
    295296             trigger="USER" before_script="" after_script="">
    296 
     297 
    297298  <guard>
    298299   <guard-role>SectionOfficer</guard-role>
     
    305306             new_state="clearance_pin_entered"
    306307             trigger="USER" before_script="" after_script="">
    307 
     308 
    308309  <guard>
    309310   <guard-role>SectionOfficer</guard-role>
     
    316317             new_state="finally_rejected" trigger="USER"
    317318             before_script="" after_script="">
    318 
    319   <guard>
    320    <guard-role>SectionOfficer</guard-role>
    321    <guard-role>ClearanceOfficer</guard-role>
    322    <guard-role>Manager</guard-role>
    323    <guard-role>SectionManager</guard-role>
    324   </guard>
    325  </transition>
    326  <transition transition_id="notify_change_courses" title=""
    327              new_state="school_fee_paid" trigger="USER"
    328              before_script="" after_script="">
    329 
    330   <guard>
    331    <guard-role>CourseAdviser</guard-role>
     319 
     320  <guard>
     321   <guard-role>SectionOfficer</guard-role>
     322   <guard-role>ClearanceOfficer</guard-role>
    332323   <guard-role>Manager</guard-role>
    333324   <guard-role>SectionManager</guard-role>
     
    337328             new_state="school_fee_paid" trigger="USER"
    338329             before_script="" after_script="">
    339 
     330 
    340331  <guard>
    341332   <guard-role>Manager</guard-role>
     
    348339             new_state="pume_failed" trigger="USER"
    349340             before_script="" after_script="">
    350 
     341 
    351342  <guard>
    352343   <guard-role>SectionOfficer</guard-role>
     
    359350             new_state="pume_passed" trigger="USER"
    360351             before_script="" after_script="">
    361 
     352 
    362353  <guard>
    363354   <guard-role>SectionOfficer</guard-role>
     
    370361             new_state="objection_raised" trigger="USER"
    371362             before_script="" after_script="">
    372 
     363 
    373364  <guard>
    374365   <guard-role>SectionOfficer</guard-role>
     
    382373             new_state="courses_registered" trigger="USER"
    383374             before_script="" after_script="">
    384 
    385   <guard>
     375 
     376  <guard>
     377   <guard-role>CourseAdviser</guard-role>
    386378   <guard-role>Manager</guard-role>
    387379   <guard-role>SectionManager</guard-role>
     
    392384             new_state="admission_rejected" trigger="USER"
    393385             before_script="" after_script="">
    394 
     386 
    395387  <guard>
    396388   <guard-role>SectionOfficer</guard-role>
     
    403395             new_state="clearance_pin_entered"
    404396             trigger="USER" before_script="" after_script="">
    405 
    406   <guard>
    407    <guard-role>SectionOfficer</guard-role>
    408    <guard-role>ClearanceOfficer</guard-role>
     397 
     398  <guard>
     399   <guard-role>SectionOfficer</guard-role>
     400   <guard-role>ClearanceOfficer</guard-role>
     401   <guard-role>Manager</guard-role>
     402   <guard-role>SectionManager</guard-role>
     403  </guard>
     404 </transition>
     405 <transition transition_id="reject_courses" title=""
     406             new_state="school_fee_paid" trigger="USER"
     407             before_script="" after_script="">
     408 
     409  <guard>
     410   <guard-role>CourseAdviser</guard-role>
     411   <guard-role>SectionOfficer</guard-role>
    409412   <guard-role>Manager</guard-role>
    410413   <guard-role>SectionManager</guard-role>
     
    414417             new_state="clearance_requested" trigger="USER"
    415418             before_script="" after_script="">
    416 
     419 
    417420  <guard>
    418421   <guard-role>SectionOfficer</guard-role>
     
    425428             new_state="returning" trigger="USER"
    426429             before_script="" after_script="">
    427 
     430 
    428431  <guard>
    429432   <guard-role>SectionOfficer</guard-role>
     
    435438             new_state="courses_validated" trigger="USER"
    436439             before_script="" after_script="">
    437 
     440 
    438441  <guard>
    439442   <guard-role>CourseAdviser</guard-role>
     
    447450  <description>Time of the last transition</description>
    448451  <default>
    449 
     452   
    450453   <expression>state_change/getDateTime</expression>
    451454  </default>
  • WAeUP_SRP/trunk/skins/waeup_custom/getCPSCandidateLocalRoles.py

    r1028 r1515  
    2424
    2525if member.id in ("admin","perry"):
    26     return ['SectionReader','SectionManager','ClearanceOfficer', 'SectionOfficer']
    27 return ['SectionReader', 'ClearanceOfficer', 'SectionOfficer']
     26    return ['SectionReader','SectionManager','ClearanceOfficer', 'SectionOfficer', 'CourseAdviser']
     27return ['SectionReader', 'ClearanceOfficer', 'SectionOfficer', 'CourseAdviser']
  • WAeUP_SRP/trunk/skins/waeup_default/isCourseAdviser.py

    r1513 r1515  
    1616mtool = context.portal_membership
    1717roles = mtool.getAuthenticatedMember().getRolesInContext(context)
    18 return context.isSectionOfficer or "ClearanceOfficer" in roles
     18return "CourseAdviser" in roles
     19
  • WAeUP_SRP/trunk/skins/waeup_student/getStudyLevelInfo.py

    r1513 r1515  
    5252student_id = context.getStudentId()
    5353
     54
     55
    5456info = {}
    55 info['is_student'] = is_student = context.isStudent()
    56 info['is_ca'] = is_ca = context.isCourseAdviser()
     57info['is_so'] = is_so = context.isSectionOfficer()
     58info['is_student'] = is_student = context.isStudent()
     59info['is_ca'] = is_ca = context.isCourseAdviser()
    5760info['student'] = student = context.students_catalog(id=student_id)[0]
    5861info['review_state'] = review_state = context.getStudentReviewState()
    59 info['view_only'] =  review_state != "school_fee_paid"
    60 info['show_check_boxes'] =  (is_ca and review_state == 'courses_registered') or (is_student and context.getStudentReviewState() == "school_fee_paid")
     62info['view_only'] =  review_state != "school_fee_paid"
     63info['show_check_boxes'] =  (is_ca and review_state in ('courses_registered',)) or\
     64                            (is_student and context.getStudentReviewState() == "school_fee_paid") or\
     65                            (is_so)
    6166info['choosen_ids'] = request.get('ids',[])
    6267info['status_info'] = ""
    6368if is_student:
    64     if review_state == 'courses_registered': 
     69    if review_state == 'courses_registered':
    6570        info['status_info'] = "Request for Course Validation pending"
    66     elif review_state == 'courses_validated': 
     71    elif review_state == 'courses_validated':
    6772        info['status_info'] = "Courses validated"
    6873elif is_ca:
    69     if review_state == 'courses_registered': 
     74    if review_state == 'courses_registered':
    7075        info['status_info'] = "Please validate these Courses"
    71     elif review_state == 'courses_validated': 
     76    elif review_state == 'courses_validated':
    7277        info['status_info'] = "Courses validated"
    7378info['doc'] = context.getContent()
  • WAeUP_SRP/trunk/skins/waeup_student/study_level_view.pt

    r1513 r1515  
    2626
    2727      <h3>
    28         <span tal:condition="is_so">
     28        <span tal:condition="python: is_so or is_ca">
    2929          <span tal:content="info/student/name" />:
    3030        </span>
    31         <span tal:content="here/title_or_id" />
     31        <span tal:condition="is_student">My </span>
     32       
     33        Course Registration Form for <span tal:content="here/title_or_id" />
    3234      </h3>
    33       <br />
     35
    3436    </metal:block>
    3537    <metal:main fill-slot="main" tal:condition="python:1">
    36       <h3 tal:content="status_info"></h3>
    3738      <form action="." method="post" class="group">
    3839        <span tal:condition="info/carry_overs" tal:omit-tag="">
    39         <h3>Carryover Courses</h3>
     40        <h4>Carryover Courses</h4>
    4041        <br />
    4142        <table tal:condition="python: 1" class="contentListing" width="100%" summary="content layout" id="folder_content">
     
    5859          </tr>
    5960        </table>
    60         </span>
    61         <h3>Session Courses</h3>
     61        </span>
     62        <br />
     63        <h4>Session Courses</h4>
    6264        <br />
    6365        <table class="contentListing" width="100%" summary="content layout" id="folder_content">     
     
    6567              tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
    6668            <td align="left" valign="middle" style="width: 5px;"
    67                 tal:condition="show_check_boxes">
     69                      tal:condition="show_check_boxes">
    6870              <input type="checkbox" name="ids:list" value="" id="" class="noborder"
    6971                     tal:define="id row/id"
     
    8082          </tr>
    8183          <tr>
    82             <td colspan="1"></td>
     84            <td tal:condition="show_check_boxes" colspan="1"></td>
    8385            <td colspan="1"></td>
    8486            <th colspan="2">Total Credits:</th>
     
    8688          </tr>
    8789        </table>
    88         <table tal:condition="not:view_only" width="100%" cellspacing="0" cellpadding="2"
     90
     91       
     92     
     93       
     94        <table tal:condition="python: is_student and review_state == 'school_fee_paid'" width="100%" cellspacing="0" cellpadding="2"
    8995               class="folderButtons">
    9096          <tr>
    9197            <td align="left" valign="top" rowspan="3"></td>
    9298            <td align="left" valign="top">
    93               <span tal:condition="python:1">
    94                 <input type="button" value="button_select_all" class="context"
    95                        onclick="someJavaScriptFunctionThatWillBeReplaced"
    96                        i18n:attributes="value"
    97                        tal:attributes="onclick python:'toggleSelect(this, \'%s\', \'%s\')'
    98                        % (cpsmcat('button_select_all'), cpsmcat('button_deselect_all'))"
    99                        />
    100                 <input type="submit" name="course_result_delete:method" value="Delete checked"
     99                <input type="submit" name="course_result_delete:method" value="Delete Selected"
    101100                       class="destructive" i18n:attributes="value"
    102101                       tal:attributes="onclick python:'return window.confirm(\'%s\')' %
    103                        ('really delete checked courses', )"
     102                       ('Do you really want to delete selected courses?', )"
    104103                       />
    105                 <input tal:condition="python:1" type="submit" name="register_courses:method"
    106                        class="context" value="Register" />
    107                 <input tal:condition="is_ca" type="submit" name="notify_change_courses:method"
    108                        class="context" value="Reject Courses" />
    109                 <input tal:condition="python: 1"
     104                <input
    110105                       type="submit" name="refresh_level:method"
    111                        class="context" value="Refresh List"
     106                       class="context" value="Check for Courses"
    112107                       />
    113               </span>
     108                <br /><br />
     109                <input type="submit" name="register_courses:method"
     110                       class="context" value="Submit Course List" />
    114111            </td>
    115112          </tr>
    116113        </table>
    117         <table tal:condition="python:is_ca and show_check_boxes" width="100%" cellspacing="0" cellpadding="2"
     114        <table tal:condition="python:is_so" width="100%" cellspacing="0" cellpadding="2"
    118115               class="folderButtons">
    119116          <tr>
    120117            <td align="left" valign="top" rowspan="3"></td>
    121118            <td align="left" valign="top">
    122               <span tal:condition="python:1">
    123                 <input type="button" value="button_select_all" class="context"
     119                <input type="button" value="Select All" class="context"
    124120                       onclick="someJavaScriptFunctionThatWillBeReplaced"
    125121                       i18n:attributes="value"
     
    127123                       % (cpsmcat('button_select_all'), cpsmcat('button_deselect_all'))"
    128124                       />
    129                 <input type="submit" name="course_result_delete:method" value="Delete checked"
     125                <input type="submit" name="course_result_delete:method" value="Delete Selected"
    130126                       class="destructive" i18n:attributes="value"
    131127                       tal:attributes="onclick python:'return window.confirm(\'%s\')' %
    132128                       ('really delete checked courses', )"
    133129                       />
    134                 <input tal:condition="python:1" type="submit" name="validate_courses:method"
    135                        class="context" value="Validate" />
    136                 <input tal:condition="is_ca" type="submit" name="notify_change_courses:method"
    137                        class="context" value="Reject Courses" />
    138                 <input tal:condition="python: 1"
     130                <input
    139131                       type="submit" name="refresh_level:method"
    140                        class="context" value="Refresh List"
     132                       class="context" value="Check for Courses"
    141133                       />
    142               </span>
     134                <input tal:condition="python: review_state == 'school_fee_paid'" type="submit" name="register_courses:method"
     135                       class="context" value="Submit Course List" /> 
     136                <input tal:condition="python: review_state == 'courses_registered'" type="submit" name="validate_courses:method"
     137                       class="context" value="Validate List" />
     138                <input tal:condition="python: review_state in ('courses_registered', 'courses_validated',)" type="submit" name="reject_courses:method"
     139                       class="context" value="Reject Course List" />
     140
    143141            </td>
    144142          </tr>
    145143        </table>
     144        <table tal:condition="python:is_ca" width="100%" cellspacing="0" cellpadding="2"
     145               class="folderButtons">
     146          <tr>
     147            <td align="left" valign="top" rowspan="3"></td>
     148            <td align="left" valign="top">
     149                <input tal:condition="python: review_state == 'school_fee_paid'"
     150                       type="button" value="Select All" class="context"
     151                       onclick="someJavaScriptFunctionThatWillBeReplaced"
     152                       i18n:attributes="value"
     153                       tal:attributes="onclick python:'toggleSelect(this, \'%s\', \'%s\')'
     154                       % (cpsmcat('button_select_all'), cpsmcat('button_deselect_all'))"
     155                       />
     156                <input tal:condition="python: review_state == 'school_fee_paid'"
     157                       type="submit" name="course_result_delete:method" value="Delete Selected"
     158                       class="destructive" i18n:attributes="value"
     159                       tal:attributes="onclick python:'return window.confirm(\'%s\')' %
     160                       ('really delete checked courses', )"
     161                       />
     162                <input tal:condition="python: review_state == 'school_fee_paid'"
     163                       type="submit" name="refresh_level:method"
     164                       class="context" value="Check for Courses"
     165                       />
     166                <input tal:condition="python: review_state == 'school_fee_paid'" type="submit" name="register_courses:method"
     167                       class="context" value="Submit Course List" /> 
     168                <input tal:condition="python: review_state == 'courses_registered'" type="submit" name="validate_courses:method"
     169                       class="context" value="Validate List" />
     170                <input tal:condition="python: review_state in ('courses_registered', 'courses_validated',)" type="submit" name="reject_courses:method"
     171                       class="context" value="Reject Course List" />
     172
     173            </td>
     174          </tr>
     175        </table>
     176
    146177      </form>
    147178      <br />
    148       <form action="add_course_result" method="post" class="group"
     179        <form action="add_course_result" method="post" class="group"
    149180            tal:condition="show_check_boxes">
    150181        <table>
     
    155186            <td tal:condition="request/error|nothing"
    156187                tal:content="request/error" />
    157           </tr>
    158           <tr>
    159             <th></th>
    160188            <td colspan="2">
    161189              <input type="submit" name="add"
    162190                     class="context" value="Add Course"
    163191                     />
    164             </td>
    165           </tr>
     192            </td>               
    166193        </table>
    167       </form>          
     194        </form>         
    168195    </metal:main>
    169196  </metal:body>
Note: See TracChangeset for help on using the changeset viewer.