diff --git a/CHANGELOG b/CHANGELOG index 6a8867d7..6d0cf0b6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,36 @@ +queXS 1.7.0 - Changes since 1.6.1 + +New Feature: Replace queXS caseid as token with a random token to allow for safe external access +New Feature: Allow for responents to self complete the questionnaire via email invitation +Fixed Bug: Replaced php short tags with long tags + +Database updates: + +ALTER TABLE `case` ADD `token` VARCHAR( 36 ) NOT NULL ; + +To allow for accessing existing cases in new system, need to assign a "token" for each case: + +UPDATE `case` SET token = case_id; +ALTER TABLE `case` ADD UNIQUE (`token`); + +New outcomes for email invitation and online self completion: + +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'), +(41, '2.36', 'Self completion email invitation sent', 10080, 1, 0, 1, 1, 1, 0, 'O'); + +New sample variable type (Email address): + +INSERT INTO `sample_var_type` (`type`, `description`, `table`) VALUES +(8, 'Email address', ''); + +Specify details of respondent self completion: + +ALTER TABLE `questionnaire` ADD `self_complete` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `info`, +ADD `lime_mode` VARCHAR( 64 ) NULL COMMENT 'Limesurvey mode for respondent self completion' AFTER `self_complete` , +ADD `lime_template` VARCHAR( 128 ) NULL COMMENT 'Limesurvey template for respondent self completion' AFTER `lime_mode` , +ADD `lime_endurl` VARCHAR( 256 ) NULL COMMENT 'Forwarding end URL for respondent self completion' AFTER `lime_template` ; + queXS 1.6.1 - Changes since 1.6.0 New Feature: Include paradata/metadata in data output (number call attempts, number of answering machine messages and all sample variables) diff --git a/admin/addshift.php b/admin/addshift.php index 008a894a..6a1cbe63 100644 --- a/admin/addshift.php +++ b/admin/addshift.php @@ -1,4 +1,4 @@ -
- "; $count = 1; foreach($shifts as $shift) @@ -257,12 +257,12 @@ if ($questionnaire_id != false)
" . T_("Day") . "" . T_("Start") . "" . T_("End") . "" . T_("Use shift?") . "
-

"/>

-

-

-

+

"/>

+

+

+

- " . T_("Add a sample to this questionnaire:") . ""; ?>
-

+
-
-
-
-
- +
+
+
+
+

-
-"; $count = 0; foreach($availabilitys as $availability) @@ -149,11 +149,11 @@ translate_array($daysofweek,array("description")); ?>
" . T_("Day") . "" . T_("Start") . "" . T_("End") . "
-
-

"/>

- +
+

"/>

+
-
-

"/> +

"/>

-
- -

-

"/>

+

+

"/>

- " . T_("The file does not contain at least caseid, starttime and endtime columns. Please try again.") ."

"; @@ -258,11 +258,11 @@ else

-

-

"/>

+

+

"/>

-
-"; $count = 0; foreach($shifts as $shift) @@ -131,10 +131,10 @@ translate_array($daysofweek,array("description")); ?>
" . T_("Day") . "" . T_("Start") . "" . T_("End") . "
-
-

"/>

+
+

"/>

-

- editor("information",get_setting("information")); ?> - "/>

+ editor("information",get_setting("information")); ?> + "/>

