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

Updated to trunk

This commit is contained in:
Adam Zammit
2015-09-02 14:42:05 +10:00
55 changed files with 3337 additions and 3357 deletions

View File

@@ -97,6 +97,57 @@ if (isset($_GET['questionnaire_id']) && isset($_GET['sample']) && isset($_GET['
VALUES('$questionnaire_id','$sid','$cm','$cam','$selecttype','$am', '$an')";
$db->Execute($sql);
if (isset($_GET['generatecases']))
{
include_once("../functions/functions.operator.php");
$db->StartTrans();
$lime_sid = $db->GetOne("SELECT lime_sid FROM questionnaire WHERE questionnaire_id = '$questionnaire_id'");
$testing = $db->GetOne("SELECT testing FROM questionnaire WHERE questionnaire_id = '$questionnaire_id'");
//add limesurvey attribute for each sample var record
$sql = "SELECT var,type
FROM sample_import_var_restrict
WHERE sample_import_id = '$sid'";
$rs = $db->GetAll($sql);
$i = 1;
$fields = array();
$fieldcontents='';
foreach($rs as $r)
{
$fields[]=array('attribute_'.$i,'C','255');
$fieldcontents.='attribute_'.$i.'='.$r['var']."\n";
$i++;
}
$dict = NewDataDictionary($db);
$sqlarray = $dict->ChangeTableSQL(LIME_PREFIX ."tokens_$lime_sid", $fields);
$execresult=$dict->ExecuteSQLArray($sqlarray, false);
$sql = "UPDATE " . LIME_PREFIX . "surveys
SET attributedescriptions = " . $db->qstr($fieldcontents) . "
WHERE sid='$lime_sid'";
$db->Execute($sql);
//generate one case for each sample record and set outcome to 41
$sql = "SELECT sample_id
FROM sample
WHERE import_id = '$sid'";
$rs = $db->GetAll($sql);
foreach($rs as $r)
{
add_case($r['sample_id'],$questionnaire_id,"NULL",$testing,41, true);
}
$db->CompleteTrans();
}
}
if (isset($_POST['edit']))
@@ -271,7 +322,14 @@ if ($questionnaire_id != false)
<label for="allownew" class="control-label col-sm-4"><?php echo T_("Allow new numbers to be drawn?");?></label>
<div class="col-sm-1"><input type="checkbox" id = "allownew" name="allownew" checked="checked" class="col-sm-1" data-toggle="toggle" data-size="small" data-on="<?php echo T_("Yes");?>" data-off="<?php echo T_("No");?>" data-width="85"/></div><br/><br/><br/>
<?php $self_complete = $db->GetOne("SELECT self_complete FROM questionnaire WHERE questionnaire_id = '$questionnaire_id'");
if ($self_complete) {?>
<label for="generatecases" class="control-label col-sm-4"><?php echo T_("Generate cases for all sample records and set outcome to 'Self completion email invitation sent'? (Ideal if you intend to send an email invitation to sample members before attempting to call using queXS)");?></label>
<div class="col-sm-1"><input type="checkbox" id = "generatecases" name="generatecases" class="col-sm-1" data-toggle="toggle" data-size="small" data-on="<?php echo T_("Yes");?>" data-off="<?php echo T_("No");?>" data-width="85"/></div><br/><br/><br/>
<?php }?>
<input type="hidden" name="questionnaire_id" value="<?php print($questionnaire_id);?>"/>
<div class="col-sm-offset-4 col-sm-3"><button type="submit" name="add_sample" class="btn btn-primary"><i class="fa fa-plus-circle fa-lg"></i>&emsp;<?php echo T_("Add sample");?></button></div>

View File

@@ -105,7 +105,7 @@ if ($operator_id)
if (!isset($_GET['csv']))
$sql .= " LIMIT 500";
else $sql .= " LIMIT 5000";
// else $sql .= " LIMIT 5000"; no limit when using CSV
$rs = $db->Execute($sql);
if (empty($rs))
@@ -115,8 +115,10 @@ if ($operator_id)
else
{
if (isset($_GET['csv']))
{
$qds = str_replace(' ','_',$_GET['dq']); $smpds = str_replace(' ','_',$_GET['ds']);
{
$qds = $smpds = "";
if (isset($_GET['dq'])) $qds = str_replace(' ','_',$_GET['dq']);
if (isset($_GET['ds'])) $smpds = str_replace(' ','_',$_GET['ds']);
$fn = "callhistory-" . $qds . $smpds . date("_d-M-Y_H-i") . ".csv";
header("Content-Type: text/csv");
@@ -165,7 +167,17 @@ if ($operator_id)
print "<h3><small>" . T_("Sample") . "&emsp;ID: $sid</small>&emsp;" . $ds . "</h3>";
unset($datacol[5]); unset($headers[5]); }
print "&nbsp;<a href='?csv=csv&amp;questionnaire_id=$qid&amp;dq=" . $dq . "&amp;sample_import_id=$sid&amp;ds=" . $ds . "' class='btn btn-default pull-right'><i class='fa fa-download fa-lg text-primary'></i>&emsp;" . T_("Download Call History List") . "</a>
print "&nbsp;<a href='?csv=csv";
if (isset($qid))
print "&amp;questionnaire_id=$qid";
if (isset($dq))
print "&amp;dq=" . $dq;
if (isset($sid))
print "&amp;sample_import_id=$sid";
if (isset($ds))
print "&amp;ds=" . $ds;
print "' class='btn btn-default pull-right'><i class='fa fa-download fa-lg text-primary'></i>&emsp;" . T_("Download Call History List") . "</a>
"; //<a href='../../admin/config.php' target='_blank' class='btn btn-default col-sm-offset-6 '><i class='fa fa-link fa-lg text-primary'></i>&emsp;" . T_("Go to Call History Report") . "</a>&nbsp;
xhtml_table($rs,$datacol,$headers,"tclass",false,false,"bs-table");

View File

@@ -88,7 +88,8 @@ T_("Respondent last name");
T_("Email address");
T_("Self completion email invitation sent");
T_("Self completed online");
T_("Max call attempts reached");
T_("Max calls reached");
T_("Max call attempts reached (Eligible)");
T_("Max calls reached (Eligible)");
T_("Max call attempts reached (Unknown eligibility)");
T_("Max calls reached (Unknown eligibility)");
?>

View File

@@ -66,7 +66,7 @@ if (isset($_POST['import_form']))
}
else
{
print -"<div class='alert alert-danger col-md-offset-2'><p>" . T_("Error importing file. Please try again") . "</p></div>";
print "<div class='alert alert-danger col-md-offset-2'><p>" . T_("Error importing file. Please try again") . "</p></div>";
}
}
else

View File

@@ -75,8 +75,8 @@ if (isset($_POST['operator']) && isset($_POST['adduser']))
$laste = $db->GetRow($sql);
$extensionn = "2000";
$extension = "'IAX2/2000'";
$extensionn = "1000";
$extension = "'IAX2/1000'";
//increment if exists
if (!empty($laste))
@@ -150,7 +150,7 @@ if (isset($_POST['operator']) && isset($_POST['adduser']))
$a = "<div class='alert alert-info'><h3>" . T_("Added operator :") . " " . $operator . "</h3>";
if (FREEPBX_PATH !== false)
$a .= "<br/>" . T_("FreePBX has been reloaded for the new VoIP extension to take effect");
$a .= "<br/><a href='/voip/admin/'>" . T_("FreePBX needs to be reloaded for the new VoIP extension to take effect") . "</a>";
print "</div>";