+++ /dev/null
-##parameters=add=''
-from Products.CMFCore.utils import getToolByName
-from Products.Plinn.utils import translate
-from ZTUtils import make_query as mq
-_ = lambda msg : translate(msg, context)
-ptool = getToolByName(script, 'portal_properties')
-atool = getToolByName(script, 'portal_actions')
-validate_email = ptool.getProperty('validate_email')
-options = {}
-options['validate_email'] = validate_email
-
-req = context.REQUEST
-resp = req.RESPONSE
-form = req.form
-fg = lambda name : form.get(name,'').strip()
-
-
-if add and \
- context.validatePassword(**form) and \
- context.customer_add_control(**form) and \
- context.validatePrivateAccess(**form) :
- came_from = fg('came_from')
- if came_from :
- return context.setRedirect( atool, 'user/logged_in'
- , came_from = came_from
- , __ac_name=fg('member_id')
- , __ac_password=fg('password'))
- #return resp.redirect('%s?%s' % ( came_from, mq(__ac_name=fg('member_id'), __ac_password=fg('password'), noajax='1')) )
- else:
- options['member_id'] = fg('member_id')
- options['password'] = fg('password')
- options['form_action'] = target = atool.getActionInfo('user/logged_in')['url']
- return context.confirm_join_template(**options)
-
-continuationFields = [
- 'given_name'
- , 'name'
- , 'member_email'
- , 'member_id'
- , 'password'
- , 'confirm'
- , 'send_password'
- , 'wedding_id'
- , 'wedding_password'
- , 'wedding_password_confirm'
- , 'billing_address'
- , 'billing_city'
- , 'billing_zipcode'
- , 'country'
- , 'phone'
- , 'accept_gcs']
-
-
-for name in continuationFields :
- options[name] = fg(name)
-
-# TODO try to be more clever...
-if not options['country']:
- options['country'] = 'FR'
-options['came_from'] = fg('came_from')
-return context.customer_join_template(**options)
+++ /dev/null
-<html metal:use-macro="context/main_template/macros/master">
- <head>
- <meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
- </head>
- <body metal:fill-slot="main_no_tabs" i18n:domain="plinn"
- tal:omit-tag="">
- <div tal:condition="python:options.get('came_from', '').endswith('/my_cart')"
- tal:define="step_authentication python:True" tal:omit-tag="">
- <div metal:use-macro="here/sell_macros/macros/sell_steps"></div>
- </div>
- <h1 i18n:translate="">New customer account</h1>
-
- <form tal:attributes="action string:portal_url/customer_join_form" method="post">
- <table class="TwoColumnForm">
- <tr>
- <td colspan="2" style="text-align:center">
- <h3 i18n:translate="">Customer informations</h3>
- </td>
- </tr>
- <tr>
- <th i18n:translate="">First name</th>
- <td>
- <input type="text" name="given_name" size="30" value="" tal:attributes="value options/given_name" />
- </td>
- </tr>
- <tr>
- <th i18n:translate="">Last name</th>
- <td>
- <input type="text" name="name" size="30" value="" tal:attributes="value options/name" />
- </td>
- </tr>
- <tr>
- <th i18n:translate="">Email Address</th>
- <td>
- <input type="text" name="member_email" size="30"
- tal:attributes="value options/member_email" />
- </td>
- </tr>
- <tr>
- <th i18n:translate="">Member ID</th>
- <td>
- <input type="text" name="member_id" size="30" value=""
- tal:attributes="value options/member_id" />
- </td>
- </tr>
- <tal:case tal:condition="not: options/validate_email">
- <tr>
- <th i18n:translate="">Password</th>
- <td>
- <input type="password" name="password" size="30" tal:attributes="value options/password" />
- </td>
- </tr>
- <tr>
- <th i18n:translate="">Password (confirm)</th>
- <td>
- <input type="password" name="confirm" size="30" tal:attributes="value options/confirm" />
- </td>
- </tr>
- <tr>
- <th i18n:translate="">Mail Password?</th>
- <td>
- <input type="checkbox" name="send_password" id="cb_send_password"
- tal:attributes="checked options/send_password" />
- <em><label for="cb_send_password" i18n:translate="">Check this box to
- have the password mailed.</label></em>
- </td>
- </tr>
- </tal:case>
- <tr>
- <td colspan="2"><hr/></td>
- </tr>
- <tr>
- <td colspan="2" style="text-align:center">
- <h3>Accès à des images privées</h3>
- veuillez entrer le code d'accès pour accéder / acheter les images<br/>
- d'un événement privé couvert par les photographes de notre agence.
- </td>
- </tr>
- <tr>
- <th>Identifiant collection privée</th>
- <td>
- <input type="text" name="wedding_id" tal:attributes="value options/wedding_id"/>
- </td>
- </tr>
- <tr>
- <th>Mot de passe associé</th>
- <td>
- <input type="password" name="wedding_password" tal:attributes="value options/wedding_password" />
- </td>
- </tr>
- <tr>
- <th>Confirmation du mot de passe</th>
- <td>
- <input type="password" name="wedding_password_confirm" tal:attributes="value options/wedding_password_confirm" />
- </td>
- </tr>
- <tr>
- <td colspan="2"><hr/></td>
- </tr>
- <tr>
- <td colspan="2" style="text-align:center">
- <h3 i18n:translate="">Billing informations</h3>
- </td>
- </tr>
- <tr>
- <th i18n:translate="">Address</th>
- <td>
- <textarea name="billing_address" tal:content="options/billing_address"
- cols="30" rows="1" style="width:auto"></textarea>
- </td>
- </tr>
- <tr>
- <th i18n:translate="">City</th>
- <td>
- <input type="text" name="billing_city" size="35" tal:attributes="value options/billing_city"/>
- </td>
- </tr>
- <tr>
- <th i18n:translate="">Zip code</th>
- <td>
- <input type="text" name="billing_zipcode" size="5" tal:attributes="value options/billing_zipcode"/>
- </td>
- </tr>
- <tr>
- <th i18n:translate="">Country</th>
- <td>
- <select name="country"
- tal:define="countries python:modules['Products.iso_3166_1'].fr.countries"
- i18n:domain="iso_3166_1">
- <option tal:repeat="c countries" tal:attributes="value python:c[0]; selected python:c[0]==options['country']" tal:content="python:c[0]" i18n:translate=""></option>
- </select>
- </td>
- </tr>
- <tr>
- <th i18n:translate="">Phone</th>
- <td>
- <input type="text" name="phone" tal:attributes="value options/phone"/>
- </td>
- </tr>
- <tr>
- <th><br/></th>
- <td>
- <input type="checkbox" name="accept_gcs" tal:attributes="checked python:options['accept_gcs']" />
- <a tal:attributes="href string:$portal_url/cgv" target="_blank" i18n:translate="">I accept general conditions of sales</a>
- </td>
- </tr>
- <tr>
- <td> </td>
- <td>
- <input type="hidden" name="noAjax" value="1"/>
- <input type="hidden" name="came_from" tal:condition="options/came_from" tal:attributes="value options/came_from" />
- <input type="submit" name="add" value="Register" i18n:attributes="value"/>
- <input type="submit" name="cancle" value="Cancel" i18n:attributes="value" style="margin-left:15em"/>
- </td>
- </tr>
- </table>
- </form>
- </body>
-</html>