Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
genotoul-bioinfo
ng6
Commits
896932b5
Commit
896932b5
authored
Dec 02, 2014
by
Penom Nom
Browse files
delete all comments when deleting a run/project/analysis
parent
b035b950
Changes
1
Hide whitespace changes
Inline
Side-by-side
ui/nG6/lib/class.tx_nG6_db.php
View file @
896932b5
...
...
@@ -414,16 +414,14 @@ class tx_nG6_db {
$res
=
0
;
//from association table
$where
=
$table_name
.
'.'
.
$id_label
.
'='
.
$id
.
' AND
tx_nG6_comment
.comment_id='
.
$comment_id
;
$where
=
$table_name
.
'.'
.
$id_label
.
'='
.
$id
.
' AND
'
.
$table_name
.
'
.comment_id='
.
$comment_id
;
$res
=
$GLOBALS
[
'TYPO3_DB'
]
->
exec_DELETEquery
(
$table_name
,
$where
);
if
(
$res
==
0
){
//from comment table
$where
=
'tx_nG6_comment.uid='
.
$comment_id
;
$res
=
$GLOBALS
[
'TYPO3_DB'
]
->
exec_DELETEquery
(
'tx_nG6_comment'
,
$where
);
if
(
$res
!=
1
)
{
$res
=
1
;
}
//from comment table
$where
=
'tx_nG6_comment.uid='
.
$comment_id
;
$res
=
$GLOBALS
[
'TYPO3_DB'
]
->
exec_DELETEquery
(
'tx_nG6_comment'
,
$where
);
if
(
$res
!=
1
)
{
$res
=
1
;
}
return
$res
;
}
...
...
@@ -940,6 +938,12 @@ class tx_nG6_db {
}
}
//all project comments
$project_comments
=
tx_nG6_db
::
get_all_project_comments
(
$p_id
);
foreach
(
$project_comments
as
$id
=>
$values
){
tx_nG6_db
::
delete_project_comment
(
$p_id
,
$values
[
'id'
]);
}
// Delete DB project entry
if
(
$res
==
0
)
{
$table
=
'tx_nG6_project'
;
...
...
@@ -1337,6 +1341,12 @@ class tx_nG6_db {
$res
=
tx_nG6_utils
::
delete_directory
(
$user_login
,
$user_pwd
,
$data_folder
.
$my_run
[
'directory'
]);
}
// delete all run analyzes
$run_comments
=
tx_nG6_utils
::
get_all_run_comments
(
$r_id
);
foreach
(
$run_comments
as
$id
=>
$values
){
tx_nG6_utils
::
delete_run_comment
(
$r_id
,
$values
[
'id'
]);
}
return
$res
;
}
...
...
@@ -1742,6 +1752,12 @@ class tx_nG6_db {
// Delete the analyse directory
$res
=
tx_nG6_utils
::
delete_directory
(
$user_login
,
$user_pwd
,
$data_folder
.
$my_analysis
[
'directory'
]);
}
// delete all analyze comments
$analyzes_comments
=
tx_nG6_utils
::
get_all_analyze_comments
(
$a_id
)
;
foreach
(
$analyzes_comments
as
$id
=>
$values
){
tx_nG6_utils
::
delete_analyze_comment
(
$a_id
,
$values
[
'id'
]);
}
return
$res
;
}
...
...
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