Commit de620c27 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

fixed php version bug

parent fd852934
......@@ -129,16 +129,20 @@ class tx_nG6_pi1 extends tslib_pibase {
// If there is at least one result
if ($GLOBALS['TYPO3_DB']->sql_num_rows($res) > 0) {
//request total in DB
$select = 'tx_nG6_project.uid';
$from = $queryParts['FROM'];
$where = $queryParts['WHERE'];
$total_count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows($select, $from, $where);
//generate HTML
$project_list= $this->pi_project_list_view($res);
$nav_links = $this->pi_navigation_link_view('project_page', $this->piVars['project_page'], $total_count);
return $project_list ."\n". $nav_links;
$queryPartsc = array(
'SELECT' => $queryParts['SELECT'],
'FROM' => $queryParts['FROM'],
'WHERE' => $queryParts['WHERE'],
'GROUPBY' => '',
'ORDERBY' => '',
'LIMIT' => ''
);
$resc = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryPartsc);
$total_count = $GLOBALS['TYPO3_DB']->sql_num_rows($resc);
//generate HTML
$project_list= $this->pi_project_list_view($res);
$nav_links = $this->pi_navigation_link_view('project_page', $this->piVars['project_page'], $total_count);
return $project_list ."\n". $nav_links;
} else { // If no results
return $this->getFieldHeader('no_raw');
}
......@@ -267,17 +271,21 @@ class tx_nG6_pi1 extends tslib_pibase {
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
if ($GLOBALS['TYPO3_DB']->sql_num_rows($res) > 0) { // There is some results to display
//request total in DB
$select = 'tx_nG6_run.uid';
$from = $queryParts['FROM'];
$where = $queryParts['WHERE'];
$total_count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows($select, $from, $where);
//request total in DB
$queryPartsc = array(
'SELECT' => $queryParts['SELECT'],
'FROM' => $queryParts['FROM'],
'WHERE' => $queryParts['WHERE'],
'GROUPBY' => '',
'ORDERBY' => '',
'LIMIT' => ''
);
$resc = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryPartsc);
$total_count = $GLOBALS['TYPO3_DB']->sql_num_rows($resc);
//generate HTML
$run_list= $this->pi_run_list_view($res);
$nav_links = $this->pi_navigation_link_view('run_page', $this->piVars['run_page'], $total_count);
return $run_list ."\n". $nav_links;
$nav_links = $this->pi_navigation_link_view('run_page', $this->piVars['run_page'], $total_count);
return $run_list ."\n". $nav_links;
} else { // no results
return $this->getFieldHeader('no_raw');
}
......@@ -472,10 +480,18 @@ class tx_nG6_pi1 extends tslib_pibase {
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
$content='';
if ($GLOBALS['TYPO3_DB']->sql_num_rows($res) > 0) {
$select = 'tx_nG6_analyze.uid';
$from = $queryParts['FROM'];
$where = $queryParts['WHERE'];
$total_count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows($select, $from, $where);
//request total in DB
$queryPartsc = array(
'SELECT' => $queryParts['SELECT'],
'FROM' => $queryParts['FROM'],
'WHERE' => $queryParts['WHERE'],
'GROUPBY' => '',
'ORDERBY' => '',
'LIMIT' => ''
);
$resc = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryPartsc);
$total_count = $GLOBALS['TYPO3_DB']->sql_num_rows($resc);
//generate HTML
$analyze_list=$this->pi_analyze_list_view($res , $total_count);
$nav_links = $this->pi_navigation_link_view('analyze_page', $this->piVars['analyze_page'], $total_count);
$content.= $analyze_list ."\n".$nav_links;
......@@ -841,9 +857,8 @@ class tx_nG6_pi1 extends tslib_pibase {
$start = intval($start);
//max page number
$end = $total_count/$this->internal['results_at_a_time'] ;
$end = $total_count/$this->internal['results_at_a_time'] ;
$end = ceil($end) ;
//repair URL mistakes caused by the nasty user
if ($start > $end)
$start = $end;
......
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