Commit 5fb9c51d authored by Jean-Paul Smets's avatar Jean-Paul Smets

added initial support of templates


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5211 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 28b229ba
......@@ -103,7 +103,25 @@ elif doAction0 == \'add\':\n
, \'view\'\n
, \'portal_status_message=Object+Created.\')\n
return request.RESPONSE.redirect( redirect_url )\n
\n
elif doAction0 == \'template\':\n
# Support for document templates (copy / paste a document from preferences)\n
template_relative_url = \' \'.join(Base_doAction[1:])\n
template = context.getPortalObject().restrictedTraverse(template_relative_url)\n
if template is not None:\n
preference = template.getParentValue()\n
preference.manage_copyObjects(ids=[template.getId()], REQUEST=request, RESPONSE=None)\n
new_content_list = context.manage_pasteObjects(request[\'__cp\'])\n
new_content_id = new_content_list[0][\'new_id\']\n
redirect_url = \'%s/%s/%s?%s\' % ( context.absolute_url()\n
, new_content_id\n
, \'view\'\n
, \'portal_status_message=Template+Created.\')\n
else: \n
redirect_url = \'%s/%s?%s\' % ( context.absolute_url()\n
, \'view\'\n
, \'portal_status_message=Template+Does+not+Exist.\')\n
return request.RESPONSE.redirect( redirect_url )\n
\n
return getattr(context,form_id)(request)\n
......@@ -175,6 +193,11 @@ return getattr(context,form_id)(request)\n
<string>str</string>
<string>new_content</string>
<string>redirect_url</string>
<string>template_relative_url</string>
<string>template</string>
<string>preference</string>
<string>new_content_list</string>
<string>new_content_id</string>
<string>getattr</string>
</tuple>
</value>
......
......@@ -90,7 +90,9 @@
global user_actions filtered_actions/user | nothing;\n
global global_actions filtered_actions/global | nothing;\n
global ordered_global_actions python:here.getOrderedGlobalActionList(global_actions);\n
global portal_url python:here.portal_url();" />\n
global portal_url python:here.portal_url();\n
global document_template_list here/getDocumentTemplateList | nothing"\n
/>\n
\n
\n
</body>\n
......
......@@ -124,6 +124,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
i18n:translate="" i18n:domain="ui">Add <tal:block tal:content="content/Title" i18n:name="portal_type" i18n:translate="" i18n:domain="ui">portal type</tal:block></option>\n
</tal:block>\n
</tal:block>\n
<tal:block tal:condition="document_template_list">\n
<option disabled>-- <tal:block i18n:translate="" i18n:domain="ui">Templates</tal:block> --</option>\n
<tal:block tal:repeat="document_template document_template_list">\n
<option value="1"\n
tal:attributes="value python:\'template \' + document_template.getRelativeUrl()">\n
<tal:block i18n:translate="" i18n:domain="ui">Add <tal:block tal:content="document_template/getTitle" i18n:name="document_template">Document Template</tal:block></tal:block></option>\n
</tal:block>\n
</tal:block>\n
<option disabled>-- <tal:block i18n:translate="" i18n:domain="ui">Workflows</tal:block> --</option>\n
<tal:block tal:repeat="action workflow_actions">\n
<option value="1" tal:content="action/name"\n
......
2006-01-20 JP & Jerome
* Added document template initial support to Base_doAction and erp5_html_style
2006-01-20 Kevin
* Replace Translation Service by Localizer in: erp5_core/Base_TranslateString, erp5_core/ERP5Site_updateTranslationTable, erp5_csv_style/Listbox_exportCsv, erp5_html_style/form_html, erp5_html_style/view_master.xml, erp5_pdf_style/form_view, erp5_pdf_style/listbox_pdf_macro, erp5_pdf_style/report_pdf and erp5_pdf_style/report_view.
* ERP5Site_getModuleItemList cleaned.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment