Commit 6ea149df authored by Yusei Tahara's avatar Yusei Tahara

2009-01-14 kazuhiko

* improve Glossary to Field/Workflow comparison dialogues.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25110 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5d0f5c70
...@@ -64,11 +64,12 @@ def get_term_list(business_field, reference):\n ...@@ -64,11 +64,12 @@ def get_term_list(business_field, reference):\n
term_list = portal_catalog(portal_type=\'Glossary Term\',\n term_list = portal_catalog(portal_type=\'Glossary Term\',\n
validation_state=\'validated\',\n validation_state=\'validated\',\n
language_id=\'en\',\n language_id=\'en\',\n
business_field_title=business_field,\n business_field_title=(\'core\', business_field),\n
reference=reference)\n reference=reference)\n
return [i.getObject() for i in term_list]\n return [i.getObject() for i in term_list]\n
\n \n
def get_field_and_reference_list(business_field):\n def get_field_and_reference_list(business_field):\n
business_field = business_field.split(\'/\')[0]\n
result = []\n result = []\n
skin_folder = getattr(portal_skins, \'erp5_%s\' % business_field, None)\n skin_folder = getattr(portal_skins, \'erp5_%s\' % business_field, None)\n
if skin_folder is None:\n if skin_folder is None:\n
...@@ -99,7 +100,6 @@ for business_field in business_field_list:\n ...@@ -99,7 +100,6 @@ for business_field in business_field_list:\n
field.aq_parent.getId(),\n field.aq_parent.getId(),\n
field.getId())\n field.getId())\n
\n \n
line = newTempBase(context, \'tmp_glossary_field_%s\' % c)\n
c += 1\n c += 1\n
field_title = field.get_value(\'title\')\n field_title = field.get_value(\'title\')\n
field_description = field.get_value(\'description\')\n field_description = field.get_value(\'description\')\n
...@@ -110,6 +110,12 @@ for business_field in business_field_list:\n ...@@ -110,6 +110,12 @@ for business_field in business_field_list:\n
elif field.get_tales_expression(\'title\') is not None:\n elif field.get_tales_expression(\'title\') is not None:\n
field_note_list.append(\'Tales is used.\')\n field_note_list.append(\'Tales is used.\')\n
\n \n
if len(term_list) == 1 and \\\n
term_list[0].getTitle() == field_title and \\\n
term_list[0].getDescription() == field_description:\n
continue\n
\n
line = newTempBase(context, \'tmp_glossary_field_%s\' % c)\n
line.edit(field_title=field_title,\n line.edit(field_title=field_title,\n
field_path=field_path,\n field_path=field_path,\n
field_edit_url = \'%s/manage_main\' % field.absolute_url(),\n field_edit_url = \'%s/manage_main\' % field.absolute_url(),\n
...@@ -181,13 +187,15 @@ return line_list\n ...@@ -181,13 +187,15 @@ return line_list\n
<string>reference</string> <string>reference</string>
<string>term_list</string> <string>term_list</string>
<string>field_path</string> <string>field_path</string>
<string>line</string>
<string>_inplacevar_</string> <string>_inplacevar_</string>
<string>field_title</string> <string>field_title</string>
<string>field_description</string> <string>field_description</string>
<string>field_note_list</string> <string>field_note_list</string>
<string>True</string> <string>True</string>
<string>None</string> <string>None</string>
<string>len</string>
<string>_getitem_</string>
<string>line</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -66,11 +66,12 @@ def get_term_list(business_field, reference):\n ...@@ -66,11 +66,12 @@ def get_term_list(business_field, reference):\n
term_list = portal_catalog(portal_type=\'Glossary Term\',\n term_list = portal_catalog(portal_type=\'Glossary Term\',\n
validation_state=\'validated\',\n validation_state=\'validated\',\n
language_id=\'en\',\n language_id=\'en\',\n
business_field_title=business_field,\n business_field_title=(\'core\', business_field),\n
reference=reference)\n reference=reference)\n
return [i.getObject() for i in term_list]\n return [i.getObject() for i in term_list]\n
\n \n
def get_obj_and_reference_list(business_field):\n def get_obj_and_reference_list(business_field):\n
business_field = business_field.split(\'/\')[0]\n
result = []\n result = []\n
# XXX this might be too simple: some business template include more than one skin folder\n # XXX this might be too simple: some business template include more than one skin folder\n
bt = portal_templates.getInstalledBusinessTemplate("erp5_%s" % business_field)\n bt = portal_templates.getInstalledBusinessTemplate("erp5_%s" % business_field)\n
...@@ -97,7 +98,6 @@ for business_field in business_field_list:\n ...@@ -97,7 +98,6 @@ for business_field in business_field_list:\n
if not term_list:\n if not term_list:\n
continue\n continue\n
\n \n
line = newTempBase(context, \'tmp_glossary_wf_item_%s\' % c)\n
c += 1\n c += 1\n
if type == \'workflow\':\n if type == \'workflow\':\n
wf_item_path = wf_item.id\n wf_item_path = wf_item.id\n
...@@ -113,6 +113,12 @@ for business_field in business_field_list:\n ...@@ -113,6 +113,12 @@ for business_field in business_field_list:\n
wf_item_title = wf_item.actbox_name\n wf_item_title = wf_item.actbox_name\n
wf_item_description = wf_item.description\n wf_item_description = wf_item.description\n
\n \n
if len(term_list) == 1 and \\\n
term_list[0].getTitle() == wf_item_title and \\\n
term_list[0].getDescription() == wf_item_description:\n
continue\n
\n
line = newTempBase(context, \'tmp_glossary_wf_item_%s\' % c)\n
line.edit(wf_item_path=wf_item_path,\n line.edit(wf_item_path=wf_item_path,\n
wf_item_type=type,\n wf_item_type=type,\n
wf_item_title=wf_item_title,\n wf_item_title=wf_item_title,\n
...@@ -185,11 +191,13 @@ return line_list\n ...@@ -185,11 +191,13 @@ return line_list\n
<string>reference</string> <string>reference</string>
<string>type</string> <string>type</string>
<string>term_list</string> <string>term_list</string>
<string>line</string>
<string>_inplacevar_</string> <string>_inplacevar_</string>
<string>wf_item_path</string> <string>wf_item_path</string>
<string>wf_item_title</string> <string>wf_item_title</string>
<string>wf_item_description</string> <string>wf_item_description</string>
<string>len</string>
<string>_getitem_</string>
<string>line</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -344,17 +344,9 @@ ...@@ -344,17 +344,9 @@
<string>field_note</string> <string>field_note</string>
<string>Note</string> <string>Note</string>
</tuple> </tuple>
<tuple>
<string>field_title</string>
<string>Title</string>
</tuple>
<tuple>
<string>field_description</string>
<string>Current Description</string>
</tuple>
<tuple> <tuple>
<string>term</string> <string>term</string>
<string>Term</string> <string>Title / Description</string>
</tuple> </tuple>
</list> </list>
</value> </value>
...@@ -504,6 +496,12 @@ ...@@ -504,6 +496,12 @@
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Field List</string> </value> <value> <string>Field List</string> </value>
</item> </item>
<item>
<key> <string>untranslatable_columns</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>url_columns</string> </key> <key> <string>url_columns</string> </key>
<value> <value>
...@@ -520,14 +518,6 @@ ...@@ -520,14 +518,6 @@
<string>field_note</string> <string>field_note</string>
<string></string> <string></string>
</tuple> </tuple>
<tuple>
<string>field_title</string>
<string></string>
</tuple>
<tuple>
<string>term</string>
<string></string>
</tuple>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<global name="ListField" module="Products.Formulator.StandardFields"/> <global name="RadioField" module="Products.Formulator.StandardFields"/>
<tuple/> <tuple/>
</tuple> </tuple>
</pickle> </pickle>
...@@ -64,10 +64,6 @@ ...@@ -64,10 +64,6 @@
<key> <string>external_validator</string> </key> <key> <string>external_validator</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>extra_item</string> </key> <key> <string>extra_item</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -85,11 +81,11 @@ ...@@ -85,11 +81,11 @@
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>orientation</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>size</string> </key> <key> <string>required</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
...@@ -141,10 +137,6 @@ ...@@ -141,10 +137,6 @@
<key> <string>external_validator</string> </key> <key> <string>external_validator</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>extra_item</string> </key> <key> <string>extra_item</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -164,11 +156,11 @@ ...@@ -164,11 +156,11 @@
</value> </value>
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>orientation</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>size</string> </key> <key> <string>required</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
...@@ -218,10 +210,6 @@ ...@@ -218,10 +210,6 @@
<key> <string>external_validator</string> </key> <key> <string>external_validator</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>extra_item</string> </key> <key> <string>extra_item</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -241,12 +229,12 @@ ...@@ -241,12 +229,12 @@
</value> </value>
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>orientation</string> </key>
<value> <int>0</int> </value> <value> <string>vertical</string> </value>
</item> </item>
<item> <item>
<key> <string>size</string> </key> <key> <string>required</string> </key>
<value> <int>1</int> </value> <value> <int>0</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
...@@ -277,7 +265,7 @@ ...@@ -277,7 +265,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.REQUEST.get(\'auto_select\', 0) == 1 and len(CONTEXTS[\'cell\'].term_list) == 1 and CONTEXTS[\'cell\'].term_list[0].getUid() or None</string> </value> <value> <string>python:here.REQUEST.get(\'auto_select\', 0) == 1 and len(cell.term_list) == 1 and cell.term_list[0].getUid() or None</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
...@@ -293,7 +281,7 @@ ...@@ -293,7 +281,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python:[(\'\', \'\')] + [("%s, %s" %(i.getTitle(), i.getDescription()[:50]), i.getUid()) for i in CONTEXTS[\'cell\'].term_list]</string> </value> <value> <string>python:[(\'(current) %s / %s\' % (cell.field_title, cell.field_description), \'\')] + [("[%s] %s / %s" %(i.getBusinessFieldTitle(), i.getTitle(), i.getDescription()), i.getUid()) for i in cell.term_list]</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -340,17 +340,9 @@ ...@@ -340,17 +340,9 @@
<string>wf_item_type</string> <string>wf_item_type</string>
<string>Type</string> <string>Type</string>
</tuple> </tuple>
<tuple>
<string>wf_item_title</string>
<string>Title</string>
</tuple>
<tuple>
<string>wf_item_description</string>
<string>Current Description</string>
</tuple>
<tuple> <tuple>
<string>term</string> <string>term</string>
<string>Term</string> <string>Title / Description</string>
</tuple> </tuple>
</list> </list>
</value> </value>
...@@ -393,7 +385,7 @@ ...@@ -393,7 +385,7 @@
<list> <list>
<tuple> <tuple>
<string>term</string> <string>term</string>
<string>Term</string> <string>Title / Description</string>
</tuple> </tuple>
</list> </list>
</value> </value>
...@@ -500,6 +492,12 @@ ...@@ -500,6 +492,12 @@
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Field List</string> </value> <value> <string>Field List</string> </value>
</item> </item>
<item>
<key> <string>untranslatable_columns</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>url_columns</string> </key> <key> <string>url_columns</string> </key>
<value> <value>
...@@ -508,18 +506,6 @@ ...@@ -508,18 +506,6 @@
<string>wf_item_path</string> <string>wf_item_path</string>
<string>GlossaryModule_getWorkflowItemEditUrl</string> <string>GlossaryModule_getWorkflowItemEditUrl</string>
</tuple> </tuple>
<tuple>
<string>wf_item_type</string>
<string></string>
</tuple>
<tuple>
<string>wf_item_title</string>
<string></string>
</tuple>
<tuple>
<string>term</string>
<string></string>
</tuple>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<global name="ListField" module="Products.Formulator.StandardFields"/> <global name="RadioField" module="Products.Formulator.StandardFields"/>
<tuple/> <tuple/>
</tuple> </tuple>
</pickle> </pickle>
...@@ -64,10 +64,6 @@ ...@@ -64,10 +64,6 @@
<key> <string>external_validator</string> </key> <key> <string>external_validator</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>extra_item</string> </key> <key> <string>extra_item</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -85,11 +81,11 @@ ...@@ -85,11 +81,11 @@
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>orientation</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>size</string> </key> <key> <string>required</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
...@@ -141,10 +137,6 @@ ...@@ -141,10 +137,6 @@
<key> <string>external_validator</string> </key> <key> <string>external_validator</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>extra_item</string> </key> <key> <string>extra_item</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -164,11 +156,11 @@ ...@@ -164,11 +156,11 @@
</value> </value>
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>orientation</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>size</string> </key> <key> <string>required</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
...@@ -218,13 +210,9 @@ ...@@ -218,13 +210,9 @@
<key> <string>external_validator</string> </key> <key> <string>external_validator</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>extra_item</string> </key> <key> <string>extra_item</string> </key>
<value> <string></string> </value> <value> <string>style="text-align:left"</string> </value>
</item> </item>
<item> <item>
<key> <string>first_item</string> </key> <key> <string>first_item</string> </key>
...@@ -241,16 +229,16 @@ ...@@ -241,16 +229,16 @@
</value> </value>
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>orientation</string> </key>
<value> <int>0</int> </value> <value> <string>vertical</string> </value>
</item> </item>
<item> <item>
<key> <string>size</string> </key> <key> <string>required</string> </key>
<value> <int>1</int> </value> <value> <int>0</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Term</string> </value> <value> <string>Description</string> </value>
</item> </item>
<item> <item>
<key> <string>unicode</string> </key> <key> <string>unicode</string> </key>
...@@ -293,7 +281,7 @@ ...@@ -293,7 +281,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python:[(\'\', \'\')] + [("%s, %s" %(i.getTitle(), i.getDescription()[:30]), i.getUid()) for i in CONTEXTS[\'cell\'].term_list]</string> </value> <value> <string>python:[(\'(current) %s / %s\' % (cell.wf_item_title, cell.wf_item_description), \'\')] + [("[%s] %s / %s" %(i.getBusinessFieldTitle(), i.getTitle(), i.getDescription()), i.getUid()) for i in CONTEXTS[\'cell\'].term_list]</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
430 431
\ 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