Changeset 362
- Timestamp:
- 5 Aug 2006, 18:24:53 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/Students.py
r361 r362 14 14 from Products.CPSCore.CPSMembershipTool import CPSUnrestrictedUser 15 15 from Products.WAeUP_SRP.Academics import makeCertificateCode 16 import logging 17 import csv,re 18 import Globals 19 p_home = Globals.package_home(globals()) 20 i_home = Globals.INSTANCE_HOME 16 21 17 22 class StudentsFolder(CPSDocument): ###( … … 19 24 WAeUP container for the various WAeUP containers data 20 25 """ 21 meta_type = 'Students 26 meta_type = 'StudentsFolder' 22 27 portal_type = meta_type 23 28 security = ClassSecurityInfo() … … 44 49 certs = {} 45 50 for c in l: 46 certs[ s.id] = c.getObject()51 certs[c.id] = c.getObject() 47 52 for student in students: 48 53 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) … … 60 65 if s is None: 61 66 #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) 63 68 students_folder.invokeFactory('Student', sid) 64 69 s = getattr(self,sid) 65 70 s.invokeFactory('StudentPersonal','personal') 66 sp = getattr(self,sid)71 sp = s.personal 67 72 d = {'Title': 'Personal Data'} 73 d['matricel_no'] = student.get('MatricNo') 74 d['entry_reg_no'] = student.get('EntryRegNo') 68 75 d['fullname'] = student.get('fullname') 69 76 d['firstname'] = student.get('FirstName') 70 77 d['middlename'] = student.get('MiddleName') 71 d['lastname'] = student.get('Last Name')78 d['lastname'] = student.get('Lastname') 72 79 d['former_surname'] = student.get('FormerSurname') 73 d['sex'] = student.get('Sex') == ' M'80 d['sex'] = student.get('Sex') == 'F' 74 81 d['nationality'] = student.get('Nationality') 75 82 d['state'] = student.get('State') … … 79 86 d['campus_address'] = student.get('CampusAddress') 80 87 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) 83 106 else: 84 107 em = 'Faculty with ID %(MatricNo)s %(fullname)s already exists' % student … … 111 134 """compose title""" 112 135 reg_nr = self.getId()[1:] 113 data = getattr(self,' PERSONAL',None)136 data = getattr(self,'personal',None) 114 137 if data is None: 115 data = getattr(self,' JAMB',None)138 data = getattr(self,'jamb',None) 116 139 if data: 117 140 content = data.getContent() … … 212 235 ###) 213 236 237 class 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 252 InitializeClass(StudentStudyCourse) 253 254 def 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 214 261 class StudentEligibility(CPSDocument): ###( 215 262 """ -
WAeUP_SRP/trunk/__init__.py
r361 r362 28 28 from Products.WAeUP_SRP.Students import StudentsFolder, addStudentsFolder 29 29 from Products.WAeUP_SRP.Students import Student, addStudent 30 from Products.WAeUP_SRP.Students import StudentStudyCourse, addStudentStudyCourse 30 31 from Products.WAeUP_SRP.Students import StudentPersonal, addStudentPersonal 31 32 from Products.WAeUP_SRP.Students import StudentEligibility, addStudentEligibility … … 52 53 StudentsFolder, 53 54 Student, 55 StudentStudyCourse, 54 56 StudentPersonal, 55 57 StudentEligibility, … … 74 76 addStudentsFolder, 75 77 addStudent, 78 addStudentStudyCourse, 76 79 addStudentPersonal, 77 80 addStudentEligibility, … … 96 99 {}, # StudentsFolder, 97 100 {}, # Student, 101 {}, # StudentStudyCourse, 98 102 {}, # StudentPersonal, 99 103 {}, # StudentEligibility, -
WAeUP_SRP/trunk/profiles/default/layouts.xml
r295 r362 19 19 <object name="jambcreate" meta_type="CPS Layout"/> 20 20 <object name="student" meta_type="CPS Layout"/> 21 <object name="student_study_course" meta_type="CPS Layout"/> 21 22 <object name="student_documents" meta_type="CPS Layout"/> 22 23 <object name="student_eligibility" meta_type="CPS Layout"/> -
WAeUP_SRP/trunk/profiles/default/layouts/student.xml
r199 r362 226 226 <property name="hidden_readonly_layout_modes"/> 227 227 </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/> 281 229 </object> -
WAeUP_SRP/trunk/profiles/default/layouts/student_personal.xml
r199 r362 8 8 <property name="validate_values_expr"></property> 9 9 <widget name="birthday" meta_type="Date Widget"> 10 <property name="title">Day of birth</property> 10 11 <property name="fields"> 11 12 <element value="birthday"/> … … 18 19 <property name="hidden_readonly_layout_modes"/> 19 20 </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> 20 43 <widget name="email" meta_type="Email Widget"> 21 44 <property name="title">Email</property> … … 28 51 <property name="display_width">40</property> 29 52 </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> 30 64 <widget name="firstname" meta_type="String Widget"> 31 65 <property name="title">First Name</property> … … 38 72 <property name="display_width">40</property> 39 73 </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> 40 96 <widget name="lastname" meta_type="String Widget"> 41 97 <property name="fields"> … … 49 105 <property name="display_width">40</property> 50 106 </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> 51 129 <widget name="middlename" meta_type="String Widget"> 52 130 <property name="fields"> … … 61 139 <property name="display_width">40</property> 62 140 </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> 63 163 <widget name="sex" meta_type="Boolean Widget"> 64 164 <property name="fields"> … … 73 173 <property name="label_true">female</property> 74 174 </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> 75 197 <table> 76 198 <row> … … 84 206 </row> 85 207 <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> 86 247 <cell name="email"/> 87 </row>88 <row>89 <cell name="sex"/>90 </row>91 <row>92 <cell name="birthday"/>93 248 </row> 94 249 </table> -
WAeUP_SRP/trunk/profiles/default/schemas.xml
r361 r362 14 14 <object name="semester" meta_type="CPS Schema"/> 15 15 <object name="student" meta_type="CPS Schema"/> 16 <object name="student_study_course" meta_type="CPS Schema"/> 16 17 <object name="student_accommodation" meta_type="CPS Schema"/> 17 18 <object name="student_admission" meta_type="CPS Schema"/> -
WAeUP_SRP/trunk/profiles/default/schemas/student_personal.xml
r361 r362 19 19 </field> 20 20 <field name="lga" meta_type="CPS String Field"/> 21 <field name="matricel_n r" meta_type="CPS String Field"/>21 <field name="matricel_no" meta_type="CPS String Field"/> 22 22 <field name="middlename" meta_type="CPS String Field"> 23 23 <property name="is_searchabletext">True</property> -
WAeUP_SRP/trunk/profiles/default/types.xml
r308 r362 17 17 <object name="Semester" meta_type="CPS Flexible Type Information"/> 18 18 <object name="Student" meta_type="CPS Flexible Type Information"/> 19 <object name="StudentStudyCourse" meta_type="CPS Flexible Type Information"/> 19 20 <object name="StudentDocuments" meta_type="CPS Flexible Type Information"/> 20 21 <object name="StudentEligibility" meta_type="CPS Flexible Type Information"/> -
WAeUP_SRP/trunk/profiles/default/types/Student.xml
r319 r362 15 15 <element value="StudentDocuments"/> 16 16 <element value="StudentPersonal"/> 17 <element value="StudentStudyCourse"/> 17 18 <element value="StudyLevel"/> 18 19 </property> -
WAeUP_SRP/trunk/profiles/default/types/StudentsFolder.xml
r361 r362 6 6 <property name="content_icon">students_folder.gif</property> 7 7 <property name="content_meta_type">StudentsFolder</property> 8 <property name="product"> CPSDefault</property>9 <property name="factory">add Folder</property>8 <property name="product">WAeUP_SRP</property> 9 <property name="factory">addStudentsFolder</property> 10 10 <property name="immediate_view">folder_view</property> 11 11 <property name="global_allow">True</property> -
WAeUP_SRP/trunk/profiles/default/workflows.xml
r355 r362 70 70 </type> 71 71 <type type_id="Student"> 72 <bound-workflow workflow_id=" waeup_student_wf"/>72 <bound-workflow workflow_id="section_folder_wf"/> 73 73 </type> 74 74 <type type_id="StudentDocuments">
Note: See TracChangeset for help on using the changeset viewer.