Changeset 204


Ignore:
Timestamp:
16 May 2006, 12:50:17 (19 years ago)
Author:
joachim
Message:

=added doc

Location:
waeup_product/trunk
Files:
5 added
8 edited

Legend:

Unmodified
Added
Removed
  • waeup_product/trunk/Widgets.py

    r199 r204  
    5555    """ ScratchcardPin Widget"""
    5656    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',
    6161                  ]
    6262   
     
    7171            value = datastructure[widget_id]
    7272            err = 0
     73            #import pdb; pdb.set_trace()
    7374            if not value in self.valid_pins:
    7475                err = 'invalid Pin'
     
    8384widgetRegistry.register(ScratchcardPinWidget)
    8485
    85 ##class ScratchcardPinWidgetType(CPSWidgetType):
    86 ##    """Scratchcard Pin widget type."""
    87 ##    meta_type = "Scratchcard Pin Widget Type"
    88 ##    cls = ScratchcardPinWidget
    8986
    9087###)
     
    9289###########
    9390
    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 0
    107 ##        else:
    108 ##            widget_id = self.getWidgetId()
    109 ##            value = datastructure[widget_id]
    110 ##            err = 0
    111 ##            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 err
    118 ##
    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 = MyProjectWeekDateTimeWidget
    125 ##
    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 0
    137 ##        else:
    138 ##            widget_id = self.getWidgetId()
    139 ##            value = datastructure[widget_id]
    140 ##            err = 0
    141 ##            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]] = value
    149 ##           
    150 ##            return not err
    151 ##
    152 ##InitializeClass(MyProjectRestrictedStringWidget)
    153 ##
    154 ##class MyProjectRestrictedStringWidgetType(CPSWidgetType):
    155 ##    """MyProject Restricted String widget type."""
    156 ##    meta_type = "MyProject Restricted String Widget Type"
    157 ##    cls = MyProjectRestrictedStringWidget
    158 ##
    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 0
    174 ##        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]] = v
    187 ##           
    188 ##            return not err
    189 ##
    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 = MyProjectRestrictedEmailWidget
    200 ##
    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 = 0
    212 ##        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]] = value
    219 ##           
    220 ##        return not err
    221 ##
    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 = MyProjectVisitTitleWidget
    231 ##
    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  
    11#-*- mode: python; mode: fold -*-
     2# $Id$
    23from Products.CMFCore.utils import ContentInit, ToolInit
    34from Products.CMFCore.DirectoryView import registerDirectory
     
    2627
    2728
    28 
    2929import Widgets
    30 
    31 #registerDirectory('skins/waeup_default', globals())
    3230
    3331contentClasses = (
  • waeup_product/trunk/profiles/default/layouts/jamb.xml

    r199 r204  
    6060   <element value="firstname"/>
    6161  </property>
     62  <property name="is_required">True</property>
    6263  <property name="label">First Name</property>
    6364  <property name="label_edit">First Name</property>
    6465  <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"/>
    6569  <property name="display_width">40</property>
    6670 </widget>
     
    6973   <element value="lastname"/>
    7074  </property>
     75  <property name="is_required">True</property>
    7176  <property name="label">Surname</property>
    7277  <property name="label_edit">Surname</property>
  • waeup_product/trunk/profiles/default/layouts/jambcreate.xml

    r199 r204  
    6060   <element value="firstname"/>
    6161  </property>
     62  <property name="is_required">True</property>
    6263  <property name="label">First Name</property>
    6364  <property name="label_edit">First Name</property>
    6465  <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"/>
    6569  <property name="display_width">40</property>
    6670 </widget>
     
    6973   <element value="lastname"/>
    7074  </property>
     75  <property name="is_required">True</property>
    7176  <property name="label">Surname</property>
    7277  <property name="label_edit">Surname</property>
  • waeup_product/trunk/profiles/default/workflows.xml

    r200 r204  
    3939   <bound-workflow workflow_id="waeup_base_wf"/>
    4040  </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>
    4159 </bindings>
    4260</object>
  • waeup_product/trunk/skins/waeup_default/logged_in.pt

    r125 r204  
    3939                   >
    4040          <tal:block
    41               condition="python:'Students' in member.getGroups()"
     41              condition="python:1 or 'Student' in member.getRoles()"
    4242              tal:define="dummy python: context.process_waeup_login(member=member,sc_pin=request.get('sc_pin'))" />
    4343          <tal:block condition="first_time">
  • waeup_product/trunk/skins/waeup_student/create_jamb.py

    r173 r204  
    5252    try:
    5353        #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'))
    5555    except:
    5656        noCPSMember = True
    5757    if noCPSMember:
    5858        #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',])
    6962    return context.students_folder_view_manager(psm=psm)
    7063
  • waeup_product/trunk/skins/waeup_student/process_waeup_login.py

    r182 r204  
    88response=request.response
    99
    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())
     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())
    1616
    1717member_id = str(member)
Note: See TracChangeset for help on using the changeset viewer.