* @param array Array of extra fields & elements to limit the query to.
*/
function setup($offset,$order_col,$sort,$max_rows,$set,$_assigned_to,$_status,$_extra_fields=array()) {
-//echo "<br />offset: $offset| order: $order|max_rows: $max_rows|_assigned_to: $_assigned_to|_status: $_status";
if ((!$offset) || ($offset < 0)) {
$this->offset=0;
$this->offset=$offset;
}
+ // $max_rows == 0 means we want all the rows
+ if (is_null($max_rows) || $max_rows < 0) {
+ $this->max_rows = 50 ;
+ } else {
+ $this->max_rows = $max_rows ;
+ }
+
if (session_loggedin()) {
$u =& session_get_user();
}
}
$this->extra_fields=$_extra_fields;
$this->setChangedFrom($_changed);
-
- // if $max_rows == 0 it means we want all the rows
- if (is_null($max_rows) || $max_rows < 0) {
- $max_rows=50;
- }
- if ($this->query_type == 'query') {
- $this->max_rows=0;
- } else {
- $this->max_rows=$max_rows;
- }
}
$ath = new ArtifactTypeHtml($group,$at->getID());
// create artifact object, setup object
$af = new ArtifactFactory($ath);
- $af->setup(0,"priority","DESC",null,"",0,1,null);
+ $af->setup(0,"priority","DESC",0,"",0,1,null);
// get artifacts from object
$art_arr =& $af->getArtifacts();
if (count($art_arr) > 0) {
return new soap_fault ('','getArtifacts',$af->getErrorMessage(),$af->getErrorMessage());
}
-//MAY HAVE TO CHANGE PARAMS TO FORCE RETRIEVAL OF RIGHT RECORDS - FOR INSTANCE $set='Custom'
-//NEEDS TO BE TESTED
-// $af->setup(0,'','',0,false,$assigned_to,$status);
-
// this is a bit hacky...
if ($assigned_to || $status) {
$set = "custom";
<?php
/**
- * SourceForge Generic Tracker facility
+ * FusionForge Tracker
*
- * SourceForge: Breaking Down the Barriers to Open Source Development
* Copyright 1999-2001 (c) VA Linux Systems
- * http://sourceforge.net
+ * Copyright 2010 Roland Mas
*
*/
require_once $gfcommon.'tracker/ArtifactFactory.class.php';
}
$query_id = getIntFromRequest('query_id');
+$start = getIntFromRequest('start');
+
+$pagelength = 25 ;
//
// The browse page can be powered by a pre-saved query
}
}
-$af->setup($offset,$_sort_col,$_sort_ord,null,$set,$_assigned_to,$_status,$aux_extra_fields);
+$af->setup($offset,$_sort_col,$_sort_ord,$pagelength,$set,$_assigned_to,$_status,$aux_extra_fields);
//
// These vals are sanitized and/or retrieved from ArtifactFactory stored settings
//
$then=(time()-$ath->getDuePeriod());
- if (!isset($_GET['start'])) {
- $start=0;
- } else {
- $start=$_GET['start'];
- }
- $max = ((count($art_arr) > ($start + 25)) ? ($start+25) : count($art_arr) );
+ $max = ((count($art_arr) > ($start + $pagelength)) ? ($start+$pagelength) : count($art_arr) );
//echo "max: $max";
for ($i=$start; $i<$max; $i++) {
$extra_data = $art_arr[$i]->getExtraFieldDataText();
}
*/
echo $GLOBALS['HTML']->listTableBottom();
- $pages = count($art_arr) / 25;
- $currentpage = intval($start / 25);
+ $pages = count($art_arr) / $pagelength;
+ $currentpage = intval($start / $pagelength);
//echo "Item Count: ".count($arr)."Pages: $pages";
if ($pages >= 1) {
$skipped_pages=false;
if ($j == $currentpage) {
echo '<strong>'.($j+1).'</strong> ';
} else {
- echo '<a href="'.getStringFromServer('PHP_SELF')."?func=browse&group_id=".$group_id.'&atid='.$ath->getID().'&set='. $set.'&start='.($j*25).'"><strong>'.($j+1).'</strong></a> ';
+ echo '<a href="'.getStringFromServer('PHP_SELF')."?func=browse&group_id=".$group_id.'&atid='.$ath->getID().'&set='. $set.'&start='.($j*$pagelength).'"><strong>'.($j+1).'</strong></a> ';
}
}
}