source: WAeUP_SRP/trunk/skins/waeup_student/personal_edit.py @ 1312

Last change on this file since 1312 was 1167, checked in by Henrik Bettermann, 18 years ago

new personal templates and scripts
student workflow extended

File size: 1.6 KB
RevLine 
[1167]1## Script (Python) "personal_edit"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=REQUEST, cpsdocument_edit_button=None, cpsdocument_edit_and_view_button=None, action=None
8##title=
9# $Id: application_edit.py 1071 2006-12-16 15:53:13Z joachim $
10"""
11"""
12wftool = context.portal_workflow
13from urllib import urlencode
14from Products.CPSDocument.utils import getFormUidUrlArg
15import DateTime
16current = DateTime.DateTime()
17import logging
18logger = logging.getLogger('Student.Personal.Edit')
19
20info = context.getPersonalInfo()
21
22if info is None:
23    logger.info('"anonymous access","%s"' % REQUEST.get('URL0'))
24    return REQUEST.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
25
26student = info['student']
27per = info['per']
28per_doc = info['per_doc']
29state = info['review_state']
30is_valid, ds = per_doc.validate(request=REQUEST,
31                                schema_id = 'student_personal',
32                                layout_id = 'student_personal_fe',
33                                proxy=per,
34                                use_session=True)
35
36psm = ""
37args = {}
38action = "/personal_edit_form"
39base_url = per.absolute_url()
40
41if is_valid:
42    if cpsdocument_edit_button:
43        logger.info('"%s", "edited personal data"' % (info['id']))
44        #action = ""
45        #base_url = student.absolute_url()
46        #url = base_url + action
47        psm = 'psm_content_changed'
48else:
49    psm = 'psm_content_error'
50    args = getFormUidUrlArg(REQUEST)
51
52args['portal_status_message'] = psm
53url = base_url + action + '?' + urlencode(args)
54REQUEST.RESPONSE.redirect(url)
Note: See TracBrowser for help on using the repository browser.