From 0fea57f29a31eda4b1130ad02ae16fbea497bb77 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 7 Dec 2015 00:48:24 +0300 Subject: [PATCH] merged rs_intro.php and rs_intro_interface2.php; removed references to rs_intro_interface2.php; removed rs_intro_interface2.php; bootstrapified rs_intro.php --- functions/functions.operator.php | 20 ++--- rs_answeringmachine.php | 20 ++--- rs_business.php | 13 +-- rs_callback.php | 12 +-- rs_intro.php | 147 ++++++++++++++++++------------- rs_intro_interface2.php | 144 ------------------------------ rs_project_intro.php | 19 ++-- 7 files changed, 116 insertions(+), 259 deletions(-) delete mode 100644 rs_intro_interface2.php diff --git a/functions/functions.operator.php b/functions/functions.operator.php index 40acf1de..3b64cd30 100644 --- a/functions/functions.operator.php +++ b/functions/functions.operator.php @@ -1307,20 +1307,12 @@ function get_respondentselection_url($operator_id,$escape = true,$interface2 = f if ($sid != false && !empty($sid) && $sid != 'NULL') $url = LIME_URL . "index.php?interviewer=interviewer" . $amp . "loadall=reload" . $amp . "sid=$sid" . $amp . "token=$call_id" . $amp . "lang=" . DEFAULT_LOCALE; else - { - if (is_respondent_selection($operator_id) === false) - { - $url = get_limesurvey_url($operator_id); - if (!$escape) - $url = str_replace("&","&",$url); - } - else - { - if ($interface2) - $url = 'rs_intro_interface2.php'; - else - $url = 'rs_intro.php'; - } + { + if (is_respondent_selection($operator_id) === false) + { + if (!$escape) $url = str_replace("&","&",$url); else $url = get_limesurvey_url($operator_id); + } + else $url = 'rs_intro.php'; } } diff --git a/rs_answeringmachine.php b/rs_answeringmachine.php index 4150a5ea..3f4f659b 100644 --- a/rs_answeringmachine.php +++ b/rs_answeringmachine.php @@ -78,17 +78,13 @@ if ($leavemessage) $r = $db->GetRow($sql); - if (!empty($r['rs_answeringmachine'])) print "

" . template_replace($r['rs_answeringmachine'],$operator_id,$case_id) . "

"; + if (!empty($r['rs_answeringmachine'])) print "
" . template_replace($r['rs_answeringmachine'],$operator_id,$case_id) . "
"; } else print "

" . T_("Do not leave a message, please hang up") . "

"; print "
- "; + "; if ($questionnaire_id){ $outcomes = $db->GetOne("SELECT q.outcomes FROM `questionnaire` as q WHERE q.questionnaire_id = $questionnaire_id");// @@ -99,22 +95,22 @@ print "
print "

" . T_("End call with outcome:") . "

"; - if (in_array(29,$outcomes)){ //preg_match('/29/',$outcomes) - print "

"; else print "href=\"javascript:parent.poptastic('call.php?defaultoutcome=29');\">"; print $des[2]['description'] . "

"; } - if (in_array(23,$outcomes) && $leavemessage){ //preg_match('/23/',$outcomes - print "

"; else print "href=\"javascript:parent.poptastic('call.php?defaultoutcome=23');\">"; print $des[0]['description'] . "

"; } - if (in_array(24,$outcomes)){ //preg_match('/24/',$outcomes - print "

"; else print "href=\"javascript:parent.poptastic('call.php?defaultoutcome=24');\">"; print $des[1]['description'] . "

"; diff --git a/rs_business.php b/rs_business.php index e859cfcc..cfe5831d 100644 --- a/rs_business.php +++ b/rs_business.php @@ -57,19 +57,14 @@ if (AUTO_LOGOUT_MINUTES !== false) $js[] = "js/childnap.js"; xhtml_head(T_("Respondent Selection") . " - " . T_("Business answers"),true,array("include/bootstrap/css/bootstrap.min.css","css/rs.css"), $js); - -print "

" . T_("Sorry to bother you, I have called the wrong number") . "

"; +print "

" . T_("Sorry to bother you, I have called the wrong number") . "

"; print "
- "; + "; $des = $db->GetAll("SELECT description FROM outcome WHERE outcome_id = 16"); - print "

" . T_("End call with outcome:") . "

- + "; diff --git a/rs_callback.php b/rs_callback.php index 0db79427..4c796d08 100644 --- a/rs_callback.php +++ b/rs_callback.php @@ -77,16 +77,12 @@ $sql = "SELECT rs_callback WHERE questionnaire_id = '$questionnaire_id'"; $r = $db->GetRow($sql); -if (!empty($r['rs_callback'])) print "

" . template_replace($r['rs_callback'],$operator_id,$case_id) . "

"; +if (!empty($r['rs_callback'])) print "
" . template_replace($r['rs_callback'],$operator_id,$case_id) . "
"; print "

" . T_("Survey is") . " " . round(limesurvey_percent_complete($case_id),1) . " % " . T_("complete") . "

"; print "
- "; + "; //filter displayed outcomes if ($questionnaire_id){ @@ -96,7 +92,7 @@ print "
if (in_array(8,$outcomes)){ $des = $db->GetAll("SELECT description FROM outcome WHERE outcome_id = 8"); print ""; @@ -104,7 +100,7 @@ print ""; print "
"; diff --git a/rs_intro.php b/rs_intro.php index c74c68f8..e2179dd8 100644 --- a/rs_intro.php +++ b/rs_intro.php @@ -20,11 +20,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * - * @author Adam Zammit - * @copyright Deakin University 2007,2008 + * @author Adam Zammit + * @copyright Australian Consortium for Social and Political Research Inc 2007,2008 * @package queXS * @subpackage user - * @link http://www.deakin.edu.au/dcarf/ queXS was writen for DCARF - Deakin Computer Assisted Research Facility + * @link http://www.acspri.org.au/ queXS was writen for Australian Consortium for Social and Political Research Incorporated (ACSPRI) * @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2 * */ @@ -62,74 +62,101 @@ include ("functions/functions.limesurvey.php"); $js = array("js/popup.js","include/jquery/jquery-1.4.2.min.js","include/jquery-ui/jquery-ui.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/jquery-ui.min.css"), $js); - -//display introduction text - +if (AUTO_LOGOUT_MINUTES !== false) $js[] = "js/childnap.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_intro,rs_project_intro,rs_callback - FROM questionnaire - WHERE questionnaire_id = '$questionnaire_id'"; +if($questionnaire_id && $operator_id){ -$r = $db->GetRow($sql); + xhtml_head(T_("Respondent Selection") . " - " . T_("Introduction"),false,array("include/bootstrap/css/bootstrap.min.css","css/rs.css"), $js);// "include/bootstrap/css/bootstrap-theme.min.css", -print "

". template_replace($r['rs_intro'],$operator_id,$case_id) . "

"; + //display outcomes + $outcomes = $db->GetOne("SELECT q.outcomes FROM `questionnaire` as q WHERE q.questionnaire_id = $questionnaire_id");// + $outcomes = explode(",",$outcomes); + $des = $db->GetAll("SELECT description FROM outcome WHERE outcome_id IN (1,2,3,6,8,16,17,18,30,31)"); + translate_array($des,array("description")); -//display outcomes + print "
+

" . T_("End call with outcome:") . "

"; + print "
" . T_("Not Contacted") . "
+
"; + + print ""; + print "
"; + + print "

" . T_("Respondent Selection") . " - " . T_("Introduction") . "

"; + //display introduction text + $sql = "SELECT rs_intro,rs_project_intro,rs_callback + FROM questionnaire + WHERE questionnaire_id = '$questionnaire_id'"; + + $r = $db->GetRow($sql); + if (!empty($r['rs_intro'])) print "
" . template_replace($r['rs_intro'],$operator_id,$case_id) . "
"; + print "
"; + + // display continue + print "
"; + print "

" . T_("Yes - Continue") . "

"; + print "
"; -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 - ?> -

- -

- -

- -

- -

-

-

-

-

-

-

-

-

- - * @copyright Australian Consortium for Social and Political Research Inc 2007,2008 - * @package queXS - * @subpackage user - * @link http://www.acspri.org.au/ queXS was writen for Australian Consortium for Social and Political Research Incorporated (ACSPRI) - * @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"); - -/** - * Authentication - */ -require ("auth-interviewer.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/jquery-1.4.2.min.js","include/jquery-ui/jquery-ui.min.js"); - -if (AUTO_LOGOUT_MINUTES !== false) -{ - $js[] = "js/childnap.js"; -} - - -xhtml_head(T_("Respondent Selection - Introduction"),false,array("include/bootstrap/css/bootstrap.min.css","css/rs.css","css/rs.css","include/jquery-ui/jquery-ui.min.css"), $js); - -$operator_id = get_operator_id(); -$case_id = get_case_id($operator_id); -$questionnaire_id = get_questionnaire_id($operator_id); - -//display outcomes -?> -
-

-
    -

-
    -

    -

    -

- -
-GetRow($sql); -print "
"; -print "

". template_replace($r['rs_intro'],$operator_id,$case_id) . "

"; -print "
"; - -// display continue -print "
"; -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 - ?> -

- -

- -

- -

- "; - -xhtml_foot(); - - -?> diff --git a/rs_project_intro.php b/rs_project_intro.php index 7a2704eb..2d70c166 100644 --- a/rs_project_intro.php +++ b/rs_project_intro.php @@ -73,15 +73,10 @@ $sql = "SELECT rs_project_intro $r = $db->GetRow($sql); -if (!empty($r['rs_project_intro'])) print "

" . template_replace($r['rs_project_intro'],$operator_id,$case_id) . "

"; +if (!empty($r['rs_project_intro'])) print "
" . template_replace($r['rs_project_intro'],$operator_id,$case_id) . "
"; print "
- "; + "; if ($questionnaire_id){ //filter displayed outcomes @@ -92,31 +87,31 @@ print "
translate_array($des,array("description")); print ""; } - print ""; + print ""; print "
";