Commit 5a74db87 authored by Xiaowu Zhang's avatar Xiaowu Zhang

display installed business configuration

See merge request nexedi/erp5!1732
parents ee8ca461 fabc4c2a
Pipeline #26127 failed with stage
in 0 seconds
<table> <table>
<tbody> <tbody>
<tal:block define="business_configuration_list python: here.ConfiguratorTool_getAvailableBusinessConfigurationList()"> <tal:block define="business_configuration_list python: here.ConfiguratorTool_getAvailableBusinessConfigurationList() + here.ConfiguratorTool_getInstalledBusinessConfigurationList()">
<div tal:condition="python: not business_configuration_list"> <div tal:condition="python: not business_configuration_list">
<h3 i18n:translate="" i18n:domain="ui"> There is no Business Configuration Available. </h3> <h3 i18n:translate="" i18n:domain="ui"> There is no Business Configuration Available. </h3>
...@@ -30,9 +30,14 @@ ...@@ -30,9 +30,14 @@
tal:attributes="title bc_description" tal:attributes="title bc_description"
tal:content="bc_description" /> tal:content="bc_description" />
<button tal:attributes="value python: bc.getRelativeUrl()" <tal:block tal:condition="python: bc.getSimulationState() == 'draft'">
type="submit" <button tal:attributes="value python: bc.getRelativeUrl()"
name="field_your_business_configuration">Configure</button> type="submit"
name="field_your_business_configuration">Configure</button>
</tal:block>
<tal:block tal:condition="python: bc.getSimulationState() == 'installed'">
<button class="bc-installed" i18n:translate="" i18n:domain="ui" disabled>Installed</button>
</tal:block>
</div> </div>
</td> </td>
</tal:block> </tal:block>
......
""" return context.ConfiguratorTool_getBusinessConfigurationList("draft")
Returns a list of tuple with max three business configuration for each tuple.
The business configurations without Resource and with the state of the related workflow
equals to 'End' are just ignored.
"""
bc_list = context.business_configuration_module.searchFolder(
portal_type="Business Configuration",
simulation_state="draft",
resource_relative_url="portal_workflow/%")
bc_list = [bc.getObject() for bc in bc_list if bc.getResourceValue() is not None]
bc_tuple_list = []
index = 0
while True:
part = bc_list[index:index+3]
if not part:
return bc_tuple_list
else:
bc_tuple_list.append(tuple(part))
index += 3
"""
Returns a list of tuple with max three business configuration for each tuple.
The business configurations without Resource are just ignored
"""
bc_list = context.business_configuration_module.searchFolder(
portal_type="Business Configuration",
simulation_state=state,
resource_relative_url="portal_workflow/%")
bc_list = [bc.getObject() for bc in bc_list if bc.getResourceValue() is not None]
bc_tuple_list = []
index = 0
while True:
part = bc_list[index:index+3]
if not part:
return bc_tuple_list
else:
bc_tuple_list.append(tuple(part))
index += 3
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ConfiguratorTool_getBusinessConfigurationList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ConfiguratorTool_getInstalledBusinessConfigurationList</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -104,4 +104,18 @@ ...@@ -104,4 +104,18 @@
.box button:hover { .box button:hover {
border: 1px solid #d4e8ec; border: 1px solid #d4e8ec;
}
.box button.bc-installed {
border: 1px solid #35b800;
background: -moz-linear-gradient(
top,
#fff3db 0%,
#1dc11a 25%,
#0dc31a);
background: -webkit-gradient(
linear, left top, left bottom,
from(#fff3db),
color-stop(0.25, #1dc11a),
to(#0dc31a))
} }
\ 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