2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

updated questionnairelist.php and new.php

TOTAL NEW look, crosslinks,

modified input types, added restrictions, collapse CKeditor textarea, "delete" protection 

switched to bs-toggle  
updated js/custom.js
This commit is contained in:
Alex
2015-03-23 12:46:28 +03:00
parent e3db2c8abf
commit 80f78fb3cb
3 changed files with 459 additions and 261 deletions

View File

@@ -1,231 +1,378 @@
<?php
/**
* Create a queXS questionnaire and link it to a LimeSurvey 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 <adam.zammit@deakin.edu.au>
* @copyright Deakin University 2007,2008
* @package queXS
* @subpackage admin
* @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");
/**
* Input functions
*/
include("../functions/functions.input.php");
/**
* CKEditor
*/
include("../include/ckeditor/ckeditor.php");
global $db;
xhtml_head(T_("New: Create new questionnaire"),true,false,array("../js/new.js"));
if (isset($_POST['import_file']))
{
//file has been submitted
global $db;
$ras =0;
$rws = 0;
$testing = 0;
$referral = 0;
$rs = 0;
$lime_sid = 0;
$respsc = 0;
$lime_rs_sid = "NULL";
if (isset($_POST['ras'])) $ras = 1;
if (isset($_POST['rws'])) $rws = 1;
if (isset($_POST['testing'])) $testing = 1;
if (isset($_POST['respsc'])) $respsc = 1;
if (isset($_POST['referral'])) $respsc = 1;
if ($_POST['selectrs'] != "none") $rs = 1;
$name = $db->qstr($_POST['description']);
$rs_intro = $db->qstr(html_entity_decode($_POST['rs_intro'],ENT_QUOTES,'UTF-8'));
$rs_project_intro = $db->qstr(html_entity_decode($_POST['rs_project_intro'],ENT_QUOTES,'UTF-8'));
$rs_project_end = $db->qstr(html_entity_decode($_POST['rs_project_end'],ENT_QUOTES,'UTF-8'));
$rs_callback = $db->qstr(html_entity_decode($_POST['rs_callback'],ENT_QUOTES,'UTF-8'));
$rs_answeringmachine = $db->qstr(html_entity_decode($_POST['rs_answeringmachine'],ENT_QUOTES,'UTF-8'));
$info = $db->qstr(html_entity_decode($_POST['info'],ENT_QUOTES,'UTF-8'));
//use existing lime instrument
$lime_sid = bigintval($_POST['select']);
if (is_numeric($_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)
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)";
$rs = $db->Execute($sql);
if ($rs)
{
$qid = $db->Insert_ID();
if ($respsc == 1)
{
$lime_mode = $db->qstr($_POST['lime_mode']);
$lime_template = $db->qstr($_POST['lime_template']);
$lime_endurl = $db->qstr($_POST['lime_endurl']);
$sql = "UPDATE questionnaire
SET lime_mode = $lime_mode, lime_template = $lime_template, lime_endurl = $lime_endurl
WHERE questionnaire_id = $qid";
$db->Execute($sql);
}
print "<p>" . T_("Successfully inserted") . " $name " . T_("as questionnaire") . " $qid, " . T_("linked to") . " $lime_sid</p>";
}else
{
print "<p>" . T_("Error: Failed to insert questionnaire") . "</p>";
}
}
//create new questionnaire
?>
<form enctype="multipart/form-data" action="" method="post">
<p><input type="hidden" name="MAX_FILE_SIZE" value="1000000000" /></p>
<p><?php echo T_("Name for questionnaire:"); ?> <input type="text" name="description"/></p>
<p><?php echo T_("Select limesurvey instrument:");
$sql = "SELECT s.sid as sid, sl.surveyls_title AS title
FROM " . LIME_PREFIX . "surveys AS s
LEFT JOIN " . LIME_PREFIX . "surveys_languagesettings AS sl ON ( s.sid = sl.surveyls_survey_id)
WHERE s.active = 'Y'
GROUP BY s.sid";
$surveys = $db->GetAll($sql);
if (!empty($surveys))
{
print "<select name='select'>";
foreach($surveys as $s)
{
print "<option value=\"{$s['sid']}\">" . T_("Existing instrument:") . " {$s['title']}</option>";
}
print "</select>";
}
else
{
print "<a href='" . LIME_URL ."admin/admin.php?action=newsurvey'>" . T_("Create an instrument in Limesurvey") ."</a>";
}
?></p>
<p><?php echo T_("Respondent selection type:"); ?>
<select name="selectrs" onchange="if(this.value=='old') show(this,'rstext'); else hide(this,'rstext');"><option value="none"><?php echo T_("No respondent selection (go straight to questionnaire)"); ?></option><option value="old"><?php echo T_("Use basic respondent selection text (below)"); ?></option>
<?php
$sql = "SELECT s.sid as sid, sl.surveyls_title AS title
FROM " . LIME_PREFIX . "surveys AS s
LEFT JOIN " . LIME_PREFIX . "surveys_languagesettings AS sl ON ( s.sid = sl.surveyls_survey_id)
WHERE s.active = 'Y'";
$surveys = $db->GetAll($sql);
if (!empty($surveys))
{
foreach($surveys as $s)
{
print "<option value=\"{$s['sid']}\">" . T_("Existing instrument:") . " {$s['title']}</option>";
}
}
$CKEditor = new CKEditor();
$CKEditor->basePath = "../include/ckeditor/";
$ckeditorConfig = array("toolbar" => array(array("tokens","-","Source"),
array("Cut","Copy","Paste","PasteText","PasteFromWord","-","Print","SpellChecker"),
array("Undo","Redo","-","Find","Replace","-","SelectAll","RemoveFormat"),
"/",
array("Bold","Italic","Underline","Strike","-","Subscript","Superscript"),
array("NumberedList","BulletedList","-","Outdent","Indent","Blockquote"),
array('JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'),
array('BidiLtr', 'BidiRtl'),
array('Link','Unlink','Anchor'),
array('Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'),
"/",
array('Styles','Format','Font','FontSize'),
array('TextColor','BGColor'),
array('About')),
"extraPlugins" => "tokens");
?></select></p>
<p><?php echo T_("Restrict appointments to shifts?"); ?> <input name="ras" type="checkbox" checked="checked"/></p>
<p><?php echo T_("Restrict work to shifts?"); ?> <input name="rws" type="checkbox" checked="checked"/></p>
<p><?php echo T_("Questionnaire for testing only?"); ?> <input name="testing" type="checkbox"/></p>
<p><?php echo T_("Allow operators to generate referrals?"); ?> <input name="referral" type="checkbox"/></p>
<p><?php echo T_("Allow for respondent self completion via email invitation?"); ?> <input name="respsc" type="checkbox" onchange="if(this.checked==true) show(this,'limesc'); else hide(this,'limesc');" /></p>
<div id='limesc' style='display:none;'>
<p><?php echo T_("Questionnaire display mode for respondent");?>: <select name="lime_mode"><option value="survey"><?php echo T_("All in one"); ?></option><option value="question"><?php echo T_("Question by question"); ?></option><option value="group"><?php echo T_("Group at a time"); ?></option></select></p>
<p><?php echo T_("Limesurvey template for respondent");?>: <select name="lime_template">
<?php
if ($handle = opendir(dirname(__FILE__)."/../include/limesurvey/templates")) {
while (false !== ($entry = readdir($handle))) {
if ($entry != "." && $entry != ".." && is_dir(dirname(__FILE__)."/../include/limesurvey/templates/" . $entry)){
echo "<option value=\"$entry\">$entry</option>";
}
}
closedir($handle);
}
?>
</select></p>
<p><?php echo T_("URL to forward respondents on self completion (required)");?>: <input name="lime_endurl" type="text" value="http://www.acspri.org.au/"/></p>
</div>
<div id='rstext' style='display:none;'>
<p><?php echo T_("Respondent selection introduction:"); echo $CKEditor->editor("rs_intro","",$ckeditorConfig);?></p>
<p><?php echo T_("Respondent selection project introduction:"); echo $CKEditor->editor("rs_project_intro","",$ckeditorConfig);?></p>
<p><?php echo T_("Respondent selection callback (already started questionnaire):"); echo $CKEditor->editor("rs_callback","",$ckeditorConfig);?> </p>
<p><?php echo T_("Message to leave on an answering machine:"); echo $CKEditor->editor("rs_answeringmachine","",$ckeditorConfig);?> </p>
</div>
<p><?php echo T_("Project end text (thank you screen):");echo $CKEditor->editor("rs_project_end","",$ckeditorConfig); ?></p>
<p><?php echo T_("Project information for interviewers/operators:");echo $CKEditor->editor("info","",$ckeditorConfig);?></p>
<p><input type="submit" name="import_file" value="<?php echo T_("Create Questionnaire"); ?>"/></p>
</form>
<?php
xhtml_foot();
?>
<?php
/**
* Configuration file
*/
include ("../config.inc.php");
/**
* Database file
*/
include ("../db.inc.php");
/**
* XHTML functions
*/
include ("../functions/functions.xhtml.php");
/**
* Input functions
*/
include("../functions/functions.input.php");
$css = array(
"../include/bootstrap-3.3.2/css/bootstrap.min.css",
"../include/bootstrap-3.3.2/css/bootstrap-theme.min.css",
"../include/font-awesome-4.3.0/css/font-awesome.css",
"../include/bootstrap-toggle/css/bootstrap-toggle.min.css",
"../css/custom.css"
);
$js_head = array(
"../js/jquery-2.1.3.min.js",
"../include/bootstrap-3.3.2/js/bootstrap.min.js",
"../include/bootstrap-toggle/js/bootstrap-toggle.min.js",
);
$js_foot = array(
"../js/new.js",
"../js/custom.js"
);
global $db;
xhtml_head(T_("Create a new questionnaire"),true,$css,$js_head);
if (isset($_POST['import_file']))
{
//file has been submitted
$ras =0;
$rws = 0;
$testing = 0;
$referral = 0;
$rs = 0;
$lime_sid = 0;
$respsc = 0;
$lime_rs_sid = "NULL";
if (isset($_POST['ras'])) $ras = 1;
if (isset($_POST['rws'])) $rws = 1;
if (isset($_POST['testing'])) $testing = 1;
if (isset($_POST['respsc'])) $respsc = 1;
if (isset($_POST['referral'])) $respsc = 1;
if ($_POST['selectrs'] != "none") $rs = 1;
$name = $db->qstr($_POST['description']);
$rs_intro = $db->qstr(html_entity_decode($_POST['rs_intro'],ENT_QUOTES,'UTF-8'));
$rs_project_intro = $db->qstr(html_entity_decode($_POST['rs_project_intro'],ENT_QUOTES,'UTF-8'));
$rs_project_end = $db->qstr(html_entity_decode($_POST['rs_project_end'],ENT_QUOTES,'UTF-8'));
$rs_callback = $db->qstr(html_entity_decode($_POST['rs_callback'],ENT_QUOTES,'UTF-8'));
$rs_answeringmachine = $db->qstr(html_entity_decode($_POST['rs_answeringmachine'],ENT_QUOTES,'UTF-8'));
$info = $db->qstr(html_entity_decode($_POST['info'],ENT_QUOTES,'UTF-8'));
//use existing lime instrument
$lime_sid = bigintval($_POST['select']);
if (is_numeric($_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)
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)";
$rs = $db->Execute($sql);
if ($rs)
{
$qid = $db->Insert_ID();
if ($respsc == 1)
{
$lime_mode = $db->qstr($_POST['lime_mode']);
$lime_template = $db->qstr($_POST['lime_template']);
$lime_endurl = $db->qstr($_POST['lime_endurl']);
$sql = "UPDATE questionnaire
SET lime_mode = $lime_mode, lime_template = $lime_template, lime_endurl = $lime_endurl
WHERE questionnaire_id = $qid";
$db->Execute($sql);
}
$cl = info;
$message = T_("Successfully inserted") . "&ensp;" . T_("with ID") . "&ensp; $qid, </h4><h4>" . T_("linked to survey") . "&ensp; $lime_sid ";
}
else{
$cl = danger;
$message = T_("Error: Failed to insert questionnaire");
}
?>
<script type="text/javascript" >
$(function() {
$('#modal-confirm').modal('show');
});
</script>
<?php
$_POST['import_file'] = false;
}
?>
<!-- Modal window confirmation start -->
<div class="modal fade " id="modal-confirm">
<div class="modal-dialog ">
<div class="modal-content ">
<div class="modal-header" style="border-bottom:none;">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-header"><?php echo T_("Questionnaire");?>&emsp; <strong class="text-<?php echo $cl;?>"> <?php echo $name; ?></strong></h4>
</div>
<div class="modal-body ">
<div class="alert alert-<?php echo $cl;?> text-center" role="alert">
<h4> <?php print $message ;?></h4>
</div>
</div>
<div class="modal-footer" style="borfer-top:none">
<button class="btn btn-default pull-left" data-dismiss="modal" style="width: 250px;" ><i class="fa fa-check fa-2x pull-right text-<?php echo $cl;?>"></i>&emsp;<?php echo T_("Create another ?");?><br><?php echo T_("Questionnaire");?></button> &emsp;
<a href="questionnairelist.php" class="btn btn-default pull-right" style="width: 250px;" ><i class="fa fa-list text-<?php echo $cl;?> fa-2x pull-left"></i><?php echo T_("No, Thank you, go to");?>&ensp;<br><?php echo T_("Questionnaire management");?></a>
</div>
</div>
</div>
</div><!-- /modal end -->
<!-- create new questionnaire -->
<body>
<a href="questionnairelist.php" class="btn btn-default pull-left" ><i class="fa fa-list text-primary"></i>&emsp;<?php echo T_("Go to");?>&ensp;<?php echo T_("Questionnaire management");?> </a>
<form enctype="multipart/form-data" action="" method="post" class="form-horizontal col-lg-12" >
<input type="hidden" name="MAX_FILE_SIZE" value="1000000000" />
<div class="form-group">
<label class="col-lg-4 control-label" ><?php echo T_("Name for questionnaire:"); ?> </label>
<div class="col-lg-4">
<input type="text" name="description" class="form-control" required placeholder="<?php echo T_("Enter New questionnaire name..");?>" title="<?php echo T_("Name for questionnaire:") ; ?>" />
</div>
</div>
<?php
$sql = "SELECT s.sid as sid, sl.surveyls_title AS title
FROM " . LIME_PREFIX . "surveys AS s
LEFT JOIN " . LIME_PREFIX . "surveys_languagesettings AS sl ON ( s.sid = sl.surveyls_survey_id)
WHERE s.active = 'Y'
GROUP BY s.sid";
$surveys = $db->GetAll($sql);
?>
<div class="form-group row">
<label class="col-sm-4 control-label" ><?php echo T_("Select limesurvey instrument:");?> </label>
<div class='col-sm-4'>
<?php if (!empty($surveys)){?>
<select name="select" class="form-control">
<?php foreach($surveys as $s){?>
<option value="<?php echo $s['sid'];?>"><?php echo T_("Existing instrument:"), "&ensp;", $s['title'] ;?></option><?php } ?>
</select>
<?php } else { ?>
<a class="btn btn-lime" href="<?php echo LIME_URL ;?>admin/admin.php?action=newsurvey"><i class="fa fa-lemon-o text-danger"></i>&emsp;<?php echo T_("Create an instrument in Limesurvey") ;?></a> <?php } ?>
</div>
<div class='col-sm-4'>
<strong><?php echo T_("or") ;?>&emsp;</strong>
<a class="btn btn-lime" href="<?php echo LIME_URL ;?>admin/admin.php?action=newsurvey"><i class="fa fa-lemon-o text-danger"></i>&emsp;<?php echo T_("Create an instrument in Limesurvey") ;?></a>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label" ><?php echo T_("Respondent selection type:"); ?> </label>
<div class="col-sm-4">
<select class="form-control" name="selectrs" id="selectrs" onchange="if(this.value == 'old') show(this,'rstext'); else hide(this,'rstext')">
<option value="none"><?php echo T_("No respondent selection (go straight to questionnaire)"); ?></option>
<option value="old" ><?php echo T_("Use basic respondent selection text (below)"); ?></option>
<?php
$sql = "SELECT s.sid as sid, sl.surveyls_title AS title
FROM " . LIME_PREFIX . "surveys AS s
LEFT JOIN " . LIME_PREFIX . "surveys_languagesettings AS sl ON ( s.sid = sl.surveyls_survey_id)
WHERE s.active = 'Y'";
$surveys = $db->GetAll($sql);
if (!empty($surveys)){ foreach($surveys as $s){ ?>
<option value="<?php echo $s['sid'];?>"><?php echo T_("Existing instrument:") ,"&ensp;", $s['title'] ;?></option>
<?php } } ?>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label" ><?php echo T_("Restrict appointments to shifts?"); ?></label>
<div class="col-sm-4" style="height: 30px;">
<input name="ras" type="checkbox" checked="checked" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" data-width="80" />
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label" ><?php echo T_("Restrict work to shifts?"); ?></label>
<div class="col-sm-4"style="height: 30px;">
<input name="rws" type="checkbox" checked="checked" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" data-width="80"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label" ><?php echo T_("Questionnaire for testing only?"); ?></label>
<div class="col-sm-4"style="height: 30px;">
<input name="testing" type="checkbox" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" data-onstyle="danger" data-width="80" />
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label" ><?php echo T_("Allow operators to generate referrals?"); ?></label>
<div class="col-sm-4"style="height: 30px;">
<input name="referral" type="checkbox" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" data-width="80"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label" ><?php echo T_("Allow for respondent self completion via email invitation?"); ?> </label>
<div class="col-sm-4"style="height: 30px;">
<input name="respsc" type="checkbox" onchange="if(this.checked==true) show(this,'limesc'); else hide(this,'limesc');" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" data-width="80"/>
</div>
</div>
<div id="limesc" style="display:none" >
<div class="form-group">
<label class="col-sm-4 control-label" ><?php echo T_("Questionnaire display mode for respondent");?>: </label>
<div class="col-sm-4">
<select class="form-control" name="lime_mode">
<option value="survey"><?php echo T_("All in one"); ?></option>
<option value="question"><?php echo T_("Question by question"); ?></option>
<option value="group"><?php echo T_("Group at a time"); ?></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label" ><?php echo T_("Limesurvey template for respondent");?>: </label>
<div class="col-sm-4">
<select class="form-control" name="lime_template">
<?php
if ($handle = opendir(dirname(__FILE__)."/../include/limesurvey/templates")) {
while (false !== ($entry = readdir($handle))) {
if ($entry != "." && $entry != ".." && is_dir(dirname(__FILE__)."/../include/limesurvey/templates/" . $entry)){
echo "<option value=\"$entry\">$entry</option>";
}
}
closedir($handle);
}
?>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label text-danger" ><?php echo T_("URL to forward respondents on self completion (required)");?>: </label>
<div class="col-sm-4">
<input class="form-control" name="lime_endurl" type="url" value="<?php print SITE_URL ;?>" />
</div>
</div>
</div>
<?php
/* CKEditor */
include("../include/ckeditor/ckeditor.php");
$CKEditor = new CKEditor();
$CKEditor->basePath = "../include/ckeditor/";
$ckeditorConfig = array("toolbar" => array(array("tokens","-","Source"),
array("Cut","Copy","Paste","PasteText","PasteFromWord","-","Print","SpellChecker"),
array("Undo","Redo","-","Find","Replace","-","SelectAll","RemoveFormat"),
array('Link','Unlink','Anchor'),
array('Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'),
array('About'),
"/",
array("Bold","Italic","Underline","Strike","-","Subscript","Superscript"),
array("NumberedList","BulletedList","-","Outdent","Indent","Blockquote"),
array('JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'),
array('BidiLtr', 'BidiRtl'),
array('Styles','Format','Font','FontSize'),
array('TextColor','BGColor')),
"extraPlugins" => "tokens");
?>
<div id="rstext" class=" " style="display:none ">
<div class="panel panel-default" >
<div class="panel-heading">
<i class="fa fa-fw fa-2x wminimize fa-chevron-circle-up text-primary pull-left" data-toggle="tooltip" title="<?php echo T_("Expand/Collapse");?>" style="margin-top: -5px;"></i>
<h3 class="panel-title text-primary "><?php echo T_("Respondent selection introduction:");?></h3>
</div>
<div class="content">
<?php echo $CKEditor->editor("rs_intro","",$ckeditorConfig);?>
</div>
</div>
<div class="panel panel-default" >
<div class="panel-heading">
<i class="fa fa-fw fa-2x wminimize fa-chevron-circle-up text-primary pull-left" data-toggle="tooltip" title="<?php echo T_("Expand/Collapse");?>" style="margin-top: -5px;"></i>
<h3 class="panel-title text-primary "><?php echo T_("Respondent selection project introduction:");?></h3>
</div>
<div class="content">
<?php echo $CKEditor->editor("rs_project_intro","",$ckeditorConfig);?>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-fw fa-2x wminimize fa-chevron-circle-up text-primary pull-left" data-toggle="tooltip" title="<?php echo T_("Expand/Collapse");?>" style="margin-top: -5px;"></i>
<h3 class="panel-title text-primary"><?php echo T_("Respondent selection callback (already started questionnaire):");?></h3>
</div>
<div class="content">
<?php echo $CKEditor->editor("rs_callback","",$ckeditorConfig);?>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-fw fa-2x wminimize fa-chevron-circle-up text-primary pull-left" data-toggle="tooltip" title="<?php echo T_("Expand/Collapse");?>" style="margin-top: -5px;"></i>
<h3 class="panel-title "><?php echo T_("Message to leave on an answering machine:");?></h3>
</div>
<div class="content">
<?php echo $CKEditor->editor("rs_answeringmachine","",$ckeditorConfig);?>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-fw fa-2x wminimize fa-chevron-circle-up text-primary pull-left" data-toggle="tooltip" title="<?php echo T_("Expand/Collapse");?>" style="margin-top: -5px;"></i>
<h3 class="panel-title "><?php echo T_("Project end text (thank you screen):");?></h3>
</div>
<div class="content" >
<?php echo $CKEditor->editor("rs_project_end","",$ckeditorConfig); ?>
</div>
</div>
<div class="panel panel-default ">
<div class="panel-heading">
<i class="fa fa-fw fa-2x wminimize fa-chevron-circle-up text-primary pull-left" data-toggle="tooltip" title="<?php echo T_("Expand/Collapse");?>" style="margin-top: -5px;"></i>
<h3 class="panel-title"><?php echo T_("Project information for interviewers/operators:");?></h3>
</div>
<div class="content">
<?php echo $CKEditor->editor("info","",$ckeditorConfig);?>
</div>
</div>
<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>&emsp;<?php echo T_("Go to");?>&ensp;<?php echo T_("Questionnaire management");?></a>
</div>
<div class="col-sm-4 ">
<button type="submit" class="btn btn-default pull-right" name="import_file" ><i class="fa fa-check-square-o fa-lg text-primary"></i>&emsp;<?php echo T_("Create Questionnaire"); ?></button>
</div>
</div>
</form>
<?php
xhtml_foot($js_foot);//
?>

