mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
Fixes lp:1480880 - disable create new questionnaire if no active Limesurvey available
Also some other comment / localisation fixes
This commit is contained in:
@@ -46,7 +46,7 @@ include ("../functions/functions.xhtml.php");
|
||||
|
||||
$css = array(
|
||||
"../include/bootstrap/css/bootstrap.min.css",
|
||||
//"../include/bootstrap-3.3.2/css/bootstrap-theme.min.css",
|
||||
//"../include/bootstrap/css/bootstrap-theme.min.css",
|
||||
"../include/clockpicker/dist/bootstrap-clockpicker.min.css",
|
||||
"../css/custom.css"
|
||||
);
|
||||
|
||||
@@ -46,7 +46,7 @@ include ("../functions/functions.xhtml.php");
|
||||
|
||||
$css = array(
|
||||
"../include/bootstrap/css/bootstrap.min.css",
|
||||
//"../include/bootstrap-3.3.2/css/bootstrap-theme.min.css",
|
||||
//"../include/bootstrap/css/bootstrap-theme.min.css",
|
||||
//"../include/font-awesome/css/font-awesome.css",
|
||||
"../include/clockpicker/dist/bootstrap-clockpicker.min.css",
|
||||
"../css/custom.css"
|
||||
|
||||
@@ -144,8 +144,16 @@ $_POST['import_file'] = false;
|
||||
|
||||
|
||||
<a href="questionnairelist.php" class="btn btn-default pull-left" ><i class="fa fa-list text-primary"></i> <?php echo T_("Go to");?> <?php echo T_("Questionnaire management");?> </a>
|
||||
|
||||
|
||||
<?php
|
||||
$sql = "SELECT s.sid as sid, CONCAT(s.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)){?>
|
||||
|
||||
<form enctype="multipart/form-data" action="" method="post" class="form-horizontal col-lg-12" >
|
||||
|
||||
@@ -157,25 +165,14 @@ $_POST['import_file'] = false;
|
||||
</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:"), " ", $s['title'] ;?></option><?php } ?>
|
||||
<option value="<?php echo $s['sid'];?>"><?php echo T_("Survey"), ": ", $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> <?php echo T_("Create an instrument in Limesurvey") ;?></a> <?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class='col-sm-4'>
|
||||
<strong><?php echo T_("or") ;?> </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> <?php echo T_("Create an instrument in Limesurvey") ;?></a>
|
||||
@@ -189,15 +186,9 @@ $surveys = $db->GetAll($sql);
|
||||
<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:") ," ", $s['title'] ;?></option>
|
||||
<?php } } ?>
|
||||
foreach($surveys as $s){ ?>
|
||||
<option value="<?php echo $s['sid'];?>"><?php echo T_("Survey") ,": ", $s['title'] ;?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -343,7 +334,7 @@ $ckeditorConfig = array("toolbar" => array(array("tokens","-","Source"),
|
||||
</div>
|
||||
|
||||
|
||||
<div class="panel panel-default">
|
||||
<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>
|
||||
@@ -353,7 +344,7 @@ $ckeditorConfig = array("toolbar" => array(array("tokens","-","Source"),
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel panel-default ">
|
||||
<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>
|
||||
@@ -365,14 +356,26 @@ $ckeditorConfig = array("toolbar" => array(array("tokens","-","Source"),
|
||||
|
||||
<div class="row form-group">
|
||||
<div class="col-sm-4 ">
|
||||
<a href="questionnairelist.php" class="btn btn-default pull-right" ><i class="fa fa-list text-primary"></i> <?php echo T_("Go to");?> <?php echo T_("Questionnaire management");?></a>
|
||||
<a href="questionnairelist.php" class="btn btn-default pull-right" ><i class="fa fa-list text-primary"></i> <?php echo T_("Cancel");?></a>
|
||||
</div>
|
||||
<div class="col-sm-4 ">
|
||||
<button type="submit" class="btn btn-default pull-right" name="import_file" ><i class="fa fa-check-square-o fa-lg text-primary"></i> <?php echo T_("Create Questionnaire"); ?></button>
|
||||
<button type="submit" class="btn btn-primary pull-right btn-lg" name="import_file" ><i class="fa fa-check-square-o fa-lg"></i> <?php echo T_("Create Questionnaire"); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<?php }
|
||||
else { ?>
|
||||
<div class='col-sm-6 col-sm-offset-1'>
|
||||
<h3 class="alert alert-warning"> <?php echo T_("NO active Lime surveys available");?> </h3>
|
||||
<a class="btn btn-lime btn-lg btn-block" href="<?php echo LIME_URL ;?>admin/admin.php?action=newsurvey"><i class="fa fa-lemon-o text-danger"></i> <?php echo T_("Create an instrument in Limesurvey");?> </a>
|
||||
<h4 class="text-center"><?php echo T_("or"); ?></h4>
|
||||
<a class="btn btn-lime btn-lg btn-block" href="<?php echo LIME_URL ;?>admin/admin.php?action=listsurveys"><i class="fa fa-lemon-o text-danger"></i> <?php echo T_("Administer instruments with Limesurvey");?> </a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<?php
|
||||
xhtml_foot($js_foot);//
|
||||
?>
|
||||
?>
|
||||
@@ -45,7 +45,7 @@ include("../db.inc.php");
|
||||
include("../functions/functions.xhtml.php");
|
||||
|
||||
/**
|
||||
* Input functions
|
||||
* Display functions
|
||||
*/
|
||||
include("../functions/functions.display.php");
|
||||
|
||||
@@ -55,7 +55,7 @@ include("../functions/functions.display.php");
|
||||
include("../functions/functions.input.php");
|
||||
|
||||
/**
|
||||
* CKEditor
|
||||
* Limesurvey functions
|
||||
*/
|
||||
include("../functions/functions.limesurvey.php");
|
||||
|
||||
@@ -321,8 +321,9 @@ if (isset($_GET['modify']))
|
||||
{
|
||||
$questionnaire_id = intval($_GET['modify']);
|
||||
|
||||
$sql = "SELECT *
|
||||
$sql = "SELECT `questionnaire`.*, sl.surveyls_title as title
|
||||
FROM questionnaire
|
||||
LEFT JOIN " . LIME_PREFIX . "surveys_languagesettings AS sl ON ( questionnaire.lime_sid = sl.surveyls_survey_id)
|
||||
WHERE questionnaire_id = $questionnaire_id";
|
||||
$rs = $db->GetRow($sql);
|
||||
|
||||
@@ -365,9 +366,13 @@ if (isset($_GET['modify']))
|
||||
"extraPlugins" => "tokens");
|
||||
?>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-2"><a href='questionnairelist.php' class='btn btn-default pull-left' ><i class='fa fa-chevron-left fa-lg' style='color:blue;'></i> <?php echo T_("Go back"); ?></a></div>
|
||||
<div class="col-sm-8"><?php // ?> </div>
|
||||
<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> " . T_("Edit instrument in Limesurvey") . " </a>"; ?> </div>
|
||||
<div class="col-sm-4">
|
||||
<a href='questionnairelist.php' class='btn btn-default pull-left' ><i class='fa fa-chevron-left fa-lg' style='color:blue;'></i> <?php echo T_("Go back"); ?></a><h3 class="pull-right"><?php echo T_("Assigned survey"); ?>:</h3>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<h3 class="pull-left" ><?php echo $rs['lime_sid']," ",$rs['title']; ?></h3>
|
||||
<?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> " . T_("Edit instrument in Limesurvey") . " </a>"; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form action="?modify=<?php echo $questionnaire_id; ?>" method="post" class="form-horizontal col-sm-12 form-group ">
|
||||
|
||||
@@ -326,7 +326,7 @@ if ($questionnaire_id != false)
|
||||
{
|
||||
if (count($data) > 2)
|
||||
{
|
||||
//one quota record per row
|
||||
//one quota record per row, placed in order of records sequence
|
||||
$description = $db->quote($data[0]);
|
||||
$completions = intval($data[1]);
|
||||
$autoprioritise = 0;
|
||||
@@ -431,7 +431,7 @@ if ($questionnaire_id != false)
|
||||
if (isset($_GET['sgqa']))
|
||||
$ssgqa = $db->qstr($_GET['sgqa']);
|
||||
|
||||
//select question
|
||||
//select question + corrected question order as in questionnaire with subquestions
|
||||
$sql = "SELECT CONCAT( lq.sid, 'X', lq.gid, 'X', CASE WHEN lq.parent_qid = 0 THEN lq.qid ELSE CONCAT(lq.parent_qid, lq.title) END) as value, CONCAT( lq.sid, 'X', lq.gid, 'X', CASE WHEN lq.parent_qid = 0 THEN lq.qid ELSE CONCAT(lq.parent_qid, lq.title) END, ' -> ' , CASE WHEN lq.parent_qid = 0 THEN lq.question ELSE CONCAT(lq2.question, ' : ', lq.question) END) as description, CASE WHEN $ssgqa LIKE CONCAT( lq.sid, 'X', lq.gid, 'X', CASE WHEN lq.parent_qid = 0 THEN lq.qid ELSE CONCAT(lq.parent_qid, lq.title) END) THEN 'selected=\'selected\'' ELSE '' END AS selected
|
||||
FROM `" . LIME_PREFIX . "questions` AS lq
|
||||
LEFT JOIN `" . LIME_PREFIX . "questions` AS lq2 ON ( lq2.qid = lq.parent_qid )
|
||||
|
||||
@@ -46,7 +46,7 @@ include ("../functions/functions.xhtml.php");
|
||||
|
||||
$css = array(
|
||||
"../include/bootstrap/css/bootstrap.min.css",
|
||||
//"../include/bootstrap-3.3.2/css/bootstrap-theme.min.css",
|
||||
//"../include/bootstrap/css/bootstrap-theme.min.css",
|
||||
"../include/clockpicker/dist/bootstrap-clockpicker.min.css",
|
||||
"../css/custom.css"
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user