Zope Zone Navigation
 
Document Actions
  • Print this page
  • Add Bookmarklet

2 forms in 2 days w simple workflow.

Up to Plone / CMF

2 forms in 2 days w simple workflow.

Posted by Ignacio Valdes at December 19. 2005
Hi, I've been asked to create a demo for this Wednesday am using Plone. The demo will consist of two forms: 1) A patient summary with 15 different data item fields like name address, phone, etc. and 3 columnar fields: Problems, Medications, Goals. Form 2) is a patient outcomes survey that consists of 15 yes/no and checkbox questions. I will then have to add a simple workflow between Doctor, Nurse, admin and patient. I have only been seriously doing Plone websites for 2 weeks.

Questions:
1) What's the most rapid way of generating these forms?
2) Why did I agree to try to do this in two days?

-- IV

2 forms in 2 days w simple workflow.

Posted by Phil Lanasa at December 21. 2005
Create a new "Controller Page Template", then use the following example to build the code:

<html
xmlns="http://www.w3c.org/1999/xhtml"
xml:lang="en-US"
lang="en-US"
i18n:domain="plone"
metal:use-macro="here/main_template/macros/master">
<head>
<title tal:content="template/title"></title>
</head>
<body>
<div metal:fill-slot="main" tal:define="errors options/state/getErrors">

<form method="post" tal:attributes="action template/id;">


<div tal:define="error_name errors/name|nothing;">
<div tal:condition="python: error_name != nothing" class="error" tal:content="error_name">Error</div>
<label class="fieldRequired">Name *</label>
<input name="name" tal:attributes="value request/name|nothing" />
</div>
<div tal:define="error_email_address errors/email_address|nothing;">
<div tal:condition="python: error_email_address != nothing" class="error" tal:content="error_email_address">Error</div>
<label class="fieldRequired">E-mail *</label>
<input name="email_address" tal:attributes="value request/email_address|nothing" />
</div>
<div>
<label>Title</label>
<input name="title" tal:attributes="value request/title|nothing" />
</div>
<div tal:define="error_company errors/company|nothing;">
<div tal:condition="python: error_company != nothing" class="error" tal:content="error_company">Error</div>
<label class="fieldRequired">Company *</label>
<input name="company" tal:attributes="value request/company|nothing" />
</div>
<div>
<label>Address</label>
<input name="address" tal:attributes="value request/address|nothing" />
</div>
<div>
<label>City</label>
<input name="city" tal:attributes="value request/city|nothing" />
</div>
<div tal:define="error_state errors/state|nothing;">
<div tal:condition="python: error_state != nothing" class="error" tal:content="error_state">Error</div>
<label class="fieldRequired">State *</label>
<input name="state" tal:attributes="value request/state|nothing" />
</div>
<div tal:define="error_zip errors/zip|nothing;">
<div tal:condition="python: error_zip != nothing" class="error" tal:content="error_zip">Error</div>
<label class="fieldRequired">Postal Code *</label>
<input name="zip" tal:attributes="value request/zip|nothing" />
</div>
<div>
<label>Country</label>
<input name="country" tal:attributes="value request/country|nothing" />
</div>
<div tal:define="error_phone errors/phone|nothing;">
<div tal:condition="python: error_phone != nothing" class="error" tal:content="error_phone">Error</div>
<label class="fieldRequired">Phone *</label>
<input name="phone" tal:attributes="value request/phone|nothing" />
</div>
<div>
<label>Fax</label>
<input name="fax" tal:attributes="value request/fax|nothing" />
</div>
<br/><br/>
<input type="submit" name="submit" value="submit" />
<input type="hidden" name="form.submitted" value="1" />

<br/><br/>

</div>

</form>
</div>
</body>
</html>


Powered by Ploneboard
 

Home Discussions Plone / CMF 2 forms in 2 days w simple workflow.