2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

Added ALLOW_RESPONDENT_SELECTOR config directive to hide or show the respondent selector to the interviewer

This commit is contained in:
azammitdcarf
2011-02-03 01:44:45 +00:00
parent d0ccbdc372
commit 05f73f1ceb
3 changed files with 35 additions and 12 deletions

View File

@@ -235,6 +235,11 @@ if (!defined('SYSTEM_SORT_MINUTES')) define ('SYSTEM_SORT_MINUTES',5);
*/
if (!defined('ALLOW_PAGE_REFRESH')) define ('ALLOW_PAGE_REFRESH',true);
/**
* Allow operator to select respondent from list or add respondents
*/
if (!defined('ALLOW_RESPONDENT_SELECTOR')) define ('ALLOW_RESPONDENT_SELECTOR',true);
/**
* Database configuration for queXS
*/

View File

@@ -123,16 +123,24 @@ else
$timezone = "";
print "<select id='respondent' name='respondent' onchange=\"LinkUp('respondent')\"><option value='?respondent_id=0' class='addresp'>" . T_("Add respondent") . "</option>";
if (!empty($rs))
if (ALLOW_RESPONDENT_SELECTOR)
{
foreach($rs as $r)
print "<select id='respondent' name='respondent' onchange=\"LinkUp('respondent')\"><option value='?respondent_id=0' class='addresp'>" . T_("Add respondent") . "</option>";
if (!empty($rs))
{
if (!empty($r['selected'])) $timezone = $r['Time_zone_name'];
print "<option value='?respondent_id={$r['respondent_id']}' {$r['selected']}>{$r['firstName']} {$r['lastName']}</option>";
foreach($rs as $r)
{
if (!empty($r['selected'])) $timezone = $r['Time_zone_name'];
print "<option value='?respondent_id={$r['respondent_id']}' {$r['selected']}>{$r['firstName']} {$r['lastName']}</option>";
}
}
print "</select></div>";
}
else
{
if (isset($rs[0]))
print " " . $rs[0]['firstName'] . " " . $rs[0]['lastName'] . "</div>";
}
print "</select></div>";
print "<div>$timezone</div>";

View File

@@ -127,16 +127,26 @@ else
$timezone = "";
print "<div><select id='respondent' name='respondent' onchange=\"LinkUp('respondent')\"><option value='?respondent_id=0' class='addresp'>" . T_("Add respondent") . "</option>";
if (!empty($rs))
if (ALLOW_RESPONDENT_SELECTOR)
{
foreach($rs as $r)
print "<div><select id='respondent' name='respondent' onchange=\"LinkUp('respondent')\"><option value='?respondent_id=0' class='addresp'>" . T_("Add respondent") . "</option>";
if (!empty($rs))
{
if (!empty($r['selected'])) $timezone = $r['Time_zone_name'];
print "<option value='?respondent_id={$r['respondent_id']}' {$r['selected']}>{$r['firstName']} {$r['lastName']}</option>";
foreach($rs as $r)
{
if (!empty($r['selected'])) $timezone = $r['Time_zone_name'];
print "<option value='?respondent_id={$r['respondent_id']}' {$r['selected']}>{$r['firstName']} {$r['lastName']}</option>";
}
}
print "</select></div>";
}
print "</select></div>";
else
{
if (isset($rs[0]))
print "<div>" . $rs[0]['firstName'] . " " . $rs[0]['lastName'] . "</div>";
}
print "<div>$timezone</div>";