mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
new look for pages
This commit is contained in:
@@ -73,7 +73,7 @@ $js_head = array(
|
|||||||
);
|
);
|
||||||
$js_foot = array(
|
$js_foot = array(
|
||||||
"../js/window.js",
|
"../js/window.js",
|
||||||
"../js/custom.js"
|
//"../js/custom.js"
|
||||||
);
|
);
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
@@ -113,29 +113,26 @@ else if (isset($_POST['availability_group']))
|
|||||||
}
|
}
|
||||||
|
|
||||||
//view groups
|
//view groups
|
||||||
$sql = "SELECT description,
|
$sql = "SELECT availability_group_id,description,
|
||||||
CONCAT('<a href=\'availability.php?availability_group=', availability_group_id, '\'>". TQ_("Modify") . "</a>') as link
|
CONCAT('<a href=\'availability.php?availability_group=', availability_group_id, '\'>". TQ_("Modify") . "</a>') as link
|
||||||
FROM availability_group";
|
FROM availability_group";
|
||||||
|
|
||||||
$rs = $db->GetAll($sql);
|
$rs = $db->GetAll($sql);
|
||||||
|
|
||||||
//print "<h3>" . T_("Time slots")."</h3>";
|
|
||||||
|
|
||||||
print "<div class='well'>" . T_("Time slots define periods of time during particular days of the week. These are used for the availability function and also the call attempt time slot function.") . "</div>";
|
print "<div class='well'>" . T_("Time slots define periods of time during particular days of the week. These are used for the availability function and also the call attempt time slot function.") . "</div>";
|
||||||
|
|
||||||
if (empty($rs))
|
if (empty($rs))
|
||||||
print "<div class='alert alert-danger'>" . T_("No time slots") . "</div>";
|
print "<div class='alert alert-danger'>" . T_("No time slots") . "</div>";
|
||||||
else{
|
else{
|
||||||
print "<div class='panel-body col-sm-4'>";
|
print "<div class='panel-body col-sm-6'>";
|
||||||
// print "<h3>" . T_("Time slots")."</h3>";
|
xhtml_table($rs,array("availability_group_id","description","link"),array(T_("ID"),T_("Time slot name"),T_("Modify")),"table table-hover");
|
||||||
xhtml_table($rs,array("description","link"),array(T_("Time slot"),T_("Modify")));
|
|
||||||
print "</div>";
|
print "</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
//add an availablity group <label for="availability_group"><?php echo T_("Time slot name"); : </label>
|
//add a time slot (ex- availablity group)
|
||||||
?>
|
?>
|
||||||
<div class=" panel-body col-sm-4"><form method="post" action="?">
|
<div class=" panel-body col-sm-4"><form method="post" action="?">
|
||||||
<h3><?php echo T_("Add time slot")," :";?></h3>
|
<h3><?php echo T_("Add new time slot")," :";?></h3>
|
||||||
<p><input type="text" class="textclass form-control" name="availability_group" id="availability_group" placeholder="<?php echo T_("Enter")," ",T_("new")," ",T_("Time slot name"); ?>"/></p>
|
<p><input type="text" class="textclass form-control" name="availability_group" id="availability_group" placeholder="<?php echo T_("Enter")," ",T_("new")," ",T_("Time slot name"); ?>"/></p>
|
||||||
<p><input class="submitclass btn btn-default" type="submit" name="submit" value="<?php echo T_("Add time slot"); ?>"/></p>
|
<p><input class="submitclass btn btn-default" type="submit" name="submit" value="<?php echo T_("Add time slot"); ?>"/></p>
|
||||||
</form></div>
|
</form></div>
|
||||||
|
|||||||
@@ -125,7 +125,8 @@ function validate_bulk_appointment($tmpfname)
|
|||||||
|
|
||||||
if (isset($_POST['tmpfname']))
|
if (isset($_POST['tmpfname']))
|
||||||
{
|
{
|
||||||
xhtml_head("queXS",true,array("../css/table.css"));
|
$subtitle = T_("Result");
|
||||||
|
xhtml_head(T_("Bulk appointment generator"),true,array("../include/bootstrap-3.3.2/css/bootstrap.min.css","../css/custom.css"),false,false,false,false,$subtitle);
|
||||||
$todo = validate_bulk_appointment($_POST['tmpfname']);
|
$todo = validate_bulk_appointment($_POST['tmpfname']);
|
||||||
|
|
||||||
if (is_array($todo))
|
if (is_array($todo))
|
||||||
@@ -213,31 +214,35 @@ if (isset($_POST['tmpfname']))
|
|||||||
else if (isset($_POST['import_file']))
|
else if (isset($_POST['import_file']))
|
||||||
{
|
{
|
||||||
//file has been submitted
|
//file has been submitted
|
||||||
|
$subtitle = T_("Check data to submit");
|
||||||
xhtml_head("queXS",true,array("../css/table.css"));
|
xhtml_head(T_("Bulk appointment generator"),true,array("../include/bootstrap-3.3.2/css/bootstrap.min.css","../css/custom.css"),false,false,false,false,$subtitle);
|
||||||
?>
|
?>
|
||||||
<form action="" method="post">
|
<form action="" method="post" >
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$tmpfname = tempnam(TEMPORARY_DIRECTORY, "FOO");
|
$tmpfname = tempnam(TEMPORARY_DIRECTORY, "FOO");
|
||||||
|
|
||||||
move_uploaded_file($_FILES['file']['tmp_name'],$tmpfname);
|
move_uploaded_file($_FILES['file']['tmp_name'],$tmpfname);
|
||||||
|
|
||||||
$todo = validate_bulk_appointment($tmpfname);
|
$todo = validate_bulk_appointment($tmpfname);
|
||||||
|
|
||||||
if (is_array($todo))
|
if (is_array($todo) && !empty($todo)) {
|
||||||
{
|
|
||||||
print "<p>" . T_("Please check the case id's, appointment start and end times and notes are correct before accepting below") . "</p>";
|
print "<p class='well'>" . T_("Please check the case id's, appointment start and end times and notes are correct before accepting below") . "</p>";
|
||||||
$todoh = array(T_("Case id"), T_("Start time"), T_("End time"), T_("Note"));
|
$todoh = array(T_("Case id"), T_("Start time"), T_("End time"), T_("Note"));
|
||||||
xhtml_table($todo,array(0,1,2,3),$todoh);
|
xhtml_table($todo,array(0,1,2,3),$todoh);
|
||||||
?>
|
?>
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
<p><input type="hidden" name="tmpfname" value="<?php echo $tmpfname; ?>" /></p>
|
<input type="hidden" name="tmpfname" value="<?php echo $tmpfname; ?>" />
|
||||||
<p><input type="submit" name="import_file" value="<?php echo T_("Accept and generate bulk appointments"); ?>"/></p>
|
<input type="submit" name="import_file" value="<?php echo T_("Accept and generate bulk appointments"); ?>" class="btn btn-primary"/>
|
||||||
</form>
|
</form>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
print "<p>" . T_("The file does not contain at least caseid, starttime and endtime columns. Please try again.") ."</p>";
|
print "<p class='well text-danger'>" . T_("The file does not contain at least caseid, starttime and endtime columns. Please try again.") ."</p>";
|
||||||
|
|
||||||
|
print "</form>";
|
||||||
|
|
||||||
|
|
||||||
xhtml_foot();
|
xhtml_foot();
|
||||||
|
|
||||||
@@ -245,28 +250,40 @@ else if (isset($_POST['import_file']))
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
//need to supply file to upload
|
//need to supply file to upload
|
||||||
xhtml_head(T_("Import: Select file to upload"),true,array("../css/table.css"));
|
$subtitle = T_("Import: Select file to upload");
|
||||||
|
xhtml_head(T_("Bulk appointment generator"),true,array("../include/bootstrap-3.3.2/css/bootstrap.min.css","../include/font-awesome-4.3.0/css/font-awesome.css","../css/custom.css"),array("../js/jquery-2.1.3.min.js","../js/bootstrap-filestyle.min.js"),false,false,false,$subtitle );
|
||||||
|
|
||||||
|
$ua = $_SERVER['HTTP_USER_AGENT'];
|
||||||
|
if (preg_match('/Firefox/i', $ua)) $csv= "text/csv"; else $csv= ".csv";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<h1><?php echo T_("Bulk appointment generator"); ?></h1>
|
|
||||||
<p><?php echo T_("Provide a headered CSV file containing at least 3 columns - caseid, starttime and endtime. Optionally you can include a note column to attach a note to the case in addition to setting an appointment. Only cases that have temporary (non final) outcomes will have appointments generated, and the outcome of the case will be updated to an appointment outcome."); ?><p>
|
<p class="well"><?php echo T_("Provide a headered CSV file containing at least 3 columns - caseid, starttime and endtime. </br> Optionally you can include a note column to attach a note to the case in addition to setting an appointment. </br>Only cases that have temporary (non final) outcomes will have appointments generated, and the outcome of the case will be updated to an appointment outcome."); ?><p>
|
||||||
<p><?php echo T_("Example CSV file:"); ?></p>
|
|
||||||
<div><table class="tclass">
|
<div class="panel-body">
|
||||||
<tr><th>caseid</th><th>starttime</th><th>endtime</th><th>note</th></tr>
|
<h5><u><?php echo T_("Example CSV file:"); ?></u></h5>
|
||||||
<tr><td>1</td><td>2012-08-15 11:00:00</td><td>2012-08-15 13:00:00</td><td>Appointment automatically generated</td></tr>
|
<table class="table-bordered table-condensed form-group">
|
||||||
<tr><td>2</td><td>2012-08-15 12:00:00</td><td>2012-08-15 14:00:00</td><td>Appointment automatically generated</td></tr>
|
<tr><th>caseid</th><th>starttime</th><th>endtime</th><th>note</th></tr>
|
||||||
<tr><td>3</td><td>2012-08-15 13:00:00</td><td>2012-08-15 15:00:00</td><td>Appointment automatically generated</td></tr>
|
<tr><td>1</td><td>2012-08-15 11:00:00</td><td>2012-08-15 13:00:00</td><td>Appointment automatically generated</td></tr>
|
||||||
</table></div>
|
<tr><td>2</td><td>2012-08-15 12:00:00</td><td>2012-08-15 14:00:00</td><td>Appointment automatically generated</td></tr>
|
||||||
|
<tr><td>3</td><td>2012-08-15 13:00:00</td><td>2012-08-15 15:00:00</td><td>Appointment automatically generated</td></tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
<form enctype="multipart/form-data" action="" method="post">
|
<form enctype="multipart/form-data" action="" method="post">
|
||||||
<p><input type="hidden" name="MAX_FILE_SIZE" value="1000000000" /></p>
|
<input type="hidden" name="MAX_FILE_SIZE" value="1000000000" />
|
||||||
<p><?php echo T_("Choose the CSV file to upload:"); ?><input name="file" type="file" /></p>
|
|
||||||
<p><input type="submit" name="import_file" value="<?php echo T_("Load bulk appointment CSV"); ?>"/></p>
|
<h4 class="pull-left" ><?php echo T_("Select bulk appointment CSV file to upload"); ?>: </h4>
|
||||||
|
|
||||||
|
<div class="col-sm-4">
|
||||||
|
<input name="file" class="filestyle" type="file" required data-buttonBefore="true" data-iconName="fa fa-folder-open fa-lg text-primary " data-buttonText="<?php echo T_("Select file"); ?>" type="file" accept="<?php echo $csv; ?>"/> 
|
||||||
|
</div>
|
||||||
|
<button type="submit" class="btn btn-primary" name="import_file" value=""><i class='fa fa-upload fa-lg'></i> <?php echo "" . T_("Upload file"); ?></button>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
xhtml_foot();
|
xhtml_foot();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -60,15 +60,13 @@ if (isset($_POST['information']))
|
|||||||
set_setting("information",$_POST['information']);
|
set_setting("information",$_POST['information']);
|
||||||
}
|
}
|
||||||
|
|
||||||
xhtml_head(T_("Set centre information"),true,false,array("../js/window.js"));
|
xhtml_head(T_("Set centre information"),true,array("../include/bootstrap-3.3.2/css/bootstrap.min.css","../css/custom.css"),array("../js/window.js"));
|
||||||
|
?>
|
||||||
?>
|
<form action="" method="post" class="panel-body">
|
||||||
<form action="" method="post"><p>
|
<!-- <label for="information"><?php //echo T_("Set centre information: "); ?></label> -->
|
||||||
<label for="information"><?php echo T_("Set centre information: "); ?></label><?php echo $CKEditor->editor("information",get_setting("information")); ?>
|
<?php echo $CKEditor->editor("information",get_setting("information")); ?>
|
||||||
<input type="submit" name="update" value="<?php echo T_("Update centre information"); ?>"/></p>
|
<br/><input class="btn btn-primary" type="submit" name="update" value="<?php echo T_("Update centre information"); ?>"/>
|
||||||
</form>
|
</form>
|
||||||
<?php
|
<?php
|
||||||
xhtml_foot();
|
xhtml_foot();
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php /**
|
<?php
|
||||||
|
/**
|
||||||
* Output data as a fixed width ASCII file
|
* Output data as a fixed width ASCII file
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
@@ -28,7 +29,6 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Input functions
|
* Input functions
|
||||||
*/
|
*/
|
||||||
@@ -77,21 +77,32 @@ if (isset($_GET['key']) || isset($_GET['sample']))
|
|||||||
Header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
|
Header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
|
||||||
header("Pragma: no-cache"); // HTTP/1.0
|
header("Pragma: no-cache"); // HTTP/1.0
|
||||||
|
|
||||||
echo("token,caseid");
|
echo("token,".T_("Case ID")."");
|
||||||
foreach($svars as $s)
|
foreach($svars as $s)
|
||||||
{
|
{
|
||||||
echo("," . $s['value']);
|
echo("," . $s['value']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_GET['sample']))
|
if (isset($_GET['sample']))
|
||||||
{
|
{
|
||||||
echo(",Outcome,AAPOR");
|
echo(",".T_("Current Outcome").",".T_("Number of call attempts").",".T_("Number of calls").",".T_("Case notes").",".T_("Total interview time over all calls (mins)").",".T_("Interview time for last call (mins)").",".T_("Last number dialled").",".T_("DATE/TIME Last number dialled").",".T_("Operator username for last call").",".T_("Shift report").", AAPOR");
|
||||||
}
|
}
|
||||||
|
|
||||||
echo("\n");
|
echo("\n");
|
||||||
|
|
||||||
$sql = "SELECT c.token,c.case_id ";
|
$sql = "SELECT c.token,c.case_id ";
|
||||||
|
|
||||||
if (isset($_GET['sample'])) $sql .= ", o.description, o.aapor_id ";
|
if (isset($_GET['sample'])) $sql .= ", o.description,
|
||||||
|
(SELECT COUNT(ca.call_attempt_id) FROM `call_attempt` as ca WHERE ca.case_id = c.case_id ) as callattempts,
|
||||||
|
(SELECT COUNT(cl.call_id) FROM `call` as cl WHERE cl.case_id = c.case_id ) as calls,
|
||||||
|
(SELECT GROUP_CONCAT(cn1.note SEPARATOR '|') FROM `case_note` as cn1 WHERE c.case_id = cn1.case_id GROUP BY cn1.case_id)as casenotes,
|
||||||
|
(SELECT ROUND(SUM( TIMESTAMPDIFF(SECOND , cl2.start,IFNULL(cl2.end,CONVERT_TZ(NOW(),'System','UTC'))))/60,2) FROM `call_attempt` as cl2 WHERE cl2.case_id = c.case_id) as interviewtimec,
|
||||||
|
(SELECT ROUND(TIMESTAMPDIFF(SECOND , cl3.start,IFNULL(cl3.end,CONVERT_TZ(NOW(),'System','UTC')))/60,2) FROM `call_attempt` as cl3 WHERE cl3.case_id = c.case_id ORDER BY cl3.call_attempt_id DESC LIMIT 1) as interviewtimel,
|
||||||
|
(SELECT cp1.phone FROM `call` as cl4, `contact_phone` as cp1 WHERE cl4.call_id = c.last_call_id AND cp1.contact_phone_id = cl4.contact_phone_id ) as lastnumber,
|
||||||
|
(SELECT cl55.start FROM `call` as cl55 WHERE cl55.call_id = c.last_call_id ) as lastcallstart,
|
||||||
|
(SELECT op1.username FROM `call` as cl5, `operator` as op1 WHERE cl5.call_id = c.last_call_id AND op1.operator_id = cl5.operator_id) as operatoru,
|
||||||
|
(SELECT GROUP_CONCAT(DISTINCT sr1.report SEPARATOR '|') FROM `call` as cl6, `shift` as sh1, `shift_report` as sr1 WHERE cl6.case_id = c.case_id AND sr1.shift_id = sh1.shift_id AND sh1.questionnaire_id = c.questionnaire_id AND cl6.start >= sh1.start AND cl6.end < sh1.end GROUP BY sr1.shift_id) as shiftr,
|
||||||
|
o.aapor_id ";
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($svars as $s)
|
foreach ($svars as $s)
|
||||||
@@ -107,7 +118,7 @@ if (isset($_GET['key']) || isset($_GET['sample']))
|
|||||||
|
|
||||||
$sql .= "JOIN `case` as c ON (c.questionnaire_id = '$questionnaire_id' AND c.sample_id = sample.sample_id) ";
|
$sql .= "JOIN `case` as c ON (c.questionnaire_id = '$questionnaire_id' AND c.sample_id = sample.sample_id) ";
|
||||||
|
|
||||||
if (isset($_GET['sample'])) $sql .= " LEFT JOIN `outcome` as o ON (o.outcome_id = c.current_outcome_id) ";
|
if (isset($_GET['sample'])) $sql .= " LEFT JOIN `outcome` as o ON (o.outcome_id = c.current_outcome_id)";
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($svars as $s)
|
foreach ($svars as $s)
|
||||||
@@ -120,7 +131,6 @@ if (isset($_GET['key']) || isset($_GET['sample']))
|
|||||||
|
|
||||||
$list = $db->GetAll($sql);
|
$list = $db->GetAll($sql);
|
||||||
|
|
||||||
|
|
||||||
if (!empty($list))
|
if (!empty($list))
|
||||||
{
|
{
|
||||||
foreach($list as $l)
|
foreach($list as $l)
|
||||||
@@ -134,12 +144,11 @@ if (isset($_GET['key']) || isset($_GET['sample']))
|
|||||||
}
|
}
|
||||||
if (isset($_GET['sample']))
|
if (isset($_GET['sample']))
|
||||||
{
|
{
|
||||||
echo "," . str_replace(","," ",$l['description']) . "," . $l['aapor_id'];
|
echo "," . str_replace(","," ",$l['description']) . "," .$l['callattempts']."," .$l['calls']."," .$l['casenotes'].",".$l['interviewtimec'].",".$l['interviewtimel'].",".$l['lastnumber'].",".$l['lastcallstart'].",".$l['operatoru'].",".$l['shiftr'].",". $l['aapor_id'];
|
||||||
}
|
}
|
||||||
echo "\n";
|
echo "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,13 +191,12 @@ if (isset($_GET['sample_var']))
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
xhtml_head(T_("Data output"),true,array("../include/bootstrap-3.3.2/css/bootstrap.min.css","../css/custom.css"),array("../js/window.js"));
|
||||||
|
|
||||||
xhtml_head(T_("Data output"),true,false,array("../js/window.js"));
|
print "<div class='form-group clearfix'><h3 class='col-sm-4 text-right'>" . T_("Please select a questionnaire") . ": </h3>";
|
||||||
|
|
||||||
print "<h3>" . T_("Please select a questionnaire") . "</h3>";
|
|
||||||
$questionnaire_id = false;
|
$questionnaire_id = false;
|
||||||
if (isset($_GET['questionnaire_id'])) $questionnaire_id = bigintval($_GET['questionnaire_id']);
|
if (isset($_GET['questionnaire_id'])) $questionnaire_id = bigintval($_GET['questionnaire_id']);
|
||||||
display_questionnaire_chooser($questionnaire_id);
|
display_questionnaire_chooser($questionnaire_id,false,"form-inline pull-left", "form-control");
|
||||||
|
|
||||||
if ($questionnaire_id)
|
if ($questionnaire_id)
|
||||||
{
|
{
|
||||||
@@ -199,38 +207,38 @@ if ($questionnaire_id)
|
|||||||
$ls = $db->GetRow($sql);
|
$ls = $db->GetRow($sql);
|
||||||
$lsid = $ls['lime_sid'];
|
$lsid = $ls['lime_sid'];
|
||||||
|
|
||||||
print "<p><a href='" . LIME_URL . "admin/admin.php?action=exportresults&sid=$lsid'>". T_("Download data for this questionnaire via Limesurvey") . "</a></p>";
|
print "  <a href='" . LIME_URL . "admin/admin.php?action=exportresults&sid=$lsid' class='btn btn-default fa btn-lime'>". T_("Download data for this questionnaire via Limesurvey") . "</a></div>";
|
||||||
|
|
||||||
print "<h3>" . T_("Please select a sample") . "</h3>";
|
print "<div class='form-group clearfix'><h3 class='col-sm-4 text-right'>" . T_("Please select a sample") . ": </h3>";
|
||||||
$sample_import_id = false;
|
$sample_import_id = false;
|
||||||
if (isset($_GET['sample_import_id'])) $sample_import_id = bigintval($_GET['sample_import_id']);
|
if (isset($_GET['sample_import_id'])) $sample_import_id = bigintval($_GET['sample_import_id']);
|
||||||
display_sample_chooser($questionnaire_id,$sample_import_id);
|
display_sample_chooser($questionnaire_id,$sample_import_id,false,"form-inline pull-left", "form-control");
|
||||||
|
|
||||||
if ($sample_import_id)
|
if ($sample_import_id)
|
||||||
{
|
{
|
||||||
print "<p><a href='" .LIME_URL . "admin/admin.php?action=exportresults&sid=$lsid&quexsfilterinc=$questionnaire_id:$sample_import_id'>" . T_("Download data for this sample via Limesurvey") . "</a></p>";
|
print "  <a href='" .LIME_URL . "admin/admin.php?action=exportresults&sid=$lsid&quexsfilterinc=$questionnaire_id:$sample_import_id' class='btn btn-default fa btn-lime'>" . T_("Download data for this sample via Limesurvey") . "</a></div>";
|
||||||
|
|
||||||
//get sample vars
|
//get sample vars
|
||||||
$sql = "SELECT sv.var as value, sv.var as description
|
$sql = "SELECT sv.var as value, sv.var as description
|
||||||
FROM `sample_var` as sv
|
FROM `sample_var` as sv
|
||||||
WHERE sv.sample_id = (SELECT sample_id FROM sample WHERE import_id = '$sample_import_id' LIMIT 1)";
|
WHERE sv.sample_id = (SELECT sample_id FROM sample WHERE import_id = '$sample_import_id' LIMIT 1)";
|
||||||
|
|
||||||
//download a key file linking the caseid to the sample
|
//download a key file linking the caseid to the sample
|
||||||
print "<h3>" . T_("Download key file: select sample var") . "</h3>";
|
print "<div class='form-group clearfix'><h3 class='col-sm-4 text-right'>" . T_("Download key file: select sample var") . ": </h3>";
|
||||||
|
|
||||||
|
display_chooser($db->GetAll($sql),"sample_var","sample_var",true,"questionnaire_id=$questionnaire_id&sample_import_id=$sample_import_id",true,true,false,true,"form-inline pull-left");
|
||||||
|
|
||||||
|
// print "</div><div class='form-group col-sm-offset-4'>";
|
||||||
|
|
||||||
display_chooser($db->GetAll($sql),"sample_var","sample_var",true,"questionnaire_id=$questionnaire_id&sample_import_id=$sample_import_id");
|
|
||||||
//download complete key file
|
//download complete key file
|
||||||
print "<p><a href='?key=key&questionnaire_id=$questionnaire_id&sample_import_id=$sample_import_id'>" . T_("Download complete key file") . "</a></p>";
|
print "  <a href='?key=key&questionnaire_id=$questionnaire_id&sample_import_id=$sample_import_id' class='btn btn-default fa'>" . T_("Download complete key file") . "</a>";
|
||||||
|
|
||||||
//download complete sample file with outcomes
|
//download complete sample file with outcomes
|
||||||
print "<p><a href='?sample=sample&questionnaire_id=$questionnaire_id&sample_import_id=$sample_import_id'>" . T_("Download complete sample file with current outcomes") . "</a></p>";
|
print "  <a href='?sample=sample&questionnaire_id=$questionnaire_id&sample_import_id=$sample_import_id' class='btn btn-default fa'>" . T_("Download complete sample file with current outcomes") . "</a></div>";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
xhtml_foot();
|
xhtml_foot();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@@ -63,16 +63,16 @@ include("../functions/functions.input.php");
|
|||||||
*/
|
*/
|
||||||
include("../functions/functions.operator.php");
|
include("../functions/functions.operator.php");
|
||||||
|
|
||||||
xhtml_head(T_("Operator Performance"),true,array("../css/table.css"),array("../js/window.js"));
|
xhtml_head(T_("Operator Performance"),true,array("../include/bootstrap-3.3.2/css/bootstrap.min.css","../css/custom.css"),array("../js/window.js"));
|
||||||
|
|
||||||
//$rs = get_stats_total(get_stats());
|
//$rs = get_stats_total(get_stats());
|
||||||
//print "<h2>" . T_("Overall") . "</h2>";
|
//print "<h2>" . T_("Overall") . "</h2>";
|
||||||
//xhtml_table($rs,array("firstName","completions","totalcalls","time","callt","CPH","CALLSPH","effectiveness"),array(T_("Operator"),T_("Completions"),T_("Calls"),T_("Total time"),T_("Call time"),T_("Completions p/h"),T_("Calls p/h"),T_("Effectiveness")));
|
//xhtml_table($rs,array("firstName","completions","totalcalls","time","callt","CPH","CALLSPH","effectiveness"),array(T_("Operator"),T_("Completions"),T_("Calls"),T_("Total time"),T_("Call time"),T_("Completions p/h"),T_("Calls p/h"),T_("Effectiveness")));
|
||||||
|
|
||||||
$questionnaire_id = false;
|
$questionnaire_id = false;
|
||||||
print "<h3>" . T_("Please select a questionnaire") . "</h3>";
|
print "<h3 class='form-inline pull-left'>" . T_("Please select a questionnaire") . " </h3>";
|
||||||
if (isset($_GET['questionnaire_id'])) $questionnaire_id = bigintval($_GET['questionnaire_id']);
|
if (isset($_GET['questionnaire_id'])) $questionnaire_id = bigintval($_GET['questionnaire_id']);
|
||||||
display_questionnaire_chooser($questionnaire_id);
|
display_questionnaire_chooser($questionnaire_id,false,"form-inline clearfix", "form-control");
|
||||||
|
|
||||||
if ($questionnaire_id)
|
if ($questionnaire_id)
|
||||||
{
|
{
|
||||||
@@ -93,9 +93,9 @@ if ($questionnaire_id)
|
|||||||
|
|
||||||
$rs = $db->GetAll($sql);
|
$rs = $db->GetAll($sql);
|
||||||
|
|
||||||
print "<h3>" . T_("Please select a shift") . "</h3>";
|
print "</br><h3 class='form-inline pull-left'>" . T_("Please select a shift") . " </h3>";
|
||||||
|
|
||||||
display_chooser($rs,"shift_id","shift_id",true,"questionnaire_id=$questionnaire_id");
|
display_chooser($rs,"shift_id","shift_id",true,"questionnaire_id=$questionnaire_id",true,true,false,true,"form-inline form-group");//,false,true,false,true,"pull-left"
|
||||||
|
|
||||||
if ($shift_id)
|
if ($shift_id)
|
||||||
{
|
{
|
||||||
@@ -106,8 +106,5 @@ if ($questionnaire_id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
xhtml_foot();
|
xhtml_foot();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@@ -58,14 +58,14 @@ include("../functions/functions.operator.php");
|
|||||||
*/
|
*/
|
||||||
include("../functions/functions.input.php");
|
include("../functions/functions.input.php");
|
||||||
|
|
||||||
xhtml_head(T_("Shift reports"),true,array("../css/table.css"),array("../js/window.js"));
|
xhtml_head(T_("Shift reports"),true,array("../include/bootstrap-3.3.2/css/bootstrap.min.css","../css/custom.css"),array("../js/window.js"));
|
||||||
|
|
||||||
$operator_id = get_operator_id();
|
$operator_id = get_operator_id();
|
||||||
|
|
||||||
print "<h3>" . T_("Please select a questionnaire") . "</h3>";
|
print "<h3>" . T_("Please select a questionnaire") . "</h3>";
|
||||||
$questionnaire_id = false;
|
$questionnaire_id = false;
|
||||||
if (isset($_GET['questionnaire_id'])) $questionnaire_id = bigintval($_GET['questionnaire_id']);
|
if (isset($_GET['questionnaire_id'])) $questionnaire_id = bigintval($_GET['questionnaire_id']);
|
||||||
display_questionnaire_chooser($questionnaire_id);
|
display_questionnaire_chooser($questionnaire_id ,false,"form-inline clearfix", "form-control");
|
||||||
|
|
||||||
if ($questionnaire_id)
|
if ($questionnaire_id)
|
||||||
{
|
{
|
||||||
@@ -85,7 +85,7 @@ if ($questionnaire_id)
|
|||||||
$r = $db->GetAll($sql);
|
$r = $db->GetAll($sql);
|
||||||
|
|
||||||
if (!empty($r))
|
if (!empty($r))
|
||||||
display_chooser($r,"shift","shift_id",true,"questionnaire_id=$questionnaire_id");
|
display_chooser($r,"shift","shift_id",true,"questionnaire_id=$questionnaire_id",true,true,false,true,"form-inline form-group");
|
||||||
|
|
||||||
if ($shift_id)
|
if ($shift_id)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -58,26 +58,34 @@ if (isset($_POST['update']))
|
|||||||
set_setting("chat_enabled",$enable);
|
set_setting("chat_enabled",$enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
xhtml_head(T_("Supervisor chat"),true,false,array("../js/window.js"));
|
xhtml_head(T_("Supervisor chat"),true,array("../include/bootstrap-3.3.2/css/bootstrap.min.css","../include/bootstrap-toggle/css/bootstrap-toggle.min.css","../css/custom.css"),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/window.js"));
|
||||||
|
|
||||||
print "<p>" . T_("Allow interviewers to chat with the supervisor over XMPP (Jabber). Required is a BOSH enabled XMPP/Jabber server. The operators and the supervisor will need XMPP/Jabber accounts.") . "</p>";
|
print "<p class='well'>" . T_("Allow interviewers to chat with the supervisor over XMPP (Jabber). Required is a BOSH enabled XMPP/Jabber server. The operators and the supervisor will need XMPP/Jabber accounts.") . "</p>";
|
||||||
|
|
||||||
$e = get_setting("chat_enabled");
|
$e = get_setting("chat_enabled");
|
||||||
$checked = "checked='checked'";
|
$checked = "checked='checked'";
|
||||||
if (empty($e))
|
if (empty($e))
|
||||||
$checked = "";
|
$checked = "";
|
||||||
|
?>
|
||||||
?>
|
<form action="" method="post" class="form-horizontal">
|
||||||
<form action="" method="post">
|
|
||||||
<p>
|
<div class="form-group form-inline">
|
||||||
<div><label for="enable"><?php echo T_("Enable supervisor chat?"); ?>: </label><input id='enable' type='checkbox' name='enable' val='1' <?php echo $checked; ?>/></div>
|
<label class="control-label col-sm-3" for="enable"><?php echo T_("Enable supervisor chat?"); ?>: </label>
|
||||||
<div><label for="bosh"><?php echo T_("Set BOSH URL"); ?>: </label><input id='bosh' type='text' name='bosh' value='<?php echo get_setting("bosh_service"); ?>'/></div>
|
<input id='enable' type='checkbox' data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" data-width="80" name='enable' val='1' <?php echo $checked; ?>/>
|
||||||
<div><label for="supervisor"><?php echo T_("Supervisor XMPP/Jabber id"); ?>: </label><input id='supervisor' name='supervisor' type='text' value='<?php echo get_setting("supervisor_xmpp"); ?>'/></div>
|
</div>
|
||||||
<div><input type="submit" id="update" name="update" value="<?php echo T_("Update"); ?>"/></div>
|
<div class="form-group form-inline">
|
||||||
</p>
|
<label class="control-label col-sm-3" for="bosh"><?php echo T_("Set BOSH URL"); ?>: </label>
|
||||||
</form>
|
<input id='bosh' type='text' name='bosh' class="form-control pull-left" required size="60" value='<?php echo get_setting("bosh_service"); ?>'/>
|
||||||
<?php
|
</div>
|
||||||
xhtml_foot();
|
<div class="form-group form-inline">
|
||||||
|
<label class="control-label col-sm-3" for="supervisor"><?php echo T_("Supervisor XMPP/Jabber id"); ?>: </label>
|
||||||
|
<input id='supervisor' name='supervisor' type='text' class="form-control pull-left" required size="60" value='<?php echo get_setting("supervisor_xmpp"); ?>'/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<input type="submit" id="update" name="update" class="btn btn-primary col-sm-offset-3 col-sm-3" value="<?php echo T_("Update"); ?>"/>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
xhtml_foot();
|
||||||
?>
|
?>
|
||||||
@@ -72,9 +72,9 @@ if ($p)
|
|||||||
set_setting('systemsort',false);
|
set_setting('systemsort',false);
|
||||||
}
|
}
|
||||||
|
|
||||||
xhtml_head(T_("Monitor system wide case sorting"),true,array("../css/table.css"),false,false,false,true);
|
xhtml_head(T_("Monitor system wide case sorting"),true,array("../include/bootstrap-3.3.2/css/bootstrap.min.css","../css/custom.css"),false,false,false,true);
|
||||||
|
|
||||||
print "<h1>" . T_("Running process:") . " $p</h1>";
|
print "<h2>" . T_("Running process:") . " $p</h2>";
|
||||||
|
|
||||||
if (is_process_killed($p))
|
if (is_process_killed($p))
|
||||||
{
|
{
|
||||||
@@ -91,15 +91,16 @@ if ($p)
|
|||||||
{
|
{
|
||||||
xhtml_table($d,array('process_log_id','datetime','data'),array(T_("Log id"), T_("Date"), T_("Log entry")));
|
xhtml_table($d,array('process_log_id','datetime','data'),array(T_("Log id"), T_("Date"), T_("Log entry")));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xhtml_head(T_("Monitor system wide case sorting"),true,array("../css/table.css"));
|
xhtml_head(T_("Monitor system wide case sorting"),true,array("../include/bootstrap-3.3.2/css/bootstrap.min.css","../css/custom.css"));
|
||||||
print "<h2>" . T_("Monitor system wide case sorting") . "</h2>";
|
//print "<h2>" . T_("Monitor system wide case sorting") . "</h2>";
|
||||||
print "<p><a href='?watch=watch'>" . T_("Click here to enable and begin system wide case sorting") . "</a></p>";
|
print "<p><a href='?watch=watch'>" . T_("Click here to enable and begin system wide case sorting") . "</a></p>";
|
||||||
print "<p>" . T_("System wide case sorting is periodically (via SYSTEM_SORT_MINUTES configuration directive) sorting cases on a system wide basis instead of finding the most appropriate case each time an operator requests a new case. This may increase performance where there are a large number of cases or complex quotas in place. If you are not experiencing any performance problems, it is not recommended to use this feature.") . "</p>";
|
print "<div class='well pull-right col-sm-4'><p>" . T_("System wide case sorting is periodically (via SYSTEM_SORT_MINUTES configuration directive) sorting cases on a system wide basis instead of finding the most appropriate case each time an operator requests a new case. This may increase performance where there are a large number of cases or complex quotas in place. If you are not experiencing any performance problems, it is not recommended to use this feature.") . "</p></div>";
|
||||||
|
|
||||||
print "<h2>" . T_("Outcome of last process run (if any)") . "</h2>";
|
print "<h2>" . T_("Outcome of last process run (if any)") . "</h2>";
|
||||||
|
|
||||||
$d = process_get_last_data(2);
|
$d = process_get_last_data(2);
|
||||||
if ($d !== false)
|
if ($d !== false)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -243,13 +243,16 @@ while (!is_process_killed($process_id)) //check if process killed every $sleepin
|
|||||||
LEFT JOIN questionnaire_sample_exclude_priority AS qsep ON (qsep.questionnaire_id = c.questionnaire_id AND qsep.sample_id = c.sample_id)
|
LEFT JOIN questionnaire_sample_exclude_priority AS qsep ON (qsep.questionnaire_id = c.questionnaire_id AND qsep.sample_id = c.sample_id)
|
||||||
LEFT JOIN case_availability AS casa ON (casa.case_id = c.case_id)
|
LEFT JOIN case_availability AS casa ON (casa.case_id = c.case_id)
|
||||||
LEFT JOIN availability AS ava ON (ava.availability_group_id = casa.availability_group_id)
|
LEFT JOIN availability AS ava ON (ava.availability_group_id = casa.availability_group_id)
|
||||||
LEFT JOIN questionnaire_timeslot AS qast ON (qast.questionnaire_id = c.questionnaire_id)
|
LEFT JOIN questionnaire_timeslot AS qast ON (qast.questionnaire_id = c.questionnaire_id)
|
||||||
LEFT JOIN questionnaire_sample_timeslot AS qasts ON (qasts.questionnaire_id = c.questionnaire_id AND qasts.sample_import_id = si.sample_import_id)
|
LEFT JOIN questionnaire_sample_timeslot AS qasts ON (qasts.questionnaire_id = c.questionnaire_id AND qasts.sample_import_id = si.sample_import_id)
|
||||||
WHERE c.current_operator_id IS NULL
|
WHERE c.current_operator_id IS NULL
|
||||||
AND c.questionnaire_id = '$questionnaire_id'
|
AND c.questionnaire_id = '$questionnaire_id'
|
||||||
AND ((apn.appointment_id IS NOT NULL) OR casa.case_id IS NULL OR (ava.day_of_week = DAYOFWEEK(CONVERT_TZ(NOW(),'System',s.Time_zone_name)) AND TIME(CONVERT_TZ(NOW(), 'System' , s.Time_zone_name)) >= ava.start AND TIME(CONVERT_TZ(NOW(), 'System' , s.Time_zone_name)) <= ava.end ))
|
AND ((apn.appointment_id IS NOT NULL) OR casa.case_id IS NULL OR (ava.day_of_week = DAYOFWEEK(CONVERT_TZ(NOW(),'System',s.Time_zone_name)) AND TIME(CONVERT_TZ(NOW(), 'System' , s.Time_zone_name)) >= ava.start AND TIME(CONVERT_TZ(NOW(), 'System' , s.Time_zone_name)) <= ava.end ))
|
||||||
AND ((apn.appointment_id IS NOT NULL) OR qast.questionnaire_id IS NULL OR ((SELECT COUNT(*) FROM availability WHERE availability.availability_group_id = qast.availability_group_id AND (availability.day_of_week = DAYOFWEEK(CONVERT_TZ(NOW(),'System',s.Time_zone_name)) AND TIME(CONVERT_TZ(NOW(), 'System' , s.Time_zone_name)) >= availability.start AND TIME(CONVERT_TZ(NOW(), 'System' , s.Time_zone_name)) <= availability.end)) >= 1 AND (SELECT COUNT(call_attempt_id) FROM `call_attempt`, availability WHERE call_attempt.case_id = c.case_id AND (availability.availability_group_id = qast.availability_group_id AND (availability.day_of_week = DAYOFWEEK(CONVERT_TZ(call_attempt.start,'UTC',s.Time_zone_name)) AND TIME(CONVERT_TZ(call_attempt.start, 'UTC' , s.Time_zone_name)) >= availability.start AND TIME(CONVERT_TZ(call_attempt.start, 'UTC' , s.Time_zone_name)) <= availability.end))) = ( SELECT (SELECT COUNT(*) FROM availability, call_attempt WHERE call_attempt.case_id = c.case_id AND availability.availability_group_id = availability_group.availability_group_id AND (availability.day_of_week = DAYOFWEEK(CONVERT_TZ(call_attempt.start,'UTC',s.Time_zone_name)) AND TIME(CONVERT_TZ(call_attempt.start, 'UTC' , s.Time_zone_name)) >= availability.start AND TIME(CONVERT_TZ(call_attempt.start, 'UTC' , s.Time_zone_name)) <= availability.end)) as cou FROM availability_group, questionnaire_timeslot WHERE questionnaire_timeslot.questionnaire_id = c.questionnaire_id AND availability_group.availability_group_id = questionnaire_timeslot.availability_group_id ORDER BY cou ASC LIMIT 1)))
|
|
||||||
AND ((apn.appointment_id IS NOT NULL) OR qasts.questionnaire_id IS NULL OR ((SELECT COUNT(*) FROM availability WHERE availability.availability_group_id = qasts.availability_group_id AND (availability.day_of_week = DAYOFWEEK(CONVERT_TZ(NOW(),'System',s.Time_zone_name)) AND TIME(CONVERT_TZ(NOW(), 'System' , s.Time_zone_name)) >= availability.start AND TIME(CONVERT_TZ(NOW(), 'System' , s.Time_zone_name)) <= availability.end)) >= 1 AND (SELECT COUNT(call_attempt_id) FROM `call_attempt`, availability WHERE call_attempt.case_id = c.case_id AND (availability.availability_group_id = qasts.availability_group_id AND (availability.day_of_week = DAYOFWEEK(CONVERT_TZ(call_attempt.start,'UTC',s.Time_zone_name)) AND TIME(CONVERT_TZ(call_attempt.start, 'UTC' , s.Time_zone_name)) >= availability.start AND TIME(CONVERT_TZ(call_attempt.start, 'UTC' , s.Time_zone_name)) <= availability.end))) = ( SELECT (SELECT COUNT(*) FROM availability, call_attempt WHERE call_attempt.case_id = c.case_id AND availability.availability_group_id = availability_group.availability_group_id AND (availability.day_of_week = DAYOFWEEK(CONVERT_TZ(call_attempt.start,'UTC',s.Time_zone_name)) AND TIME(CONVERT_TZ(call_attempt.start, 'UTC' , s.Time_zone_name)) >= availability.start AND TIME(CONVERT_TZ(call_attempt.start, 'UTC' , s.Time_zone_name)) <= availability.end)) as cou FROM availability_group, questionnaire_sample_timeslot WHERE questionnaire_sample_timeslot.questionnaire_id = c.questionnaire_id AND questionnaire_sample_timeslot.sample_import_id = si.sample_import_id AND availability_group.availability_group_id = questionnaire_sample_timeslot.availability_group_id ORDER BY cou ASC LIMIT 1)))
|
AND ((apn.appointment_id IS NOT NULL) OR qast.questionnaire_id IS NULL OR ((SELECT COUNT(*) FROM availability WHERE availability.availability_group_id = qast.availability_group_id AND (availability.day_of_week = DAYOFWEEK(CONVERT_TZ(NOW(),'System',s.Time_zone_name)) AND TIME(CONVERT_TZ(NOW(), 'System' , s.Time_zone_name)) >= availability.start AND TIME(CONVERT_TZ(NOW(), 'System' , s.Time_zone_name)) <= availability.end)) >= 1 AND (SELECT COUNT(call_attempt_id) FROM `call_attempt`, availability WHERE call_attempt.case_id = c.case_id AND (availability.availability_group_id = qast.availability_group_id AND (availability.day_of_week = DAYOFWEEK(CONVERT_TZ(call_attempt.start,'UTC',s.Time_zone_name)) AND TIME(CONVERT_TZ(call_attempt.start, 'UTC' , s.Time_zone_name)) >= availability.start AND TIME(CONVERT_TZ(call_attempt.start, 'UTC' , s.Time_zone_name)) <= availability.end))) = ( SELECT (SELECT COUNT(*) FROM availability, call_attempt WHERE call_attempt.case_id = c.case_id AND availability.availability_group_id = availability_group.availability_group_id AND (availability.day_of_week = DAYOFWEEK(CONVERT_TZ(call_attempt.start,'UTC',s.Time_zone_name)) AND TIME(CONVERT_TZ(call_attempt.start, 'UTC' , s.Time_zone_name)) >= availability.start AND TIME(CONVERT_TZ(call_attempt.start, 'UTC' , s.Time_zone_name)) <= availability.end)) as cou FROM availability_group, questionnaire_timeslot WHERE questionnaire_timeslot.questionnaire_id = c.questionnaire_id AND availability_group.availability_group_id = questionnaire_timeslot.availability_group_id ORDER BY cou ASC LIMIT 1)))
|
||||||
|
|
||||||
|
AND ((apn.appointment_id IS NOT NULL) OR qasts.questionnaire_id IS NULL OR ((SELECT COUNT(*) FROM availability WHERE availability.availability_group_id = qasts.availability_group_id AND (availability.day_of_week = DAYOFWEEK(CONVERT_TZ(NOW(),'System',s.Time_zone_name)) AND TIME(CONVERT_TZ(NOW(), 'System' , s.Time_zone_name)) >= availability.start AND TIME(CONVERT_TZ(NOW(), 'System' , s.Time_zone_name)) <= availability.end)) >= 1 AND (SELECT COUNT(call_attempt_id) FROM `call_attempt`, availability WHERE call_attempt.case_id = c.case_id AND (availability.availability_group_id = qasts.availability_group_id AND (availability.day_of_week = DAYOFWEEK(CONVERT_TZ(call_attempt.start,'UTC',s.Time_zone_name)) AND TIME(CONVERT_TZ(call_attempt.start, 'UTC' , s.Time_zone_name)) >= availability.start AND TIME(CONVERT_TZ(call_attempt.start, 'UTC' , s.Time_zone_name)) <= availability.end))) = ( SELECT (SELECT COUNT(*) FROM availability, call_attempt WHERE call_attempt.case_id = c.case_id AND availability.availability_group_id = availability_group.availability_group_id AND (availability.day_of_week = DAYOFWEEK(CONVERT_TZ(call_attempt.start,'UTC',s.Time_zone_name)) AND TIME(CONVERT_TZ(call_attempt.start, 'UTC' , s.Time_zone_name)) >= availability.start AND TIME(CONVERT_TZ(call_attempt.start, 'UTC' , s.Time_zone_name)) <= availability.end)) as cou FROM availability_group, questionnaire_sample_timeslot WHERE questionnaire_sample_timeslot.questionnaire_id = c.questionnaire_id AND questionnaire_sample_timeslot.sample_import_id = si.sample_import_id AND availability_group.availability_group_id = questionnaire_sample_timeslot.availability_group_id ORDER BY cou ASC LIMIT 1)))
|
||||||
|
|
||||||
AND (a.call_id is NULL or (a.end < CONVERT_TZ(DATE_SUB(NOW(), INTERVAL ou.default_delay_minutes MINUTE),'System','UTC')))
|
AND (a.call_id is NULL or (a.end < CONVERT_TZ(DATE_SUB(NOW(), INTERVAL ou.default_delay_minutes MINUTE),'System','UTC')))
|
||||||
AND ap.case_id is NULL
|
AND ap.case_id is NULL
|
||||||
AND ((qsep.questionnaire_id is NULL) or qsep.exclude = 0)
|
AND ((qsep.questionnaire_id is NULL) or qsep.exclude = 0)
|
||||||
@@ -259,7 +262,7 @@ while (!is_process_killed($process_id)) //check if process killed every $sleepin
|
|||||||
AND ((apn.appointment_id IS NOT NULL) or qs.call_max = 0 or ((SELECT count(*) FROM `call` WHERE case_id = c.case_id) < qs.call_max))
|
AND ((apn.appointment_id IS NOT NULL) or qs.call_max = 0 or ((SELECT count(*) FROM `call` WHERE case_id = c.case_id) < qs.call_max))
|
||||||
AND (SELECT count(*) FROM `questionnaire_sample_quota` WHERE questionnaire_id = c.questionnaire_id AND sample_import_id = s.import_id AND quota_reached = 1) = 0
|
AND (SELECT count(*) FROM `questionnaire_sample_quota` WHERE questionnaire_id = c.questionnaire_id AND sample_import_id = s.import_id AND quota_reached = 1) = 0
|
||||||
GROUP BY c.case_id
|
GROUP BY c.case_id
|
||||||
ORDER BY IF(ISNULL(apn.end),1,0),apn.end ASC, qsep.priority DESC, a.start ASC";
|
ORDER BY IF(ISNULL(apn.end),1,0), apn.end ASC, qsep.priority DESC, a.start ASC";
|
||||||
|
|
||||||
$rs = $db->GetAll($sql);
|
$rs = $db->GetAll($sql);
|
||||||
|
|
||||||
|
|||||||
@@ -70,18 +70,18 @@ if ($p)
|
|||||||
kill_process($p);
|
kill_process($p);
|
||||||
}
|
}
|
||||||
|
|
||||||
xhtml_head(T_("Monitor VoIP Process"),true,array("../css/table.css"),false,false,false,true);
|
xhtml_head(T_("Monitor VoIP Process"),true,array("../include/bootstrap-3.3.2/css/bootstrap.min.css","../css/custom.css"),false,false,false,true);
|
||||||
|
|
||||||
print "<h1>" . T_("Running process:") . " $p</h1>";
|
print "<h2>" . T_("Running process:") . " $p</h2>";
|
||||||
|
|
||||||
if (is_process_killed($p))
|
if (is_process_killed($p))
|
||||||
{
|
{
|
||||||
print "<h3>" . T_("Kill signal sent: Please wait... (Note: Process will be stalled until there is activity on the VoIP Server)") . "</h3>";
|
print "<h3>" . T_("Kill signal sent: Please wait... </br>(Note: Process will be stalled until there is activity on the VoIP Server)") . "</h3>";
|
||||||
print "<p><a href='?kill=force'>" . T_("Process is already closed (eg. server was rebooted) - click here to confirm") . "</a></p>";
|
print "<p>" . T_("Process is already closed (eg. server was rebooted)") . "<a href='?kill=force'>" . T_("click here to confirm") . "</a></p>";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "<p><a href='?kill=kill'>" . T_("Kill the running process") . "</a> ". T_("(requires activity on the VoIP Server to take effect)") . "</p>";
|
print "<p><a class='btn btn-default' href='?kill=kill'>" . T_("Kill the running process") . "</a> ". T_("(requires activity on the VoIP Server to take effect)") . "</p>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$d = process_get_data($p);
|
$d = process_get_data($p);
|
||||||
@@ -92,10 +92,10 @@ if ($p)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xhtml_head(T_("Monitor VoIP Process"),true,array("../css/table.css"));
|
xhtml_head(T_("Monitor VoIP Process"),true,array("../include/bootstrap-3.3.2/css/bootstrap.min.css","../css/custom.css"));
|
||||||
print "<h2>" . T_("Monitor VoIP Process") . "</h2>";
|
//print "<h2>" . T_("Monitor VoIP Process") . "</h2>";
|
||||||
print "<p><a href='?watch=watch'>" . T_("Click here to begin monitoring the VoIP Process") . "</a></p>";
|
print "<p><a class='btn btn-warning' href='?watch=watch'>" . T_("Click here to begin monitoring the VoIP Process") . "</a></p>";
|
||||||
print "<h2>" . T_("Outcome of last process run (if any)") . "</h2>";
|
print "<h3>" . T_("Outcome of last process run (if any)") . "</h3>";
|
||||||
$d = process_get_last_data();
|
$d = process_get_last_data();
|
||||||
if ($d !== false)
|
if ($d !== false)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user