Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alexander Emmerich
erp5
Commits
fabc4c2a
Commit
fabc4c2a
authored
Jan 25, 2023
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_configurator: display installed business configuration
parent
fd737b5f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
173 additions
and
25 deletions
+173
-25
bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_displayBusinessConfigurationList.zpt
...ard/ConfiguratorTool_displayBusinessConfigurationList.zpt
+9
-4
bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_getAvailableBusinessConfigurationList.py
...ConfiguratorTool_getAvailableBusinessConfigurationList.py
+1
-21
bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_getBusinessConfigurationList.py
...r_wizard/ConfiguratorTool_getBusinessConfigurationList.py
+20
-0
bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_getBusinessConfigurationList.xml
..._wizard/ConfiguratorTool_getBusinessConfigurationList.xml
+62
-0
bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_getInstalledBusinessConfigurationList.py
...ConfiguratorTool_getInstalledBusinessConfigurationList.py
+1
-0
bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_getInstalledBusinessConfigurationList.xml
...onfiguratorTool_getInstalledBusinessConfigurationList.xml
+66
-0
bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/wizard.css.css
...Item/portal_skins/erp5_configurator_wizard/wizard.css.css
+14
-0
No files found.
bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_displayBusinessConfigurationList.zpt
View file @
fabc4c2a
<table>
<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">
<h3 i18n:translate="" i18n:domain="ui"> There is no Business Configuration Available. </h3>
...
...
@@ -30,9 +30,14 @@
tal:attributes="title bc_description"
tal:content="bc_description" />
<button tal:attributes="value python: bc.getRelativeUrl()"
type="submit"
name="field_your_business_configuration">Configure</button>
<tal:block tal:condition="python: bc.getSimulationState() == 'draft'">
<button tal:attributes="value python: bc.getRelativeUrl()"
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>
</td>
</tal:block>
...
...
bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_getAvailableBusinessConfigurationList.py
View file @
fabc4c2a
"""
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
return
context
.
ConfiguratorTool_getBusinessConfigurationList
(
"draft"
)
bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_getBusinessConfigurationList.py
0 → 100644
View file @
fabc4c2a
"""
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
bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_getBusinessConfigurationList.xml
0 → 100644
View file @
fabc4c2a
<?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>
bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_getInstalledBusinessConfigurationList.py
0 → 100644
View file @
fabc4c2a
return
context
.
ConfiguratorTool_getBusinessConfigurationList
(
"installed"
)
bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_getInstalledBusinessConfigurationList.xml
0 → 100644
View file @
fabc4c2a
<?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>
bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/wizard.css.css
View file @
fabc4c2a
...
...
@@ -104,4 +104,18 @@
.box
button
:hover
{
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment