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

Merged from internetcomplete

This commit is contained in:
Adam Zammit
2013-03-08 11:55:48 +11:00
5 changed files with 164 additions and 4 deletions

View File

@@ -4,11 +4,11 @@ New Feature: Replace queXS caseid as token with a random token to allow for safe
New Feature: Allow for responents to self complete the questionnaire via email invitation New Feature: Allow for responents to self complete the questionnaire via email invitation
New Feature: Allow restricting appointment to just yourself New Feature: Allow restricting appointment to just yourself
New Feature: Added ability to edit operators New Feature: Added ability to edit operators
New Featuer: Can delete a queXS questionnaire New Feature: Can delete a queXS questionnaire
New Feature: List and enable/disable sample files
New Feature: Deidentify (delete fields) from sample files
Fixed Bug: Replaced php short tags with long tags Fixed Bug: Replaced php short tags with long tags
Database updates: Database updates:
ALTER TABLE `case` ADD `token` VARCHAR( 36 ) NOT NULL ; ALTER TABLE `case` ADD `token` VARCHAR( 36 ) NOT NULL ;
@@ -36,6 +36,10 @@ ADD `lime_mode` VARCHAR( 64 ) NULL COMMENT 'Limesurvey mode for respondent self
ADD `lime_template` VARCHAR( 128 ) NULL COMMENT 'Limesurvey template for respondent self completion' AFTER `lime_mode` , ADD `lime_template` VARCHAR( 128 ) NULL COMMENT 'Limesurvey template for respondent self completion' AFTER `lime_mode` ,
ADD `lime_endurl` VARCHAR( 256 ) NULL COMMENT 'Forwarding end URL for respondent self completion' AFTER `lime_template` ; ADD `lime_endurl` VARCHAR( 256 ) NULL COMMENT 'Forwarding end URL for respondent self completion' AFTER `lime_template` ;
Allow for enabling/disabling sample files:
ALTER TABLE `sample_import` ADD `enabled` TINYINT( 1 ) NOT NULL DEFAULT '1';
queXS 1.6.1 - Changes since 1.6.0 queXS 1.6.1 - Changes since 1.6.0
New Feature: Include paradata/metadata in data output (number call attempts, number of answering machine messages and all sample variables) New Feature: Include paradata/metadata in data output (number call attempts, number of answering machine messages and all sample variables)

View File

@@ -124,7 +124,8 @@ if ($questionnaire_id != false)
$sql = "SELECT si.sample_import_id,si.description $sql = "SELECT si.sample_import_id,si.description
FROM sample_import as si FROM sample_import as si
LEFT JOIN questionnaire_sample as q ON (q.questionnaire_id = '$questionnaire_id' AND q.sample_import_id = si.sample_import_id) LEFT JOIN questionnaire_sample as q ON (q.questionnaire_id = '$questionnaire_id' AND q.sample_import_id = si.sample_import_id)
WHERE q.questionnaire_id is NULL"; WHERE q.questionnaire_id is NULL
AND si.enabled = 1";
$qs = $db->GetAll($sql); $qs = $db->GetAll($sql);

View File

