";
if (!empty($rs))
{
xhtml_table($rs,array("var","val"),array(T_("Var"),T_("Value")));
diff --git a/css/index_interface2.css b/css/index_interface2.css
new file mode 100644
index 00000000..d0e21946
--- /dev/null
+++ b/css/index_interface2.css
@@ -0,0 +1,81 @@
+.headerexpand {
+ position: absolute;
+ height: 20px;
+ bottom: 0px;
+ right: 0px;
+}
+#headerexpandimage {
+ height: 20px;
+}.box {
+ margin: 18px;
+}
+.online {
+ background: #00FF00;
+}
+.offline {
+ background: #FF0000;
+}
+a {
+ padding: 3px 0.5em;
+ margin-left: 3px;
+ border: 1px solid #778;
+ background: #DDE;
+ text-decoration: none;
+ color: black;
+}
+a:active {
+ border: 4px inset;
+}
+
+#header {
+ position : absolute;
+ width : 20%;
+ height : 30%;
+ top : 0;
+ right : 0;
+ bottom : auto;
+ left : 0;
+ /*border-bottom: 1px solid #aaa;*/
+}
+#calllist {
+ position : absolute;
+ width : 50%;
+ height : 30%;
+ left : 50%;
+ top : 0;
+ right : 0;
+ bottom : auto;
+}
+#qstatus {
+ position : absolute;
+ width : 30%;
+ height : 30%;
+ top : 0;
+ right : 0;
+ left: 20%;
+ bottom : auto;
+ /*border: 1px solid #aaa;*/
+}
+#casefunctions {
+ position : absolute;
+ width : 20%;
+ height : 30%;
+ top : 0;
+ right : 0;
+ left: 0;
+ bottom : auto;
+}
+#content {
+ position : absolute;
+ top : 30%;
+ left : 0;
+ bottom : auto;
+ width : 100%;
+ height : 70%;
+}
+.embeddedobject {
+ width:100%;
+ height:100%;
+ position:absolute;
+}
+
diff --git a/css/respondent_interface2.css b/css/respondent_interface2.css
new file mode 100644
index 00000000..969dc18c
--- /dev/null
+++ b/css/respondent_interface2.css
@@ -0,0 +1,13 @@
+.labelclass{
+ width:20%;
+}
+.textclass {
+ width:70%;
+ height:80%;
+}
+.submitclass{
+ width:20%;
+}
+.addresp{
+ font-style:italic;
+}
diff --git a/functions/functions.operator.php b/functions/functions.operator.php
index 4cb0cdbd..d53312b7 100644
--- a/functions/functions.operator.php
+++ b/functions/functions.operator.php
@@ -1056,10 +1056,11 @@ function get_call($operator_id,$respondent_id = "",$contact_phone_id = "",$creat
*
* @param int $operator_id The operator id
* @param bool $escape Whether to escape the ampersands default true
+ * @param bool $interface2 Whether we are using the alternate interface
* @return string The URL of the LimeSurvey questionnaire, or the URL of an error screen if none available
*
*/
-function get_respondentselection_url($operator_id,$escape = true)
+function get_respondentselection_url($operator_id,$escape = true,$interface2 = false)
{
global $db;
@@ -1078,7 +1079,12 @@ function get_respondentselection_url($operator_id,$escape = true)
if ($sid != false && !empty($sid) && $sid != 'NULL')
$url = LIME_URL . "index.php?loadall=reload" . $amp . "sid=$sid" . $amp . "token=$call_id" . $amp . "lang=" . DEFAULT_LOCALE;
else
- $url = 'rs_intro.php';
+ {
+ if ($interface2)
+ $url = 'rs_intro_interface2.php';
+ else
+ $url = 'rs_intro.php';
+ }
}
//if ($db->HasFailedTrans()) { print "FAILED in get_limesurvey_url"; exit; }
@@ -1377,6 +1383,94 @@ function copy_row_quota($questionnaire_id,$sample_import_id,$copy_sample_import_
$db->CompleteTrans();
}
+/**
+ * Copy row quotas from one sample to another with blocking
+ * Set quota_reached to 0 by default
+ *
+ * @param int $questionnaire_id
+ * @param int $sample_import_id
+ * @param int $copy_sample_import_id The sample_import_id to copy to
+ */
+function copy_row_quota_with_blocking($questionnaire_id,$sample_import_id,$copy_sample_import_id)
+{
+ global $db;
+
+ $db->StartTrans();
+
+ //Set quota_reached to 0 always
+
+ $sql = "INSERT INTO questionnaire_sample_quota_row (questionnaire_id,sample_import_id,lime_sgqa,value,comparison,completions,exclude_var,exclude_val,quota_reached,description)
+ SELECT questionnaire_id, $copy_sample_import_id, lime_sgqa,value,comparison,completions,exclude_var,exclude_val,quota_reached,description
+ FROM questionnaire_sample_quota_row
+ WHERE questionnaire_id = '$questionnaire_id'
+ AND sample_import_id = '$sample_import_id'";
+
+ $db->Execute($sql);
+
+
+ update_quotas($questionnaire_id);
+
+ $db->CompleteTrans();
+}
+
+/**
+ * Copy row quotas from one sample to another and adjust completion number appropriately to completed in the sample.
+ *
+ * @param int $questionnaire_id
+ * @param int $sample_import_id
+ * @param int $copy_sample_import_id The sample_import_id to copy to
+ */
+function copy_row_quota_with_adjusting($questionnaire_id,$sample_import_id,$copy_sample_import_id)
+{
+ global $db;
+
+ // Copy quotas (defalt Quexs function)
+ copy_row_quota_with_blocking($questionnaire_id,$sample_import_id,$copy_sample_import_id);
+
+ $db->StartTrans();
+
+ // Select quotas from the old sample rows and calculate
+ $sql = "SELECT questionnaire_sample_quota_row_id,q.questionnaire_id,sample_import_id,lime_sgqa,value,comparison,completions,quota_reached,q.lime_sid,qsq.exclude_var,qsq.exclude_val
+ FROM questionnaire_sample_quota_row as qsq, questionnaire as q
+ WHERE qsq.questionnaire_id = '$questionnaire_id'
+ AND q.questionnaire_id = '$questionnaire_id'
+ #AND qsq.quota_reached != '1'
+ AND qsq.lime_sgqa != -1
+ AND sample_import_id='".$sample_import_id."'
+ ";
+
+ $rs = $db->GetAll($sql);
+
+ if (isset($rs) && !empty($rs))
+ {
+ //include limesurvey functions
+ include_once(dirname(__FILE__).'/functions.limesurvey.php');
+
+ //update all row quotas for this questionnaire
+ foreach($rs as $r)
+ {
+ $completions = limesurvey_quota_completions($r['lime_sgqa'],$r['lime_sid'],$r['questionnaire_id'],$r['sample_import_id'],$r['value'],$r['comparison']);
+ if ($completions > 0)
+ {
+ //Update adjusting the completion number
+ $sql = "UPDATE questionnaire_sample_quota_row
+ SET completions = IF(completions>".$completions.",(completions-".$completions."),0), quota_reached = IF(quota_reached = 0,IF(completions=0,1,0),1)
+ WHERE questionnaire_id = '".$questionnaire_id."'
+ AND sample_import_id='".$copy_sample_import_id."'
+ AND lime_sgqa='".$r['lime_sgqa']."'
+ AND value='".$r['value']."'
+ AND comparison='".$r['comparison']."'";
+
+ $db->Execute($sql);
+ }
+
+ }
+ }
+
+ $db->CompleteTrans();
+}
+
+
/**
* Update the row quota table
*
diff --git a/include/limesurvey/index.php b/include/limesurvey/index.php
index c398fac2..e2346d2b 100644
--- a/include/limesurvey/index.php
+++ b/include/limesurvey/index.php
@@ -2335,9 +2335,9 @@ function buildsurveysession()
";
echo templatereplace(file_get_contents("$thistpl/endpage.pstpl"));
- doFooter();
- exit;
- }
+ doFooter();
+ exit;
+ }
}
//BEFORE BUILDING A NEW SESSION FOR THIS SURVEY, LET'S CHECK TO MAKE SURE THE SURVEY SHOULD PROCEED!
@@ -2452,6 +2452,15 @@ function buildsurveysession()
doFooter();
exit;
}
+
+ //This should only happen once, so a good place to add the "start of the limesurrvey instrument code"
+ //queXS Addition
+ include_once("quexs.php");
+ if(HEADER_EXPANDER_QUESTIONNAIRE && HEADER_EXPANDER_MANUAL)
+ {
+ global $js_header_includes;
+ $js_header_includes[] = '/../../js/headerexpandquestionnaire.js'; //queXS addition
+ }
}
// TOKENS REQUIRED, A TOKEN PROVIDED
// SURVEY CAPTCHA REQUIRED
diff --git a/index.php b/index.php
index 27b27c88..dd302561 100644
--- a/index.php
+++ b/index.php
@@ -45,10 +45,16 @@ include ("functions/functions.xhtml.php");
*/
include("functions/functions.operator.php");
-$db->StartTrans();
-
$operator_id = get_operator_id();
+if (ALTERNATE_INTERFACE && !is_voip_enabled($operator_id))
+{
+ include_once("waitnextcase_interface2.php");
+ die();
+}
+
+$db->StartTrans();
+
if (isset($_GET['endwork']))
{
diff --git a/index_interface2.php b/index_interface2.php
new file mode 100644
index 00000000..686b0062
--- /dev/null
+++ b/index_interface2.php
@@ -0,0 +1,330 @@
+
+/**
+ * Display the main page including all panels and tabs
+ *
+ *
+ * This file is part of queXS
+ *
+ * queXS is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * queXS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with queXS; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ *
+ * @author Adam Zammit
+ * @copyright Deakin University 2007,2008
+ * @package queXS
+ * @subpackage user
+ * @link http://www.deakin.edu.au/dcarf/ queXS was writen for DCARF - Deakin Computer Assisted Research Facility
+ * @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2
+ *
+ *
+ */
+
+/**
+ * Configuration file
+ */
+include ("config.inc.php");
+
+/**
+ * XHTML functions
+ */
+include ("functions/functions.xhtml.php");
+
+/**
+ * Operator functions
+ */
+include("functions/functions.operator.php");
+
+$db->StartTrans();
+
+
+$popupcall = false;
+$operator_id = get_operator_id();
+
+if (isset($_GET['endwork']))
+{
+ $call_id = get_call($operator_id);
+
+ if ($call_id)
+ {
+ //Don't end the case if we are on a call
+ $popupcall = true;
+ }
+ else
+ {
+ if (isset($_GET['note']))
+ {
+ $case_id = get_case_id($operator_id,false);
+ $note = $db->qstr($_GET['note']);
+ $sql = "INSERT INTO `case_note` (case_note_id,case_id,operator_id,note,datetime)
+ VALUES (NULL,'$case_id','$operator_id',$note,CONVERT_TZ(NOW(),'System','UTC'))";
+ $db->Execute($sql);
+ }
+ end_call_attempt($operator_id);
+ end_case($operator_id);
+
+ //if ($db->HasFailedTrans()){ print "FAILED AT ENDWORK
"; exit();}
+ $db->CompleteTrans();
+
+ include("waitnextcase_interface2.php");
+ exit();
+ }
+}
+
+
+if (isset($_GET['endcase']))
+{
+
+ if (isset($_GET['note']))
+ {
+ $case_id = get_case_id($operator_id,false);
+ $note = $db->qstr($_GET['note']);
+ $sql = "INSERT INTO `case_note` (case_note_id,case_id,operator_id,note,datetime)
+ VALUES (NULL,'$case_id','$operator_id',$note,CONVERT_TZ(NOW(),'System','UTC'))";
+ $db->Execute($sql);
+ }
+
+ $endthecase = true;
+
+ if (isset($_GET['outcome']))
+ {
+ $outcome_id = intval($_GET['outcome']);
+ end_call($operator_id,$outcome_id);
+
+ $sql = "SELECT tryanother
+ FROM outcome
+ WHERE outcome_id = '$outcome_id'";
+
+ $rs = $db->GetRow($sql);
+
+ if (!empty($rs) && $rs['tryanother'] == 1)
+ $endthecase = false;
+ }
+
+ if ($endthecase)
+ {
+ end_call_attempt($operator_id);
+ end_case($operator_id);
+
+ $db->CompleteTrans(); //need to complete here otherwise getting the case later will fail
+
+ include("waitnextcase_interface2.php");
+ exit();
+ }
+}
+
+$js = array("js/popup.js","js/tabber.js","include/jquery-ui/js/jquery-1.4.2.min.js","include/jquery-ui/js/jquery-ui-1.8.2.custom.min.js");
+$body = true;
+$script = "";
+if (AUTO_LOGOUT_MINUTES !== false)
+{
+ $js[] = "include/nap-1.0.0/js/jquery.nap-1.0.0.js";
+ $script = "";
+
+ $body = false;
+}
+
+if ($popupcall)
+ $js[] = "js/popupcallonload.js";
+
+if (HEADER_EXPANDER)
+{
+ $js[] = "js/headerexpand.js";
+ $js[] = "js/headerexpandmanual.js";
+}
+else if (HEADER_EXPANDER_MANUAL)
+{
+ $js[] = "js/headerexpand.js";
+ $js[] = "js/headerexpandmanual.js";
+}
+
+
+
+
+xhtml_head(T_("queXS"), $body, array("css/index_interface2.css","css/tabber.css","include/jquery-ui/css/smoothness/jquery-ui-1.8.2.custom.css") , $js);
+print $script;
+
+?>
+
+
+
+
+
+
+$case_id = get_case_id($operator_id,true);
+$ca = get_call_attempt($operator_id,true);
+$call_id = get_call($operator_id);
+$appointment = false;
+if ($ca)
+{
+ $appointment = is_on_appointment($ca);
+ $respondent_id = get_respondent_id($ca);
+}
+
+if (!$call_id)
+{
+ if ($appointment)
+ {
+ //create a call on the appointment number
+ $sql = "SELECT cp.*
+ FROM contact_phone as cp, appointment as a
+ WHERE cp.case_id = '$case_id'
+ AND a.appointment_id = '$appointment'
+ AND a.contact_phone_id = cp.contact_phone_id";
+ }
+ else
+ {
+ //create a call on the first available number by priority
+ $sql = "SELECT *
+ FROM contact_phone
+ WHERE case_id = '$case_id'
+ ORDER BY priority ASC
+ LIMIT 1";
+ }
+ $rs = $db->GetRow($sql);
+
+ if (!empty($rs))
+ {
+ $contact_phone_id = $rs['contact_phone_id'];
+
+ $call_id = get_call($operator_id,$respondent_id,$contact_phone_id,true);
+ }
+}
+
+
+if (!is_respondent_selection($operator_id))
+ $data = get_limesurvey_url($operator_id);
+else
+ $data = get_respondentselection_url($operator_id,true,true); //use second interface
+
+xhtml_object($data,"main-content");
+
+?>
+
+
+
+
+
+
+
+
+
+xhtml_foot();
+
+
+ //if ($db->HasFailedTrans()){ print "FAILED AT END of index
"; exit();}
+$db->CompleteTrans();
+
+?>
diff --git a/js/headerexpandmanual.js b/js/headerexpandmanual.js
index 694cea29..a75b12d2 100644
--- a/js/headerexpandmanual.js
+++ b/js/headerexpandmanual.js
@@ -4,6 +4,12 @@ $(document).ready(function(){
});
+function headerforcecontract()
+{
+ $("#headerexpandimage").attr('src',"./images/arrow-down-2.png");
+ headercontract();
+}
+
function headertogglemanual()
{
if ($("#headerexpandimage").attr('src') == './images/arrow-up-2.png')
diff --git a/js/headerexpandquestionnaire.js b/js/headerexpandquestionnaire.js
new file mode 100644
index 00000000..b86f16cb
--- /dev/null
+++ b/js/headerexpandquestionnaire.js
@@ -0,0 +1,2 @@
+//Contract on load
+$(document).ready(parent.headerforcecontract);
diff --git a/js/popupcallonload.js b/js/popupcallonload.js
new file mode 100644
index 00000000..89c1dd46
--- /dev/null
+++ b/js/popupcallonload.js
@@ -0,0 +1,4 @@
+//Contract on load
+$(document).ready(function(){
+ poptastic('call_interface2.php');
+ });
diff --git a/js/window_ie6_interface2.js b/js/window_ie6_interface2.js
new file mode 100644
index 00000000..d4d61d78
--- /dev/null
+++ b/js/window_ie6_interface2.js
@@ -0,0 +1,37 @@
+function LinkUp(element)
+{
+ var number = document.getElementById(element).selectedIndex;
+ location.href = document.getElementById(element).options[number].value;
+}
+
+function openParent(get)
+{
+ parent.location.href = 'index_interface2.php?' + get;
+}
+
+
+function openParentNote(get)
+{
+ parent.location.href = 'index_interface2.php?note=' + document.getElementById('note').value + '&' + get;
+}
+
+function openParentObject(oid,get)
+{
+ var a = parent.document.getElementById(oid);
+ if (a)
+ {
+ a.src = get;
+ }
+
+}
+
+function toggleRec(text,link,classes)
+{
+ var a = parent.document.getElementById('reclink');
+ if (a)
+ {
+ a.innerHTML = text;
+ a.href = "javascript:poptastic('" + link + "');";
+ a.className = classes;
+ }
+}
diff --git a/js/window_interface2.js b/js/window_interface2.js
new file mode 100644
index 00000000..ba30e175
--- /dev/null
+++ b/js/window_interface2.js
@@ -0,0 +1,41 @@
+function LinkUp(element)
+{
+ var number = document.getElementById(element).selectedIndex;
+ location.href = document.getElementById(element).options[number].value;
+}
+
+function openParent(get)
+{
+ parent.location.href = 'index_interface2.php?' + get;
+}
+
+
+function openParentNote(get)
+{
+ parent.location.href = 'index_interface2.php?note=' + document.getElementById('note').value + '&' + get;
+}
+
+function openParentObject(oid,get)
+{
+ var a = parent.document.getElementById(oid);
+ if (a)
+ {
+ var clone = a.cloneNode(true);
+ var pnode = a.parentNode;
+ clone.data = get;
+ pnode.removeChild(a);
+ pnode.appendChild(clone);
+ }
+
+}
+
+function toggleRec(text,link,classes)
+{
+ var a = parent.document.getElementById('reclink');
+ if (a)
+ {
+ a.innerHTML = text;
+ a.href = "javascript:poptastic('" + link + "');";
+ a.className = classes;
+ }
+}
diff --git a/rs_answeringmachine_interface2.php b/rs_answeringmachine_interface2.php
new file mode 100644
index 00000000..c38075ad
--- /dev/null
+++ b/rs_answeringmachine_interface2.php
@@ -0,0 +1,96 @@
+
+/**
+ * Respondent selection - Answering machine
+ *
+ *
+ * This file is part of queXS
+ *
+ * queXS is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * queXS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with queXS; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ *
+ * @author Adam Zammit
+ * @copyright Deakin University 2007,2008
+ * @package queXS
+ * @subpackage user
+ * @link http://www.deakin.edu.au/dcarf/ queXS was writen for DCARF - Deakin Computer Assisted Research Facility
+ * @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2
+ *
+ */
+
+/**
+ * Configuration file
+ */
+include ("config.inc.php");
+
+/**
+ * Database file
+ */
+include ("db.inc.php");
+
+/**
+ * XHTML
+ */
+include ("functions/functions.xhtml.php");
+
+/**
+ * Operator functions
+ */
+include ("functions/functions.operator.php");
+
+$operator_id = get_operator_id();
+$case_id = get_case_id($operator_id);
+$questionnaire_id = get_questionnaire_id($operator_id);
+$leavemessage = leave_message($case_id);
+
+$js = array("js/popup.js","include/jquery-ui/js/jquery-1.4.2.min.js","include/jquery-ui/js/jquery-ui-1.8.2.custom.min.js");
+
+if (AUTO_LOGOUT_MINUTES !== false)
+{
+ $js[] = "js/childnap.js";
+}
+
+xhtml_head(T_("Respondent Selection - Answering machine"),true,array("css/rs.css","include/jquery-ui/css/smoothness/jquery-ui-1.8.2.custom.css"),$js);
+
+if ($leavemessage)
+{
+ //display answering machine text
+ $sql = "SELECT rs_answeringmachine
+ FROM questionnaire
+ WHERE questionnaire_id = '$questionnaire_id'";
+
+ $r = $db->GetRow($sql);
+
+ print "" . template_replace($r['rs_answeringmachine'],$operator_id,$case_id) . "
";
+}
+else
+ print "" . T_("Do not leave a message, please hang up") . "
";
+
+?>
+ echo T_("End call with outcome: Business answering machine"); ?>
+
+if ($leavemessage)
+{
+?>
+ echo T_("End call with outcome: Answering machine Message left"); ?>
+
+}
+?>
+ echo T_("End call with outcome: Answering machine No message left"); ?>
+ echo T_("Go Back"); ?>
+
+
+xhtml_foot();
+
+?>
diff --git a/rs_business_interface2.php b/rs_business_interface2.php
new file mode 100644
index 00000000..47f929c6
--- /dev/null
+++ b/rs_business_interface2.php
@@ -0,0 +1,67 @@
+
+/**
+ * Respondent selection - Business answers
+ *
+ *
+ * This file is part of queXS
+ *
+ * queXS is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * queXS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with queXS; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ *
+ * @author Adam Zammit
+ * @copyright Deakin University 2007,2008
+ * @package queXS
+ * @subpackage user
+ * @link http://www.deakin.edu.au/dcarf/ queXS was writen for DCARF - Deakin Computer Assisted Research Facility
+ * @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2
+ *
+ */
+
+/**
+ * Configuration file
+ */
+include ("config.inc.php");
+
+/**
+ * XHTML
+ */
+include ("functions/functions.xhtml.php");
+
+/**
+ * Language
+ */
+include ("lang.inc.php");
+
+$js = array("js/popup.js","include/jquery-ui/js/jquery-1.4.2.min.js","include/jquery-ui/js/jquery-ui-1.8.2.custom.min.js");
+
+if (AUTO_LOGOUT_MINUTES !== false)
+{
+ $js[] = "js/childnap.js";
+}
+
+
+xhtml_head(T_("Respondent Selection - Business answers"),true,array("css/rs.css","include/jquery-ui/css/smoothness/jquery-ui-1.8.2.custom.css"), $js);
+
+
+?>
+ echo T_("Sorry to bother you, I have called the wrong number")?>
+
+ echo T_("End call with outcome: Business number"); ?>
+ echo T_("Go Back"); ?>
+
+
+xhtml_foot();
+
+?>
diff --git a/rs_callback_interface2.php b/rs_callback_interface2.php
new file mode 100644
index 00000000..da45c986
--- /dev/null
+++ b/rs_callback_interface2.php
@@ -0,0 +1,95 @@
+
+/**
+ * Respondent selection - Call back (respondent already started questionnaire)
+ *
+ *
+ * This file is part of queXS
+ *
+ * queXS is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * queXS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with queXS; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ *
+ * @author Adam Zammit
+ * @copyright Deakin University 2007,2008
+ * @package queXS
+ * @subpackage user
+ * @link http://www.deakin.edu.au/dcarf/ queXS was writen for DCARF - Deakin Computer Assisted Research Facility
+ * @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2
+ *
+ */
+
+/**
+ * Configuration file
+ */
+include ("config.inc.php");
+
+/**
+ * Database file
+ */
+include ("db.inc.php");
+
+/**
+ * XHTML functions
+ */
+include ("functions/functions.xhtml.php");
+
+/**
+ * Operator functions
+ */
+include ("functions/functions.operator.php");
+
+/**
+ * Limesurvey functions
+ */
+include ("functions/functions.limesurvey.php");
+
+$js = array("js/popup.js","include/jquery-ui/js/jquery-1.4.2.min.js","include/jquery-ui/js/jquery-ui-1.8.2.custom.min.js");
+
+if (AUTO_LOGOUT_MINUTES !== false)
+{
+ $js[] = "js/childnap.js";
+}
+
+
+
+xhtml_head(T_("Respondent Selection - Call back"),true,array("css/rs.css","include/jquery-ui/css/smoothness/jquery-ui-1.8.2.custom.css"), $js );
+
+$operator_id = get_operator_id();
+$case_id = get_case_id($operator_id);
+$questionnaire_id = get_questionnaire_id($operator_id);
+
+//display introduction text
+$sql = "SELECT rs_callback
+ FROM questionnaire
+ WHERE questionnaire_id = '$questionnaire_id'";
+
+$r = $db->GetRow($sql);
+
+print "" . template_replace($r['rs_callback'],$operator_id,$case_id) . "
";
+print "" . T_("You are: ") . round(limesurvey_percent_complete($case_id),1) . T_("% complete") . "
";
+
+
+//display outcomes
+
+?>
+
+ echo T_("Yes - Continue where we left off"); ?>
+ echo T_("End call with outcome: Refusal by respondent"); ?>
+ echo T_("Go Back"); ?>
+
+
+xhtml_foot();
+
+
+?>
diff --git a/rs_intro_interface2.php b/rs_intro_interface2.php
new file mode 100644
index 00000000..230957b2
--- /dev/null
+++ b/rs_intro_interface2.php
@@ -0,0 +1,131 @@
+
+/**
+ * Respondent selection introduction
+ *
+ *
+ * This file is part of queXS
+ *
+ * queXS is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * queXS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with queXS; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ *
+ * @author Adam Zammit
+ * @copyright Deakin University 2007,2008
+ * @package queXS
+ * @subpackage user
+ * @link http://www.deakin.edu.au/dcarf/ queXS was writen for DCARF - Deakin Computer Assisted Research Facility
+ * @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2
+ *
+ */
+
+/**
+ * Configuration file
+ */
+include ("config.inc.php");
+
+/**
+ * Database file
+ */
+include ("db.inc.php");
+
+/**
+ * XHTML functions
+ */
+include ("functions/functions.xhtml.php");
+
+/**
+ * Operator functions
+ */
+include ("functions/functions.operator.php");
+
+/**
+ * Limesurvey functions
+ */
+include ("functions/functions.limesurvey.php");
+
+$js = array("js/popup.js","include/jquery-ui/js/jquery-1.4.2.min.js","include/jquery-ui/js/jquery-ui-1.8.2.custom.min.js");
+
+if (AUTO_LOGOUT_MINUTES !== false)
+{
+ $js[] = "js/childnap.js";
+}
+
+
+xhtml_head(T_("Respondent Selection - Introduction"),true,array("css/rs.css","include/jquery-ui/css/smoothness/jquery-ui-1.8.2.custom.css"), $js);
+
+//display introduction text
+
+
+$operator_id = get_operator_id();
+$case_id = get_case_id($operator_id);
+$questionnaire_id = get_questionnaire_id($operator_id);
+
+//display introduction text
+$sql = "SELECT rs_intro,rs_project_intro,rs_callback
+ FROM questionnaire
+ WHERE questionnaire_id = '$questionnaire_id'";
+
+$r = $db->GetRow($sql);
+
+print "". template_replace($r['rs_intro'],$operator_id,$case_id) . "
";
+
+
+//display outcomes
+
+if (limesurvey_percent_complete($case_id) == false)
+{
+ if(empty($r['rs_project_intro']))
+ {
+ //If nothing is specified as a project introduction, skip straight to questionnaire
+ ?>
+ echo T_("Yes - Continue"); ?>
+
+ }
+ else
+ {
+ ?>
+ echo T_("Yes - Continue"); ?>
+
+ }
+} else {
+ if(empty($r['rs_callback']))
+ {
+ //If nothing is specified as a callback screen, skip straight to questionnaire
+ ?>
+ echo T_("Yes - Continue"); ?>
+
+ }
+ else
+ {
+ ?>
+ echo T_("Yes - Continue"); ?>
+
+ }
+}
+?>
+ echo T_("Business number"); ?>
+ echo T_("Answering machine"); ?>
+ echo T_("End call with outcome: No answer (ring out or busy) "); ?>
+ echo T_("End call with outcome: Accidental hang up"); ?>
+ echo T_("End call with outcome: Refusal by unknown person"); ?>
+ echo T_("End call with outcome: Refusal by respondent"); ?>
+ echo T_("End call with outcome: No eligible respondent (person never available on this number)"); ?>
+ echo T_("End call with outcome: Non contact (person not currently available on this number: no appointment made)"); ?>
+ echo T_("End call with outcome: Out of sample (already completed in another mode)"); ?>
+
+
+xhtml_foot();
+
+
+?>
diff --git a/rs_project_end.php b/rs_project_end.php
index 78f45f71..89dc0d03 100644
--- a/rs_project_end.php
+++ b/rs_project_end.php
@@ -34,6 +34,7 @@
*/
include ("config.inc.php");
+
/**
* Database file
*/
@@ -49,6 +50,14 @@ include ("functions/functions.xhtml.php");
*/
include ("functions/functions.operator.php");
+$operator_id = get_operator_id();
+
+//check for alternate interface
+if (ALTERNATE_INTERFACE && !is_voip_enabled($operator_id))
+{
+ include_once("rs_project_end_interface2.php");
+ die();
+}
$js = array("js/popup.js","include/jquery-ui/js/jquery-1.4.2.min.js","include/jquery-ui/js/jquery-ui-1.8.2.custom.min.js");
@@ -61,7 +70,6 @@ if (AUTO_LOGOUT_MINUTES !== false)
xhtml_head(T_("Respondent Selection - Project end"),true,array("css/rs.css","include/jquery-ui/css/smoothness/jquery-ui-1.8.2.custom.css"), $js);
-$operator_id = get_operator_id();
$case_id = get_case_id($operator_id);
$questionnaire_id = get_questionnaire_id($operator_id);
diff --git a/rs_project_end_interface2.php b/rs_project_end_interface2.php
new file mode 100644
index 00000000..a4a96961
--- /dev/null
+++ b/rs_project_end_interface2.php
@@ -0,0 +1,90 @@
+
+/**
+ * Respondent selection - Project End
+ *
+ *
+ * This file is part of queXS
+ *
+ * queXS is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * queXS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with queXS; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ *
+ * @author Adam Zammit
+ * @copyright Deakin University 2007,2008
+ * @package queXS
+ * @subpackage user
+ * @link http://www.deakin.edu.au/dcarf/ queXS was writen for DCARF - Deakin Computer Assisted Research Facility
+ * @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2
+ *
+ */
+
+/**
+ * Configuration file
+ */
+include_once ("config.inc.php");
+
+/**
+ * Database file
+ */
+include_once ("db.inc.php");
+
+/**
+ * XHTML functions
+ */
+include_once ("functions/functions.xhtml.php");
+
+/**
+ * Operator functions
+ */
+include_once ("functions/functions.operator.php");
+
+
+$js = array("js/popup.js","include/jquery-ui/js/jquery-1.4.2.min.js","include/jquery-ui/js/jquery-ui-1.8.2.custom.min.js");
+
+if (AUTO_LOGOUT_MINUTES !== false)
+{
+ $js[] = "js/childnap.js";
+}
+
+
+
+xhtml_head(T_("Respondent Selection - Project end"),true,array("css/rs.css","include/jquery-ui/css/smoothness/jquery-ui-1.8.2.custom.css"), $js);
+
+$operator_id = get_operator_id();
+$case_id = get_case_id($operator_id);
+$questionnaire_id = get_questionnaire_id($operator_id);
+
+//display introduction text
+$sql = "SELECT rs_project_end
+ FROM questionnaire
+ WHERE questionnaire_id = '$questionnaire_id'";
+
+$r = $db->GetRow($sql);
+
+print "" . template_replace($r['rs_project_end'],$operator_id,$case_id) . "
";
+
+if (!is_voip_enabled($operator_id) && AUTO_COMPLETE_OUTCOME)
+{
+ end_call($operator_id,10);
+ print "" . T_("Call automatically ended with outcome: Complete - End case") . "
";
+}
+else
+{
+ ?>
+ echo T_("End call with outcome: Complete"); ?>
+
+}
+xhtml_foot();
+
+?>
diff --git a/rs_project_intro_interface2.php b/rs_project_intro_interface2.php
new file mode 100644
index 00000000..bf6b8e57
--- /dev/null
+++ b/rs_project_intro_interface2.php
@@ -0,0 +1,92 @@
+
+/**
+ * Respondent selection - Project Introduction
+ *
+ *
+ * This file is part of queXS
+ *
+ * queXS is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * queXS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with queXS; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ *
+ * @author Adam Zammit
+ * @copyright Deakin University 2007,2008
+ * @package queXS
+ * @subpackage user
+ * @link http://www.deakin.edu.au/dcarf/ queXS was writen for DCARF - Deakin Computer Assisted Research Facility
+ * @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2
+ *
+ */
+
+/**
+ * Configuration file
+ */
+include ("config.inc.php");
+
+/**
+ * Database file
+ */
+include ("db.inc.php");
+
+/**
+ * XHTML functions
+ */
+include ("functions/functions.xhtml.php");
+
+/**
+ * Operator functions
+ */
+include ("functions/functions.operator.php");
+
+$js = array("js/popup.js","include/jquery-ui/js/jquery-1.4.2.min.js","include/jquery-ui/js/jquery-ui-1.8.2.custom.min.js");
+
+if (AUTO_LOGOUT_MINUTES !== false)
+{
+ $js[] = "js/childnap.js";
+}
+
+xhtml_head(T_("Respondent Selection - Project Introduction"),true,array("css/rs.css","include/jquery-ui/css/smoothness/jquery-ui-1.8.2.custom.css"), $js);
+
+$operator_id = get_operator_id();
+$case_id = get_case_id($operator_id);
+$questionnaire_id = get_questionnaire_id($operator_id);
+
+//display introduction text
+$sql = "SELECT rs_project_intro
+ FROM questionnaire
+ WHERE questionnaire_id = '$questionnaire_id'";
+
+$r = $db->GetRow($sql);
+
+print "" . template_replace($r['rs_project_intro'],$operator_id,$case_id) . "
";
+
+
+//display outcomes
+
+?>
+
+ echo T_("Yes - Continue"); ?>
+
+ echo T_("End call with outcome: Refusal by respondent"); ?>
+ echo T_("End call with outcome: No eligible respondent (person not available on this number)"); ?>
+ echo T_("End call with outcome: Out of sample (already completed in another mode)"); ?>
+
+ echo T_("Go Back"); ?>
+
+
+
+xhtml_foot();
+
+
+?>
diff --git a/rs_quota_end.php b/rs_quota_end.php
index f39af001..a3ed9999 100644
--- a/rs_quota_end.php
+++ b/rs_quota_end.php
@@ -66,9 +66,18 @@ $questionnaire_id = get_questionnaire_id($operator_id);
print "" . template_replace($_GET['message'],$operator_id,$case_id) . "
";
+if (ALTERNATE_INTERFACE && !is_voip_enabled($operator_id))
+{
+?>
+ echo T_("End call with outcome: Quota filled"); ?>
+
+}
+else
+{
?>
echo T_("End call with outcome: Quota filled"); ?>
+}
xhtml_foot();
diff --git a/status_interface2.php b/status_interface2.php
new file mode 100644
index 00000000..490b5c30
--- /dev/null
+++ b/status_interface2.php
@@ -0,0 +1,211 @@
+
+/**
+ * Display status of case
+ *
+ *
+ * This file is part of queXS
+ *
+ * queXS is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * queXS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with queXS; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ *
+ * @author Adam Zammit
+ * @copyright Deakin University 2007,2008
+ * @package queXS
+ * @subpackage user
+ * @link http://www.deakin.edu.au/dcarf/ queXS was writen for DCARF - Deakin Computer Assisted Research Facility
+ * @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2
+ *
+ */
+
+/**
+ * Configuration file
+ */
+include ("config.inc.php");
+
+/**
+ * Database file
+ */
+include ("db.inc.php");
+
+/**
+ * XHTML functions
+ */
+include ("functions/functions.xhtml.php");
+
+/**
+ * Operator functions
+ */
+include("functions/functions.operator.php");
+
+
+
+$operator_id = get_operator_id();
+$state = is_on_call($operator_id);
+
+$js = array("js/popup.js");
+
+if (browser_ie())
+ $js[] = "js/window_ie6.js";
+else
+ $js[] = "js/window.js";
+
+if (AUTO_LOGOUT_MINUTES !== false)
+{
+ $js[] = "include/jquery-ui/js/jquery-1.4.2.min.js";
+ $js[] = "js/childnap.js";
+}
+
+xhtml_head(T_("Status"),true,array("css/status.css"),$js);
+
+$ca = get_call_attempt($operator_id,false);
+if ($ca)
+{
+ $respondent_id = get_respondent_id($ca);
+ $case_id = get_case_id($operator_id);
+ $fname = get_respondent_variable("firstName",$respondent_id);
+ $lname = get_respondent_variable("lastName",$respondent_id);
+ print "" . T_("Name") . ": $fname $lname
";
+
+ $appointment = is_on_appointment($ca);
+
+ $call_id = get_call($operator_id);
+
+ $sql = "SELECT o.tryanother, o.require_note
+ FROM `call` as c, `outcome` as o
+ WHERE c.call_attempt_id = '$ca'
+ AND c.outcome_id = o.outcome_id
+ ORDER BY call_id DESC
+ LIMIT 1";
+
+ $rst = $db->GetRow($sql);
+
+ if ((empty($rst) || $rst['tryanother'] == 1)) //dial another number only when available and not ending
+ {
+
+ if (isset($_POST['contactphone']))
+ {
+ $pcontact_phone_id = intval($_POST['contactphone']);
+
+ //If an outcome already assigned, end the current call and start the enxt one to pcontact_phone_id
+ //Otherwise bring up the assign outcome window
+ if (!$call_id) //outcome assigned
+ {
+ $call_id = get_call($operator_id,$respondent_id,$pcontact_phone_id,true);
+ echo "";
+ }
+ else
+ {
+ //bring up assign outcome window
+ print "";
+ }
+ }
+
+ if (!$call_id)
+ {
+ if ($appointment)
+ {
+ //create a call on the appointment number
+ $sql = "SELECT cp.*
+ FROM contact_phone as cp, appointment as a
+ WHERE cp.case_id = '$case_id'
+ AND a.appointment_id = '$appointment'
+ AND a.contact_phone_id = cp.contact_phone_id";
+
+ }
+ else
+ {
+ //create a call on the first available number by priority
+ $sql = "SELECT *
+ FROM contact_phone
+ WHERE case_id = '$case_id'
+ ORDER BY priority ASC
+ LIMIT 1";
+
+ }
+
+ $rs = $db->GetRow($sql);
+ $contact_phone_id = $rs['contact_phone_id'];
+
+ $call_id = get_call($operator_id,$respondent_id,$contact_phone_id,true);
+ }
+
+ if ($appointment)
+ {
+ $sql = "SELECT DATE_FORMAT(CONVERT_TZ(a.start,'System', o.Time_zone_name),'%Y-%b-%d %H:%i') as time
+ FROM appointment as a, operator as o
+ WHERE o.operator_id = '$operator_id'
+ AND a.appointment_id = '$appointment'";
+
+ $rs = $db->GetRow($sql);
+
+ $apdate = $rs['time'];
+
+
+ print "" . T_("Appointment") . ": " . $apdate . "
";
+ //if (missed_appointment($ca)) print "" . T_("MISSED") . "
";
+ }
+
+
+ $sql = "SELECT c.*, CASE WHEN c.contact_phone_id = ccc.contact_phone_id THEN 'checked=\"checked\"' ELSE '' END as checked
+ FROM contact_phone as c
+ LEFT JOIN `call` as ccc ON (ccc.call_id = '$call_id')
+ LEFT JOIN (
+ SELECT contact_phone.contact_phone_id
+ FROM contact_phone
+ LEFT JOIN `call` ON ( call.contact_phone_id = contact_phone.contact_phone_id )
+ LEFT JOIN outcome ON ( call.outcome_id = outcome.outcome_id )
+ WHERE contact_phone.case_id = '$case_id'
+ AND outcome.tryagain =0
+ ) AS l ON l.contact_phone_id = c.contact_phone_id
+ LEFT JOIN
+ (
+ SELECT contact_phone_id
+ FROM `call`
+ WHERE call_attempt_id = '$ca'
+ AND outcome_id != 18
+ AND outcome_id != 0
+ ) as ca on ca.contact_phone_id = c.contact_phone_id
+ WHERE c.case_id = '$case_id'
+ AND l.contact_phone_id IS NULL
+ AND ca.contact_phone_id IS NULL";
+
+
+ $rs = $db->GetAll($sql);
+
+
+ //Display all available numbers for this case as a list of radio buttons
+ //By default, the selected radio button should have a "call" started for it
+ //When then next one clicked, it should bring up call screen if no outcome otherwise start new call
+ print "";
+ foreach($rs as $r)
+ {
+ print "
";
+ }
+ print "
";
+ }
+ else
+ print "" . T_("No more numbers to call") . "
";
+}
+else
+ print "" . T_("No case") . "
";
+
+xhtml_foot();
+
+?>
diff --git a/waitnextcase_interface2.php b/waitnextcase_interface2.php
new file mode 100644
index 00000000..7dc16ffc
--- /dev/null
+++ b/waitnextcase_interface2.php
@@ -0,0 +1,84 @@
+
+/**
+ * Display the main page including all panels and tabs
+ *
+ *
+ * This file is part of queXS
+ *
+ * queXS is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * queXS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with queXS; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ *
+ * @author Adam Zammit
+ * @copyright Deakin University 2007,2008
+ * @package queXS
+ * @subpackage user
+ * @link http://www.deakin.edu.au/dcarf/ queXS was writen for DCARF - Deakin Computer Assisted Research Facility
+ * @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2
+ *
+ *
+ */
+
+/**
+ * Configuration file
+ */
+include_once("config.inc.php");
+
+/**
+ * XHTML functions
+ */
+include_once("functions/functions.xhtml.php");
+
+/**
+ * Operator functions
+ */
+include_once("functions/functions.operator.php");
+
+
+xhtml_head(T_("queXS"), false, array("css/index_interface2.css","css/tabber.css"),array("js/tabber.js"));
+
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
echo T_("Info"); ?>
+
+
+
+
+
+
+
+
+
+
+xhtml_foot();
+
+?>