verification
## Script (Python) "verification"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
# Thanks to runyaga, Clemens Robbenhaar
from Products.Formulator.Errors import ValidationError, FormValidationError
import os
import string
# Change the next line to the name of your form, i.e. "context.name_of_my_form"
form = context.info_formulator
# Here I initialize a couple of variables
i = 0
myField = []
for field in form.get_fields():
myField.append(field.get_value('title'))
i = i + 1
# Here we'll catch errors
try:
result = context.info_formulator.validate_all(context.REQUEST)
except FormValidationError, errlist:
print "I'm sorry. Some of the information you entered was either incorrect or incomplete. Please use the "back" button and fill it in correctly. Thank you!
" for error in errlist.errors: print '' + error.field.get_value('title') + ': '+ error.error_text + '
' print '' return printed # If we didn't get an error, then print for verification before going to the next steps. if result: print 'STEP 3: Verification. Plese verify that these information are correct.' print "" print ""
print "
"
print ''
print ''
print ''
print ''
print ''
print ''
print ''
print "
" for error in errlist.errors: print '' + error.field.get_value('title') + ': '+ error.error_text + '
' print '' return printed # If we didn't get an error, then print for verification before going to the next steps. if result: print 'STEP 3: Verification. Plese verify that these information are correct.' print "" print "
Deceased's First Name: | " print '' + result['firstname'] + ' |
Deceased's Last Name: | " print '' + result['lastname'] + ' |
Date of Birth: | " print '' + result['datebirth'] + ' |
Date of Death: | " print '' + result['datedeath'] + ' |
Maintainer's Name: | " print '' + result['maintainer_name'] + ' |
Maintainer's Email: | " print '' + result['maintainer_email'] + ' |
" print "" return printed