Bug Fix - loading of one item twice when user in more than one group targeted. Feature Added - load only first found item or all items found.

This commit is contained in:
Llewellyn van der Merwe 2014-07-26 13:35:52 +01:00
parent d34279eecb
commit f8dd0a1dcf
3 changed files with 23 additions and 3 deletions

View File

@ -14,9 +14,10 @@ MOD_PERGROUP_VALIDATION_TYPE="Validation Type"
MOD_PERGROUP_IN_GROUP="In Group" MOD_PERGROUP_IN_GROUP="In Group"
MOD_PERGROUP_NOT_IN_GROUP="Not In Group" MOD_PERGROUP_NOT_IN_GROUP="Not In Group"
MOD_PERGROUP_EXECUTION_DIRECTION="Execution Direction" MOD_PERGROUP_EXECUTION_DIRECTION="Load Direction"
MOD_PERGROUP_UP="Up" MOD_PERGROUP_FIRST_FOUND_CONTENT="Load Only First Found"
MOD_PERGROUP_DOWN="Down" MOD_PERGROUP_UP="Normal"
MOD_PERGROUP_DOWN="Change"
MOD_PERGROUP_NONE="None" MOD_PERGROUP_NONE="None"
MOD_PERGROUP_BREAK="New Line" MOD_PERGROUP_BREAK="New Line"
MOD_PERGROUP_CLASS="Class [<div class="separator">]" MOD_PERGROUP_CLASS="Class [<div class="separator">]"

View File

@ -295,6 +295,16 @@
<option value="1">JYES</option> <option value="1">JYES</option>
<option value="0">JNO</option> <option value="0">JNO</option>
</field> </field>
<field
name="first_found_content"
type="radio"
class="btn-group btn-group-yesno"
label="MOD_PERGROUP_FIRST_FOUND_CONTENT"
description=""
default="1">
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field <field
name="execution_direction" name="execution_direction"
type="radio" type="radio"

View File

@ -20,6 +20,7 @@ class perGroup
protected $document; protected $document;
protected $jQuery_set; protected $jQuery_set;
protected $params; protected $params;
protected $found = false;
protected $range_low = 0; protected $range_low = 0;
protected $range_high = 8; protected $range_high = 8;
@ -77,6 +78,10 @@ class perGroup
$app->redirect($this->results[$field_id]); $app->redirect($this->results[$field_id]);
return true; return true;
} }
// if set so that not all content should be loaded, then break when firt data is found
if($this->found && $this->params->get('first_found_content')){
break;
}
} }
return true; return true;
} }
@ -107,6 +112,8 @@ class perGroup
} }
// set result only if not a redirect // set result only if not a redirect
$text[] = $result; $text[] = $result;
$this->found = true;
break;
} else { } else {
// when user is not in active group // when user is not in active group
$text[] = false; $text[] = false;
@ -120,6 +127,8 @@ class perGroup
} }
// set result only if not a redirect // set result only if not a redirect
$text[] = $result; $text[] = $result;
$this->found = true;
break;
} else { } else {
// when user is not in active group // when user is not in active group
$text[] = false; $text[] = false;