Commit 69d3b8cd authored by Gerald Salin's avatar Gerald Salin
Browse files

add number formatting for thousands

add sorting for projects
parent 7c4da604
<?php
/***************************************************************
* Copyright notice
......@@ -58,8 +57,6 @@ class tx_nG6_pi1 extends tslib_pibase {
$piFlexForm = $this->cObj->data['pi_flexform'];
print_r($piFlexForm);
if ($this->userIsAuthorized()) {
switch((string)$this->conf['view']) {
case 'project':
......@@ -67,6 +64,8 @@ class tx_nG6_pi1 extends tslib_pibase {
return $this->pi_wrapInBaseClass($this->pi_analyze_view('analyze'));
} elseif ($this->piVars['project_id'] && $this->piVars['run_id']) {
return $this->pi_wrapInBaseClass($this->pi_run_view());
}elseif ($this->piVars['project_id'] && $this->piVars['summary']) {
return $this->pi_wrapInBaseClass($this->pi_project_summary());
} else {
return $this->pi_wrapInBaseClass($this->pi_project_view());
}
......@@ -86,7 +85,31 @@ class tx_nG6_pi1 extends tslib_pibase {
return $this->pi_wrapInBaseClass($this->getFieldHeader('not_authorized'));
}
}
/**
* Shows the summary and statistics for a project
*
* @return HTML list of table entries
*/
function pi_project_summary() {
$queryParts = array(
'SELECT' => 'tx_nG6_run.uid AS run_id, tx_nG6_run.name AS name, tx_nG6_project.name AS project_name,' .
'tx_nG6_run.date AS date, tx_nG6_run.species AS run_species, tx_nG6_run.data_nature AS run_data_nature,' .
'tx_nG6_run.type AS run_type, tx_nG6_run.nb_sequences AS run_nb_sequences, tx_nG6_run.full_seq_size AS run_full_seq_size,' .
'tx_nG6_run.description AS run_description, tx_nG6_run.sequencer AS run_sequencer,' .
'tx_nG6_run.directory AS run_directory, tx_nG6_run.hidden AS run_hidden, tx_nG6_project.name AS project_name,' .
'tx_nG6_project.fe_group AS project_fe_group',
'FROM' => 'tx_nG6_run INNER JOIN (tx_nG6_project_run INNER JOIN tx_nG6_project ON tx_nG6_project_run.project_id=tx_nG6_project.uid)' .
'ON tx_nG6_run.uid=tx_nG6_project_run.run_id',
'WHERE' => 'tx_nG6_project.uid = '.$this->piVars['project_id'],
'GROUPBY' => '',
'ORDERBY' => '',
'LIMIT' => ''
);
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
$content = "Le projet ".$this->piVars['project_id']." contient " . $GLOBALS['TYPO3_DB']->sql_num_rows($res) . " runs.";
return $content;
}
/**
* Shows a list of database entries
*
......@@ -331,8 +354,8 @@ class tx_nG6_pi1 extends tslib_pibase {
<td>'.$this->getFieldContent('run_species').'</td>
<td>'.$this->getFieldContent('run_data_nature').'</td>
<td>'.$this->getFieldContent('run_type').'</td>
<td>'.$this->getFieldContent('run_nb_sequences').'</td>
<td>'.$this->getFieldContent('run_full_seq_size').'</td>
<td>'.number_format($this->getFieldContent('run_nb_sequences'), 0, ',', ' ').'</td>
<td>'.number_format($this->getFieldContent('run_full_seq_size'), 0, ',', ' ').'</td>
<td>'.$this->getFieldContent('run_description').'</td>
<td>'.$this->getFieldContent('run_sequencer').'</td>
</tr>';
......@@ -354,8 +377,8 @@ class tx_nG6_pi1 extends tslib_pibase {
<td '.$this->pi_classParam('hidden').' >'.$this->getFieldContent('run_species').'</td>
<td '.$this->pi_classParam('hidden').' >'.$this->getFieldContent('run_data_nature').'</td>
<td '.$this->pi_classParam('hidden').' >'.$this->getFieldContent('run_type').'</td>
<td '.$this->pi_classParam('hidden').' >'.$this->getFieldContent('run_nb_sequences').'</td>
<td '.$this->pi_classParam('hidden').' >'.$this->getFieldContent('run_full_seq_size').'</td>
<td '.$this->pi_classParam('hidden').' >'.number_format($this->getFieldContent('run_nb_sequences'), 0, ',', ' ').'</td>
<td '.$this->pi_classParam('hidden').' >'.number_format($this->getFieldContent('run_full_seq_size'), 0, ',', ' ').'</td>
<td '.$this->pi_classParam('hidden').' >'.$this->getFieldContent('run_description').'</td>
<td '.$this->pi_classParam('hidden').' >'.$this->getFieldContent('run_sequencer').'</td>
</tr>';
......@@ -402,11 +425,11 @@ class tx_nG6_pi1 extends tslib_pibase {
</tr>
<tr>
<th align="left">'.$this->getFieldHeader('nb_sequences').' :</th>
<td align="left">'.$this->getFieldContent('run_nb_sequences').'</td>
<td align="left">'.number_format($this->getFieldContent('run_nb_sequences'), 0, ',', ' ').'</td>
</tr>
<tr>
<th align="left">'.$this->getFieldHeader('full_seq_size').' :</th>
<td align="left">'.$this->getFieldContent('run_full_seq_size').'</td>
<td align="left">'.number_format($this->getFieldContent('run_full_seq_size'), 0, ',', ' ').'</td>
</tr>
<tr>
<th align="left">'.$this->getFieldHeader('sequencer').' :</th>
......
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