Commit 4bff58db authored by Jerome Mariette's avatar Jerome Mariette
Browse files

add hide/unhide toolbar

parent 30e14ca2
......@@ -126,10 +126,85 @@ class tx_nG6_eid {
$ids = trim(t3lib_div::_GP('ids'));
$data_folder = trim(t3lib_div::_GP('data_folder'));
print $this->get_file_size($user_group, $ids, $data_folder);
}
// If asked to hide a {project/run}
} else if ($type == 'hide') {
$ids = trim(t3lib_div::_GP('ids'));
$hide_level = trim(t3lib_div::_GP('hide_level')); //{project/run}
//{project/run}_id to array (1;2;3;...) -> [1;2;3;...]
$tab_ids = explode(";",$ids);
// hide
$to_hide = '1';
foreach($tab_ids as $p_id => $p_value) {
// Execute query
tx_nG6_db::change_hide_status($p_value, $to_hide, $hide_level);
// Hide subgroups (project -> runs -> analyzes)
$this->change_child_hide_status($user_group, $p_value, $to_hide, $hide_level);
}
// If asked to unhide a {project/run}
} else if ($type == 'unhide') {
$ids = trim(t3lib_div::_GP('ids'));
$hide_level = trim(t3lib_div::_GP('hide_level')); //{project/run}
//{project/run}_id to array (1;2;3;...) -> [1;2;3;...]
$tab_ids = explode(";",$ids);
// unhide
$to_hide = '0';
foreach($tab_ids as $p_id => $p_value) {
// Execute query
tx_nG6_db::change_hide_status($p_value, $to_hide, $hide_level);
// Unhide subgroups (project -> runs -> analyzes)
$this->change_child_hide_status($user_group, $p_value, $to_hide, $hide_level);
}
}
}
/**
* Hide/unhide inherits rights from a run/project
*
* @param string $user_group the user group
* @param string $pr_id {project/run} id
* @param string $hide_status hide status {'1' (hide)/ '0' (unhide)}
* @param string $pr_choice point of view choice {'project'/'run'}
*/
function change_child_hide_status($user_group, $pr_id, $hide_status, $pr_choice) {
if ($pr_choice == 'project') {
// First, All project runs
$project_runs = tx_nG6_db::get_project_runs($user_group, $pr_id);
foreach($project_runs as $run_id => $run_values) {
tx_nG6_db::change_hide_status($run_values['id'], $hide_status, 'run');
// All run analyzes
$run_analysis = tx_nG6_db::get_run_analysis($user_group, $run_values['id']);
foreach($run_analysis as $analyse_id => $analyze_values) {
tx_nG6_db::change_hide_status($analyze_values['id'], $hide_status, 'analyze');
}
}
// All project analysis
$project_analysis = tx_nG6_db::get_project_analysis($user_group, $pr_id);
foreach($project_analysis as $analyse_id => $analyze_values) {
tx_nG6_db::change_hide_status($analyze_values['id'], $hide_status, 'analyze');
}
} elseif ($pr_choice == 'run') {
// All run analysis
$run_analysis = tx_nG6_db::get_run_analysis($user_group, $pr_id);
foreach($run_analysis as $analyse_id => $analyze_values) {
tx_nG6_db::change_hide_status($analyze_values['id'], $hide_status, 'analyze');
}
}
}
/**
* Creates an archiving script to archive data from ids
*
......
......@@ -86,6 +86,7 @@ class tx_nG6_db {
'id' => $project_id,
'name' => $row['project_name'],
'hidden' => $row['project_hidden'],
'group' => $row['project_fe_group'],
'description' => $row['project_description']);
}
......@@ -193,7 +194,7 @@ class tx_nG6_db {
* @param string $project_id the project id
* @return hash table with all analysis information
*/
function get_project_analysis($user_group, $project_id, $orderby, $limit) {
function get_project_analysis($user_group, $project_id, $orderby='', $limit='') {
// First select all analysis from the database
$queryParts = array(
'SELECT' => 'tx_nG6_analyze.uid AS analyze_id,'.
......@@ -485,7 +486,7 @@ class tx_nG6_db {
/*
* Run functions
* Analyze functions
*------------------------------------------------------------*/
/**
......@@ -634,15 +635,41 @@ class tx_nG6_db {
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
$reslist = array();
$i = 0;
while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
if (in_array($group, t3lib_div::intExplode(',',$row['subgroup']))) {
$reslist[$i] = $row['uid'];
$i++;
}
}
return $reslist;
}
/**
* Return the recursive supergroups list of the specified group
*
* @param string $group the group id
* @param string $level the search depth, can be 'all' or 'first' (default)
* @return array
*/
function get_all_super_groups_of ($group, $level = 'first') {
if ($level == 'all') {
// return the recursive list of all $group super groups
$first_list = tx_nG6_db::get_super_groups_of($group);
$super_list = $first_list;
foreach ($first_list as $first_list_group_id) {
$next_list = tx_nG6_db::get_all_super_groups_of($first_list_group_id, $level);
$super_list = array_merge($super_list,$next_list);
}
return $super_list;
} else {
return tx_nG6_db::get_super_groups_of($group);
}
}
/**
* Returns a string with user groups separated by comas
*
......@@ -745,7 +772,132 @@ class tx_nG6_db {
return in_array($authorized_group, preg_split("/,/", tx_nG6_db::get_user_groups($user_group)));
}
}
/**
* Return if the user is a superuser for the specified project/run/analyse
*
* @param string $user_group the user group
* @param string $type can be project/run/analyse
* @param string $uid the uid
* @return boolean {1 = ok, 0 = nok}
*/
function is_super_user($user_group, $type, $uid) {
if ($type == 'project') {
$queryParts = array(
'SELECT' => 'fe_group',
'FROM' => 'tx_nG6_project',
'WHERE' => 'uid='.$uid,
'GROUPBY' => '',
'ORDERBY' => '',
'LIMIT' => ''
);
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
$val = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
$authorized_group = $val['fe_group'];
} elseif ($type == 'run') {
$queryParts = array(
'SELECT' => 'project_id',
'FROM' => 'tx_nG6_project_run',
'WHERE' => 'run_id='.$uid,
'GROUPBY' => '',
'ORDERBY' => '',
'LIMIT' => ''
);
$res1 = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
$val = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res1);
$queryParts = array(
'SELECT' => 'fe_group',
'FROM' => 'tx_nG6_project',
'WHERE' => 'uid='.$val['project_id'],
'GROUPBY' => '',
'ORDERBY' => '',
'LIMIT' => ''
);
$res2 = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
$val = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res2);
$authorized_group = $val['fe_group'];
} elseif ($type == 'analyze') {
$queryParts = array(
'SELECT' => 'run_id',
'FROM' => 'tx_nG6_run_analyze',
'WHERE' => 'analyze_id='.$uid,
'GROUPBY' => '',
'ORDERBY' => '',
'LIMIT' => ''
);
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
$val = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
$queryParts = array(
'SELECT' => 'project_id',
'FROM' => 'tx_nG6_project_run',
'WHERE' => 'run_id='.$val['run_id'],
'GROUPBY' => '',
'ORDERBY' => '',
'LIMIT' => ''
);
$res2 = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
$val = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res2);
$queryParts = array(
'SELECT' => 'fe_group',
'FROM' => 'tx_nG6_project',
'WHERE' => 'uid='.$val['project_id'],
'GROUPBY' => '',
'ORDERBY' => '',
'LIMIT' => ''
);
$res3 = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
$val = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res3);
$authorized_group = $val['fe_group'];
} else {
return true;
}
if (!$GLOBALS['TSFE']->loginUser) { // If the user is not logged on
return $authorized_group == 0;
} else {
// super groups string => supergroup1,supergroup2,...
$all_list = tx_nG6_db::get_all_super_groups_of($authorized_group,'all');
$groups_str='';
foreach ($all_list as $asd) { $groups_str .= $asd.','; }
$effective_supergroups = substr($groups_str, 0, -1); //delete the last comma
if (strlen($effective_supergroups) == 0) {
$is_super_user = true; // means : current user is a super user (no super groups exists)
} else {
$is_super_user = in_array($user_group, preg_split("/,/", $effective_supergroups));
}
return $is_super_user;
}
}
/*
* Miscellaneous functions
*------------------------------------------------------------*/
/**
* Change the hide status of a project/run/analyze
*
* @param string $pra_id {project/run/analyze} id
* @param string $new_hide_status the new status {'1' (hide)/ '0' (unhide)}
* @param string $pra_choice point of view choice {'project'/'run'/'analyze'}
*/
function change_hide_status($pra_id, $new_hide_status, $pra_choice) {
$table='tx_nG6_'.$pra_choice;
$where='tx_nG6_'.$pra_choice.'.uid='.$pra_id;
$fields_values = array('hidden' => $new_hide_status);
$res = $GLOBALS['TYPO3_DB']-> exec_UPDATEquery ($table, $where, $fields_values);
print $res;
}
}
......
......@@ -61,40 +61,54 @@ class tx_nG6_pi1 extends tslib_pibase {
$this->pi_loadLL();
// Add the ng6 plugins css
$GLOBALS['TSFE']->additionalHeaderData[$this->prefixId] = '<link type="text/css" rel="stylesheet" media="screen" href="'.t3lib_extMgm::siteRelPath($this->extKey).'res/css/tx_nG6.css"/>';
$GLOBALS['TSFE']->additionalHeaderData[$this->prefixId] = '
<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/jquery.js"></script>
<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/jquery.ui.core.min.js"></script>
<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/jquery.ui.dialog.min.js"></script>
<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/jquery.ui.draggable.min.js"></script>
<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/jquery.ui.resizable.min.js"></script>
<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/jquery.bgiframe.min.js"></script>
<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/jquery.url.packed.js"></script>
<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/tx_nG6_pi1.js"></script>
<link type="text/css" rel="stylesheet" media="screen" href="'.t3lib_extMgm::siteRelPath($this->extKey).'res/css/tx_nG6.css"/>
<link type="text/css" rel="stylesheet" media="screen" href="'.t3lib_extMgm::siteRelPath($this->extKey).'res/css/jquery.ui.core.css"/>
<link type="text/css" rel="stylesheet" media="screen" href="'.t3lib_extMgm::siteRelPath($this->extKey).'res/css/jquery.ui.theme.css"/>
<link type="text/css" rel="stylesheet" media="screen" href="'.t3lib_extMgm::siteRelPath($this->extKey).'res/css/jquery.ui.dialog.css"/>';
$content = '<input type="hidden" id="user_group" value="'.$GLOBALS['TSFE']->fe_user->user['usergroup'].'" />';
// If the user is authorized to access the specified project/run, display the page
if (tx_nG6_db::user_is_authorized($GLOBALS['TSFE']->fe_user->user['usergroup'], $this->piVars['project_id'], $this->piVars['run_id'])) {
switch((string)$this->conf['view']) {
// If the plugin is configured to display results by project
case 'project':
if ($this->piVars['analyze_id']) {
return $this->pi_wrapInBaseClass($this->pi_analyze_view('analyze'));
$content .= $this->pi_analyze_view('analyze');
} elseif ($this->piVars['project_id'] && $this->piVars['run_id']) {
return $this->pi_wrapInBaseClass($this->pi_run_view());
$content .= $this->pi_run_view();
}elseif ($this->piVars['project_id'] && $this->piVars['summary']) {
return $this->pi_wrapInBaseClass($this->pi_project_summary());
$content .= $this->pi_project_summary();
} else {
return $this->pi_wrapInBaseClass($this->pi_project_view());
$content .= $this->pi_project_view();
}
break;
// If the plugin is configured to display results by run
case 'run':
if ($this->piVars['analyze_id']) {
return $this->pi_wrapInBaseClass($this->pi_analyze_view('analyze'));
$content .= $this->pi_analyze_view('analyze');
} else {
return $this->pi_wrapInBaseClass($this->pi_run_view());
$content .= $this->pi_run_view();
}
break;
// If the plugin is not configured, display by project is default
default:
return $this->pi_wrapInBaseClass($this->pi_project_view());
$content .= $this->pi_project_view();
break;
}
// If the user is not authorized
} else {
return $this->pi_wrapInBaseClass($this->pi_getLL('not_authorized','[not_authorized]'));
$content .= $this->pi_getLL('not_authorized','[not_authorized]');
}
return $this->pi_wrapInBaseClass($content);
}
/**
......@@ -156,8 +170,8 @@ class tx_nG6_pi1 extends tslib_pibase {
function pi_project_list_view($projects) {
// First add the table header
$content = '<table'.$this->pi_classParam('listrow').'>
<tr>
$content = '<table'.$this->pi_classParam('listrow').' id="table_chk"><tr>
<th id="main_chk"><center><input type="checkbox" id="chk_all"></center></th>
<th>'.$this->pi_getLL('project_name','[project_name]').'</th>
<th>'.$this->pi_getLL('description','[description]').'</th>
</tr>';
......@@ -167,14 +181,24 @@ class tx_nG6_pi1 extends tslib_pibase {
// If it's not a hidden project
$hidden = $this->pi_classParam('hidden');
if ($project_values['hidden'] == 0) { $hidden = ''; }
$content .= '<tr>
<td '.$hidden.' >'.$this->pi_list_linkSingle($project_values['name'],$project_values['id'],1, array('project_id'=>$project_values['id'])).'</td>
<td '.$hidden.' >'.$project_values['description'].'</td>
</tr>';
$content .= '<tr id="project_'.$project_values['id'].'">';
// projects updates possibility depends on projects rights (show checkboxes or not)
if ( tx_nG6_db::is_super_user($GLOBALS['TSFE']->fe_user->user['usergroup'], 'project', $project_values['id']) ) {
$content .= '<td '.$hidden.'><center><input type="checkbox" name="opt_checkbox" value="project_'.$project_values['id'].'"></center></td>';
} else {
$content .= '<td name="empty_checkbox"></td>';
}
$content .= '<td '.$hidden.' >'.$this->pi_list_linkSingle($project_values['name'],$project_values['id'],1, array('project_id'=>$project_values['id'])).'</td>
<td '.$hidden.' >'.$project_values['description'].'</td>
</tr>';
}
// Return the whole table
return $content .= '</table>';
$content .= '</table>';
// option toolbar
$content .= $this->get_option_toolbar();
return $content;
}
/**
......@@ -256,8 +280,8 @@ class tx_nG6_pi1 extends tslib_pibase {
function pi_run_list_view($runs) {
// First add the table header
$content = '<table'.$this->pi_classParam('listrow').'>
<tr>
$content = '<table'.$this->pi_classParam('listrow').' id="table_chk"><tr>
<th id="main_chk"><center><input type="checkbox" id="chk_all"></center></th>
<th>'.$this->pi_getLL('run_name','[run_name]').'</th>
<th>'.$this->pi_getLL('project_name','[project_name]').'</th>
<th>'.$this->pi_getLL('date','[date]').'</th>
......@@ -278,22 +302,30 @@ class tx_nG6_pi1 extends tslib_pibase {
if ($run_values['hidden'] == 0) { $hidden = ''; }
// Add the row information
$content .= '<tr>
<td '.$hidden.' >'.$this->pi_list_linkSingle($run_values['name'],$run_id,1, array('run_id'=>$run_values['id'], 'project_id'=>$run_values['project_id'])).'</td>
<td '.$hidden.' >'.$run_values['project_name'].'</td>
<td '.$hidden.' >'.strftime('%d-%m-%y',$run_values['date']).'</td>
<td '.$hidden.' >'.$run_values['species'].'</td>
<td '.$hidden.' >'.$run_values['data_nature'].'</td>
<td '.$hidden.' >'.$run_values['type'].'</td>
<td '.$hidden.' >'.number_format($run_values['nb_sequences'], 0, ',', ' ').'</td>
<td '.$hidden.' >'.number_format($run_values['full_seq_size'], 0, ',', ' ').'</td>
<td '.$hidden.' >'.$run_values['description'].'</td>
<td '.$hidden.' >'.$run_values['sequencer'].'</td>
</tr>';
$content .= '<tr id="run_'.$run_values["id"].'">';
// runs updates possibility depends on runs rights (show checkboxes or not)
if ( tx_nG6_db::is_super_user($GLOBALS['TSFE']->fe_user->user['usergroup'], 'run', $run_values['id']) ) {
$content .= '<td '.$hidden.' ><center><input type="checkbox" name="opt_checkbox" value="run_'.$run_values["id"].'"></center></td>';
} else {
$content .= '<td name="empty_checkbox"></td>';
}
$content .='<td '.$hidden.' >'.$this->pi_list_linkSingle($run_values['name'],$run_id,1, array('run_id'=>$run_values['id'], 'project_id'=>$run_values['project_id'])).'</td>
<td '.$hidden.' >'.$run_values['project_name'].'</td>
<td '.$hidden.' >'.strftime('%d-%m-%y',$run_values['date']).'</td>
<td '.$hidden.' >'.$run_values['species'].'</td>
<td '.$hidden.' >'.$run_values['data_nature'].'</td>
<td '.$hidden.' >'.$run_values['type'].'</td>
<td '.$hidden.' >'.number_format($run_values['nb_sequences'], 0, ',', ' ').'</td>
<td '.$hidden.' >'.number_format($run_values['full_seq_size'], 0, ',', ' ').'</td>
<td '.$hidden.' >'.$run_values['description'].'</td>
<td '.$hidden.' >'.$run_values['sequencer'].'</td>
</tr>';
}
// Return the html table
return $content .= '</table>' ;
$content .= '</table>' ;
// option toolbar
$content .= $this->get_option_toolbar();
return $content;
}
/**
......@@ -443,8 +475,8 @@ class tx_nG6_pi1 extends tslib_pibase {
// First add the table header to the HTML
$content = '<br /> <h3> '.$this->pi_getLL('analyzes_done','[analyzes_done]').'</h3> <br />
<table'.$this->pi_classParam('listrow').'>
<tr>
<table'.$this->pi_classParam('listrow').' id="table_chk">
<th id="main_chk"><center><input type="checkbox" id="chk_all"></center></th>
<th>'.$this->pi_getLL('name','[name]').'</th>
<th>'.$this->pi_getLL('description','[description]').'</th>
<th>'.$this->pi_getLL('software','[software]').'</th>
......@@ -458,15 +490,24 @@ class tx_nG6_pi1 extends tslib_pibase {
$hidden = $this->pi_classParam('hidden');
if ($analyse_values['hidden'] == 0) { $hidden = ''; }
$content .= '<tr>
<td '.$hidden.' >'.$this->pi_list_linkSingle($analyse_values['name'],$analyse_values['id'],1, array('analyze_id'=>$analyse_values['id'], 'project_id'=>$this->piVars['project_id'], 'run_id'=>$this->piVars['run_id'])).'</td>
$content .= '<tr id="analyze_'.$analyse_values["id"].'">';
// analyzes updates possibility depends on analyzes rights (show checkboxes or not)
if ( tx_nG6_db::is_super_user($GLOBALS['TSFE']->fe_user->user['usergroup'], 'analyze', $analyse_values['id']) ) {
$content .= '<td '.$hidden.' ><center><input type="checkbox" name="opt_checkbox" value="analyze_'.$analyse_values["id"].'"></center></td>';
} else {
$content .= '<td name="empty_checkbox"></td>';
}
$content .='<td '.$hidden.' >'.$this->pi_list_linkSingle($analyse_values['name'],$analyse_values['id'],1, array('analyze_id'=>$analyse_values['id'], 'project_id'=>$this->piVars['project_id'], 'run_id'=>$this->piVars['run_id'])).'</td>
<td '.$hidden.' >'.$analyse_values['description'].'</td>
<td '.$hidden.' >'.$analyse_values['software'].'</td>
<td '.$hidden.' >'.$analyse_values['version'].'</td>
</tr>';
}
return $content.'</table>' ;
$content.='</table>' ;
// option toolbar
$content .= $this->get_option_toolbar();
return $content;
}
......@@ -546,6 +587,16 @@ class tx_nG6_pi1 extends tslib_pibase {
return $content;
}
/**
* Return the <div> option toolbar
*/
function get_option_toolbar() {
return '<div id="table_opt" '.$this->pi_classParam('div-option-menu').'> '.$this->pi_getLL('toolbar_title','[toolbar_title]').' [
<a href="#" id="hide_link"> '.$this->pi_getLL('hide_btn','[hide_btn]').' </a>/
<a href="#" id="unhide_link"> '.$this->pi_getLL('unhide_btn','[unhide_btn]').' </a>/
<a href="#" id="delete_link"> '.$this->pi_getLL('delete_btn','[delete_btn]').' </a> ] </div>';
}
/**
* Overloading of the tslib_pibase->pi_list_linkSingle function so piVars[showUid] is not set.
* Uses pi_linkTP for the linking
......
......@@ -31,6 +31,10 @@
<label index="software">Sofware</label>
<label index="version">Version</label>
<label index="params">Parameters</label>
<label index="toolbar_title">With selection : </label>
<label index="hide_btn">hide</label>
<label index="unhide_btn">unhide</label>
<label index="delete_btn">delete</label>
<label index="Analyse_sample">Samples</label>
<label index="Analyse_archives_title">Result file(s)</label>
......@@ -273,6 +277,10 @@
<label index="software">Logiciel</label>
<label index="version">Version</label>
<label index="params">Paramètres</label>
<label index="toolbar_title">Pour la selection : </label>
<label index="hide_btn">cacher</label>
<label index="unhide_btn">décacher</label>
<label index="delete_btn">supprimer</label>
<label index="Analyse_sample">Echantillons</label>
<label index="Analyse_archives_title">Fichier(s) résultat</label>
......
......@@ -24,6 +24,16 @@
.tx-nG6-wait { margin-left: 0px; padding-left: 50px; padding-top: 10px; height: 40px; background: url(../img/light_wait.gif) left no-repeat; }
/* tx-nG6-pi1 plugin style */
div.tx-nG6-pi1-div-option-menu {
background: #EFEEDF;
-moz-border-radius-bottomleft:7px;
-moz-border-radius-bottomright:7px;
-webkit-border-bottom-right-radius: 7px;
-webkit-border-bottom-left-radius: 7px;
border-bottom-right-radius:7px;
border-bottom-left-radius:7px;
padding: 5px 8px;
}
table.tx-nG6-pi1-listrow { width: 100%; margin: 1em 0;font-size:90%;}
table.tx-nG6-pi1-listrow th, table.tx-nG6-pi1-listrow td { text-align: left; padding: 5px 8px; }
table.tx-nG6-pi1-listrow th {
......
......@@ -27,7 +27,7 @@
*/
$(function () {
$("#img_dialog").dialog({
autoOpen: false,
width: 850,
......@@ -51,5 +51,119 @@ $(function () {
}
return false;
});
/* Hide toolbar option */
$("#table_opt #hide_link").click(function() {
var nb_checked = $('input:checked[name=opt_checkbox]').size();
if (nb_checked != 0) {
// level
if ($('#table_chk tr:first[id^="project"]').length != 0) {
var hide_level = 'project';
} else if ($('#table_chk tr:first[id^="run"]').length != 0) {
var hide_level = 'run';
} else {
var hide_level = 'analyze';
}
//Adress definition
var val_url = "index.php?eID=tx_nG6&type=hide";
val_url += "&hide_level="+hide_level;
val_url += "&user_group="+$("#user_group").val();
val_url += "&ids=";
$('input:checked[name=opt_checkbox]').each(function(i){
val_url += $(this).val().split("_",2)[1]+";"; // {project/run} id
});
$.ajax({
url: val_url,
success: function(val, status, xhr) {
$('input:checked[name=opt_checkbox]').each(function(i){
$id_tmp = $(this).val().split("_",2)[1]+";"; // {project/run} id
// update gui
// hide rows
$("#table_chk tr#"+hide_level+"_"+$id_tmp+" td").addClass("tx-nG6-pi1-hidden");
// uncheck checkboxes
$("#table_chk input[type='checkbox']").attr('checked',false);