Merged revisions 47459 via svnmerge from

http://svn.silverstripe.com/open/modules/sapphire/branches/2.2.1asfonz

........
  r47459 | jshipman | 2007-12-21 13:56:40 +1300 (Fri, 21 Dec 2007) | 1 line
  
  implemented equal values
........


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@48537 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-01-24 00:12:14 +00:00
parent a356bf9181
commit 4e32ae08a3

View File

@ -849,12 +849,19 @@ class DataObjectSet extends ViewableData implements Iterator {
$previous = null;
foreach($this->items as $key => $item){
//check if current item field value equals the next
if($item->$field == $previous->$field){
if($previous && $item->$field == $previous->$field){
$item->Ranking = $this->convertIntToRank($count - 1)." equal";
$previous->Ranking = $this->convertIntToRank($count - 1)." equal";
if($skipduplicates){
$count++;
}
}else{
$item->Ranking = $this->convertIntToRank($count);
$count++;
$count++;
}
$previous = $item;
}
}
}