Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-core
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
intranet-core
Commits
290e56f2
Commit
290e56f2
authored
Oct 14, 2020
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Added filters to select projects to cleanup
parent
6ab434e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
cleanup-projects.tcl
www/admin/cleanup-demo/cleanup-projects.tcl
+19
-3
No files found.
www/admin/cleanup-demo/cleanup-projects.tcl
View file @
290e56f2
...
...
@@ -19,7 +19,9 @@ ad_page_contract {
@author frank.bergmann@project-open.com
}
{
{
return_url
""
}
{
limit 100000
}
{
parent_id
""
}
{
num_children:integer
""
}
{
limit:integer 100000
}
}
# ------------------------------------------------------
...
...
@@ -93,7 +95,19 @@ list::create \
-filters
{
return_url
}
set
parent_sql
""
if
{
""
ne
$parent
_id
}
{
if
{
"null"
eq
$parent
_id
}
{
set parent_sql
"and p.parent_id is null"
}
if
{[
string
is integer
$parent
_id
]}
{
set parent_sql
"and p.parent_id = :parent_id"
}
}
set
num_children_sql
""
if
{
""
ne
$num
_children
}
{
if
{[
string
is integer
$num
_children
]}
{
set num_children_sql
"and coalesce(subp.num_subprojects, 0) = :num_children"
}
}
db_multirow -extend
{
project_url parent_project_url
}
projects get_projects
"
select
p.*,
...
...
@@ -101,7 +115,7 @@ db_multirow -extend {project_url parent_project_url} projects get_projects "
im_category_from_id(p.project_type_id) as project_type,
im_project_name_from_id(p.parent_id) as parent_project_name,
im_project_nr_from_id(p.parent_id) as parent_project_nr,
subp.
num_subprojects
coalesce(subp.num_subprojects, 0) as
num_subprojects
from
im_projects p
left outer join
...
...
@@ -117,6 +131,8 @@ db_multirow -extend {project_url parent_project_url} projects get_projects "
proj.project_id
) subp on (p.project_id = subp.project_id)
where 1=1
$parent
_sql
$num
_children_sql
order by p.project_id DESC
LIMIT :limit
"
{
...
...
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