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
Labels
Merge Requests
146
Merge Requests
146
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
6607a825
Commit
6607a825
authored
Feb 24, 2020
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_project_ui: drop SQL script
parent
75dcf973
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
313 deletions
+17
-313
bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/Base_getProjectInfo.py
...Item/portal_skins/erp5_web_project/Base_getProjectInfo.py
+0
-60
bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/Base_getProjectInfo.xml
...tem/portal_skins/erp5_web_project/Base_getProjectInfo.xml
+0
-62
bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/ProjectModule_viewProjectManagementList/my_front_page_gadget_field.xml
..._viewProjectManagementList/my_front_page_gadget_field.xml
+1
-16
bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_front_page_info.js.js
...ortal_skins/erp5_web_project/gadget_front_page_info.js.js
+16
-175
No files found.
bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/Base_getProjectInfo.py
deleted
100644 → 0
View file @
75dcf973
import
json
from
datetime
import
datetime
def
getProjectId
(
id
):
segments
=
id
.
split
(
"/"
);
if
(
len
(
segments
)
==
2
):
return
id
return
"/"
.
join
(
segments
[
0
:
-
1
])
project_dict
=
{}
now_date
=
datetime
.
now
().
strftime
(
"%Y-%m-%d %H:%M:%S"
)
#TODO these should be parameters
limit_date
=
"2019-12-19 00:00:00"
valid_states
=
[
'planned'
,
'ordered'
,
'confirmed'
,
'delivered'
,
'ready'
]
valid_states
=
"('"
+
"', '"
.
join
(
valid_states
)
+
"')"
valid_types
=
[
'Task'
,
'Bug'
,
'Task Report'
]
valid_types
=
"('"
+
"', '"
.
join
(
valid_types
)
+
"')"
query
=
"""SELECT DISTINCT
COUNT(*) AS `#number`,
`related_source_project__relative_url_1_catalog`.`relative_url` AS `source_project__relative_url`,
`catalog`.`portal_type` AS `portal_type`
FROM (catalog AS `catalog`
LEFT JOIN ( category AS `related_source_project__relative_url_category`
INNER JOIN catalog AS `related_source_project__relative_url_1_catalog`
ON related_source_project__relative_url_1_catalog.uid = related_source_project__relative_url_category.category_uid)
ON related_source_project__relative_url_category.uid = catalog.uid)
WHERE
1 = 1
AND (`catalog`.`modification_date` <= "%s")
AND `catalog`.`simulation_state` IN %s
AND ( `catalog`.`portal_type` IN %s)
AND ( `related_source_project__relative_url_1_catalog`.`relative_url` IS NOT NULL)
AND `related_source_project__relative_url_1_catalog`.`portal_type` IN ('Project', 'Project Line')
AND `related_source_project__relative_url_1_catalog`.`validation_state` = 'validated'
GROUP BY
`related_source_project__relative_url_1_catalog`.`relative_url`,
`catalog`.`portal_type`"""
total_query
=
query
%
(
now_date
,
valid_states
,
valid_types
)
for
row
in
context
.
cmf_activity_sql_connection
.
manage_test
(
total_query
):
key
=
getProjectId
(
row
[
'source_project__relative_url'
])
if
key
in
project_dict
:
if
row
[
'portal_type'
]
in
project_dict
[
key
]:
project_dict
[
key
][
row
[
'portal_type'
]][
'total'
]
=
project_dict
[
key
][
row
[
'portal_type'
]][
'total'
]
+
row
[
"#number"
]
else
:
project_dict
[
key
][
row
[
'portal_type'
]]
=
{
'total'
:
row
[
"#number"
],
'outdated'
:
0
}
else
:
project_dict
[
key
]
=
{
row
[
'portal_type'
]
:
{
'total'
:
row
[
"#number"
],
'outdated'
:
0
}}
outdated_query
=
query
%
(
limit_date
,
valid_states
,
valid_types
)
for
row
in
context
.
cmf_activity_sql_connection
.
manage_test
(
outdated_query
):
key
=
getProjectId
(
row
[
'source_project__relative_url'
])
#project_dict[key][row['portal_type']]['outdated'] = row["#number"]
project_dict
[
key
][
row
[
'portal_type'
]][
'outdated'
]
=
project_dict
[
key
][
row
[
'portal_type'
]][
'outdated'
]
+
row
[
"#number"
]
return
json
.
dumps
(
project_dict
,
indent
=
2
)
bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/Base_getProjectInfo.xml
deleted
100644 → 0
View file @
75dcf973
<?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>
Base_getProjectInfo
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/ProjectModule_viewProjectManagementList/my_front_page_gadget_field.xml
View file @
6607a825
...
...
@@ -150,9 +150,7 @@
</item>
<item>
<key>
<string>
renderjs_extra
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
...
...
@@ -245,17 +243,4 @@
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python: {"project_info_dict": here.Base_getProjectInfo()}
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_front_page_info.js.js
View file @
6607a825
This diff is collapsed.
Click to expand it.
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