Commit 896932b5 authored by Penom Nom's avatar Penom Nom
Browse files

delete all comments when deleting a run/project/analysis

parent b035b950
......@@ -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;
}
......
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