Commit b96d0e3d authored by Penom Nom's avatar Penom Nom
Browse files

Unhide the project when unhide the run

Unhide the project and eventually the run when unhide the analyze
parent bac93309
......@@ -762,7 +762,14 @@ class tx_nG6_db {
$run_analysis = tx_nG6_db::get_run_analysis($user_group, $r_id);
foreach($run_analysis as $analysis_id => $analysis_values) {
tx_nG6_db::unhide_analysis($analysis_values['id']);
}
}
// Unhide the project
$GLOBALS['TYPO3_DB']-> exec_UPDATEquery (
'tx_nG6_project, tx_nG6_project_run',
'tx_nG6_project.uid = tx_nG6_project_run.project_id AND tx_nG6_project_run.run_id = '.$r_id ,
array('tx_nG6_project.hidden' => '0')
) ;
// Finaly change the run itself
$GLOBALS['TYPO3_DB']-> exec_UPDATEquery ('tx_nG6_run', 'uid='.$r_id, array('hidden' => '0'));
......@@ -941,6 +948,38 @@ class tx_nG6_db {
* @param string $user_group the group of the current user
*/
function unhide_analysis($a_id) {
$queryParts = array(
'SELECT' => 'tx_nG6_project_analyze.uid',
'FROM' => 'tx_nG6_project_analyze',
'WHERE' => 'tx_nG6_project_analyze.analyze_id = '.$a_id,
'GROUPBY' => '',
'ORDERBY' => '',
'LIMIT' => ''
);
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts) ;
$is_project_analyze = $GLOBALS['TYPO3_DB']->sql_num_rows( $res ) ;
// If the analyse isn't link to run
if( $is_project_analyze )
{
// unhide the project
$GLOBALS['TYPO3_DB']-> exec_UPDATEquery (
'tx_nG6_project, tx_nG6_project_analyze',
'tx_nG6_project.uid = tx_nG6_project_analyze.project_id AND tx_nG6_project_analyze.analyze_id = '.$a_id ,
array('tx_nG6_project.hidden' => '0')
) ;
}
// If the analyse is link to run
else
{
// unhide the project and the run
$GLOBALS['TYPO3_DB']->exec_UPDATEquery (
'tx_nG6_project, tx_nG6_project_run, tx_nG6_run, tx_nG6_run_analyze',
'tx_nG6_project.uid = tx_nG6_project_run.project_id AND tx_nG6_project_run.run_id = tx_nG6_run.uid AND tx_nG6_run.uid = tx_nG6_run_analyze.run_id AND tx_nG6_run_analyze.analyze_id = '.$a_id ,
array('tx_nG6_project.hidden' => '0', 'tx_nG6_run.hidden' => '0')
) ;
}
// Change the analysis itself
$GLOBALS['TYPO3_DB']-> exec_UPDATEquery ('tx_nG6_analyze', 'uid='.$a_id, array('hidden' => '0'));
}
......
Supports Markdown
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