mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
updated to rev 499 main
This commit is contained in:
25
CHANGELOG
25
CHANGELOG
@@ -1,6 +1,5 @@
|
||||
queXS 1.14.0 - Changes since 1.13.1
|
||||
|
||||
|
||||
Changes for session authentication:
|
||||
|
||||
queXS now uses the Limesurvey session based authentication system to authenticate all users.
|
||||
@@ -29,23 +28,23 @@ These queries will:
|
||||
2. Make all other users regular users, and assign them the password "password"
|
||||
3. Make all clients regular clients, and assign them the password "password"
|
||||
|
||||
Once you have run these - please go to the operator management page and update passwords for all users.
|
||||
Once you have run these - please go to the operator management page and update passwords for all users AND reassign any extensions.
|
||||
|
||||
/* Make the first user the admin user - with default password of: password */
|
||||
INSERT INTO `lime_users` (`users_name`, `password`, `full_name`, `parent_id`, `lang`, `superadmin`)
|
||||
SELECT username, '0x35653838343839386461323830343731353164306535366638646336323932373733363033643064366161626264643632613131656637323164313534326438', firstName, 0, 'auto', 1
|
||||
SELECT username, 0x35653838343839386461323830343731353164306535366638646336323932373733363033643064366161626264643632613131656637323164313534326438, firstName, 0, 'auto', 1
|
||||
FROM operator
|
||||
WHERE operator_id = 1;
|
||||
|
||||
/* Make all other users operators - with default password of: password */
|
||||
INSERT INTO `lime_users` (`users_name`, `password`, `full_name`, `parent_id`, `lang`, `superadmin`)
|
||||
SELECT username, '0x35653838343839386461323830343731353164306535366638646336323932373733363033643064366161626264643632613131656637323164313534326438', firstName, 1, 'auto', 0
|
||||
SELECT username, 0x35653838343839386461323830343731353164306535366638646336323932373733363033643064366161626264643632613131656637323164313534326438, firstName, 1, 'auto', 0
|
||||
FROM operator
|
||||
WHERE operator_id != 1;
|
||||
|
||||
/* Make all clients - with default password of: password */
|
||||
INSERT INTO `lime_users` (`users_name`, `password`, `full_name`, `parent_id`, `lang`, `superadmin`)
|
||||
SELECT username, '0x35653838343839386461323830343731353164306535366638646336323932373733363033643064366161626264643632613131656637323164313534326438', firstName, 1, 'auto', 0
|
||||
SELECT username, 0x35653838343839386461323830343731353164306535366638646336323932373733363033643064366161626264643632613131656637323164313534326438, firstName, 1, 'auto', 0
|
||||
FROM client
|
||||
WHERE 1;
|
||||
|
||||
@@ -54,6 +53,22 @@ DROP TABLE `sessions2`;
|
||||
|
||||
/* Add sort order feature to questionnaire sample table */
|
||||
ALTER TABLE `questionnaire_sample` ADD `sort_order` INT( 11 ) NOT NULL DEFAULT '0';
|
||||
UPDATE `questionnaire_sample` SET sort_order = sample_import_id;
|
||||
|
||||
/* Add default outcomes feature */
|
||||
|
||||
/* -- add `default` and `permanent` parameters for outcomes -- */
|
||||
ALTER TABLE `outcome` ADD `default` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1' COMMENT 'Used as default for questionnaire outcomes' AFTER `calc`, ADD `permanent` TINYINT(1) UNSIGNED NOT NULL COMMENT 'Permanent outcome, used for all questionnaires, not possible to de-select' AFTER `default`;
|
||||
|
||||
/* -- define and set mandatory(constant) outcome_id's --*/
|
||||
UPDATE `outcome` SET `permanent` = '1' WHERE `outcome`.`outcome_id` IN (1,2,3,7,9,10,14,17,18,19) ;
|
||||
|
||||
/* -- add `outcomes` parameter , define default list of outcome_ID's to be enabled for new questionnaries --*/
|
||||
ALTER TABLE `questionnaire` ADD `outcomes` VARCHAR(256) NULL DEFAULT '1,2,3,7,9,10,14,17,18,19' COMMENT 'Comma-separated string of outcomes defined for the questionnaire' AFTER `enabled`;
|
||||
|
||||
/* -- enable all outcomes for existing questionnaires -- */
|
||||
UPDATE `questionnaire` SET `outcomes` = '1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,40,41,42,43,44,45' ;
|
||||
|
||||
|
||||
queXS 1.13.1 - Changes since 1.13.0
|
||||
|
||||
|
||||
@@ -50,9 +50,7 @@ session_name($db->GetOne($sql));
|
||||
|
||||
session_set_cookie_params(0,QUEXS_PATH);
|
||||
|
||||
if ((defined('PHP_SESSION_ACTIVE') && session_status() !== PHP_SESSION_ACTIVE) || !session_id()) {
|
||||
session_start();
|
||||
}
|
||||
session_start();
|
||||
|
||||
//check if the session exists or loginID not set
|
||||
if (session_id() == "" || !isset($_SESSION['loginID']))
|
||||
|
||||
@@ -122,6 +122,7 @@ include ("../functions/functions.operator.php");
|
||||
<li><a href="?g=1&page=<?php echo LIME_URL ;?>admin/admin.php?action=newsurvey"><i class="fa fa-file-text-o lime fa-fw"></i><?php print T_("Create an instrument in Limesurvey") ;?></a></li>
|
||||
<li><a href="?g=1&page=new.php"><i class="fa fa-plus-circle fa-fw"></i><?php print T_("Create a new questionnaire") ;?></a></li>
|
||||
<li><a href="?g=1&page=questionnairelist.php"><i class="fa fa-list fa-fw"></i><?php print T_("Questionnaire management") ;?></a></li>
|
||||
<li><a href="?g=1&page=set_outcomes.php?qid=0"><i class="fa fa-list-ol fa-fw"></i><?php print T_("Set questionnaire outcomes") ;?></a></li>
|
||||
<li><a href="?g=1&page=<?php echo LIME_URL ;?>admin/admin.php"><i class="fa fa-lemon-o lime fa-fw"></i><?php print T_("Administer instruments with Limesurvey") ;?></a></li>
|
||||
<li><a href="?g=1&page=questionnaireprefill.php"><i class="fa fa-thumb-tack fa-fw"></i><?php print T_("Pre-fill questionnaire") ;?></a></li>
|
||||
</ul>
|
||||
@@ -185,8 +186,9 @@ include ("../functions/functions.operator.php");
|
||||
</li>
|
||||
<li class="has_sub"><a href="" class=""><i class="fa fa-lg fa-gear"></i><span><?php print T_("System settings") ;?></span></a>
|
||||
<ul style="<?php if ($g == 9) echo "display:block";?>">
|
||||
<li><a href="?g=9&page=set_outcomes.php?default"><i class="fa fa-list-ol fa-fw"></i><?php print T_("Set default outcomes") ;?></a></li>
|
||||
<li><a href="?g=9&page=timezonetemplate.php"><i class="fa fa-globe fa-fw"></i><?php print T_("Set default timezone list") ;?></a></li>
|
||||
<li><a href="?g=9&page=availabilitygroup.php"><i class="fa fa-clock-o fa-fw"></i><?php print T_("Manage Time slots") ;?></a></li>
|
||||
<li><a href="?g=9&page=availabilitygroup.php"><i class="fa fa-clock-o fa-fw"></i><?php print T_("Manage Time slots") ;?></a></li>
|
||||
<li><a href="?g=9&page=shifttemplate.php"><i class="fa fa-calendar fa-fw"></i><?php print T_("Set default shift times") ;?></a></li>
|
||||
<li><a href="?g=9&page=callrestrict.php"><i class="fa fa-clock-o fa-fw"></i><?php print T_("Set call restriction times") ;?></a></li>
|
||||
<li><a href="?g=9&page=centreinfo.php"><i class="fa fa-university fa-fw"></i><?php print T_("Set centre information") ;?></a></li>
|
||||
|
||||
@@ -81,8 +81,24 @@ if (isset($_POST['import_file']))
|
||||
$lime_rs_sid = bigintval($_POST['selectrs']);
|
||||
}
|
||||
|
||||
$sql = "INSERT INTO questionnaire (questionnaire_id,description,lime_sid,restrict_appointments_shifts,restrict_work_shifts,respondent_selection,rs_intro,rs_project_intro,rs_project_end,rs_callback,rs_answeringmachine,testing,lime_rs_sid,info,self_complete,referral)
|
||||
VALUES (NULL,$name,'$lime_sid','$ras','$rws','$rs',$rs_intro,$rs_project_intro,$rs_project_end,$rs_callback,$rs_answeringmachine,'$testing',$lime_rs_sid,$info,$respsc,$referral)";
|
||||
//** get default coma-separated outcomes list and use it for new questionnaire as initial set
|
||||
$sql = "SELECT o.outcome_id
|
||||
FROM `outcome` as o
|
||||
WHERE o.default = 1;";
|
||||
$def = $db->GetAll($sql);
|
||||
|
||||
for ($i=0; $i < count($def); $i++){
|
||||
foreach($def[$i] as $key => $val){
|
||||
$do[] = $val;
|
||||
}
|
||||
}
|
||||
|
||||
$do = implode($do,",");
|
||||
|
||||
//** - end
|
||||
|
||||
$sql = "INSERT INTO questionnaire (questionnaire_id,description,lime_sid,restrict_appointments_shifts,restrict_work_shifts,respondent_selection,rs_intro,rs_project_intro,rs_project_end,rs_callback,rs_answeringmachine,testing,lime_rs_sid,info,self_complete,referral,outcomes)
|
||||
VALUES (NULL,$name,'$lime_sid','$ras','$rws','$rs',$rs_intro,$rs_project_intro,$rs_project_end,$rs_callback,$rs_answeringmachine,'$testing',$lime_rs_sid,$info,$respsc,$referral,'$do')";
|
||||
|
||||
$rs = $db->Execute($sql);
|
||||
|
||||
@@ -265,7 +281,7 @@ if (!empty($surveys)){?>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label text-danger" ><?php echo T_("URL to forward respondents on self completion (required)");?>: </label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" name="lime_endurl" id="url" type="url" value="<?php echo SITE_URL; ?>"/>
|
||||
<input class="form-control" name="lime_endurl" id="url" type="url" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -261,7 +261,7 @@ function generate() {
|
||||
<a href='timezonetemplate.php' class="btn btn-default fa"><?php echo T_("TimeZones list");?></a>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (FREEPBX_PATH != false) { ?>
|
||||
<?php if (VOIP_ENABLED != false) { ?>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-3 control-label"><?php echo T_("Uses VoIP") . "? ";?></label>
|
||||
<div class="col-lg-3"><input name="voip" type="checkbox" onchange="if(this.checked==true){show(this,'usesvoip');} else{ hide(this,'usesvoip');}" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" /></div><!-- checked="checked" -->
|
||||
|
||||
@@ -238,25 +238,36 @@ if ($questionnaire_id)
|
||||
{
|
||||
//limesurvey quotas for this question
|
||||
$quotas = (get_limesurvey_quota_info($r['id']));
|
||||
$sqlq = array();
|
||||
$cob = array();
|
||||
|
||||
foreach ($quotas as $q)
|
||||
$sqlq[] = "s." . $q['fieldname'] . " = '" . $q['value'] . "'";
|
||||
foreach ($quotas as $qr)
|
||||
{
|
||||
$sqlq = array();
|
||||
foreach($qr as $qid => $q)
|
||||
{
|
||||
$sqlq[] = "s." . $q['fieldname'] . " = '" . $q['value'] . "'";
|
||||
}
|
||||
$cob[] = "( " . implode(' OR ', $sqlq) . " )";
|
||||
}
|
||||
|
||||
if (!empty($cob))
|
||||
{
|
||||
|
||||
$sql = "SELECT COUNT(id) as count
|
||||
FROM ".LIME_PREFIX."survey_{$r['sid']} as s
|
||||
JOIN `case` as c ON (c.questionnaire_id = '$questionnaire_id')
|
||||
JOIN `sample` as sam ON (c.sample_id = sam.sample_id AND sam.import_id = '$sample_import_id')
|
||||
WHERE ".implode(' AND ',$sqlq)." "."
|
||||
AND submitdate IS NOT NULL
|
||||
AND s.token = c.token";
|
||||
$sql = "SELECT COUNT(id) as count
|
||||
FROM ".LIME_PREFIX."survey_{$r['sid']} as s
|
||||
JOIN `case` as c ON (c.questionnaire_id = '$questionnaire_id')
|
||||
JOIN `sample` as sam ON (c.sample_id = sam.sample_id AND sam.import_id = '$sample_import_id')
|
||||
WHERE ".implode(' AND ',$cob)." "."
|
||||
AND submitdate IS NOT NULL
|
||||
AND s.token = c.token";
|
||||
|
||||
$rs = $db->GetRow($sql);
|
||||
$rs = $db->GetRow($sql);
|
||||
|
||||
$completions = $rs['count'];
|
||||
$perc = ROUND(($completions / $r['qlimit']) * 100,2);
|
||||
|
||||
$report[] = array("strata" => "<a href='" . LIME_URL . "/admin/admin.php?action=quotas&sid={$r['sid']}"a_id={$r['id']}&subaction=quota_editquota'>" . $r['name'] . "</a>", "quota" => $r['qlimit'], "completions" => $completions, "perc" => $perc);
|
||||
$completions = $rs['count'];
|
||||
$perc = ROUND(($completions / $r['qlimit']) * 100,2);
|
||||
|
||||
$report[] = array("strata" => "<a href='" . LIME_URL . "/admin/admin.php?action=quotas&sid={$r['sid']}"a_id={$r['id']}&subaction=quota_editquota'>" . $r['name'] . "</a>", "quota" => $r['qlimit'], "completions" => $completions, "perc" => $perc);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -284,7 +295,7 @@ if ($questionnaire_id)
|
||||
|
||||
$sql = "SELECT count(*) as count
|
||||
FROM `case` as c, sample as s
|
||||
WHERE c.current_outcome_id = 10
|
||||
WHERE c.current_outcome_id IN (10,40)
|
||||
AND s.import_id = '$sample_import_id'
|
||||
AND s.sample_id = c.sample_id
|
||||
AND c.questionnaire_id = '$questionnaire_id'";
|
||||
|
||||
274
admin/set_outcomes.php
Normal file
274
admin/set_outcomes.php
Normal file
@@ -0,0 +1,274 @@
|
||||
<?php
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Configuration file
|
||||
*/
|
||||
require(dirname(__FILE__).'/../config.inc.php');
|
||||
|
||||
/**
|
||||
* Database
|
||||
*/
|
||||
require(dirname(__FILE__).'/../db.inc.php');
|
||||
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
*/
|
||||
require(dirname(__FILE__).'/../functions/functions.xhtml.php');
|
||||
|
||||
|
||||
$css = array(
|
||||
"../include/bootstrap/css/bootstrap.min.css",
|
||||
"../include/bootstrap/css/bootstrap-theme.min.css",
|
||||
"../include/font-awesome/css/font-awesome.css",
|
||||
"../include/bootstrap-toggle/css/bootstrap-toggle.min.css",
|
||||
"../css/custom.css"
|
||||
);
|
||||
$js_head = array(
|
||||
"../include/jquery/jquery.min.js",
|
||||
"../include/bootstrap/js/bootstrap.min.js",
|
||||
"../include/bootstrap-toggle/js/bootstrap-toggle.min.js",
|
||||
);
|
||||
$js_foot = array(
|
||||
"../js/window.js",
|
||||
"../js/bootstrap-confirmation.js",
|
||||
"../js/custom.js"
|
||||
);
|
||||
|
||||
global $db;
|
||||
|
||||
|
||||
if (isset($_POST['default']) && isset($_POST['save'])){
|
||||
|
||||
$sql = "UPDATE `outcome` as o
|
||||
SET `default` = 0
|
||||
WHERE o.permanent != 1";
|
||||
$db->Execute($sql);
|
||||
|
||||
if(!empty($_POST['select']) ){
|
||||
foreach($_POST['select'] as $n => $val)
|
||||
{
|
||||
$sel[] = $val;
|
||||
}
|
||||
$sel=implode($sel,",");
|
||||
|
||||
$sql = "UPDATE `outcome` as o
|
||||
SET `default` = 1
|
||||
WHERE o.permanent != 1
|
||||
AND o.outcome_id IN ($sel)";
|
||||
|
||||
$db->Execute($sql);
|
||||
}
|
||||
if(!empty($_POST['delay']) && $_SESSION['user'] === "admin" ){
|
||||
|
||||
foreach($_POST['delay'] as $n => $val)
|
||||
{
|
||||
$sql = "UPDATE `outcome`SET default_delay_minutes = $val WHERE outcome_id = $n";
|
||||
$db->Execute($sql);
|
||||
}
|
||||
}
|
||||
|
||||
$_GET['default'] = $_POST['default'];
|
||||
|
||||
unset($_POST['default']);
|
||||
unset($_POST['save']);
|
||||
}
|
||||
|
||||
if (isset($_POST['qid']) && isset($_POST['save'])){
|
||||
|
||||
//get id's for 'permanent' outcomes
|
||||
$sql = "SELECT o.outcome_id
|
||||
FROM `outcome` as o
|
||||
WHERE o.permanent = 1
|
||||
AND o.default = 1;";
|
||||
$def = $db->GetAll($sql);
|
||||
|
||||
for ($i=0; $i < count($def); $i++){
|
||||
foreach($def[$i] as $key => $val){
|
||||
$sel[] = $val;
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($_POST['select']) ){
|
||||
//add selected outcomes
|
||||
foreach($_POST['select'] as $n => $val){
|
||||
$sel[] = $val;
|
||||
}
|
||||
}
|
||||
|
||||
$sel=implode($sel,",");
|
||||
|
||||
$qid = intval($_POST['qid']);
|
||||
$sql = "UPDATE questionnaire
|
||||
SET outcomes = '$sel'
|
||||
WHERE questionnaire_id = $qid";
|
||||
|
||||
$db->Execute($sql);
|
||||
|
||||
$_GET['qid'] = $_POST['qid'];
|
||||
|
||||
unset($_POST['qid']);
|
||||
unset($_POST['save']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*select outcomes list*/
|
||||
|
||||
if (isset($_GET['default'])) { $title = T_("Set default outcomes"); }
|
||||
else if (isset($_GET['qid'])){ $title = T_("Set questionnaire outcomes"); $qid = intval($_GET['qid']); }
|
||||
else die();
|
||||
|
||||
xhtml_head($title,true,$css,$js_head);
|
||||
|
||||
/* for questionnire outcomes */
|
||||
if (isset($_GET['qid'])) {
|
||||
|
||||
if($qid == 0) $qid = false;
|
||||
|
||||
print "<h3 class='form-inline pull-left'>" . T_("Questionnaire") . ": </h3>";
|
||||
|
||||
$sql = "SELECT questionnaire_id as value,description, CASE WHEN questionnaire_id = '$qid' THEN 'selected=\'selected\'' ELSE '' END AS selected
|
||||
FROM questionnaire
|
||||
WHERE enabled = 1";
|
||||
display_chooser($db->GetAll($sql),"questionnaire","qid", true,false,true,true,false,true,"form-inline pull-left ");
|
||||
|
||||
|
||||
if ($qid != false)
|
||||
{
|
||||
$qd = $db->GetRow("SELECT outcomes, self_complete, referral FROM `questionnaire` WHERE questionnaire_id = $qid");
|
||||
|
||||
$qoutc = $qd['outcomes'];
|
||||
$sc = $qd['self_complete'];
|
||||
$ref = $qd['referral'];
|
||||
|
||||
if (empty($qoutc)) { // update q.outcomes with default list
|
||||
|
||||
$sql = "SELECT o.outcome_id
|
||||
FROM `outcome` as o
|
||||
WHERE o.default = 1;";
|
||||
$def = $db->GetAll($sql);
|
||||
|
||||
for ($i=0; $i < count($def); $i++){
|
||||
foreach($def[$i] as $key => $val){
|
||||
$do[] = $val;
|
||||
}
|
||||
}
|
||||
|
||||
$qoutc = implode($do,",");
|
||||
|
||||
$sql = "UPDATE questionnaire
|
||||
SET outcomes = '$qoutc'
|
||||
WHERE questionnaire_id = $qid";
|
||||
|
||||
$db->Execute($sql);
|
||||
}
|
||||
|
||||
$sql = "SELECT o.*, ot.description as type,
|
||||
CONCAT('<input type=\'checkbox\'',
|
||||
CASE WHEN ((o.outcome_id = 40 AND $sc = 1) OR (o.outcome_id = 41 AND $ref = 1)) THEN 'checked=\"checked\" data-onstyle=\"success\"' ELSE '' END ,'',
|
||||
CASE WHEN ((o.outcome_id = 40 AND $sc != 1) OR (o.outcome_id = 41 AND $ref != 1)) THEN 'disabled=\"disabled\"' ELSE '' END ,'',
|
||||
CASE WHEN o.outcome_id NOT IN (40,41) AND o.outcome_id IN ($qoutc) THEN 'checked=\"checked\"' ELSE '' END ,'',
|
||||
CASE WHEN o.outcome_id NOT IN (40,41) AND o.permanent = 1 THEN 'disabled=\"disabled\" data-onstyle=\"success\"' ELSE '' END ,'
|
||||
name=\"select[]\" value=\'',o.outcome_id,'\' data-toggle=\"toggle\" data-size=\"small\" data-style=\"center-block\" data-on=" . TQ_("Yes") . " data-off=" . TQ_("No") . " data-width=\"70\"/>') as `select`
|
||||
from `outcome` as o, `outcome_type` as ot
|
||||
WHERE o.outcome_type_id = ot.outcome_type_id
|
||||
ORDER BY `o`.`outcome_id` ASC";
|
||||
|
||||
$rs = $db->GetAll($sql);
|
||||
|
||||
$row = array("outcome_id","description","type","select");
|
||||
$hdr = array(T_("Outcome ID"),T_("Description"),T_("Outcome type"),T_("Select"));
|
||||
$hid = "qid";
|
||||
$value = "$qid";
|
||||
}
|
||||
}
|
||||
|
||||
/* for default outcomes */
|
||||
if (isset($_GET['default'])) {
|
||||
|
||||
$sql = "SELECT o.*, ot.description as type,
|
||||
CONCAT('<input type=\'number\' name=\"delay[', o.outcome_id ,']\" class=\'form-control text-right\' style=\'width:7em;\' max=50000 min=0 required value=\'', o.default_delay_minutes ,'\' />') as `delay`,
|
||||
CONCAT('<h4> <span class=\"label label-', CASE WHEN o.tryanother = 1 THEN 'primary\">" . T_("Yes") . "' ELSE 'default\">" . T_("No") . "' END , '</span></h4>') as tryanother,
|
||||
CONCAT('<h4> <span class=\"label label-', CASE WHEN o.tryagain = 1 THEN 'primary\">" . T_("Yes") . "' ELSE 'default\">" . T_("No") . "' END , '</span></h4>') as tryagain,
|
||||
CONCAT('<h4> <span class=\"label label-', CASE WHEN o.contacted = 1 THEN 'primary\">" . T_("Yes") . "' ELSE 'default\">" . T_("No") . "' END , '</span></h4>') as contacted,
|
||||
CONCAT('<h4> <span class=\"label label-', CASE WHEN o.eligible = 1 THEN 'primary\">" . T_("Yes") . "' ELSE 'default\">" . T_("No") . "' END , '</span></h4>') as eligible,
|
||||
CONCAT('<h4> <span class=\"label label-', CASE WHEN o.require_note = 1 THEN 'primary\">" . T_("Yes") . "' ELSE 'default\">" . T_("No") . "' END , '</span></h4>') as require_note,
|
||||
CONCAT('<input type=\'checkbox\' ', CASE WHEN o.default = 1 THEN 'checked=\"checked\"' ELSE '' END ,' ', CASE WHEN o.permanent = 1 THEN 'disabled=\"disabled\" data-onstyle=\"success\"' ELSE '' END ,' name=\"select[]\" value=\'',o.outcome_id,'\' data-toggle=\"toggle\" data-size=\"small\" data-style=\"center-block\" data-on=" . TQ_("Yes") . " data-off=" . TQ_("No") . " data-width=\"70\" />') as `select`
|
||||
from `outcome` as o, `outcome_type` as ot
|
||||
WHERE o.outcome_type_id = ot.outcome_type_id
|
||||
ORDER BY `o`.`outcome_id` ASC";
|
||||
|
||||
$rs = $db->GetAll($sql);
|
||||
|
||||
$row = array("outcome_id","description","select","type","delay","contacted","tryanother","tryagain","eligible","require_note");
|
||||
$hdr = array(T_("Outcome ID"),T_("Description"),T_("Default"),T_("Outcome type"),T_("Delay, min"),T_("Contacted"),T_("Try another"),T_("Try again"),T_("Eligible"),T_("Require note"));
|
||||
|
||||
/* allow delay edit only to superadmins (currenlty admin) */
|
||||
if ( $_SESSION['user'] != "admin"){ unset($row[4]); unset($hdr[4]); }
|
||||
|
||||
$hid = "default";
|
||||
$value = "";
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (isset($rs) && !empty($rs)){
|
||||
|
||||
translate_array($rs, array("description","type"));
|
||||
|
||||
for ($i = 0; $i < count($rs); $i++){
|
||||
foreach ($rs[$i] as $key => $val){
|
||||
if ($key == "type"){
|
||||
$rs[$i]['type'] = preg_replace("#\s*\(.+#m", '', $val); // cut description in bracets for 'outcome_type'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<form enctype="multipart/form-data" action="?" method="post" class="form-horizontal col-lg-12" >
|
||||
|
||||
<?php xhtml_table($rs,$row,$hdr); ?>
|
||||
|
||||
<input type='hidden' name='<?php echo $hid; ?>' value='<?php echo $value;?>' /> </br>
|
||||
|
||||
<div class="row form-group">
|
||||
<div class="col-sm-4 ">
|
||||
<a href="questionnairelist.php" class="btn btn-default pull-right" ><i class="fa fa-list text-primary"></i> <?php echo T_("Cancel");?></a>
|
||||
</div>
|
||||
<div class="col-sm-4 ">
|
||||
<button type="submit" class="btn btn-primary pull-right btn-lg" name="save" ><i class="fa fa-check-square-o fa-lg"></i> <?php echo T_("Save selection"); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
/* else {
|
||||
|
||||
if (isset($_GET['default'])) { ?>
|
||||
<div class="well text-danger col-sm-4"><p><?php echo T_("ERROR: Check tables 'outcome' and 'outcome_type' in DB"); ?></p></div>
|
||||
<?php }
|
||||
|
||||
if (isset($_GET['qid']) ) { ?>
|
||||
<div class="well text-danger col-sm-4"><p><?php echo T_("ERROR: Check tables 'outcome' and 'questionnaire' in DB"); ?></p></div>
|
||||
<?php }
|
||||
|
||||
} */
|
||||
|
||||
xhtml_foot($js_foot);
|
||||
|
||||
?>
|
||||
@@ -49,9 +49,7 @@ $sql = "SELECT stg_value
|
||||
session_name($db->GetOne($sql));
|
||||
|
||||
session_set_cookie_params(0,QUEXS_PATH);
|
||||
if ((defined('PHP_SESSION_ACTIVE') && session_status() !== PHP_SESSION_ACTIVE) || !session_id()) {
|
||||
session_start();
|
||||
}
|
||||
session_start();
|
||||
|
||||
//check if the session exists or loginID not set
|
||||
if (session_id() == "" || !isset($_SESSION['loginID']))
|
||||
|
||||
26
call.php
26
call.php
@@ -107,32 +107,32 @@ function display_outcomes($contacted,$ca,$case_id)
|
||||
AND call_attempt_id = '$ca'";
|
||||
|
||||
$rs = $db->GetAll($sql);
|
||||
|
||||
$outcomes = $db->GetOne("SELECT q.outcomes FROM `questionnaire` as q JOIN `case` as c ON (c.questionnaire_id =q.questionnaire_id) WHERE c.case_id = $case_id");
|
||||
|
||||
if (!empty($rs))
|
||||
{
|
||||
//we have an appointment made ... only select appointment ID's
|
||||
$sql = "SELECT outcome_id,description
|
||||
FROM outcome
|
||||
WHERE outcome_type_id = '5'";
|
||||
WHERE outcome_type_id = '5'
|
||||
AND outcome_id IN ($outcomes)";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($contacted === false)
|
||||
{
|
||||
$sql = "SELECT outcome_id,description
|
||||
FROM outcome
|
||||
WHERE outcome_id != 10"; //don't show completed if not
|
||||
}
|
||||
if ($contacted === false) $ctd = "";
|
||||
else
|
||||
{
|
||||
$contacted = bigintval($contacted);
|
||||
|
||||
$sql = "SELECT outcome_id,description
|
||||
FROM outcome
|
||||
WHERE contacted = '$contacted'
|
||||
AND outcome_id != 10"; //don't show completed if not
|
||||
$ctd = "AND contacted = '$contacted'";
|
||||
}
|
||||
|
||||
|
||||
$sql = "SELECT outcome_id,description
|
||||
FROM outcome
|
||||
WHERE outcome_type_id != '5'
|
||||
$ctd
|
||||
AND outcome_id IN ($outcomes)
|
||||
AND outcome_id NOT IN(10,42,43,44,45)"; //don't show completed if not, hide max calls as the supposed to be automatic or admin
|
||||
}
|
||||
}
|
||||
$rs = $db->GetAll($sql);
|
||||
|
||||
@@ -106,13 +106,16 @@ function display_outcomes($contacted,$ca,$case_id)
|
||||
AND call_attempt_id = '$ca'";
|
||||
|
||||
$rs = $db->GetAll($sql);
|
||||
|
||||
|
||||
$outcomes = $db->GetOne("SELECT q.outcomes FROM `questionnaire` as q JOIN `case` as c ON (c.questionnaire_id =q.questionnaire_id) WHERE c.case_id = $case_id");
|
||||
|
||||
if (!empty($rs))
|
||||
{
|
||||
//we have an appointment made ... only select appointment ID's
|
||||
$sql = "SELECT outcome_id,description,contacted
|
||||
FROM outcome
|
||||
WHERE outcome_id = '19'"; //outcome_type_id = '5'
|
||||
WHERE outcome_type_id = '5'
|
||||
AND outcome_id IN ($outcomes)";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -133,7 +136,7 @@ function display_outcomes($contacted,$ca,$case_id)
|
||||
}
|
||||
$rs = $db->GetAll($sql);
|
||||
|
||||
print "<div>";
|
||||
print "<div class=\"panel-body\">";
|
||||
if (!empty($rs))
|
||||
{
|
||||
$do = false;
|
||||
@@ -473,7 +476,7 @@ switch($state)
|
||||
print "<form action='?' method='post'><div class=\"form-group\">";
|
||||
display_outcomes(false,$call_attempt_id,$case_id);
|
||||
if (isset($_POST['confirm'])){
|
||||
print "</div><input type='submit' class=\"btn btn-primary\" value=\"" . T_("Assign outcome") . "\" name='submit' id='submit'/></form>";
|
||||
print "</div><input type='submit' class=\"btn btn-primary btn-lg\" style=\"margin-left: 15px; margin-right: 30px; min-width: 150px;\" value=\"" . T_("Assign outcome") . "\" name='submit' id='submit'/></form>";
|
||||
}
|
||||
break;
|
||||
case 5: //done -- shouldn't come here as should be coded + done
|
||||
|
||||
@@ -50,9 +50,7 @@ session_name($db->GetOne($sql));
|
||||
|
||||
session_set_cookie_params(0,QUEXS_PATH);
|
||||
|
||||
if ((defined('PHP_SESSION_ACTIVE') && session_status() !== PHP_SESSION_ACTIVE) || !session_id()) {
|
||||
session_start();
|
||||
}
|
||||
session_start();
|
||||
|
||||
//check if the session exists or loginID not set
|
||||
if (session_id() == "" || !isset($_SESSION['loginID']))
|
||||
|
||||
@@ -1055,6 +1055,8 @@ CREATE TABLE `outcome` (
|
||||
`eligible` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'If the respondent is eligible to participate',
|
||||
`require_note` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Whether to require a note to be entered',
|
||||
`calc` char(2) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`default` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1' COMMENT 'Used as default for questionnaire outcomes',
|
||||
`permanent` TINYINT(1) UNSIGNED NOT NULL COMMENT 'Permanent outcome, used for all questionnaires, not possible to de-select',
|
||||
PRIMARY KEY (`outcome_id`),
|
||||
KEY `calc` (`calc`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
@@ -1063,45 +1065,45 @@ CREATE TABLE `outcome` (
|
||||
-- Dumping data for table `outcome`
|
||||
--
|
||||
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(1, '3.11', 'Not attempted or worked', 0, 1, 1, 0, 1, 0, 0, 'UH');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(2, '3.13', 'No answer', 180, 1, 1, 0, 1, 1, 0, 'UH');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(3, '3.16', 'Technical phone problems', 180, 1, 1, 0, 1, 0, 0, 'UH');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(4, '2.34', 'Other, Referred to Supervisor (Eligible)', 0, 2, 0, 1, 1, 1, 1, 'O');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(5, '3.91', 'Other, Referred to Supervisor (Unknown eligibility)', 0, 2, 0, 0, 1, 0, 1, 'UO');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(6, '2.111a', 'Soft Refusal, Other', 10080, 3, 0, 1, 1, 1, 1, 'R');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(7, '2.111b', 'Hard Refusal, Other', 10080, 3, 0, 1, 1, 1, 1, 'R');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(8, '2.112a', 'Soft Refusal, Respondent', 10080, 3, 0, 1, 1, 1, 1, 'R');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(9, '2.112b', 'Hard Refusal, Respondent', 10080, 3, 0, 1, 1, 1, 1, 'R');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(10, '1.1', 'Complete', 0, 4, 0, 1, 1, 1, 0, 'I');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(11, '2.112', 'Known respondent refusal', 0, 4, 0, 1, 1, 1, 0, 'R');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(12, '2.111', 'Household-level refusal', 0, 4, 0, 1, 1, 1, 0, 'R');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(13, '2.112c', 'Broken appointment (Implicit refusal)', 10080, 3, 1, 0, 1, 1, 0, 'R');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(14, '4.32', 'Disconnected number', 0, 4, 1, 0, 0, 0, 0, '');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(15, '4.20', 'Fax/data line', 0, 4, 1, 1, 0, 0, 0, '');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(16, '4.51', 'Business, government office, other organization', 0, 4, 1, 1, 0, 0, 0, '');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(17, '4.70', 'No eligible respondent', 0, 4, 1, 1, 0, 0, 0, '');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(18, '2.35a', 'Accidental hang up or temporary phone problem', 0, 1, 1, 1, 1, 1, 0, 'O');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(19, '2.12a', 'Definite Appointment - Respondent', 0, 5, 0, 1, 1, 1, 0, 'R');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(20, '2.12b', 'Definite Appointment - Other', 0, 5, 0, 1, 1, 1, 0, 'R');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(21, '2.13a', 'Unspecified Appointment - Respondent', 0, 5, 0, 1, 1, 1, 0, 'R');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(22, '2.13b', 'Unspecified Appointment - Other', 0, 5, 0, 1, 1, 1, 0, 'R');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(23, '2.221', 'Household answering machine - Message left', 180, 1, 1, 1, 1, 1, 0, 'NC');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(24, '2.222', 'Household answering machine - No message left', 180, 1, 1, 1, 1, 1, 0, 'NC');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(25, '2.31', 'Respondent Dead', 0, 4, 0, 1, 0, 1, 0, 'O');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(26, '2.32', 'Physically or mentally unable/incompetent', 0, 4, 0, 1, 0, 1, 0, 'O');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(27, '2.331', 'Household level language problem', 0, 4, 1, 1, 0, 1, 0, 'O');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(28, '2.332', 'Respondent language problem', 0, 4, 0, 1, 0, 1, 0, 'O');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(29, '3.14', 'Answering machine - Not a household', 0, 4, 1, 1, 0, 0, 0, 'UH');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(30, '4.10', 'Out of sample', 0, 4, 0, 1, 0, 0, 0, '');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(31, '2.20', 'Non contact', 180, 1, 1, 1, 1, 1, 0, 'NC');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(32, '4.80', 'Quota filled', 0, 4, 0, 1, 0, 0, 0, '');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(33, '2.36', 'Miscellaneous - Unavailable for a week', 10080, 1, 0, 1, 1, 1, 0, 'O');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(40, '1.1', 'Self completed online', 0, 4, 0, 1, 1, 1, 0, 'I');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(41, '2.36', 'Self completion email invitation sent', 10080, 1, 0, 1, 1, 1, 0, 'O');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(42, '3.90', 'Max call attempts reached (Unknown eligibility)', 0, 1, 0, 1, 1, 0, 0, 'UH');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(43, '3.90', 'Max calls reached (Unknown eligibility)', 0, 1, 0, 1, 1, 0, 0, 'UH');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(44, '2.30', 'Max call attempts reached (Eligible)', 0, 1, 0, 1, 1, 1, 0, 'O');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(45, '2.30', 'Max calls reached (Eligible)', 0, 1, 0, 1, 1, 1, 0, 'O');
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (1,'3.11','Not attempted or worked',0,1,1,0,1,0,0,'UH',1,1);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (2,'3.13','No answer',180,1,1,0,1,1,0,'UH',1,1);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (3,'3.16','Technical phone problems',180,1,1,0,1,0,0,'UH',1,1);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (4,'2.34','Other, Referred to Supervisor (Eligible)',0,2,0,1,1,1,1,'O',1,0);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (5,'3.91','Other, Referred to Supervisor (Unknown eligibility)',0,2,0,0,1,0,1,'UO',1,0);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (6,'2.111a','Soft Refusal, Other',10080,3,0,1,1,1,1,'R',1,0);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (7,'2.111b','Hard Refusal, Other',10080,3,0,1,1,1,1,'R',1,1);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (8,'2.112a','Soft Refusal, Respondent',10080,3,0,1,1,1,1,'R',1,0);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (9,'2.112b','Hard Refusal, Respondent',10080,3,0,1,1,1,1,'R',1,1);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (10,'1.1','Complete',0,4,0,1,1,1,0,'I',1,1);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (11,'2.112','Known respondent refusal',0,4,0,1,1,1,0,'R',1,0);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (12,'2.111','Household-level refusal',0,4,0,1,1,1,0,'R',1,0);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (13,'2.112c','Broken appointment (Implicit refusal)',10080,3,1,0,1,1,0,'R',1,0);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (14,'4.32','Disconnected number',0,4,1,0,0,0,0,'',1,1);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (15,'4.20','Fax/data line',0,4,1,1,0,0,0,'',1,0);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (16,'4.51','Business, government office, other organization',0,4,1,1,0,0,0,'',1,0);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (17,'4.70','No eligible respondent',0,4,1,1,0,0,0,'',1,1);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (18,'2.35a','Accidental hang up or temporary phone problem',0,1,1,1,1,1,0,'O',1,1);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (19,'2.12a','Definite Appointment - Respondent',0,5,0,1,1,1,0,'R',1,1);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (20,'2.12b','Definite Appointment - Other',0,5,0,1,1,1,0,'R',1,0);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (21,'2.13a','Unspecified Appointment - Respondent',0,5,0,1,1,1,0,'R',1,0);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (22,'2.13b','Unspecified Appointment - Other',0,5,0,1,1,1,0,'R',1,0);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (23,'2.221','Household answering machine - Message left',180,1,1,1,1,1,0,'NC',1,0);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (24,'2.222','Household answering machine - No message left',180,1,1,1,1,1,0,'NC',1,0);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (25,'2.31','Respondent Dead',0,4,0,1,0,1,0,'O',1,0);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (26,'2.32','Physically or mentally unable/incompetent',0,4,0,1,0,1,0,'O',1,0);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (27,'2.331','Household level language problem',0,4,1,1,0,1,0,'O',1,0);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (28,'2.332','Respondent language problem',0,4,0,1,0,1,0,'O',1,0);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (29,'3.14','Answering machine - Not a household',0,4,1,1,0,0,0,'UH',1,0);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (30,'4.10','Out of sample',0,4,0,1,0,0,0,'',1,0);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (31,'2.20','Non contact',180,1,1,1,1,1,0,'NC',1,0);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (32,'4.80','Quota filled',0,4,0,1,0,0,0,'',1,0);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (33,'2.36','Miscellaneous - Unavailable for a week',10080,1,0,1,1,1,0,'O',1,0);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (40,'1.1','Self completed online',0,4,0,1,1,1,0,'I',1,0);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (41,'2.36','Self completion email invitation sent',10080,1,0,1,1,1,0,'O',1,0);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (42,'3.90','Max call attempts reached (Unknown eligibility)',0,1,0,1,1,0,0,'UH',1,0);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (43,'3.90','Max calls reached (Unknown eligibility)',0,1,0,1,1,0,0,'UH',1,0);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (44,'2.30','Max call attempts reached (Eligible)',0,1,0,1,1,1,0,'O',1,0);
|
||||
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`, `default`, `permanent`) VALUES (45,'2.30','Max calls reached (Eligible)',0,1,0,1,1,1,0,'O',1,0);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@@ -1219,6 +1221,7 @@ CREATE TABLE `questionnaire` (
|
||||
`lime_template` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Limesurvey template for respondent self completion',
|
||||
`lime_endurl` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Forwarding end URL for respondent self completion',
|
||||
`enabled` tinyint(1) NOT NULL DEFAULT '1',
|
||||
`outcomes` varchar(256) COLLATE utf8_unicode_ci NULL DEFAULT '1,2,3,7,9,10,14,17,18,19' COMMENT 'Comma-separated string of outcomes defined for the questionnaire',
|
||||
PRIMARY KEY (`questionnaire_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
@@ -441,57 +441,74 @@ function get_limesurvey_quota_info($lime_quota_id)
|
||||
|
||||
$ret = array();
|
||||
|
||||
$sql = "SELECT q.*,s.language
|
||||
$sql = "SELECT q.qid
|
||||
FROM ".LIME_PREFIX."quota_members as q, ".LIME_PREFIX."surveys as s
|
||||
WHERE q.quota_id='$lime_quota_id'
|
||||
AND s.sid = q.sid";
|
||||
AND s.sid = q.sid
|
||||
GROUP BY q.qid";
|
||||
|
||||
$rs = $db->GetAll($sql);
|
||||
$rsq = $db->GetAll($sql);
|
||||
|
||||
foreach($rs as $quota_entry)
|
||||
foreach ($rsq as $q)
|
||||
{
|
||||
$lime_qid = $quota_entry['qid'];
|
||||
$surveyid = $quota_entry['sid'];
|
||||
$language = $quota_entry['language'];
|
||||
$qid = $q['qid'];
|
||||
|
||||
$sql = "SELECT type, title,gid
|
||||
FROM ".LIME_PREFIX."questions
|
||||
WHERE qid='$lime_qid'
|
||||
AND language='$language'";
|
||||
|
||||
$qtype = $db->GetRow($sql);
|
||||
$sql = "SELECT q.*,s.language
|
||||
FROM ".LIME_PREFIX."quota_members as q, ".LIME_PREFIX."surveys as s
|
||||
WHERE q.quota_id='$lime_quota_id'
|
||||
AND s.sid = q.sid
|
||||
AND q.qid = $qid";
|
||||
|
||||
$fieldnames = "0";
|
||||
|
||||
if ($qtype['type'] == "I" || $qtype['type'] == "G" || $qtype['type'] == "Y")
|
||||
{
|
||||
$fieldnames= ($surveyid.'X'.$qtype['gid'].'X'.$quota_entry['qid']);
|
||||
$value = $quota_entry['code'];
|
||||
}
|
||||
|
||||
if($qtype['type'] == "L" || $qtype['type'] == "O" || $qtype['type'] =="!")
|
||||
{
|
||||
$fieldnames=( $surveyid.'X'.$qtype['gid'].'X'.$quota_entry['qid']);
|
||||
$value = $quota_entry['code'];
|
||||
}
|
||||
$rs = $db->GetAll($sql);
|
||||
|
||||
if($qtype['type'] == "M")
|
||||
{
|
||||
$fieldnames=( $surveyid.'X'.$qtype['gid'].'X'.$quota_entry['qid'].$quota_entry['code']);
|
||||
$value = "Y";
|
||||
}
|
||||
|
||||
if($qtype['type'] == "A" || $qtype['type'] == "B")
|
||||
{
|
||||
$temp = explode('-',$quota_entry['code']);
|
||||
$fieldnames=( $surveyid.'X'.$qtype['gid'].'X'.$quota_entry['qid'].$temp[0]);
|
||||
$value = $temp[1];
|
||||
}
|
||||
|
||||
$r2 = array();
|
||||
|
||||
$ret[] = array('code' => $quota_entry['code'], 'value' => $value, 'qid' => $quota_entry['qid'], 'fieldname' => $fieldnames);
|
||||
foreach($rs as $quota_entry)
|
||||
{
|
||||
$lime_qid = $quota_entry['qid'];
|
||||
$surveyid = $quota_entry['sid'];
|
||||
$language = $quota_entry['language'];
|
||||
|
||||
$sql = "SELECT type, title,gid
|
||||
FROM ".LIME_PREFIX."questions
|
||||
WHERE qid='$lime_qid'
|
||||
AND language='$language'";
|
||||
|
||||
$qtype = $db->GetRow($sql);
|
||||
|
||||
$fieldnames = "0";
|
||||
|
||||
if ($qtype['type'] == "I" || $qtype['type'] == "G" || $qtype['type'] == "Y")
|
||||
{
|
||||
$fieldnames= ($surveyid.'X'.$qtype['gid'].'X'.$quota_entry['qid']);
|
||||
$value = $quota_entry['code'];
|
||||
}
|
||||
|
||||
if($qtype['type'] == "L" || $qtype['type'] == "O" || $qtype['type'] =="!")
|
||||
{
|
||||
$fieldnames=( $surveyid.'X'.$qtype['gid'].'X'.$quota_entry['qid']);
|
||||
$value = $quota_entry['code'];
|
||||
}
|
||||
|
||||
if($qtype['type'] == "M")
|
||||
{
|
||||
$fieldnames=( $surveyid.'X'.$qtype['gid'].'X'.$quota_entry['qid'].$quota_entry['code']);
|
||||
$value = "Y";
|
||||
}
|
||||
|
||||
if($qtype['type'] == "A" || $qtype['type'] == "B")
|
||||
{
|
||||
$temp = explode('-',$quota_entry['code']);
|
||||
$fieldnames=( $surveyid.'X'.$qtype['gid'].'X'.$quota_entry['qid'].$temp[0]);
|
||||
$value = $temp[1];
|
||||
}
|
||||
|
||||
|
||||
$r2[] = array('code' => $quota_entry['code'], 'value' => $value, 'qid' => $quota_entry['qid'], 'fieldname' => $fieldnames);
|
||||
}
|
||||
|
||||
$ret[$qid] = $r2;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
BIN
locale/hr/LC_MESSAGES/hr.mo
Normal file
BIN
locale/hr/LC_MESSAGES/hr.mo
Normal file
Binary file not shown.
4152
locale/hr/LC_MESSAGES/hr.po
Normal file
4152
locale/hr/LC_MESSAGES/hr.po
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
6637
locale/quexs.pot
6637
locale/quexs.pot
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -50,9 +50,7 @@ session_name($db->GetOne($sql));
|
||||
|
||||
session_set_cookie_params(0,QUEXS_PATH);
|
||||
|
||||
if ((defined('PHP_SESSION_ACTIVE') && session_status() !== PHP_SESSION_ACTIVE) || !session_id()) {
|
||||
session_start();
|
||||
}
|
||||
session_start();
|
||||
|
||||
//check if the session exists or loginID not set
|
||||
if (session_id() == "" || !isset($_SESSION['loginID']))
|
||||
|
||||
Reference in New Issue
Block a user