mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
Added customised outcomes feature (thanks Alex)
This commit is contained in:
16
CHANGELOG
16
CHANGELOG
@@ -1,6 +1,5 @@
|
|||||||
queXS 1.14.0 - Changes since 1.13.1
|
queXS 1.14.0 - Changes since 1.13.1
|
||||||
|
|
||||||
|
|
||||||
Changes for session authentication:
|
Changes for session authentication:
|
||||||
|
|
||||||
queXS now uses the Limesurvey session based authentication system to authenticate all users.
|
queXS now uses the Limesurvey session based authentication system to authenticate all users.
|
||||||
@@ -56,6 +55,21 @@ DROP TABLE `sessions2`;
|
|||||||
ALTER TABLE `questionnaire_sample` ADD `sort_order` INT( 11 ) NOT NULL DEFAULT '0';
|
ALTER TABLE `questionnaire_sample` ADD `sort_order` INT( 11 ) NOT NULL DEFAULT '0';
|
||||||
UPDATE `questionnaire_sample` SET sort_order = sample_import_id;
|
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
|
queXS 1.13.1 - Changes since 1.13.0
|
||||||
|
|
||||||
Fixed Bug: Remove references to old DEFAULT_TIME_ZONE config constant (use get_settings instead)
|
Fixed Bug: Remove references to old DEFAULT_TIME_ZONE config constant (use get_settings instead)
|
||||||
|
|||||||
@@ -117,6 +117,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=<?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=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=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=<?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>
|
<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>
|
</ul>
|
||||||
@@ -180,8 +181,9 @@ include ("../functions/functions.operator.php");
|
|||||||
</li>
|
</li>
|
||||||
<li class="has_sub"><a href="" class=""><i class="fa fa-lg fa-gear"></i><span><?php print T_("System settings") ;?></span></a>
|
<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";?>">
|
<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=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=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=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>
|
<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']);
|
$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)
|
//** get default coma-separated outcomes list and use it for new questionnaire as initial set
|
||||||
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)";
|
$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);
|
$rs = $db->Execute($sql);
|
||||||
|
|
||||||
@@ -101,12 +117,12 @@ if (isset($_POST['import_file']))
|
|||||||
|
|
||||||
$db->Execute($sql);
|
$db->Execute($sql);
|
||||||
}
|
}
|
||||||
$cl = info;
|
$cl = "info";
|
||||||
$message = T_("Successfully inserted") . " " . T_("with ID") . "  $qid, </h4><h4>" . T_("linked to survey") . "  $lime_sid ";
|
$message = T_("Successfully inserted") . " " . T_("with ID") . "  $qid, </h4><h4>" . T_("linked to survey") . "  $lime_sid ";
|
||||||
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$cl = danger;
|
$cl = "danger";
|
||||||
$message = T_("Error: Failed to insert questionnaire");
|
$message = T_("Error: Failed to insert questionnaire");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -581,6 +581,7 @@ else
|
|||||||
CONCAT('<a href=\'outcomes.php?questionnaire_id=',questionnaire_id,'\' class=\'btn\' title=\'" . TQ_("Outcomes for questionnaire"). " ',questionnaire_id,'\' data-toggle=\'tooltip\'><i class=\'fa fa-bar-chart fa-2x\'></i></a>')
|
CONCAT('<a href=\'outcomes.php?questionnaire_id=',questionnaire_id,'\' class=\'btn\' title=\'" . TQ_("Outcomes for questionnaire"). " ',questionnaire_id,'\' data-toggle=\'tooltip\'><i class=\'fa fa-bar-chart fa-2x\'></i></a>')
|
||||||
END as outcomes,
|
END as outcomes,
|
||||||
CONCAT('<a href=\'callhistory.php?questionnaire_id=',questionnaire_id,'\' class=\'btn\' title=\'" . TQ_("Call history"). " \n" . TQ_("questionnaire"). " ',questionnaire_id,'\' data-toggle=\'tooltip\'><i class=\'fa fa-phone fa-2x\'></i></a>') as calls,
|
CONCAT('<a href=\'callhistory.php?questionnaire_id=',questionnaire_id,'\' class=\'btn\' title=\'" . TQ_("Call history"). " \n" . TQ_("questionnaire"). " ',questionnaire_id,'\' data-toggle=\'tooltip\'><i class=\'fa fa-phone fa-2x\'></i></a>') as calls,
|
||||||
|
CONCAT('<a href=\'set_outcomes.php?qid=',questionnaire_id,'\' class=\'btn\' title=\'" . TQ_("Set outcomes"). " \n" . TQ_("questionnaire"). " ',questionnaire_id,'\' data-toggle=\'tooltip\'><i class=\'fa fa-list-ol fa-2x\'></i></a>') as setoutcomes,
|
||||||
CASE WHEN enabled = 0 THEN
|
CASE WHEN enabled = 0 THEN
|
||||||
CONCAT('<i class=\'btn fa fa-download fa-2x\' style=\'color:lightgrey;\'></i>')
|
CONCAT('<i class=\'btn fa fa-download fa-2x\' style=\'color:lightgrey;\'></i>')
|
||||||
ELSE
|
ELSE
|
||||||
@@ -599,7 +600,7 @@ else
|
|||||||
FROM questionnaire";
|
FROM questionnaire";
|
||||||
$rs = $db->GetAll($sql);
|
$rs = $db->GetAll($sql);
|
||||||
|
|
||||||
$columns = array("qid","description","status","enabledisable","outcomes","calls","casestatus","shifts","assample","dataout","modify","inlime","prefill","deletee");
|
$columns = array("qid","description","status","enabledisable","outcomes","calls","casestatus","shifts","assample","dataout","modify","setoutcomes","inlime","prefill","deletee");
|
||||||
xhtml_table($rs,$columns,false,"table-hover table-condensed ");
|
xhtml_table($rs,$columns,false,"table-hover table-condensed ");
|
||||||
|
|
||||||
print "</div>";
|
print "</div>";
|
||||||
|
|||||||
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);
|
||||||
|
|
||||||
|
?>
|
||||||
26
call.php
26
call.php
@@ -107,32 +107,32 @@ function display_outcomes($contacted,$ca,$case_id)
|
|||||||
AND call_attempt_id = '$ca'";
|
AND call_attempt_id = '$ca'";
|
||||||
|
|
||||||
$rs = $db->GetAll($sql);
|
$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))
|
if (!empty($rs))
|
||||||
{
|
{
|
||||||
//we have an appointment made ... only select appointment ID's
|
//we have an appointment made ... only select appointment ID's
|
||||||
$sql = "SELECT outcome_id,description
|
$sql = "SELECT outcome_id,description
|
||||||
FROM outcome
|
FROM outcome
|
||||||
WHERE outcome_type_id = '5'";
|
WHERE outcome_type_id = '5'
|
||||||
|
AND outcome_id IN ($outcomes)";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($contacted === false)
|
if ($contacted === false) $ctd = "";
|
||||||
{
|
|
||||||
$sql = "SELECT outcome_id,description
|
|
||||||
FROM outcome
|
|
||||||
WHERE outcome_id != 10"; //don't show completed if not
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$contacted = bigintval($contacted);
|
$contacted = bigintval($contacted);
|
||||||
|
$ctd = "AND contacted = '$contacted'";
|
||||||
$sql = "SELECT outcome_id,description
|
|
||||||
FROM outcome
|
|
||||||
WHERE contacted = '$contacted'
|
|
||||||
AND outcome_id != 10"; //don't show completed if not
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$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);
|
$rs = $db->GetAll($sql);
|
||||||
|
|||||||
@@ -106,45 +106,39 @@ function display_outcomes($contacted,$ca,$case_id)
|
|||||||
AND call_attempt_id = '$ca'";
|
AND call_attempt_id = '$ca'";
|
||||||
|
|
||||||
$rs = $db->GetAll($sql);
|
$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))
|
if (!empty($rs))
|
||||||
{
|
{
|
||||||
//we have an appointment made ... only select appointment ID's
|
//we have an appointment made ... only select appointment ID's
|
||||||
$sql = "SELECT outcome_id,description,contacted
|
$sql = "SELECT outcome_id,description,contacted
|
||||||
FROM outcome
|
FROM outcome
|
||||||
WHERE outcome_id = '19'"; //outcome_type_id = '5'
|
WHERE outcome_type_id = '5'
|
||||||
|
AND outcome_id IN ($outcomes)";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($contacted === false)
|
print "<div class=\"form-group\" ><a href=\"?contacted=1\" class=\"btn btn-info\" style=\"margin-left: 15px; margin-right: 30px; min-width: 200px;\">".T_("CONTACTED")."</a>";
|
||||||
{
|
print "<a href=\"?contacted=0\" class=\"btn btn-default\" style=\"margin-left: 30px; margin-right: 15px; min-width: 200px;\">".T_("NOT CONTACTED")."</a></div>";
|
||||||
print "<div class=\"form-group\" ><a href=\"?contacted=1\" class=\"btn btn-info\" style=\"margin-left: 15px; margin-right: 30px; min-width: 150px;\">".T_("CONTACTED")."</a>";
|
|
||||||
print "<a href=\"?contacted=0\" class=\"btn btn-default\" style=\"margin-left: 30px; margin-right: 15px; min-width: 150px;\">".T_("NOT CONTACTED")."</a></div>";
|
if (isset ($_GET['contacted'])) $contacted = bigintval($_GET['contacted']);
|
||||||
|
else if ($contacted) $contacted = bigintval($contacted);
|
||||||
if (isset ($_GET['contacted'])){
|
|
||||||
|
if ($contacted || $contacted === 0 ){
|
||||||
$contacted = bigintval($_GET['contacted']);
|
|
||||||
|
|
||||||
$sql = "SELECT outcome_id,description,contacted
|
$sql = "SELECT outcome_id,description,contacted
|
||||||
FROM outcome
|
FROM outcome
|
||||||
WHERE contacted = '$contacted'
|
WHERE contacted = '$contacted'
|
||||||
AND outcome_id NOT IN(5,10,19,21,40,41,42,43,44,45)";
|
AND outcome_type_id != '5'
|
||||||
}
|
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
|
||||||
else
|
|
||||||
{
|
|
||||||
$contacted = bigintval($contacted);
|
|
||||||
|
|
||||||
$sql = "SELECT outcome_id,description,contacted
|
|
||||||
FROM outcome
|
|
||||||
WHERE contacted = '$contacted'
|
|
||||||
AND outcome_id NOT IN(5,10,19,21,40,41,42,43,44,45)";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$rs = $db->GetAll($sql);
|
$rs = $db->GetAll($sql);
|
||||||
|
|
||||||
print "<div>";
|
print "<div class=\"panel-body\">";
|
||||||
if (!empty($rs))
|
if (!empty($rs))
|
||||||
{
|
{
|
||||||
$do = false;
|
$do = false;
|
||||||
@@ -154,14 +148,12 @@ function display_outcomes($contacted,$ca,$case_id)
|
|||||||
{
|
{
|
||||||
if ($do == $r['outcome_id']) $selected = "checked='checked'"; else $selected = "";
|
if ($do == $r['outcome_id']) $selected = "checked='checked'"; else $selected = "";
|
||||||
if (isset($r['contacted']) && $r['contacted'] == 1) $highlight = "text-primary"; else $highlight = "text-default";
|
if (isset($r['contacted']) && $r['contacted'] == 1) $highlight = "text-primary"; else $highlight = "text-default";
|
||||||
print "<li><label class='$highlight'><input type='radio' class='radio' name='outcome' id='outcome-{$r['outcome_id']}' value='{$r['outcome_id']}' $selected style='float:left'/> " . T_($r['description']) . "</label></li>";
|
print "<p><label class='$highlight'><input type='radio' class='radio' name='outcome' id='outcome-{$r['outcome_id']}' value='{$r['outcome_id']}' $selected style='float:left'/> " . T_($r['description']) . "</label></p>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$_POST['confirm'] = true;
|
$_POST['confirm'] = true;
|
||||||
}
|
}
|
||||||
print "</div>";
|
print "</div>";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -308,7 +300,7 @@ if (isset($_GET['newstate']))
|
|||||||
|
|
||||||
if (browser_ie()) $js = "js/window_ie6_interface2.js"; else $js = "js/window_interface2.js";
|
if (browser_ie()) $js = "js/window_ie6_interface2.js"; else $js = "js/window_interface2.js";
|
||||||
|
|
||||||
xhtml_head(T_("Set outcome"),true,array("include/bootstrap/css/bootstrap.min.css"/* ,"css/call.css" */),array($js,"include/jquery/jquery-1.4.2.min.js"));
|
xhtml_head(T_("Set outcome"),true,array("include/bootstrap/css/bootstrap.min.css"/* ,"css/call.css" */),array($js,"include/jquery/jquery.min.js"));
|
||||||
|
|
||||||
$state = is_on_call($operator_id);
|
$state = is_on_call($operator_id);
|
||||||
switch($state)
|
switch($state)
|
||||||
@@ -484,7 +476,7 @@ switch($state)
|
|||||||
print "<form action='?' method='post'><div class=\"form-group\">";
|
print "<form action='?' method='post'><div class=\"form-group\">";
|
||||||
display_outcomes(false,$call_attempt_id,$case_id);
|
display_outcomes(false,$call_attempt_id,$case_id);
|
||||||
if (isset($_POST['confirm'])){
|
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;
|
break;
|
||||||
case 5: //done -- shouldn't come here as should be coded + done
|
case 5: //done -- shouldn't come here as should be coded + done
|
||||||
|
|||||||
@@ -1055,6 +1055,8 @@ CREATE TABLE `outcome` (
|
|||||||
`eligible` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'If the respondent is eligible to participate',
|
`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',
|
`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,
|
`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`),
|
PRIMARY KEY (`outcome_id`),
|
||||||
KEY `calc` (`calc`)
|
KEY `calc` (`calc`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||||
@@ -1063,45 +1065,45 @@ CREATE TABLE `outcome` (
|
|||||||
-- Dumping data for 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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`, `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`) 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 (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_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',
|
`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',
|
`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`)
|
PRIMARY KEY (`questionnaire_id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user