View File

@@ -339,29 +339,29 @@ if (isset($_GET['modify']))
<div class="col-sm-2"><?php echo "<a class='btn btn-default btn-lime pull-right' href='" . LIME_URL . "admin/admin.php?sid={$rs['lime_sid']}'><i class='fa fa-edit' style='color:blue;'></i>&emsp;" . T_("Edit instrument in Limesurvey") . "&emsp;</a>"; ?> </div>
</div>
<form action="?modify=<?php echo $questionnaire_id; ?>" method="post" class="form-horizontal col-sm-12">
<form action="?modify=<?php echo $questionnaire_id; ?>" method="post" class="form-horizontal col-sm-12 form-group ">
<div class="form-group">
<label class="col-sm-4 control-label" ><?php echo T_("Edit"),"&ensp;", T_("Name for questionnaire:"); ?> </label>
<div class="col-sm-4"><input type="text" name="description" class="form-control" value="<?php echo $rs['description']; ?>" label="<?php echo T_("Name for questionnaire:") ; ?> "/></div>
<div class="col-sm-4"><input type="text" name="description" class="form-control" required value="<?php echo $rs['description']; ?>" label="<?php echo T_("Name for questionnaire:") ; ?> "/></div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label" ><?php echo T_("Restrict appointments to shifts?"); ?> </label>
<div class="col-sm-4" style="height: 30px;"><input name="ras" type="checkbox" <?php echo $ras; ?> data-toggle="toggle" data-on="<?php echo T_("YES"); ?>" data-off="<?php echo T_("NO"); ?>"/> </div>
<div class="col-sm-4" style="height: 30px;"><input name="ras" type="checkbox" <?php echo $ras; ?> data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" data-width="80"/> </div>
</div>
<div class="form-group"><label class="col-sm-4 control-label" ><?php echo T_("Restrict work to shifts?"); ?> </label>
<div class="col-sm-4" style="height: 30px;" ><input name="rws" type="checkbox" <?php echo $rws; ?> data-toggle="toggle" data-on="<?php echo T_("YES"); ?>" data-off="<?php echo T_("NO"); ?>"/></div>
<div class="col-sm-4" style="height: 30px;" ><input name="rws" type="checkbox" <?php echo $rws; ?> data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" data-width="80"/></div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label" ><?php echo T_("Questionnaire for testing only?"); ?> </label>
<div class="col-sm-4" style="height: 30px;" ><input name="testing" type="checkbox" disabled="true" data-toggle="toggle" data-on="<?php echo T_("YES"); ?>" data-off="<?php echo T_("NO"); ?>" <?php echo $testing; ?> data-onstyle="danger" /></div>
<div class="col-sm-4" style="height: 30px;" ><input name="testing" type="checkbox" disabled="true" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" <?php echo $testing; ?> data-onstyle="danger" data-width="80"/></div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label" ><?php echo T_("Allow operators to generate referrals?"); ?></label>
<div class="col-sm-4" style="height: 30px;"> <input name="referral" type="checkbox" <?php echo $referral; ?> data-toggle="toggle" data-on="<?php echo T_("YES"); ?>" data-off="<?php echo T_("NO"); ?>"/></div>
<div class="col-sm-4" style="height: 30px;"> <input name="referral" type="checkbox" <?php echo $referral; ?> data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" data-width="80"/></div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label" ><?php echo T_("Allow for respondent self completion via email invitation?"); ?> </label>
<div class="col-sm-4" style="height: 30px;"><input name="respsc" id="respsc" type="checkbox" <?php echo $rsc ?> onchange="if(this.checked==true) show(this,'limesc'); else hide(this,'limesc');" data-toggle="toggle" data-on="<?php echo T_("YES"); ?>" data-off="<?php echo T_("NO"); ?>"/></div>
<div class="col-sm-4" style="height: 30px;"><input name="respsc" id="respsc" type="checkbox" <?php echo $rsc ?> onchange="if(this.checked==true) show(this,'limesc'); else hide(this,'limesc');" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" data-width="80"/></div>
</div>
<div id="limesc" <?php echo $rscd; ?> >
<div class="form-group">
@@ -396,23 +396,82 @@ if (isset($_GET['modify']))
<div class="form-group">
<label class="col-sm-4 control-label text-danger" ><?php echo T_("URL to forward respondents on self completion (required)");?>: </label>
<div class="col-sm-4">
<input class="form-control" name="lime_endurl" type="text" value="<?php echo $rs['lime_endurl']; ?>"/>
<input class="form-control" name="lime_endurl" type="url" required placeholder="<?php print SITE_URL ;?>" value="<?php echo $rs['lime_endurl']; ?>"/>
</div>
</div>
</div>
<?php
if ($rs['respondent_selection'] == 1 && empty($rs['lime_rs_sid'])) {
echo "<p><h4 style='text-align:center;' >" . T_("Respondent selection introduction:") . "</h4>"; echo $CKEditor->editor("rs_intro",$rs['rs_intro'],$ckeditorConfig);
echo "</p><p><h4 style='text-align:center;' >" . T_("Respondent selection project introduction:") . "</h4>"; echo $CKEditor->editor("rs_project_intro",$rs['rs_project_intro'],$ckeditorConfig);
echo "</p><p><h4 style='text-align:center;' >" . T_("Respondent selection callback (already started questionnaire):") . "</h4>"; echo $CKEditor->editor("rs_callback",$rs['rs_callback'],$ckeditorConfig);
echo "</p><p><h4 style='text-align:center;' >" . T_("Message to leave on an answering machine:") . "</h4>"; echo $CKEditor->editor("rs_answeringmachine",$rs['rs_answeringmachine'],$ckeditorConfig);
echo "</p>"; }
else if (!empty($rs['lime_rs_sid'])) { echo "<p><a href='" . LIME_URL . "admin/admin.php?sid={$rs['lime_rs_sid']}'>" . T_("Edit respondent selection instrument in Limesurvey") . "</a></p>"; }
echo "<p><h4 style='text-align:center;' >" . T_("Project end text (thank you screen):") . "</h4>"; echo $CKEditor->editor("rs_project_end",$rs['rs_project_end'],$ckeditorConfig);
echo "</p><p><h4 style='text-align:center;' >" . T_("Project information for interviewers/operators:") . "</h4>"; echo $CKEditor->editor("info",$rs['info'],$ckeditorConfig);
echo "</p>";
if ($rs['respondent_selection'] == 1 && empty($rs['lime_rs_sid'])) { ?>
<div class="panel panel-default" >
<div class="panel-heading">
<i class="fa fa-fw fa-2x wminimize fa-chevron-circle-up text-primary pull-left" data-toggle="tooltip" title="<?php echo T_("Expand/Collapse");?>" style="margin-top: -5px;"></i>
<h3 class="panel-title text-primary "><?php echo T_("Respondent selection introduction:");?></h3>
</div>
<div class="content">
<?php echo $CKEditor->editor("rs_intro",$rs['rs_intro'],$ckeditorConfig);?>
</div>
</div>
<div class="panel panel-default" >
<div class="panel-heading">
<i class="fa fa-fw fa-2x wminimize fa-chevron-circle-up text-primary pull-left" data-toggle="tooltip" title="<?php echo T_("Expand/Collapse");?>" style="margin-top: -5px;"></i>
<h3 class="panel-title text-primary "><?php echo T_("Respondent selection project introduction:");?></h3>
</div>
<div class="content">
<?php echo $CKEditor->editor("rs_project_intro",$rs['rs_project_intro'],$ckeditorConfig);?>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-fw fa-2x wminimize fa-chevron-circle-up text-primary pull-left" data-toggle="tooltip" title="<?php echo T_("Expand/Collapse");?>" style="margin-top: -5px;"></i>
<h3 class="panel-title text-primary"><?php echo T_("Respondent selection callback (already started questionnaire):");?></h3>
</div>
<div class="content">
<?php echo $CKEditor->editor("rs_callback",$rs['rs_callback'],$ckeditorConfig);?>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-fw fa-2x wminimize fa-chevron-circle-up text-primary pull-left" data-toggle="tooltip" title="<?php echo T_("Expand/Collapse");?>" style="margin-top: -5px;"></i>
<h3 class="panel-title "><?php echo T_("Message to leave on an answering machine:");?></h3>
</div>
<div class="content">
<?php echo $CKEditor->editor("rs_answeringmachine",$rs['rs_answeringmachine'],$ckeditorConfig);?>
</div>
</div>
<?php
}
else if (!empty($rs['lime_rs_sid'])) {
echo "<div class='well text-center'><a href='" . LIME_URL . "admin/admin.php?sid={$rs['lime_rs_sid']}'>" . T_("Edit respondent selection instrument in Limesurvey") . "</a></div>"; }
?>
<p><a href="questionnairelist.php" class="btn btn-default"><i class="fa fa-chevron-left fa-lg" style="color:blue;"></i>&emsp;<?php echo T_("Go back") ; ?></a><input type="submit" class="btn btn-primary col-sm-offset-4" name="update" value="<?php echo T_("Update Questionnaire"); ?>"/></p>
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-fw fa-2x wminimize fa-chevron-circle-up text-primary pull-left" data-toggle="tooltip" title="<?php echo T_("Expand/Collapse");?>" style="margin-top: -5px;"></i>
<h3 class="panel-title "><?php echo T_("Project end text (thank you screen):");?></h3>
</div>
<div class="content" >
<?php echo $CKEditor->editor("rs_project_end",$rs['rs_project_end'],$ckeditorConfig);?>
</div>
</div>
<div class="panel panel-default ">
<div class="panel-heading">
<i class="fa fa-fw fa-2x wminimize fa-chevron-circle-up text-primary pull-left" data-toggle="tooltip" title="<?php echo T_("Expand/Collapse");?>" style="margin-top: -5px;"></i>
<h3 class="panel-title"><?php echo T_("Project information for interviewers/operators:");?></h3>
</div>
<div class="content">
<?php echo $CKEditor->editor("info",$rs['info'],$ckeditorConfig);?>
</div>
</div>
<a href="questionnairelist.php" class="btn btn-default"><i class="fa fa-chevron-left fa-lg" style="color:blue;"></i>&emsp;<?php echo T_("Go back") ; ?></a>
<input type="submit" class="btn btn-primary col-sm-offset-4" name="update" value="<?php echo T_("Update Questionnaire"); ?>"/>
</form>
<?php
}

View File

@@ -1,7 +1,7 @@
/* Widget minimize */
$('.wminimize').click(function(e){
e.preventDefault();
var $wcontent = $(this).parent().parent().next('.content');
var $wcontent = $(this).parent().next('.content');
if($wcontent.is(':visible'))
{
$(this).removeClass('fa-chevron-circle-up text-primary').addClass('fa-chevron-circle-down text-danger');
@@ -35,7 +35,7 @@ $('body,html').animate({scrollTop: 0}, 500);
/* panel close
$('.pclose').click(function(e){
e.preventDefault();
var $pbox = $(this).parent().parent().parent();
var $pbox = $(this).parent().parent();
$pbox.hide(100);
});*/
@@ -54,12 +54,4 @@ pickDate: false
/* Modal fix
$('.modal').appendTo($('body'));*/
/*Bootstrap Data table, tooltip and bs switch init */
$('[data-toggle="tooltip"]').tooltip();
/*
$('[switch="yes"]').bootstrapSwitch();
$('#bs-table').bdt();*/
//alert ("custom js OK"); //test js
$('[data-toggle="tooltip"]').tooltip();