* Copyright 2002 GForge, LLC, Tim Perdue
* Copyright 2010, FusionForge Team
* Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
+ * Copyright 2014, Franck Villaume - TrivialDev
* http://fusionforge.org
*
* This file is part of FusionForge. FusionForge is free software;
*/
echo '<tr><td colspan="2">';
if ($offset > 0) {
- echo util_make_link ('/pm/task.php?func=browse&group_project_id='.$group_project_id.'&group_id='.$group_id.'&offset='.($offset-50),'<strong>← '._('previous').'</strong>');
+ echo util_make_link ('/pm/task.php?func=browse&group_project_id='.$group_project_id.'&group_id='.$group_id.'&offset='.($offset-$paging),'<strong>← '._('previous').'</strong>');
} else {
echo ' ';
}
echo '</td><td> </td><td colspan="2">';
- if ($rows==50) {
- echo util_make_link ('/pm/task.php?func=browse&group_project_id='.$group_project_id.'&group_id='.$group_id.'&offset='.($offset+50),'<strong>'._('next').' →</strong></a>');
+ // currently pm knows only 4 status_id : 100, 1, 2, 3 (any, open, closed, deleted)
+ switch ($_status) {
+ case 1: {
+ $totalTasks = $pg->getOpenCount();
+ break;
+ }
+ case 2:
+ case 3: {
+ $totalTasks = $pg->getCount($_status);
+ break;
+ }
+ default: {
+ $totalTasks = $pg->getTotalCount();
+ break;
+ }
+ }
+ if ($totalTasks > $offset + $paging) {
+ echo util_make_link ('/pm/task.php?func=browse&group_project_id='.$group_project_id.'&group_id='.$group_id.'&offset='.($offset+$paging),'<strong>'._('next').' →</strong></a>');
} else {
echo ' ';
}