@@ -55,6 +55,7 @@ print "<li><a href=\"?page=" . LIME_URL . "admin/admin.php\">" . T_("Administer
print "<li><h3>" . T_("Sample/List management") . "</h3><ul>"; print "<li><h3>" . T_("Sample/List management") . "</h3><ul>";
print "<li><a href=\"?page=import.php\">" . T_("Import a sample file (in CSV form)") . "</a></li>"; print "<li><a href=\"?page=import.php\">" . T_("Import a sample file (in CSV form)") . "</a></li>";
print "<li><a href=\"?page=samplelist.php\">" . T_("Sample management") . "</a></li>";
print "<li><a href=\"?page=assignsample.php\">" . T_("Assign samples to questionnaires") . "</a></li>"; print "<li><a href=\"?page=assignsample.php\">" . T_("Assign samples to questionnaires") . "</a></li>";
print "<li><a href=\"?page=questionnaireprefill.php\">" . T_("Set values in questionnaire to pre fill") . "</a></li></ul></li>"; print "<li><a href=\"?page=questionnaireprefill.php\">" . T_("Set values in questionnaire to pre fill") . "</a></li></ul></li>";

153
admin/samplelist.php Normal file
View File

@@ -0,0 +1,153 @@
<?php
/**
* List operators and allow for customised VoIP downloads, changing passwords, disabling, etc
*
*
* 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@acspri.org.au>
* @copyright Australian Consortium for Social and Political Research Incorporated (ACSPRI) 2013
* @package queXS
* @subpackage admin
* @link http://www.acspri.org.au/software queXS was writen for ACSPRI
* @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2
*
*/
/**
* Configuration file
*/
include_once(dirname(__FILE__).'/../config.inc.php');
/**
* Database
*/
include_once(dirname(__FILE__).'/../db.inc.php');
/**
* XHTML functions
*/
include_once(dirname(__FILE__).'/../functions/functions.xhtml.php');
if (isset($_POST['submit']))
{
$sample_import_id = intval($_POST['sample_import_id']);
unset($_POST['submit']);
unset($_POST['sample_import_id']);
foreach($_POST as $p)
{
$sql = "DELETE FROM sample_var
WHERE var LIKE " . $db->qstr($p) . "
AND sample_id IN
(SELECT sample_id
FROM sample
WHERE import_id = $sample_import_id)";
$db->Execute($sql);
}
$_GET['edit'] = $sample_import_id;
}
if (isset($_GET['edit']))
{
xhtml_head(T_("Deidentify"),true,array("../css/table.css"));
$sample_import_id = intval($_GET['edit']);
$sql = "SELECT si.description, sv.val, sv.var,
CONCAT('<input type=\'checkbox\' name=\'',sv.var,'\' value=\'',sv.var,'\'/>') as box
FROM sample_import as si, sample_var as sv, sample as s
WHERE si.sample_import_id = $sample_import_id
AND sv.sample_id = s.sample_id
AND s.import_id = si.sample_import_id
GROUP BY sv.var";
$rs = $db->GetAll($sql);
print "<h2>" . T_("Deidentify") . ": " . $rs[0]['description'] . "</h2>";
echo "<p><a href='?'>" . T_("Go back") . "</a></p>";
print "<p>" . T_("Select which fields from this sample to deidentify. Deidentified fields will be permanently deleted from the sample.") . "</p>";
?>
<form action="?" method="post">
<?php
xhtml_table($rs,array("var","val","box"),array(T_("Field"),T_("Example data"),T_("Deidentify")));
?>
<div><input type='hidden' name='sample_import_id' value='<?php echo $sample_import_id;?>'/></div>
<div><input type="submit" name="submit" value="<?php echo T_("Delete selected fields");?>"/></div>
</form>
<?php
xhtml_foot();
exit();
}
if (isset($_GET['sampledisable']))
{
$id = intval($_GET['sampledisable']);
$sql = "UPDATE sample_import
SET enabled = 0
WHERE sample_import_id = '$id'";
$db->Execute($sql);
}
if (isset($_GET['sampleenable']))
{
$id = intval($_GET['sampleenable']);
$sql = "UPDATE sample_import
SET enabled = 1
WHERE sample_import_id = '$id'";
$db->Execute($sql);
}
$sql = "SELECT
CASE WHEN enabled = 0 THEN
CONCAT('<a href=\'?sampleenable=',sample_import_id,'\'>" . T_("Enable") . "</a>')
ELSE
CONCAT('<a href=\'?sampledisable=',sample_import_id,'\'>" . T_("Disable") . "</a>')
END
as enabledisable,
CONCAT('<a href=\'?edit=',sample_import_id,'\'>" . T_("Deidentify") . "</a>') as did,
description
FROM sample_import";
$rs = $db->GetAll($sql);
xhtml_head(T_("Sample list"),true,array("../css/table.css"));
$columns = array("description","enabledisable","did");
$titles = array(T_("Sample"),T_("Enable/Disable"),T_("Deidentify"));
xhtml_table($rs,$columns,$titles);
xhtml_foot();
?>

View File

@@ -1600,6 +1600,7 @@ CREATE TABLE `sample_import` (
`description` varchar(255) collate utf8_unicode_ci NOT NULL, `description` varchar(255) collate utf8_unicode_ci NOT NULL,
`call_restrict` tinyint(1) NOT NULL default '1', `call_restrict` tinyint(1) NOT NULL default '1',
`refusal_conversion` tinyint(1) NOT NULL default '1', `refusal_conversion` tinyint(1) NOT NULL default '1',
`enabled` tinyint(1) NOT NULL default '1',
PRIMARY KEY (`sample_import_id`) PRIMARY KEY (`sample_import_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;