Award combo rule now counts types of badges, not just count

This commit is contained in:
Zachary Doll 2013-11-15 23:03:49 -06:00
parent 4e924eb1b0
commit f1079beaa6

View File

@ -19,14 +19,14 @@ class AwardCombo implements YagaRule {
$TargetDate = strtotime($Criteria->Duration . ' ' . $Criteria->Period . ' ago');
$Badges = $BadgeModel->GetUserBadgeAwards($UserID);
$Count = 0;
$Types = array();
foreach($Badges as $Badge) {
if(strtotime($Badge['DateInserted']) >= $TargetDate) {
$Count++;
$Types[$Badge['RuleClass']] = TRUE;
}
}
if($Count >= $Target) {
if(count($Types) >= $Target) {
return $UserID;
}
else {
@ -41,7 +41,7 @@ class AwardCombo implements YagaRule {
'year' => 'Years'
);
$String = $Form->Label('Number of Badges', 'AwardCombo');
$String = $Form->Label('Number of Badge Types', 'AwardCombo');
$String .= $Form->Textbox('Target');
$String .= $Form->Label('Time Frame');
$String .= $Form->Textbox('Duration');