Commit 98fa8891 authored by Yusei Tahara's avatar Yusei Tahara

2008-2-2 Yusei

* Prevent  adding duplicate term.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18998 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 75f9afd5
...@@ -65,22 +65,37 @@ ...@@ -65,22 +65,37 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>result = context.GlossaryModule_getTermDictListFromPropertySheet(property_sheet_list)\n <value> <string encoding="cdata"><![CDATA[
result = context.GlossaryModule_getTermDictListFromPropertySheet(property_sheet_list)\n
\n \n
if export_tsv:\n if export_tsv:\n
for i in result:\n for i in result:\n
print \'\\t\'.join(map(lambda x:\'"%s"\'%x, (i[\'reference\'], i[\'language\'], i[\'business_field\'],\n print \'\\t\'.join(map(lambda x:\'"%s"\'%x, (i[\'reference\'], i[\'language\'],\n
i[\'business_field\'],\n
i[\'title\'], i[\'description\'],)))\n i[\'title\'], i[\'description\'],)))\n
return printed\n return printed\n
else:\n else:\n
portal_catalog = context.portal_catalog\n
for i in result:\n for i in result:\n
item_list = portal_catalog(portal_type=\'Glossary Term\',\n
reference=i[\'reference\'], language=i[\'language\'],\n
business_field=i[\'business_field\'],\n
validation_state="!=deleted")\n
if len(item_list)>0:\n
continue\n
\n
new_id = context.generateNewId()\n new_id = context.generateNewId()\n
context.newContent(id=new_id, portal_type=\'Glossary Term\', container=context,\n context.newContent(id=new_id, portal_type=\'Glossary Term\',\n
reference=i[\'reference\'], language=i[\'language\'], business_field=i[\'business_field\'],\n container=context,\n
reference=i[\'reference\'], language=i[\'language\'],\n
business_field=i[\'business_field\'],\n
title=i[\'title\'], description=i[\'description\'])\n title=i[\'title\'], description=i[\'description\'])\n
\n \n
context.REQUEST.RESPONSE.redirect(context.absolute_url())\n context.Base_redirect()\n
</string> </value>
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_code</string> </key> <key> <string>_code</string> </key>
...@@ -135,6 +150,9 @@ context.REQUEST.RESPONSE.redirect(context.absolute_url())\n ...@@ -135,6 +150,9 @@ context.REQUEST.RESPONSE.redirect(context.absolute_url())\n
<string>i</string> <string>i</string>
<string>map</string> <string>map</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>portal_catalog</string>
<string>item_list</string>
<string>len</string>
<string>new_id</string> <string>new_id</string>
</tuple> </tuple>
</value> </value>
......
2008-2-2 Yusei
* Prevent adding duplicate term.
2008-2-1 Yusei 2008-2-1 Yusei
* Fixed wrong name of scripts of erp5_glossary. Use proxy-roled script to find terms. * Fixed wrong name of scripts of erp5_glossary. Use proxy-roled script to find terms.
......
183 189
\ No newline at end of file \ No newline at end of file
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