- - -GetAll($sql); if ($a) { ?> -

- + -

-

-

+

+

+

-

- -

- -

-

-

"; display_chooser($rs,"Time_zone_name","Time_zone_name",false,false,false,false,array("value",DEFAULT_TIME_ZONE)); ?>

-

" />

+

+ +

+ +

+

+

"; display_chooser($rs,"Time_zone_name","Time_zone_name",false,false,false,false,array("value",DEFAULT_TIME_ZONE)); ?>

+

" />

- diff --git a/admin/dataoutput.php b/admin/dataoutput.php index a4d0a17c..e7a1633f 100644 --- a/admin/dataoutput.php +++ b/admin/dataoutput.php @@ -1,5 +1,4 @@ -qstr($_GET['end']); $contact_phone_id = bigintval($_GET['contact_phone_id']); $respondent_id = bigintval($_GET['respondent_id']); + $require_operator_id = "NULL"; + if ($_GET['require_operator_id'] > 1) $require_operator_id = bigintval($_GET['require_operator_id']); //Edit this appointment in the database $sql = "UPDATE appointment as a, respondent as r - SET a.start = CONVERT_TZ($start,r.Time_zone_name,'UTC'), a.end = CONVERT_TZ($end,r.Time_zone_name,'UTC'), a.contact_phone_id = $contact_phone_id, a.respondent_id = $respondent_id + SET a.start = CONVERT_TZ($start,r.Time_zone_name,'UTC'), a.end = CONVERT_TZ($end,r.Time_zone_name,'UTC'), a.contact_phone_id = $contact_phone_id, a.respondent_id = $respondent_id, + a.require_operator_id = $require_operator_id WHERE a.appointment_id = $appointment_id AND r.respondent_id = $respondent_id"; @@ -157,7 +159,7 @@ if (isset($_GET['appointment_id']) && isset($_GET['case_id'])) xhtml_head(T_("Edit appointment"),false,$css,$js); print ""; - $sql = "SELECT a.contact_phone_id,a.call_attempt_id,CONVERT_TZ(a.start,'UTC',r.Time_zone_name) as start,CONVERT_TZ(a.end,'UTC',r.Time_zone_name) as end,a.respondent_id + $sql = "SELECT a.contact_phone_id,a.call_attempt_id,CONVERT_TZ(a.start,'UTC',r.Time_zone_name) as start,CONVERT_TZ(a.end,'UTC',r.Time_zone_name) as end,a.respondent_id,a.require_operator_id FROM appointment as a, respondent as r WHERE a.appointment_id = '$appointment_id' AND a.case_id = '$case_id' @@ -169,6 +171,7 @@ if (isset($_GET['appointment_id']) && isset($_GET['case_id'])) { $respondent_id = $rs['respondent_id']; $contact_phone_id = $rs['contact_phone_id']; + $require_operator_id = $rs['require_operator_id']; $start = $rs['start']; $end = $rs['end']; @@ -189,6 +192,22 @@ if (isset($_GET['appointment_id']) && isset($_GET['case_id'])) print "
"; print "
"; + print "
"; + $ops = $db->GetAll(" SELECT o.operator_id as value, + CONCAT(o.firstName, ' ', o.lastName) as description, + CASE WHEN o.operator_id = '$require_operator_id' THEN 'selected=\'selected\'' ELSE '' END as selected + FROM operator as o"); + $selected = "selected=\'selected\'"; + foreach($ops as $o) + { + if (!empty($o['selected'])) + { + $selected = ""; + break; + } + } + array_unshift($ops,array('value'=>0,'description'=>T_("Any operator"),'selected'=>$selected)); + display_chooser($ops,"require_operator_id","require_operator_id",false,false,false,false); print ""; print "
"; @@ -207,20 +226,21 @@ else print "

" . T_("Appointments") . "

" . T_("All appointments (with times displayed in your time zone)") . "

"; - $sql = "SELECT q.description, CONVERT_TZ(a.start,'UTC',o.Time_zone_name) as start, CONVERT_TZ(a.end,'UTC',o.Time_zone_name) as end, r.firstName, r.lastName, IFNULL(ou.description,'" . T_("Not yet called") . "') as outcome, oo.firstName as makerName, ooo.firstName as callerName, CONCAT('
', c.case_id, '') as case_id, CONCAT('". T_("Delete") . "') as link, CONCAT('". T_("Edit") . "') as edit + $sql = "SELECT q.description, CONVERT_TZ(a.start,'UTC',o.Time_zone_name) as start, CONVERT_TZ(a.end,'UTC',o.Time_zone_name) as end, r.firstName, r.lastName, IFNULL(ou.description,'" . T_("Not yet called") . "') as outcome, oo.firstName as makerName, ooo.firstName as callerName, CONCAT('', c.case_id, '') as case_id, CONCAT('". T_("Delete") . "') as link, CONCAT('". T_("Edit") . "') as edit,IFNULL(ao.firstName,'" . T_("Any operator") . "') as witho FROM appointment as a JOIN (`case` as c, respondent as r, questionnaire as q, operator as o, operator as oo, call_attempt as cc) on (a.case_id = c.case_id and a.respondent_id = r.respondent_id and q.questionnaire_id = c.questionnaire_id and o.operator_id = '$operator_id' and a.call_attempt_id = cc.call_attempt_id and cc.operator_id = oo.operator_id) LEFT JOIN (`call` as ca, outcome as ou, operator as ooo) ON (ca.call_id = a.completed_call_id and ou.outcome_id = ca.outcome_id and ca.operator_id = ooo.operator_id) + LEFT JOIN operator AS ao ON ao.operator_id = a.require_operator_id WHERE a.end >= CONVERT_TZ(NOW(),'System','UTC') ORDER BY a.start ASC"; $rs = $db->GetAll($sql); - + if (!empty($rs)) { translate_array($rs,array("outcome")); - xhtml_table($rs,array("description","case_id","start","end","makerName","firstName","lastName","outcome","callerName","link","edit"),array(T_("Questionnaire"),T_("Case ID"),T_("Start"),T_("End"),T_("Operator Name"),T_("Respondent Name"),T_("Surname"),T_("Current outcome"),T_("Operator who called"),T_("Delete"),T_("Edit"))); + xhtml_table($rs,array("description","case_id","start","end","makerName","witho","firstName","lastName","outcome","callerName","link","edit"),array(T_("Questionnaire"),T_("Case ID"),T_("Start"),T_("End"),T_("Operator Name"),T_("Appointment with"),T_("Respondent Name"),T_("Surname"),T_("Current outcome"),T_("Operator who called"),T_("Delete"),T_("Edit"))); } else print "

" . T_("No appointments in the future") . "

"; diff --git a/admin/extensionstatus.php b/admin/extensionstatus.php index 6ad4aeeb..d0c7a297 100644 --- a/admin/extensionstatus.php +++ b/admin/extensionstatus.php @@ -1,5 +1,4 @@ -
- -

-

+

+

-

-

-

-

"/>

+

+

+

"/>

- qstr($_POST['description'],get_magic_quotes_gpc()); @@ -91,14 +93,26 @@ 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) - 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)"; + $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) + 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)"; $rs = $db->Execute($sql); if ($rs) { $qid = $db->Insert_ID(); + if ($respsc == 1) + { + $lime_mode = $db->qstr($_POST['lime_mode'],get_magic_quotes_gpc()); + $lime_template = $db->qstr($_POST['lime_template'],get_magic_quotes_gpc()); + $lime_endurl = $db->qstr($_POST['lime_endurl'],get_magic_quotes_gpc()); + + $sql = "UPDATE questionnaire + SET lime_mode = $lime_mode, lime_template = $lime_template, lime_endurl = $lime_endurl + WHERE questionnaire_id = $qid"; + + $db->Execute($sql); + } print "

" . T_("Successfully inserted") . " $name " . T_("as questionnaire") . " $qid, " . T_("linked to") . " $lime_sid

"; }else { @@ -113,8 +127,8 @@ if (isset($_POST['import_file'])) ?>

-

-

+

" . T_("Create an instrument in Limesurvey") .""; } ?>

-

- + array(array("tokens","-","Source"), ?>

-

-

-

-