Changeset 362


Ignore:
Timestamp:
5 Aug 2006, 18:24:53 (18 years ago)
Author:
joachim
Message:

more us changes

Location:
WAeUP_SRP/trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Students.py

    r361 r362  
    1414from Products.CPSCore.CPSMembershipTool import CPSUnrestrictedUser
    1515from Products.WAeUP_SRP.Academics import makeCertificateCode
     16import logging
     17import csv,re
     18import Globals
     19p_home = Globals.package_home(globals())
     20i_home = Globals.INSTANCE_HOME
    1621
    1722class StudentsFolder(CPSDocument): ###(
     
    1924    WAeUP container for the various WAeUP containers data
    2025    """
    21     meta_type = 'Students Folder'
     26    meta_type = 'StudentsFolder'
    2227    portal_type = meta_type
    2328    security = ClassSecurityInfo()
     
    4449        certs = {}
    4550        for c in l:
    46             certs[s.id] = c.getObject()
     51            certs[c.id] = c.getObject()
    4752        for student in students:
    4853            logger.info('processing "%(MatricNo)s","%(EntryRegNo)s","%(CurrentSession)s","%(StudentLevel)s","%(fullname)s","%(FirstName)s","%(MiddleName)s","%(Lastname)s","%(FormerSurname)s","%(Sex)s","%(Nationality)s","%(State)s","%(LGA)s","%(PermanentAddress)s","%(PermanentAddressCity)s","%(CampusAddress)s","%(PhoneNumber)s","%(Emailaddress)s","%(Mode)s","%(CourseMajor)s","%(Faculty)s","%(Dept)s"' % student)
     
    6065            if s is None:
    6166                #self.log('Creating Faculty %(id)s = %(Title)s' % faculty)
    62                 logger.info('Creating Student with ID %(MatricNo)s %(fullname)s' % faculty)
     67                logger.info('Creating Student with ID %(MatricNo)s %(fullname)s' % student)
    6368                students_folder.invokeFactory('Student', sid)
    6469                s = getattr(self,sid)
    6570                s.invokeFactory('StudentPersonal','personal')
    66                 sp = getattr(self,sid)
     71                sp = s.personal
    6772                d = {'Title': 'Personal Data'}
     73                d['matricel_no'] = student.get('MatricNo')
     74                d['entry_reg_no'] = student.get('EntryRegNo')
    6875                d['fullname'] = student.get('fullname')
    6976                d['firstname'] = student.get('FirstName')
    7077                d['middlename'] = student.get('MiddleName')
    71                 d['lastname'] = student.get('LastName')
     78                d['lastname'] = student.get('Lastname')
    7279                d['former_surname'] = student.get('FormerSurname')
    73                 d['sex'] = student.get('Sex') == 'M'
     80                d['sex'] = student.get('Sex') == 'F'
    7481                d['nationality'] = student.get('Nationality')
    7582                d['state'] = student.get('State')
     
    7986                d['campus_address'] = student.get('CampusAddress')
    8087                d['phone'] = student.get('PhoneNumber')
    81                 d['email'] = student.get('EmailAddress')
    82                 f.getContent().edit(mapping=d)
     88                d['email'] = student.get('Emailaddress')
     89                sp.getContent().edit(mapping=d)
     90                #
     91                # Study Course
     92                #
     93                s.invokeFactory('StudentStudyCourse','study_course')
     94                sc = s.study_course
     95                d = {}
     96                d['matricel_no'] = student.get('MatricNo')
     97                d['entry_reg_no'] = student.get('EntryRegNo')
     98                d['faculty'] = student.get('Faculty')
     99                d['department'] = student.get('Dept')
     100                d['course_major'] = certcode
     101                css = student.get('CurrentSession') or '2004-2005'
     102                cs = int(css.split('-')[0]) - 2000
     103                cl = int(student.get('StudentLevel'))/100
     104                d['entry_session'] = "200%s" % (cs - cl)
     105                sc.getContent().edit(mapping=d)
    83106            else:
    84107                em = 'Faculty with ID %(MatricNo)s %(fullname)s already exists' % student
     
    111134        """compose title"""
    112135        reg_nr = self.getId()[1:]
    113         data = getattr(self,'PERSONAL',None)
     136        data = getattr(self,'personal',None)
    114137        if data is None:
    115             data = getattr(self,'JAMB',None)
     138            data = getattr(self,'jamb',None)
    116139        if data:
    117140            content = data.getContent()
     
    212235###)
    213236
     237class StudentStudyCourse(CPSDocument): ###(
     238    """
     239    WAeUP Student container for the various student data
     240    """
     241    meta_type = 'StudentStudyCourse'
     242    portal_type = meta_type
     243    security = ClassSecurityInfo()
     244
     245##    security.declareProtected(View,"Title")
     246##    def Title(self):
     247##        """compose title"""
     248##        content = self.getContent()
     249##        return "StudyCourse Data for %s %s" % (content.firstname,content.lastname)
     250
     251
     252InitializeClass(StudentStudyCourse)
     253
     254def addStudentStudyCourse(container, id, REQUEST=None, **kw):
     255    """Add a Students personal data."""
     256    ob = StudentStudyCourse(id, **kw)
     257    return CPSBase_adder(container, ob, REQUEST=REQUEST)
     258
     259###)
     260
    214261class StudentEligibility(CPSDocument): ###(
    215262    """
  • WAeUP_SRP/trunk/__init__.py

    r361 r362  
    2828from Products.WAeUP_SRP.Students import StudentsFolder, addStudentsFolder
    2929from Products.WAeUP_SRP.Students import Student, addStudent
     30from Products.WAeUP_SRP.Students import StudentStudyCourse, addStudentStudyCourse
    3031from Products.WAeUP_SRP.Students import StudentPersonal, addStudentPersonal
    3132from Products.WAeUP_SRP.Students import StudentEligibility, addStudentEligibility
     
    5253    StudentsFolder,
    5354    Student,
     55    StudentStudyCourse,
    5456    StudentPersonal,
    5557    StudentEligibility,
     
    7476    addStudentsFolder,
    7577    addStudent,
     78    addStudentStudyCourse,
    7679    addStudentPersonal,
    7780    addStudentEligibility,
     
    9699    {}, # StudentsFolder,
    97100    {}, # Student,
     101    {}, # StudentStudyCourse,
    98102    {}, # StudentPersonal,
    99103    {}, # StudentEligibility,
  • WAeUP_SRP/trunk/profiles/default/layouts.xml

    r295 r362  
    1919 <object name="jambcreate" meta_type="CPS Layout"/>
    2020 <object name="student" meta_type="CPS Layout"/>
     21 <object name="student_study_course" meta_type="CPS Layout"/>
    2122 <object name="student_documents" meta_type="CPS Layout"/>
    2223 <object name="student_eligibility" meta_type="CPS Layout"/>
  • WAeUP_SRP/trunk/profiles/default/layouts/student.xml

    r199 r362  
    226226  <property name="hidden_readonly_layout_modes"/>
    227227 </widget>
    228  <table>
    229   <row>
    230    <cell name="adm_check_sc_id"/>
    231   </row>
    232   <row>
    233    <cell name="adm_check_sc_pin"/>
    234   </row>
    235   <row>
    236    <cell name="adm_check_sc_value"/>
    237   </row>
    238   <row>
    239    <cell name="adm_check_date"/>
    240   </row>
    241   <row>
    242    <cell name="clearance_sc_id"/>
    243   </row>
    244   <row>
    245    <cell name="clearance_sc_pin"/>
    246   </row>
    247   <row>
    248    <cell name="clearance_sc_value"/>
    249   </row>
    250   <row>
    251    <cell name="clearance_date"/>
    252   </row>
    253   <row>
    254    <cell name="accommodation"/>
    255   </row>
    256   <row>
    257    <cell name="accommodation_sc_id"/>
    258   </row>
    259   <row>
    260    <cell name="accommodation_sc_pin"/>
    261   </row>
    262   <row>
    263    <cell name="accommodation_sc_value"/>
    264   </row>
    265   <row>
    266    <cell name="accommodation_date"/>
    267   </row>
    268   <row>
    269    <cell name="hostel_fee_sc_id"/>
    270   </row>
    271   <row>
    272    <cell name="hostel_fee_sc_pin"/>
    273   </row>
    274   <row>
    275    <cell name="hostel_fee_sc_value"/>
    276   </row>
    277   <row>
    278    <cell name="hostel_fee_date"/>
    279   </row>
    280  </table>
     228 <table/>
    281229</object>
  • WAeUP_SRP/trunk/profiles/default/layouts/student_personal.xml

    r199 r362  
    88 <property name="validate_values_expr"></property>
    99 <widget name="birthday" meta_type="Date Widget">
     10  <property name="title">Day of birth</property>
    1011  <property name="fields">
    1112   <element value="birthday"/>
     
    1819  <property name="hidden_readonly_layout_modes"/>
    1920 </widget>
     21 <widget name="campus_address" meta_type="String Widget">
     22  <property name="title">Campus Address</property>
     23  <property name="fields">
     24   <element value="campus_address"/>
     25  </property>
     26  <property name="label">Campus Address</property>
     27  <property name="label_edit">Campus Address</property>
     28  <property name="readonly_layout_modes"/>
     29  <property name="hidden_layout_modes"/>
     30  <property name="hidden_readonly_layout_modes"/>
     31 </widget>
     32 <widget name="city" meta_type="String Widget">
     33  <property name="title">City</property>
     34  <property name="fields">
     35   <element value="city"/>
     36  </property>
     37  <property name="label">City</property>
     38  <property name="label_edit">City</property>
     39  <property name="readonly_layout_modes"/>
     40  <property name="hidden_layout_modes"/>
     41  <property name="hidden_readonly_layout_modes"/>
     42 </widget>
    2043 <widget name="email" meta_type="Email Widget">
    2144  <property name="title">Email</property>
     
    2851  <property name="display_width">40</property>
    2952 </widget>
     53 <widget name="entry_reg_no" meta_type="String Widget">
     54  <property name="title">Jamb Reg No</property>
     55  <property name="fields">
     56   <element value="entry_reg_no"/>
     57  </property>
     58  <property name="label">Jamb Reg No</property>
     59  <property name="label_edit">Jamb Reg No</property>
     60  <property name="readonly_layout_modes"/>
     61  <property name="hidden_layout_modes"/>
     62  <property name="hidden_readonly_layout_modes"/>
     63 </widget>
    3064 <widget name="firstname" meta_type="String Widget">
    3165  <property name="title">First Name</property>
     
    3872  <property name="display_width">40</property>
    3973 </widget>
     74 <widget name="former_surname" meta_type="String Widget">
     75  <property name="title">Former Surname</property>
     76  <property name="fields">
     77   <element value="former_surname"/>
     78  </property>
     79  <property name="label">Former Surname</property>
     80  <property name="label_edit">Former Surname</property>
     81  <property name="readonly_layout_modes"/>
     82  <property name="hidden_layout_modes"/>
     83  <property name="hidden_readonly_layout_modes"/>
     84 </widget>
     85 <widget name="fullname" meta_type="String Widget">
     86  <property name="title">Fullname</property>
     87  <property name="fields">
     88   <element value="fullname"/>
     89  </property>
     90  <property name="label">Fullname</property>
     91  <property name="label_edit">Fullname</property>
     92  <property name="readonly_layout_modes"/>
     93  <property name="hidden_layout_modes"/>
     94  <property name="hidden_readonly_layout_modes"/>
     95 </widget>
    4096 <widget name="lastname" meta_type="String Widget">
    4197  <property name="fields">
     
    49105  <property name="display_width">40</property>
    50106 </widget>
     107 <widget name="lga" meta_type="String Widget">
     108  <property name="title">LGA</property>
     109  <property name="fields">
     110   <element value="lga"/>
     111  </property>
     112  <property name="label">LGA</property>
     113  <property name="label_edit">LGA</property>
     114  <property name="readonly_layout_modes"/>
     115  <property name="hidden_layout_modes"/>
     116  <property name="hidden_readonly_layout_modes"/>
     117 </widget>
     118 <widget name="matricel_no" meta_type="String Widget">
     119  <property name="title">Matricel No</property>
     120  <property name="fields">
     121   <element value="matricel_no"/>
     122  </property>
     123  <property name="label">Matricel No</property>
     124  <property name="label_edit">Matricel No</property>
     125  <property name="readonly_layout_modes"/>
     126  <property name="hidden_layout_modes"/>
     127  <property name="hidden_readonly_layout_modes"/>
     128 </widget>
    51129 <widget name="middlename" meta_type="String Widget">
    52130  <property name="fields">
     
    61139  <property name="display_width">40</property>
    62140 </widget>
     141 <widget name="nationality" meta_type="String Widget">
     142  <property name="title">Nationality</property>
     143  <property name="fields">
     144   <element value="nationality"/>
     145  </property>
     146  <property name="label">Nationality</property>
     147  <property name="label_edit">Nationality</property>
     148  <property name="readonly_layout_modes"/>
     149  <property name="hidden_layout_modes"/>
     150  <property name="hidden_readonly_layout_modes"/>
     151 </widget>
     152 <widget name="phone" meta_type="String Widget">
     153  <property name="title">Phone</property>
     154  <property name="fields">
     155   <element value="phone"/>
     156  </property>
     157  <property name="label">Phone</property>
     158  <property name="label_edit">Phone</property>
     159  <property name="readonly_layout_modes"/>
     160  <property name="hidden_layout_modes"/>
     161  <property name="hidden_readonly_layout_modes"/>
     162 </widget>
    63163 <widget name="sex" meta_type="Boolean Widget">
    64164  <property name="fields">
     
    73173  <property name="label_true">female</property>
    74174 </widget>
     175 <widget name="state" meta_type="String Widget">
     176  <property name="title">State</property>
     177  <property name="fields">
     178   <element value="state"/>
     179  </property>
     180  <property name="label">State</property>
     181  <property name="label_edit">State</property>
     182  <property name="readonly_layout_modes"/>
     183  <property name="hidden_layout_modes"/>
     184  <property name="hidden_readonly_layout_modes"/>
     185 </widget>
     186 <widget name="street" meta_type="String Widget">
     187  <property name="title">Street</property>
     188  <property name="fields">
     189   <element value="street"/>
     190  </property>
     191  <property name="label">Street</property>
     192  <property name="label_edit">Street</property>
     193  <property name="readonly_layout_modes"/>
     194  <property name="hidden_layout_modes"/>
     195  <property name="hidden_readonly_layout_modes"/>
     196 </widget>
    75197 <table>
    76198  <row>
     
    84206  </row>
    85207  <row>
     208   <cell name="fullname"/>
     209  </row>
     210  <row>
     211   <cell name="former_surname"/>
     212  </row>
     213  <row>
     214   <cell name="sex"/>
     215  </row>
     216  <row>
     217   <cell name="birthday"/>
     218  </row>
     219  <row>
     220   <cell name="entry_reg_no"/>
     221  </row>
     222  <row>
     223   <cell name="matricel_no"/>
     224  </row>
     225  <row>
     226   <cell name="street"/>
     227  </row>
     228  <row>
     229   <cell name="campus_address"/>
     230  </row>
     231  <row>
     232   <cell name="city"/>
     233  </row>
     234  <row>
     235   <cell name="nationality"/>
     236  </row>
     237  <row>
     238   <cell name="state"/>
     239  </row>
     240  <row>
     241   <cell name="lga"/>
     242  </row>
     243  <row>
     244   <cell name="phone"/>
     245  </row>
     246  <row>
    86247   <cell name="email"/>
    87   </row>
    88   <row>
    89    <cell name="sex"/>
    90   </row>
    91   <row>
    92    <cell name="birthday"/>
    93248  </row>
    94249 </table>
  • WAeUP_SRP/trunk/profiles/default/schemas.xml

    r361 r362  
    1414 <object name="semester" meta_type="CPS Schema"/>
    1515 <object name="student" meta_type="CPS Schema"/>
     16 <object name="student_study_course" meta_type="CPS Schema"/>
    1617 <object name="student_accommodation" meta_type="CPS Schema"/>
    1718 <object name="student_admission" meta_type="CPS Schema"/>
  • WAeUP_SRP/trunk/profiles/default/schemas/student_personal.xml

    r361 r362  
    1919 </field>
    2020 <field name="lga" meta_type="CPS String Field"/>
    21  <field name="matricel_nr" meta_type="CPS String Field"/>
     21 <field name="matricel_no" meta_type="CPS String Field"/>
    2222 <field name="middlename" meta_type="CPS String Field">
    2323  <property name="is_searchabletext">True</property>
  • WAeUP_SRP/trunk/profiles/default/types.xml

    r308 r362  
    1717 <object name="Semester" meta_type="CPS Flexible Type Information"/>
    1818 <object name="Student" meta_type="CPS Flexible Type Information"/>
     19 <object name="StudentStudyCourse" meta_type="CPS Flexible Type Information"/>
    1920 <object name="StudentDocuments" meta_type="CPS Flexible Type Information"/>
    2021 <object name="StudentEligibility" meta_type="CPS Flexible Type Information"/>
  • WAeUP_SRP/trunk/profiles/default/types/Student.xml

    r319 r362  
    1515  <element value="StudentDocuments"/>
    1616  <element value="StudentPersonal"/>
     17  <element value="StudentStudyCourse"/>
    1718  <element value="StudyLevel"/>
    1819 </property>
  • WAeUP_SRP/trunk/profiles/default/types/StudentsFolder.xml

    r361 r362  
    66 <property name="content_icon">students_folder.gif</property>
    77 <property name="content_meta_type">StudentsFolder</property>
    8  <property name="product">CPSDefault</property>
    9  <property name="factory">addFolder</property>
     8 <property name="product">WAeUP_SRP</property>
     9 <property name="factory">addStudentsFolder</property>
    1010 <property name="immediate_view">folder_view</property>
    1111 <property name="global_allow">True</property>
  • WAeUP_SRP/trunk/profiles/default/workflows.xml

    r355 r362  
    7070  </type>
    7171  <type type_id="Student">
    72    <bound-workflow workflow_id="waeup_student_wf"/>
     72   <bound-workflow workflow_id="section_folder_wf"/>
    7373  </type>
    7474  <type type_id="StudentDocuments">
Note: See TracChangeset for help on using the changeset viewer.