Changeset 204
- Timestamp:
- 16 May 2006, 12:50:17 (19 years ago)
- Location:
- waeup_product/trunk
- Files:
-
- 5 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup_product/trunk/Widgets.py
r199 r204 55 55 """ ScratchcardPin Widget""" 56 56 meta_type = "Scratchcard Pin Widget" 57 valid_pins = ['123456 ',58 '234567 ',59 '345678 ',60 '456789 ',57 valid_pins = ['12345678', 58 '23456789', 59 '34567890', 60 '45678901', 61 61 ] 62 62 … … 71 71 value = datastructure[widget_id] 72 72 err = 0 73 #import pdb; pdb.set_trace() 73 74 if not value in self.valid_pins: 74 75 err = 'invalid Pin' … … 83 84 widgetRegistry.register(ScratchcardPinWidget) 84 85 85 ##class ScratchcardPinWidgetType(CPSWidgetType):86 ## """Scratchcard Pin widget type."""87 ## meta_type = "Scratchcard Pin Widget Type"88 ## cls = ScratchcardPinWidget89 86 90 87 ###) … … 92 89 ########### 93 90 94 ##WidgetTypeRegistry.register(StudentIdWidgetType)95 ##WidgetTypeRegistry.register(ScratchcardPinWidgetType)96 97 ##class MyProjectWeekDateTimeWidget(CPSDateTimeWidget): ###(98 ## """ """99 ## meta_type = "MyProject Week Date Time Widget"100 ##101 ## def validate(self, datastructure, **kw):102 ## """Validate datastructure and update datamodel."""103 ##104 ## valid = CPSDateTimeWidget.validate(self, datastructure, **kw)105 ## if not valid:106 ## return 0107 ## else:108 ## widget_id = self.getWidgetId()109 ## value = datastructure[widget_id]110 ## err = 0111 ## if value.dow() in (6, 0):112 ## err = 'Cette date ne correspond pas à un jour de semaine'113 ##114 ## if err:115 ## datastructure.setError(widget_id, err)116 ##117 ## return not err118 ##119 ##InitializeClass(MyProjectWeekDateTimeWidget)120 121 ##class MyProjectWeekDateTimeWidgetType(CPSWidgetType):122 ## """MyProject Week DateTime widget type."""123 ## meta_type = "MyProject Week Date Time Widget Type"124 ## cls = MyProjectWeekDateTimeWidget125 ##126 ##InitializeClass(MyProjectWeekDateTimeWidgetType)127 ##class MyProjectRestrictedStringWidget(CPSStringWidget):128 ## """ """129 ## meta_type = "MyProject Restricted String Widget"130 ##131 ## def validate(self, datastructure, **kw):132 ## """Validate datastructure and update datamodel."""133 ##134 ## valid = CPSStringWidget.validate(self, datastructure, **kw)135 ## if not valid:136 ## return 0137 ## else:138 ## widget_id = self.getWidgetId()139 ## value = datastructure[widget_id]140 ## err = 0141 ## if not (len(value) == 5 and value.isupper() and value.isalpha()):142 ## err = 'Cette chaîne ne correspond pas au format imposé'143 ##144 ## if err:145 ## datastructure.setError(widget_id, err)146 ## else:147 ## datamodel = datastructure.getDataModel()148 ## datamodel[self.fields[0]] = value149 ##150 ## return not err151 ##152 ##InitializeClass(MyProjectRestrictedStringWidget)153 ##154 ##class MyProjectRestrictedStringWidgetType(CPSWidgetType):155 ## """MyProject Restricted String widget type."""156 ## meta_type = "MyProject Restricted String Widget Type"157 ## cls = MyProjectRestrictedStringWidget158 ##159 ##InitializeClass(MyProjectRestrictedStringWidgetType)160 ##161 ##162 ##class MyProjectRestrictedEmailWidget(CPSEmailWidget):163 ## """ """164 ## meta_type = "MyProject Restricted Email Widget"165 ##166 ## email_myproject_pat = compile(r"^([-\w_+])+\.([-\w_+])+@myproject\.fr$")167 ##168 ## def validate(self, datastructure, **kw):169 ## """Validate datastructure and update datamodel."""170 ##171 ## valid = CPSEmailWidget.validate(self, datastructure, **kw)172 ## if not valid:173 ## return 0174 ## else:175 ## widget_id = self.getWidgetId()176 ## err, v = self._extractValue(datastructure[widget_id])177 ## LOG('MyProject: MyProjectWidgets.py', DEBUG, "Valeur de v : %s" % v)178 ## if not err and kw.get('layout_mode') != 'search' and \179 ## v and not self.email_myproject_pat.match(v):180 ## err = 'cpsschemas_err_email'181 ##182 ## if err:183 ## datastructure.setError(widget_id, err)184 ## else:185 ## datamodel = datastructure.getDataModel()186 ## datamodel[self.fields[0]] = v187 ##188 ## return not err189 ##190 ## def render(self, mode, datastructure, **kw):191 ## """Render in mode from datastructure."""192 ## return CPSStringWidget.render(self, mode, datastructure, **kw)193 ##194 ##InitializeClass(MyProjectRestrictedEmailWidget)195 ##196 ##class MyProjectRestrictedEmailWidgetType(CPSWidgetType):197 ## """MyProject Restricted String widget type."""198 ## meta_type = "MyProject Restricted Email Widget Type"199 ## cls = MyProjectRestrictedEmailWidget200 ##201 ##InitializeClass(MyProjectRestrictedEmailWidgetType)202 ##203 ##class MyProjectVisitTitleWidget(CPSStringWidget):204 ## """ """205 ## meta_type = "MyProject Visit Title Widget"206 ##207 ## def validate(self, datastructure, **kw):208 ## """Validate datastructure and update datamodel."""209 ##210 ## widget_id = self.getWidgetId()211 ## err = 0212 ## curr_date = DateTime()213 ## date = "%d.%d.%d" % (curr_date.day(), curr_date.month(), curr_date.year())214 ## user = getSecurityManager().getUser()215 ## value = 'Demande de visite du %s par %s' % (date,216 ## self.portal_directories.members.getEntry(user.getId()).get('fullname'))217 ## datamodel = datastructure.getDataModel()218 ## datamodel[self.fields[0]] = value219 ##220 ## return not err221 ##222 ## def render(self, mode, datastructure, **kw):223 ## return ''224 ##225 ##InitializeClass(MyProjectVisitTitleWidget)226 ##227 ##class MyProjectVisitTitleWidgetType(CPSWidgetType):228 ## """MyProject Visit Title widget type."""229 ## meta_type = "MyProject Visit Title Widget Type"230 ## cls = MyProjectVisitTitleWidget231 ##232 ##InitializeClass(MyProjectVisitTitleWidgetType)233 234 #####################################################################################235 236 ##WidgetTypeRegistry.register(MyProjectWeekDateTimeWidgetType)237 ##WidgetTypeRegistry.register(MyProjectRestrictedStringWidgetType)238 ##WidgetTypeRegistry.register(MyProjectRestrictedEmailWidgetType)239 ##WidgetTypeRegistry.register(MyProjectVisitTitleWidgetType)240 ##241 242 ###) -
waeup_product/trunk/__init__.py
r200 r204 1 1 #-*- mode: python; mode: fold -*- 2 # $Id$ 2 3 from Products.CMFCore.utils import ContentInit, ToolInit 3 4 from Products.CMFCore.DirectoryView import registerDirectory … … 26 27 27 28 28 29 29 import Widgets 30 31 #registerDirectory('skins/waeup_default', globals())32 30 33 31 contentClasses = ( -
waeup_product/trunk/profiles/default/layouts/jamb.xml
r199 r204 60 60 <element value="firstname"/> 61 61 </property> 62 <property name="is_required">True</property> 62 63 <property name="label">First Name</property> 63 64 <property name="label_edit">First Name</property> 64 65 <property name="description">First Name</property> 66 <property name="readonly_layout_modes"/> 67 <property name="hidden_layout_modes"/> 68 <property name="hidden_readonly_layout_modes"/> 65 69 <property name="display_width">40</property> 66 70 </widget> … … 69 73 <element value="lastname"/> 70 74 </property> 75 <property name="is_required">True</property> 71 76 <property name="label">Surname</property> 72 77 <property name="label_edit">Surname</property> -
waeup_product/trunk/profiles/default/layouts/jambcreate.xml
r199 r204 60 60 <element value="firstname"/> 61 61 </property> 62 <property name="is_required">True</property> 62 63 <property name="label">First Name</property> 63 64 <property name="label_edit">First Name</property> 64 65 <property name="description">First Name</property> 66 <property name="readonly_layout_modes"/> 67 <property name="hidden_layout_modes"/> 68 <property name="hidden_readonly_layout_modes"/> 65 69 <property name="display_width">40</property> 66 70 </widget> … … 69 73 <element value="lastname"/> 70 74 </property> 75 <property name="is_required">True</property> 71 76 <property name="label">Surname</property> 72 77 <property name="label_edit">Surname</property> -
waeup_product/trunk/profiles/default/workflows.xml
r200 r204 39 39 <bound-workflow workflow_id="waeup_base_wf"/> 40 40 </type> 41 <type type_id="StudentPersonal"> 42 <bound-workflow workflow_id="waeup_base_wf"/> 43 </type> 44 <type type_id="StudentEligibility"> 45 <bound-workflow workflow_id="waeup_base_wf"/> 46 </type> 47 <type type_id="StudentDocuments"> 48 <bound-workflow workflow_id="waeup_base_wf"/> 49 </type> 50 <type type_id="StudyLevel"> 51 <bound-workflow workflow_id="waeup_base_wf"/> 52 </type> 53 <type type_id="Semester"> 54 <bound-workflow workflow_id="waeup_student_wf"/> 55 </type> 56 <type type_id="CourseTicket"> 57 <bound-workflow workflow_id="waeup_student_wf"/> 58 </type> 41 59 </bindings> 42 60 </object> -
waeup_product/trunk/skins/waeup_default/logged_in.pt
r125 r204 39 39 > 40 40 <tal:block 41 condition="python: 'Students' in member.getGroups()"41 condition="python:1 or 'Student' in member.getRoles()" 42 42 tal:define="dummy python: context.process_waeup_login(member=member,sc_pin=request.get('sc_pin'))" /> 43 43 <tal:block condition="first_time"> -
waeup_product/trunk/skins/waeup_student/create_jamb.py
r173 r204 52 52 try: 53 53 #pr.addMember(s_id, 'UnSeT',roles=('Member','CPSMember','Student','Contributor')) 54 pr.addMember(s_id, '123456',roles=('Member','CPSMember','Student' ,'Contributor'))54 pr.addMember(s_id, '123456',roles=('Member','CPSMember','Student')) 55 55 except: 56 56 noCPSMember = True 57 57 if noCPSMember: 58 58 #pr.addMember(s_id, 'UnSeT',roles=('Member','Student','Contributor')) 59 pr.addMember(s_id, '123456',roles=('Member','Student','Contributor')) 60 student.manage_setLocalRoles(s_id, ['Owner']) 61 jamb.manage_setLocalRoles(s_id, ['Owner']) 62 ## student.getContent().setOwnership(s_id) 63 ## jamb.getContent().setOwnership(s_id) 64 ## groups = context.portal_directories.groups 65 ## gm = list(groups.getEntry('Students')['members']) 66 ## gm.extend((s_id,)) 67 ## groups.editEntry({'group': 'Students', 68 ## 'members': gm}) 59 pr.addMember(s_id, '123456',roles=('Member','Student')) 60 student.manage_setLocalRoles(s_id, ['Owner',]) 61 jamb.manage_setLocalRoles(s_id, ['Owner',]) 69 62 return context.students_folder_view_manager(psm=psm) 70 63 -
waeup_product/trunk/skins/waeup_student/process_waeup_login.py
r182 r204 8 8 response=request.response 9 9 10 if request.form.get('submit') == 'Login':11 #waeup = context.portal_catalog(id = 'demouni')[0]12 waeup = context.portal_catalog(portal_type = 'University')[0]13 if "Manager" in member.getRoles():14 return15 return response.redirect(waeup.getURL())10 ##if request.form.get('submit') == 'Login': 11 ## #waeup = context.portal_catalog(id = 'demouni')[0] 12 ## waeup = context.portal_catalog(portal_type = 'University')[0] 13 ## if "Manager" in member.getRoles(): 14 ## return 15 ## return response.redirect(waeup.getURL()) 16 16 17 17 member_id = str(member)
Note: See TracChangeset for help on using the changeset viewer.