Ignore:
Timestamp:
16 Apr 2011, 14:26:00 (14 years ago)
Author:
uli
Message:

Add a confirm_passport attribute to applicants and reflect that change in form.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/applicants
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/applicants.py

    r5941 r5952  
    4444    fst_sit_results = FieldProperty(IApplicant['fst_sit_results'])
    4545    locked = False
     46    confirm_passport = False
    4647   
    4748    def __init__(self):
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py

    r5941 r5952  
    381381        super(EditApplicant, self).update()
    382382        return
    383    
     383
     384    def filteredWidgets(self):
     385        for widget in self.widgets:
     386            if widget.name == 'form.confirm_passport':
     387                continue
     388            yield widget
     389
    384390    @property
    385391    def label(self):
     
    412418
    413419    def dataComplete(self):
    414         if self.request.form.get('confirm', False) is False:
     420        if context.confirm_passport is not True:
    415421            return False
    416422        if len(self.errors) > 0:
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser_templates/form_edit_pde.pt

    r5487 r5952  
    2323  <table class="form-fields">
    2424    <tbody>
    25       <tal:block repeat="widget view/widgets">
     25      <tal:block repeat="widget view/filteredWidgets">
    2626        <tr>
    2727          <td class="label" tal:define="hint widget/hint">
     
    5151      <tr>
    5252        <td colspan="2">
    53           <input type="checkbox" name="confirm" />
     53          <input class="hiddenType" id="form.confirm_passport.used"
     54                 name="form.confirm_passport.used" type="hidden" value="" />
     55          <input type="checkbox" name="form.confirm_passport"
     56                 tal:attributes="checked context/confirm_passport"
     57                 />
    5458          <label for="confirm"></label>
    5559<span>
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/interfaces.py

    r5941 r5952  
    445445        required = False,
    446446        )
     447    confirm_passport = schema.Bool(
     448        title = u"Confirmation that photograph represents applicant ticked.",
     449        default = False,
     450        required = True,
     451        )
    447452
    448453   
     
    676681        required = True,
    677682        )
    678 
     683    confirm_passport = schema.Bool(
     684        title = u"Confirmation that photograph represents applicant ticked.",
     685        default = False,
     686        required = True,
     687        )
     688
     689   
    679690class IApplicantPrincipalInfo(IPrincipalInfo):
    680691    """Infos about principals that are applicants.
Note: See TracChangeset for help on using the changeset viewer.