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

Fixes by Alex (thank you!)

This commit is contained in:
Adam Zammit
2015-11-20 12:34:56 +11:00
90 changed files with 811 additions and 1140 deletions

View File

@@ -42,7 +42,7 @@ include ("../db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions

View File

@@ -43,7 +43,7 @@ include ("../db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions

View File

@@ -43,7 +43,7 @@ include ("../db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions

View File

@@ -42,7 +42,7 @@ include ("../db.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**

View File

@@ -43,7 +43,7 @@ include ("../db.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions

View File

@@ -47,7 +47,7 @@ include ("../db.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* Operator functions * Operator functions

View File

@@ -42,7 +42,7 @@ include ("../db.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions
@@ -133,7 +133,7 @@ if ($operator_id)
while ($r = $rs->FetchRow()) while ($r = $rs->FetchRow())
{ {
translate_array($r,array("des")); translate_array($r,array("descr"));
echo $r['start_date'] . "," .$r['start_time'] . "," . $r['end'] . "," . $r['case_id'] . "," . $r['qd'] . "," . $r['spl'] . "," . $r['cpi'] . "," . $r['opname'] . "," . $r['descr'] . "," . $r['casenotes'] . "," . $r['firstName'] . "\n"; echo $r['start_date'] . "," .$r['start_time'] . "," . $r['end'] . "," . $r['case_id'] . "," . $r['qd'] . "," . $r['spl'] . "," . $r['cpi'] . "," . $r['opname'] . "," . $r['descr'] . "," . $r['casenotes'] . "," . $r['firstName'] . "\n";
} }
@@ -151,7 +151,7 @@ if ($operator_id)
} }
else else
{ {
translate_array($rs,array("des")); translate_array($rs,array("descr"));
$datacol = array("start_date", "start_time","end","case_id","qd","spl","cpi","opname","descr","casenotes","firstName"); $datacol = array("start_date", "start_time","end","case_id","qd","spl","cpi","opname","descr","casenotes","firstName");
$headers = array(T_("Date"), T_("Start time"), T_("End time"),T_("Case ID"),T_("Questionnaire"),T_("Sample"),T_("Phone number"),T_("Operator"),T_("Outcome"),T_("Case notes"),T_("Respondent")); $headers = array(T_("Date"), T_("Start time"), T_("End time"),T_("Case ID"),T_("Questionnaire"),T_("Sample"),T_("Phone number"),T_("Operator"),T_("Outcome"),T_("Case notes"),T_("Respondent"));

View File

@@ -42,7 +42,7 @@ include ("../db.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions

View File

@@ -42,7 +42,7 @@ include ("../db.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions
@@ -75,7 +75,8 @@ if ($operator_id)
if (!empty($rs)){ if (!empty($rs)){
print "<h2 class=' '>" . T_("Project") . ":&emsp;<span class='text-primary'>{$rs['qd']}</span></h2>"; print "<h2 class=' '>" . T_("Project") . ":&emsp;<span class='text-primary'>{$rs['qd']}</span></h2>";
if($sample_import_id=intval($_GET['sample_import_id'])){ if( isset($_GET['sample_import_id'])){
$sample_import_id=intval($_GET['sample_import_id']);
$sql = "SELECT si.description as sd $sql = "SELECT si.description as sd
FROM `sample_import` as si FROM `sample_import` as si
WHERE si.sample_import_id = '$sample_import_id' ;"; WHERE si.sample_import_id = '$sample_import_id' ;";
@@ -85,7 +86,8 @@ if ($operator_id)
} }
else{$sid = " ";}; else{$sid = " ";};
if($oper_id= intval($_GET['oper_id'])){ if( isset($_GET['oper_id'])){
$oper_id= intval($_GET['oper_id']);
$sql = "SELECT CONCAT(op.firstname, op.lastname) as opname $sql = "SELECT CONCAT(op.firstname, op.lastname) as opname
FROM `operator` as op FROM `operator` as op
WHERE op.operator_id = '$oper_id' ;"; WHERE op.operator_id = '$oper_id' ;";

View File

@@ -15,7 +15,7 @@ include ("../db.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions
@@ -110,19 +110,24 @@ function case_status_report($questionnaire_id = false, $sample_id = false, $outc
LEFT JOIN outcome as co ON (co.outcome_id = ca.outcome_id) LEFT JOIN outcome as co ON (co.outcome_id = ca.outcome_id)
LEFT JOIN case_queue as cq ON (cq.case_id = c.case_id) LEFT JOIN case_queue as cq ON (cq.case_id = c.case_id)
LEFT JOIN operator as oq ON (cq.operator_id = oq.operator_id) LEFT JOIN operator as oq ON (cq.operator_id = oq.operator_id)
LEFT JOIN (questionnaire_sample_quota as qsq) on (s.import_id = qsq.sample_import_id and c.questionnaire_id = qsq.questionnaire_id)
LEFT JOIN (questionnaire_sample_quota_row as qsqr) on (s.import_id = qsqr.sample_import_id and c.questionnaire_id = qsqr.questionnaire_id)
WHERE c.current_operator_id IS NULL $q $o WHERE c.current_operator_id IS NULL $q $o
AND (qsq.quota_reached IS NULL OR qsq.quota_reached != 1 )
AND (qsqr.quota_reached IS NULL OR qsqr.quota_reached != 1)
ORDER BY c.case_id ASC"; ORDER BY c.case_id ASC";
// print $sql;
print ("<form method=\"post\" action=\"?questionnaire_id=$questionnaire_id&sample_import_id=$sample_id\">"); print ("<form method=\"post\" action=\"?questionnaire_id=$questionnaire_id&sample_import_id=$sample_id\">");
$rs2 = $db->GetAll($sql);
translate_array($rs2,array("outcomes"));
$datacol = array('case_id','samples','timezone','time','nrattempts','nrcalls','outcomes','availableinmin','assignedoperator','ordr','flag'); $datacol = array('case_id','samples','timezone','time','nrattempts','nrcalls','outcomes','availableinmin','assignedoperator','ordr','flag');
$headers = array(T_("Case id"),T_("Sample"),T_("Timezone"),T_("Time NOW"),T_("Call attempts"),T_("Calls"),T_("Outcome"),T_("Available in"),T_("Assigned to"),T_("Order"),"<i class='fa fa-check-square-o fa-lg'></i>"); $headers = array(T_("Case id"),T_("Sample"),T_("Timezone"),T_("Time NOW"),T_("Call attempts"),T_("Calls"),T_("Outcome"),T_("Available in"),T_("Assigned to"),T_("Order"),"<i class='fa fa-check-square-o fa-lg'></i>");
if (isset($_GET['sample_import_id'])){ unset($datacol[1]); unset($headers[1]); } if (isset($_GET['sample_import_id'])){ unset($datacol[1]); unset($headers[1]); }
xhtml_table($db->GetAll($sql),$datacol,$headers,"tclass",false,false,"bs-table"); xhtml_table($rs2,$datacol,$headers,"tclass",false,false,"bs-table");
$sql = "SELECT operator_id as value,CONCAT(firstName,' ', lastName) as description, '' selected $sql = "SELECT operator_id as value,CONCAT(firstName,' ', lastName) as description, '' selected
FROM operator FROM operator
@@ -206,7 +211,7 @@ if (isset($_GET['unassign']))
$db->CompleteTrans(); $db->CompleteTrans();
} }
xhtml_head(T_("Case status and assignment"),true,$css,$js_head);//array("../css/table.css"),array("../js/window.js") xhtml_head(T_("Case status and assignment"),true,$css,$js_head);
echo "<a href='' onclick='history.back();return false;' class='btn btn-default pull-left' ><i class='fa fa-chevron-left text-primary'></i>&emsp;" . T_("Go back") . "</a> echo "<a href='' onclick='history.back();return false;' class='btn btn-default pull-left' ><i class='fa fa-chevron-left text-primary'></i>&emsp;" . T_("Go back") . "</a>
<i class='fa fa-question-circle fa-3x text-primary pull-right btn' data-toggle='modal' data-target='.inform'></i>"; <i class='fa fa-question-circle fa-3x text-primary pull-right btn' data-toggle='modal' data-target='.inform'></i>";
?> ?>
@@ -237,7 +242,7 @@ print "<div class='form-group '><h3 class=' col-sm-2 text-right'>" . T_("Questio
display_questionnaire_chooser($questionnaire_id, false, "pull-left", "form-control"); display_questionnaire_chooser($questionnaire_id, false, "pull-left", "form-control");
if ($questionnaire_id){ if ($questionnaire_id){
print "<h3 class=' col-sm-2 text-right'>" . T_("Sample") . ":</h3>"; print "<h3 class=' col-sm-2 text-right'>" . T_("Sample") . ":</h3>";
display_sample_chooser($questionnaire_id,$sample_import_id,false, "pull-left", "form-control"); display_sample_chooser($questionnaire_id,$sample_import_id,false, "pull-left", "form-control", true);
print "</div> print "</div>
<div class='clearfix'></div>"; <div class='clearfix'></div>";

View File

@@ -43,7 +43,7 @@ include ("../db.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions

View File

@@ -47,7 +47,7 @@ include ("../db.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions

View File

@@ -1,4 +1,5 @@
<?php /** <?php
/**
* Display appointments * Display appointments
*/ */
@@ -15,7 +16,7 @@ include ("../db.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions
@@ -64,13 +65,21 @@ if (isset($_GET['start']) && isset($_GET['end']) && isset($_GET['update']))
{ {
$start = $db->qstr($_GET['start']); $start = $db->qstr($_GET['start']);
$end = $db->qstr($_GET['end']); $end = $db->qstr($_GET['end']);
$contact_phone_id = bigintval($_GET['contact_phone_id']); $case_id = bigintval($_GET['case_id']);
$respondent_id = bigintval($_GET['respondent_id']); $respondent_id = bigintval($_GET['respondent_id']);
$require_operator_id = "NULL"; $require_operator_id = "NULL";
if ($_GET['require_operator_id'] > 1) $require_operator_id = bigintval($_GET['require_operator_id']); if ($_GET['require_operator_id'] > 1) $require_operator_id = bigintval($_GET['require_operator_id']);
if ($_GET['new'] == 'create'){ //* add new number to db
$case_id = bigintval($_GET['case_id']); if ( isset($_GET['addphonenumber']) && !empty($_GET['addphonenumber'])){
add_contact_phone($case_id,$_GET['addphonenumber']);
$contact_phone_id = $db->Insert_ID();
}
else {
$contact_phone_id = bigintval($_GET['contact_phone_id']);
}
if (isset($_GET['new']) && $_GET['new'] == 'create'){
$operator_id = get_operator_id(); $operator_id = get_operator_id();
if ($operator_id == false) die(); if ($operator_id == false) die();
$sql = "SELECT Time_zone_name FROM respondent WHERE respondent_id = '$respondent_id'"; $sql = "SELECT Time_zone_name FROM respondent WHERE respondent_id = '$respondent_id'";
@@ -104,14 +113,15 @@ if (isset($_GET['start']) && isset($_GET['end']) && isset($_GET['update']))
$db->Execute($sql); $db->Execute($sql);
} }
unset ($_GET['start'],$_GET['end'],$_GET['appointment_id'],$_GET['case_id'],$_GET['new'],$_GET['update']); unset ($_GET['start'],$_GET['end'],$_GET['new'],$_GET['update'],$_GET['appointment_id'],$_GET['case_id'],$_GET['addphonenumber']); //
} }
if ( (isset($_GET['appointment_id']) && isset($_GET['case_id'])) ||(isset($_GET['new']) && isset($_GET['case_id']))) if ( (isset($_GET['appointment_id']) && isset($_GET['case_id'])) ||(isset($_GET['new']) && isset($_GET['case_id'])))
{ {
$appointment_id = bigintval($_GET['appointment_id']); if (isset($_GET['appointment_id'])) $appointment_id = bigintval($_GET['appointment_id']); else $appointment_id = "";
$case_id = bigintval($_GET['case_id']); if (isset($_GET['case_id'])) $case_id = bigintval($_GET['case_id']);
$require_operator_id = "NULL";
if (isset($_GET['delete'])) if (isset($_GET['delete']))
{ {
@@ -121,52 +131,38 @@ if ( (isset($_GET['appointment_id']) && isset($_GET['case_id'])) ||(isset($_GET[
xhtml_head(T_("Now modify case outcome"),true,$css,$js_head); xhtml_head(T_("Now modify case outcome"),true,$css,$js_head);
print "<div class='col-sm-6'><p class='well'>" . T_("The appointment has been deleted. Now you must modify the case outcome") . "</p> print "<div class='col-lg-6'><p class='well'>" . T_("The appointment has been deleted. Now you must modify the case outcome") . "</p>
<a href='supervisor.php?case_id=$case_id' class='btn btn-default'>" . T_("Modify case outcome") . "</a></div>"; <a href='supervisor.php?case_id=$case_id' class='btn btn-default'>" . T_("Modify case outcome") . "</a></div>";
} }
else else
{ {
//Display an edit form $lang = DEFAULT_LOCALE ;
if ($_GET['new'] == 'new'){$title = T_("Create NEW appointment");} else{$title = T_("Edit appointment"); $subtitle = "ID&ensp;" . $appointment_id;} $sql = "SELECT CONVERT_TZ(NOW(),'SYSTEM',r.Time_zone_name) as startdate,
CONVERT_TZ(DATE_ADD(NOW(), INTERVAL 10 YEAR),'SYSTEM',r.Time_zone_name) as enddate,
r.respondent_id, ca.contact_phone_id
FROM `case` as c, `respondent` as r, `call` as ca
WHERE c.case_id = '$case_id'
AND r.case_id = c.case_id
AND c.last_call_id = ca.call_id";
$rs = $db->GetRow($sql);
xhtml_head($title,true,$css,$js_head,false,false,false,$subtitle); $startdate = $rs['startdate'];
$enddate = $rs['enddate'];
$respondent_id = $rs['respondent_id'];
if (!isset($contact_phone_id)) $contact_phone_id = $rs['contact_phone_id'];
$lang = DEFAULT_LOCALE; if (isset($_GET['new']) && $_GET['new'] == 'new'){
$title = T_("Create NEW appointment");
$sql = "SELECT CONVERT_TZ(NOW(),'SYSTEM',r.Time_zone_name) as startdate, CONVERT_TZ(DATE_ADD(NOW(), INTERVAL 10 YEAR),'SYSTEM',r.Time_zone_name) as enddate $subtitle ="";
FROM `case` as c, `respondent` as r $start = $startdate;
WHERE c.case_id = '$case_id' AND r.case_id = c.case_id";
$rs = $db->GetRow($sql);
$startdate = $rs['startdate'];
$enddate = $rs['enddate'];
print "<script type='text/javascript'>
$(document).ready(function() { var startDateTextBox = $('#start'); var endDateTextBox = $('#end');
$.timepicker.datetimeRange(
startDateTextBox,endDateTextBox,{
minInterval: (1000*60*15), // 15min
numberOfMonths: 2,
dateFormat: 'yy-mm-dd',
timeFormat: 'HH:mm:ss',
showSecond: false,
regional: '$lang',
hourMin: 0,
hourMax: 23,
stepMinute: 5,
hourGrid: 2,
minuteGrid: 10,
minDate: '$startdate',
maxDate: '$enddate'
});});</script>";
if ($_GET['new'] =='new'){
$start = $startdate;
$end = $enddate; $end = $enddate;
$rtz = $_GET['rtz']; $rtz = $_GET['rtz'];
} }
if (isset($_GET['appointment_id'])) { if (isset($_GET['appointment_id'])) {
$title = T_("Edit appointment");
$subtitle = "ID&ensp;" . $appointment_id;
$sql = "SELECT a.contact_phone_id,a.call_attempt_id, CONVERT_TZ(a.start,'UTC',r.Time_zone_name) as `start`, CONVERT_TZ(a.end,'UTC',r.Time_zone_name) as `end`, a.respondent_id, a.require_operator_id, r.Time_zone_name as rtz $sql = "SELECT a.contact_phone_id,a.call_attempt_id, CONVERT_TZ(a.start,'UTC',r.Time_zone_name) as `start`, CONVERT_TZ(a.end,'UTC',r.Time_zone_name) as `end`, a.respondent_id, a.require_operator_id, r.Time_zone_name as rtz
FROM `appointment` as a, respondent as r FROM `appointment` as a, respondent as r
@@ -184,33 +180,76 @@ if ( (isset($_GET['appointment_id']) && isset($_GET['case_id'])) ||(isset($_GET[
$end = $rs['end']; $end = $rs['end'];
$rtz = $rs['rtz']; $rtz = $rs['rtz'];
} }
else die(T_("ERROR in DB records, Check tables 'appointment' and 'respondent' and Time zone settings"));
} }
print "<form action='?' method='get' class='form-horizontal'>";
print "<label class='pull-left text-right control-label col-sm-2' for='respondent_id'>" . T_("Respondent") . "</label>";
display_chooser($db->GetAll("SELECT respondent_id as value, CONCAT(firstName,' ',lastName) as description, //Display an edit form
CASE when respondent_id = '$respondent_id' THEN 'selected=\'selected\'' ELSE '' END as selected xhtml_head($title,true,$css,$js_head,false,false,false,$subtitle);
FROM respondent
WHERE case_id = '$case_id'"),"respondent_id","respondent_id",false,false,false,true,false,true,"pull-left");
print "<br/><br/><label for='contact_phone_id' class='pull-left text-right control-label col-sm-2'>" . T_("Contact phone") . "</label>"; print "<script type='text/javascript'>
display_chooser($db->GetAll("SELECT contact_phone_id as value, phone as description, $(document).ready(function() { var startDateTextBox = $('#start'); var endDateTextBox = $('#end');
CASE when contact_phone_id = '$contact_phone_id' THEN 'selected=\'selected\'' ELSE '' END as selected $.timepicker.datetimeRange(
FROM contact_phone startDateTextBox,endDateTextBox,{
WHERE case_id = '$case_id'"), minInterval: (1000*60*15), // 15min
"contact_phone_id","contact_phone_id",false,false,false,true,false,true,"pull-left"); numberOfMonths: 2,
dateFormat: 'yy-mm-dd',
timeFormat: 'HH:mm:ss',
showSecond: false,
regional: '$lang',
hourMin: 0,
hourMax: 23,
stepMinute: 5,
hourGrid: 2,
minuteGrid: 10,
minDate: '$startdate',
maxDate: '$enddate'
});});</script>";
print "<form action='?' method='get' class='form-horizontal form-group'>";
print "<label class='pull-left text-right control-label col-lg-2' for='respondent_id'>" . T_("Respondent") . "</label>";
display_chooser($db->GetAll("SELECT respondent_id as value, CONCAT(firstName,' ',lastName) as description,
CASE when respondent_id = '$respondent_id' THEN 'selected=\'selected\'' ELSE '' END as selected
FROM respondent
WHERE case_id = '$case_id'"),"respondent_id","respondent_id",false,false,false,true,false,true,"pull-left");
print "<br/><br/><label for='contact_phone_id' class='pull-left text-right control-label col-lg-2'>" . T_("Contact phone") . "</label>";
$sql = "SELECT contact_phone_id as value, phone as description,
CASE when contact_phone_id = '$contact_phone_id' THEN 'selected=\'selected\'' ELSE '' END as selected
FROM contact_phone
WHERE case_id = '$case_id'";
$rs = $db->GetAll($sql);
//* added option to add new number
print "<div class=\"pull-left\"><select class=\"form-control\" id='contact_phone_id' name='contact_phone_id'
onchange=\"if($(this).val()=='add'){ $('#addPhone').show(); } else{ $('#addPhone').hide(); } \">";
foreach($rs as $l)
{
print "<option value='{$l['value']}' {$l['selected']} >{$l['description']}</option>";
}
print "<option value='add'>" . T_("Add new phone number") . "</option></select></div>";
print "<div class='col-lg-4' id='addPhone' style='display:none'>
<div class='col-lg-6' id=''>
<input type=\"tel\" maxlength=\"10\" pattern=\"[0-9]{10}\" class='form-control col-lg-2 ' name='addphonenumber' />
</div>
</div>";
//*end option
print "<div class='clearfix'></div></br><div class='alert alert-info col-lg-6 '>". T_("ATTENTION! Keep in mind that you're setting 'Start' & 'End' appoinment times in RESPONDENT LOCAL TIME !!!") . "</div><div class='clearfix'></div>";
print "<div class='clearfix'></div></br><div class='alert alert-info col-sm-6 '>". T_("ATTENTION! Keep in mind that you're setting 'Start' & 'End' appoinment times in RESPONDENT LOCAL TIME !!!") . "</div><div class='clearfix'></div>";
date_default_timezone_set($rtz); date_default_timezone_set($rtz);
print "<label class='text-right col-sm-2 control-label'>" . T_("Respondent TimeZone") . ":</label>
<h4 class='col-sm-2 text-danger text-uppercase fa-lg'>" . $rtz . "</h4> print "<label class='text-right col-lg-2 control-label'>" . T_("Respondent TimeZone") . ":</label>
<h4 class='col-lg-2 text-danger text-uppercase fa-lg'>" . $rtz . "</h4>
<label class=''>" . T_("Respondent Time") . ":&emsp;<b class='fa fa-2x '>" . date("H:i:s") . "</b></label>"; <label class=''>" . T_("Respondent Time") . ":&emsp;<b class='fa fa-2x '>" . date("H:i:s") . "</b></label>";
print "<br/><br/><label class='pull-left text-right control-label col-sm-2' for='start'>" . T_("Start time") . "</label> print "<br/><br/><label class='pull-left text-right control-label col-lg-2' for='start'>" . T_("Start time") . "</label>
<div class='pull-left'><input class='form-control' type='text' value='$start' id='start' name='start'/></div>"; <div class='pull-left'><input class='form-control' type='text' value='$start' id='start' name='start'/></div>";
print "<br/><br/><label class='pull-left text-right control-label col-sm-2' for='end'>" . T_("End time") . "</label> print "<br/><br/><label class='pull-left text-right control-label col-lg-2' for='end'>" . T_("End time") . "</label>
<div class='pull-left'><input class='form-control' type='text' value='$end' id='end' name='end'/></div>"; <div class='pull-left'><input class='form-control' type='text' value='$end' id='end' name='end'/></div>";
print "<br/><br/><label class='pull-left text-right control-label col-sm-2' for='require_operator_id'>" . T_("Appointment with") . "</label>"; print "<br/><br/><label class='pull-left text-right control-label col-lg-2' for='require_operator_id'>" . T_("Appointment with") . "</label>";
$ops = $db->GetAll("SELECT o.operator_id as value, $ops = $db->GetAll("SELECT o.operator_id as value,
CONCAT(o.firstName, ' ', o.lastName) as description, CONCAT(o.firstName, ' ', o.lastName) as description,
CASE WHEN o.operator_id = '$require_operator_id' THEN 'selected=\'selected\'' ELSE '' END as selected CASE WHEN o.operator_id = '$require_operator_id' THEN 'selected=\'selected\'' ELSE '' END as selected
@@ -225,17 +264,25 @@ if ( (isset($_GET['appointment_id']) && isset($_GET['case_id'])) ||(isset($_GET[
} }
} }
array_unshift($ops,array('value'=>0,'description'=>T_("Any operator"),'selected'=>$selected)); array_unshift($ops,array('value'=>0,'description'=>T_("Any operator"),'selected'=>$selected));
display_chooser($ops,"require_operator_id","require_operator_id",false,false,false,true,false,true,"pull-left");
print "<input type='hidden' value='$appointment_id' id='appointment_id' name='appointment_id'/><input type='hidden' value='update' id='update' name='update'/>";
if ($_GET['new'] == 'new') { print "<input type='hidden' value='create' id='new' name='new'/><input type='hidden' value='$case_id' id='case_id' name='case_id'/>";} display_chooser($ops,"require_operator_id","require_operator_id",false,false,false,true,false,true,"pull-left");
print " <input type='hidden' value='$appointment_id' id='appointment_id' name='appointment_id'/>
<input type='hidden' value='update' id='update' name='update'/>
<input type='hidden' value='$case_id' id='case_id' name='case_id'/>";
if (isset($_GET['new']) && $_GET['new'] == 'new') {
print "<input type='hidden' value='create' id='new' name='new'/>";
}
print "<div class='clearfix'></div><br/><br/> print "<div class='clearfix'></div><br/><br/>
<div class='col-sm-2'><a href='' onclick='history.back();return false;' class='btn btn-default pull-left'><i class='fa fa-ban fa-lg'></i>&emsp;" . T_("Cancel edit") . "</a></div>"; <div class='col-lg-2'><a href='?' class='btn btn-default pull-left'><i class='fa fa-ban fa-lg'></i>&emsp;" . T_("Cancel edit") . "</a></div>";
print "<div class='col-sm-2'><button type='submit' class='btn btn-primary btn-block'><i class='fa fa-floppy-o fa-lg'></i>&emsp;" . T_("Save changes") . "</button></div>"; print "<div class='col-lg-2'>
<button type='submit' class='btn btn-primary btn-block'><i class='fa fa-floppy-o fa-lg'></i>&emsp;" . T_("Save changes") . "</button>
</div>";
print "<div class='col-sm-2'><a href='' class='btn btn-default pull-right' toggle='confirmation' data-placement='left' data-href='?delete=delete&amp;appointment_id=$appointment_id&amp;case_id=$case_id' ><i class='fa fa-trash fa-lg text-danger'></i>&emsp;" . T_("Delete this appointment") . "</a></div>"; print "<div class='col-lg-2'><a href='' class='btn btn-default pull-right' toggle='confirmation' data-placement='left' data-href='?delete=delete&amp;appointment_id=$appointment_id&amp;case_id=$case_id' ><i class='fa fa-trash fa-lg text-danger'></i>&emsp;" . T_("Delete this appointment") . "</a></div>";
print "</form>"; print "</form>";
} }
@@ -243,45 +290,53 @@ if ( (isset($_GET['appointment_id']) && isset($_GET['case_id'])) ||(isset($_GET[
else { else {
$operator_id = get_operator_id(); $operator_id = get_operator_id();
$subtitle = T_("Appointments"); $subtitle = T_("Appointments");
xhtml_head(T_("Display Appointments"),true,$css,$js_head,false,30); //array("../css/table.css") xhtml_head(T_("Display Appointments"),true,$css,$js_head,false,30);
print "<h3>" . T_("All appointments (with times displayed in your time zone)") . "</h3>"; print "<h3>" . T_("All appointments (with times displayed in your time zone)") . "</h3>";
$sql = "SELECT q.description, CONVERT_TZ(a.start,'UTC',@@session.time_zone) as start, CONVERT_TZ(a.end,'UTC',@@session.time_zone) as end,CONCAT(r.firstName, ' ', r.lastName) as resp, IFNULL(ou.description,'" . TQ_("Not yet called") . "') as outcome, oo.firstName as makerName, ooo.firstName as callerName, $sql = "SELECT q.description, si.description as smpl, CONVERT_TZ(a.start,'UTC',@@session.time_zone) as start, CONVERT_TZ(a.end,'UTC',@@session.time_zone) as end,CONCAT(r.firstName, ' ', r.lastName) as resp, IFNULL(ou.description,'" . TQ_("Not yet called") . "') as outcome, oo.firstName as makerName, ooo.firstName as callerName,
CONCAT('<a href=\'supervisor.php?case_id=', c.case_id, '\'>', c.case_id, '</a>') as case_id, CONCAT('<a href=\'supervisor.php?case_id=', c.case_id, '\'>', c.case_id, '</a>') as case_id,
CONCAT('&emsp;<a href=\'\'><i class=\'fa fa-trash-o fa-lg text-danger\' toggle=\'confirmation\' data-placement=\'left\' data-href=\'?case_id=', c.case_id, '&amp;appointment_id=', a.appointment_id, '&amp;delete=delete\' ></i></a>&emsp;') as link, CONCAT('&emsp;<a href=\'\'><i class=\'fa fa-trash-o fa-lg text-danger\' toggle=\'confirmation\' data-placement=\'left\' data-href=\'?case_id=', c.case_id, '&amp;appointment_id=', a.appointment_id, '&amp;delete=delete\' ></i></a>&emsp;') as link,
CONCAT('&emsp;<a href=\'?case_id=', c.case_id, '&amp;appointment_id=', a.appointment_id, '\'><i class=\'fa fa-pencil-square-o fa-lg\' ></i></a>&emsp;') as edit,IFNULL(ao.firstName,'" . TQ_("Any operator") . "') as witho CONCAT('&emsp;<a href=\'?case_id=', c.case_id, '&amp;appointment_id=', a.appointment_id, '\'><i class=\'fa fa-pencil-square-o fa-lg\' ></i></a>&emsp;') as edit,IFNULL(ao.firstName,'" . TQ_("Any operator") . "') as witho
FROM appointment as a FROM appointment as a
JOIN (`case` as c, respondent as r, questionnaire as q, operator as oo, call_attempt as cc) on (a.case_id = c.case_id and a.respondent_id = r.respondent_id and q.questionnaire_id = c.questionnaire_id and a.call_attempt_id = cc.call_attempt_id and cc.operator_id = oo.operator_id) JOIN (`case` as c, respondent as r, questionnaire as q, operator as oo, call_attempt as cc, `sample` as s, sample_import as si) on (c.sample_id = s.sample_id and a.case_id = c.case_id and a.respondent_id = r.respondent_id and q.questionnaire_id = c.questionnaire_id and a.call_attempt_id = cc.call_attempt_id and cc.operator_id = oo.operator_id and si.sample_import_id = s.import_id)
LEFT JOIN (`call` as ca, outcome as ou, operator as ooo) ON (ca.call_id = a.completed_call_id and ou.outcome_id = ca.outcome_id and ca.operator_id = ooo.operator_id) LEFT JOIN (`call` as ca, outcome as ou, operator as ooo) ON (ca.call_id = a.completed_call_id and ou.outcome_id = ca.outcome_id and ca.operator_id = ooo.operator_id)
LEFT JOIN operator AS ao ON ao.operator_id = a.require_operator_id LEFT JOIN operator AS ao ON ao.operator_id = a.require_operator_id
WHERE a.end >= CONVERT_TZ(NOW(),'System','UTC') AND c.current_outcome_id !=10 LEFT JOIN (questionnaire_sample_quota as qsq) on (s.import_id = qsq.sample_import_id and c.questionnaire_id = qsq.questionnaire_id)
LEFT JOIN (questionnaire_sample_quota_row as qsqr) on (s.import_id = qsqr.sample_import_id and c.questionnaire_id = qsqr.questionnaire_id)
WHERE q.enabled=1 AND si.enabled=1 AND a.end >= CONVERT_TZ(NOW(),'System','UTC') AND c.current_outcome_id !=10
AND (qsq.quota_reached IS NULL OR qsq.quota_reached != 1)
AND (qsqr.quota_reached IS NULL OR qsqr.quota_reached != 1)
ORDER BY a.start ASC"; ORDER BY a.start ASC";
$rs = $db->GetAll($sql); $rs = $db->GetAll($sql);
if (!empty($rs)) { if (!empty($rs)) {
translate_array($rs,array("outcome")); translate_array($rs,array("outcome"));
xhtml_table($rs,array("description","case_id","start","end","edit","makerName","witho","resp","outcome","callerName","link"),array(T_("Questionnaire"),T_("Case ID"),T_("Start"),T_("End"),"&emsp;<i class='fa fa-pencil-square-o fa-lg' data-toggle='tooltip' title='" . T_("Edit") . "'></i>&emsp;",T_("Created by"),T_("Appointment with"),T_("Respondent"),T_("Current outcome"),T_("Operator who called"),"&emsp;<i class='fa fa-trash-o fa-lg' data-toggle='tooltip' title='" . T_("Delete") . "'></i>&emsp;"),"tclass",false,false,"bs-table"); xhtml_table($rs,array("description","smpl","case_id","start","end","edit","makerName","witho","resp","outcome","callerName","link"),array(T_("Questionnaire"),T_("Sample"),T_("Case ID"),T_("Start"),T_("End"),"&emsp;<i class='fa fa-pencil-square-o fa-lg' data-toggle='tooltip' title='" . T_("Edit") . "'></i>&emsp;",T_("Created by"),T_("Appointment with"),T_("Respondent"),T_("Current outcome"),T_("Operator who called"),"&emsp;<i class='fa fa-trash-o fa-lg' data-toggle='tooltip' title='" . T_("Delete") . "'></i>&emsp;"),"tclass",false,false,"bs-table");
} else print "<h4 class='well text-info'>" . T_("No future appointments") . "</h4>"; } else print "<h4 class='well text-info'>" . T_("No future appointments") . "</h4>";
print "<h3 style='color:red'>" . T_("Missed appointments (with times displayed in your time zone)") . "</h3>"; print "<h3 style='color:red'>" . T_("Missed appointments (with times displayed in your time zone)") . "</h3>";
$sql = "SELECT q.description, CONVERT_TZ(a.start,'UTC',@@session.time_zone) as start, CONVERT_TZ(a.end,'UTC',@@session.time_zone) as end, CONCAT(r.firstName, ' ', r.lastName) as resp, $sql = "SELECT q.description, si.description as smpl, CONVERT_TZ(a.start,'UTC',@@session.time_zone) as start, CONVERT_TZ(a.end,'UTC',@@session.time_zone) as end, CONCAT(r.firstName, ' ', r.lastName) as resp,
CONCAT('<a href=\'supervisor.php?case_id=', c.case_id, '\'>', c.case_id, '</a>') as case_id, CONCAT('<a href=\'supervisor.php?case_id=', c.case_id, '\'>', c.case_id, '</a>') as case_id,
CONCAT('&emsp;<a href=\'\'><i class=\'fa fa-trash-o fa-lg text-danger\' toggle=\'confirmation\' data-placement=\'left\' data-href=\'?case_id=', c.case_id, '&amp;appointment_id=', a.appointment_id, '&amp;delete=delete\' ></i></a>&emsp;') as link, CONCAT('&emsp;<a href=\'\'><i class=\'fa fa-trash-o fa-lg text-danger\' toggle=\'confirmation\' data-placement=\'left\' data-href=\'?case_id=', c.case_id, '&amp;appointment_id=', a.appointment_id, '&amp;delete=delete\' ></i></a>&emsp;') as link,
CONCAT('&emsp;<a href=\'?case_id=', c.case_id, '&amp;appointment_id=', a.appointment_id, '\'><i class=\'fa fa-pencil-square-o fa-lg\' ></i></a>&emsp;') as edit CONCAT('&emsp;<a href=\'?case_id=', c.case_id, '&amp;appointment_id=', a.appointment_id, '\'><i class=\'fa fa-pencil-square-o fa-lg\' ></i></a>&emsp;') as edit
FROM appointment as a FROM appointment as a
JOIN (`case` as c, respondent as r, questionnaire as q, `sample` as s, sample_import as si) on (a.case_id = c.case_id and a.respondent_id = r.respondent_id and q.questionnaire_id = c.questionnaire_id and s.sample_id = c.sample_id and s.import_id= si.sample_import_id) JOIN (`case` as c, respondent as r, questionnaire as q, `sample` as s, sample_import as si) on (a.case_id = c.case_id and a.respondent_id = r.respondent_id and q.questionnaire_id = c.questionnaire_id and s.sample_id = c.sample_id and s.import_id= si.sample_import_id)
LEFT JOIN (`call` as ca) ON (ca.call_id = a.completed_call_id) LEFT JOIN (`call` as ca) ON (ca.call_id = a.completed_call_id)
WHERE q.enabled=1 AND si.enabled = 1 AND a.end < CONVERT_TZ(NOW(),'System','UTC') AND a.completed_call_id IS NULL AND c.current_outcome_id !=10 LEFT JOIN (questionnaire_sample_quota as qsq) on (s.import_id = qsq.sample_import_id and c.questionnaire_id = qsq.questionnaire_id)
LEFT JOIN (questionnaire_sample_quota_row as qsqr) on (s.import_id = qsqr.sample_import_id and c.questionnaire_id = qsqr.questionnaire_id)
WHERE q.enabled=1 AND si.enabled=1 AND a.end < CONVERT_TZ(NOW(),'System','UTC') AND a.completed_call_id IS NULL AND c.current_outcome_id !=10
AND (qsq.quota_reached IS NULL OR qsq.quota_reached != 1 )
AND (qsqr.quota_reached IS NULL OR qsqr.quota_reached != 1)
GROUP BY c.case_id GROUP BY c.case_id
ORDER BY a.start ASC"; ORDER BY a.start ASC";
$rs = $db->GetAll($sql); $rs = $db->GetAll($sql);
if (!empty($rs)) { if (!empty($rs)) {
xhtml_table($rs,array("description","case_id","start","end","edit","resp","link"),array(T_("Questionnaire"),T_("Case ID"),T_("Start"),T_("End"),"&emsp;<i class='fa fa-pencil-square-o fa-lg' data-toggle='tooltip' title='" . T_("Edit") . "'></i>&emsp;",T_("Respondent"),"&emsp;<i class='fa fa-trash-o fa-lg' data-toggle='tooltip' title='" . T_("Delete") . "'></i>&emsp;"),"tclass",false,false,"bs-table"); xhtml_table($rs,array("description","smpl","case_id","start","end","edit","resp","link"),array(T_("Questionnaire"),T_("Sample"),T_("Case ID"),T_("Start"),T_("End"),"&emsp;<i class='fa fa-pencil-square-o fa-lg' data-toggle='tooltip' title='" . T_("Edit") . "'></i>&emsp;",T_("Respondent"),"&emsp;<i class='fa fa-trash-o fa-lg' data-toggle='tooltip' title='" . T_("Delete") . "'></i>&emsp;"),"tclass",false,false,"bs-table");
} else print "<h4 class='well text-info'>" . T_("No appointments missed") . "</h4>"; } else print "<h4 class='well text-info'>" . T_("No missed appointments") . "</h4>";
} }
xhtml_foot($js_foot); xhtml_foot($js_foot);

View File

@@ -41,7 +41,7 @@ include ("../db.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions
@@ -185,27 +185,29 @@ if (isset($_GET['edit']) || isset($_GET['addext']))
WHERE extension_id = " . intval($_GET['edit']); WHERE extension_id = " . intval($_GET['edit']);
$rs = $db->GetRow($sql); $rs = $db->GetRow($sql);
} else $rs = array(); }
print "<a href='?' class='btn btn-default pull-left'>" . T_("Go back") . "</a>";
?> ?>
<div class="panel-body "> <div class="panel-body ">
<h3 class="col-sm-offset-3"><?php if (isset($_GET['edit']))echo T_("Edit extension"); else echo T_("Add an extension");?></h3> <h3 class="col-lg-offset-3"><?php if (isset($_GET['edit']))echo T_("Edit extension"); else echo T_("Add an extension");?></h3>
<form enctype="multipart/form-data" action="?" method="post" name="editext" class="form-horizontal"> <form enctype="multipart/form-data" action="?" method="post" name="editext" class="form-horizontal">
<div class="form-group form-inline"> <div class="form-group form-inline">
<label class="control-label col-sm-3"><?php echo T_("Extension name: ");?></label> <label class="control-label col-lg-3"><?php echo T_("Extension name: ");?></label>
<input name="extension" type="text" placeholder="<?php echo T_("such as SIP/1000");?>" maxlength="12" required value="<?php echo $rs['extension'];?>" class="form-control"/> <input name="extension" type="text" placeholder="<?php echo T_("such as SIP/1000");?>" maxlength="12" required value="<?php if (isset($_GET['edit']))echo $rs['extension'];?>" class="form-control"/>
</div> </div>
<div class="form-group form-inline"> <div class="form-group form-inline">
<label class="control-label col-sm-3"><?php echo T_("Extension password: ");?></label> <label class="control-label col-lg-3"><?php echo T_("Extension password: ");?></label>
<input name="password" type="text" required pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}" style="width:20em;" maxlength="50" value="<?php echo $rs['password'];?>" class="form-control pull-left" placeholder="<?php echo T_("Enter New Password");?>"/>&emsp;&emsp;<?php echo T_(" or ");?>&ensp; <input name="password" type="text" required pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}" style="width:20em;" maxlength="50" value="<?php if (isset($_GET['edit'])) echo $rs['password'];?>" class="form-control pull-left" placeholder="<?php echo T_("Enter New Password");?>"/>&emsp;&emsp;<?php echo T_(" or ");?>&ensp;
<input type="button" onclick="generate();" value="<?php echo T_("Generate");?>" class="btn btn-default fa" />&emsp;<?php echo T_("New password");?>&ensp; <input type="button" onclick="generate();" value="<?php echo T_("Generate");?>" class="btn btn-default fa" />&emsp;<?php echo T_("New password");?>&ensp;
<input type="number" name="number" value="25" min="8" max="50" style="width:5em;" class="form-control" />&ensp;<?php echo T_("characters long");?> <input type="number" name="number" value="25" min="8" max="50" style="width:5em;" class="form-control" />&ensp;<?php echo T_("characters long");?>
</div> </div>
<div class=" col-sm-offset-3 "> <div class="form-group form-inline">
<input type="submit" class="btn btn-primary " value="<?php if (isset($_GET['edit'])) echo T_("Save changes"); else echo T_("Add extension"); ?>" /> <div class='col-lg-3'>
</div> <a href='?' class='btn btn-default'><?php echo T_("Cancel") ;?></a>
</div>
<input type="submit" class="btn btn-primary pull-left" value="<?php if (isset($_GET['edit'])) echo T_("Save changes"); else echo T_("Add extension"); ?>" />
<?php if (isset($_GET['edit'])){?> <?php if (isset($_GET['edit'])){?>
@@ -213,13 +215,13 @@ if (isset($_GET['edit']) || isset($_GET['addext']))
<?php if (empty($rs['current_operator_id'])) { ?> <?php if (empty($rs['current_operator_id'])) { ?>
<input type="submit" name="delete" class="btn btn-danger " data-toggle="confirmation" value="<?php echo T_("Delete extension"); ?>" /> <input type="submit" name="delete" class="btn btn-danger col-lg-offset-2 pull-left" data-toggle="confirmation" value="<?php echo T_("Delete extension"); ?>" />
<?php } else <?php } else
print "</br></br><b class='well text-danger'>" . T_("Unassign the operator from this extension to be able to delete it") . "</b>"; print "</br></br><b class='well text-danger'>" . T_("Unassign the operator from this extension to be able to delete it") . "</b>";
} }
print "</form></div>"; print "</div></form></div>";
} }
else else
{ {
@@ -241,8 +243,10 @@ else
$rs = $db->GetAll($sql); $rs = $db->GetAll($sql);
print "<div class='panel-body'>";
if ($msg != "") if ($msg != "")
print "<p>$msg</p>"; print "<p class='alert alert-warning'>$msg</p></br>";
if (!empty($rs)) if (!empty($rs))
{ {
@@ -258,14 +262,15 @@ else
if ($rs[$i]['assignment'] == "list") if ($rs[$i]['assignment'] == "list")
$rs[$i]['assignment'] = display_chooser($ers,"operator_id_" . $rs[$i]["extension_id"],"operator_id_" . $rs[$i]["extension_id"],true,"extension_id=".$rs[$i]["extension_id"],true,false,false,false); $rs[$i]['assignment'] = display_chooser($ers,"operator_id_" . $rs[$i]["extension_id"],"operator_id_" . $rs[$i]["extension_id"],true,"extension_id=".$rs[$i]["extension_id"],true,false,false,false);
} }
print "<div class='panel-body'>";
xhtml_table($rs,array("extension","firstName","assignment","status","case_id","state","calltime"),array(T_("Extension"),T_("Operator"),T_("Assignment"),T_("VoIP Status"),T_("Case ID"),T_("Call state"),T_("Time on call")),"tclass",array("vs" => "1")); xhtml_table($rs,array("extension","firstName","assignment","status","case_id","state","calltime"),array(T_("Extension"),T_("Operator"),T_("Assignment"),T_("VoIP Status"),T_("Case ID"),T_("Call state"),T_("Time on call")),"tclass",array("vs" => "1"));
print "</div>"; print "</br>";
} }
else else
print "<p>" . T_("No extensions") . "</p>"; print "<p class='alert alert-warning'>" . T_("No extensions") . "</p>";
print "<div class='col-sm-3'><a href='?addext=addext' class='btn btn-default '>" . T_("Add extension") . "</a></div>"; print "<a href='?addext=addext' class='btn btn-primary '>" . T_("Add extension") . "</a>
</div>";
} }

View File

@@ -11,7 +11,7 @@ include ("../config.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions

View File

@@ -41,7 +41,7 @@ include ("../config.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/* /*
* XHTML file * XHTML file
@@ -85,21 +85,21 @@ include ("../functions/functions.operator.php");
<ul class="nav navbar-nav pull-right"> <ul class="nav navbar-nav pull-right">
<li class=" "> <li class=" ">
<a href="../" class=" " target="_blanc" style="padding-top: 20px; "> <a href="../index.php" class=" " target="_blanc" style="padding-top: 20px; ">
<i class="fa fa-lg fa-users"></i><?php print T_("Operator panel");?> <i class="fa fa-sign-in fa-lg fa-fw "></i><?php print T_("Operator panel");?>
</a> </a>
</li> </li>
<li class=" "> <li class=" ">
<a href="../client/index.php" class=" " target="_blanc" style="padding-top: 20px; "> <a href="../client/index.php" class=" " target="_blanc" style="padding-top: 20px; ">
<i class="fa fa-user-secret fa-lg fa-fw "></i><?php print T_("Client panel");?> <i class="fa fa-user-secret fa-lg fa-fw "></i><?php print T_("Client panel");?>
</a> </a>
</li> </li>
<li class="dropdown pull-right user-data"> <li class="dropdown pull-right user-data">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" style=" min-width: 160px;"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" style=" min-width: 160px;">
<i class="fa fa-user fa fa-fw "></i><?php print T_("Logged as:") . "&ensp;" . $username ;?> <i class="fa fa-user fa-fw "></i><?php print T_("Logged as:") . "&ensp;" . $username ;?>
</a> </a>
<!--- User menu // not connected to pages so not working yet // could be hidden --> <!--- User menu // not connected to pages so not working yet // could be hidden -->
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li><a href="?g=5&amp;page=operatorlist.php?edit=<?php print get_operator_id(); ?>"><i class="fa fa-cogs fa-fw "></i>&ensp;<?php print T_("Settings"); ?></a></li> <li><a href="?g=5&amp;page=operatorlist.php?edit=<?php print get_operator_id(); ?>"><i class="fa fa-cogs fa-fw "></i>&ensp;<?php print T_("Settings"); ?></a></li>
<!--- <li><a href="../screenloc.php"><i class="fa fa-lock fa-fw "></i>&ensp;<?php print T_("Lock Screen"); ?></a></li> --> <!--- <li><a href="../screenloc.php"><i class="fa fa-lock fa-fw "></i>&ensp;<?php print T_("Lock Screen"); ?></a></li> -->
<li><a href="../include/limesurvey/admin/admin.php?action=logout"><i class="fa fa-sign-out fa-fw "></i>&ensp;<?php print T_("Logout"); ?> </a></li> <li><a href="../include/limesurvey/admin/admin.php?action=logout"><i class="fa fa-sign-out fa-fw "></i>&ensp;<?php print T_("Logout"); ?> </a></li>

View File

@@ -14,7 +14,7 @@ include ("../db.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions

View File

@@ -42,7 +42,7 @@ include_once(dirname(__FILE__).'/../db.inc.php');
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions
@@ -195,7 +195,7 @@ function generate() {
} }
</script> </script>
<div class="form-group clearfix"><div class="col-sm-3"><a href='?' class="btn btn-default"><?php echo T_("Go back") ;?></a></div><div class="col-sm-6"> <div class="form-group clearfix"><div class="col-lg-3"><a href='?' class="btn btn-default"><?php echo T_("Go back") ;?></a></div><div class="col-lg-6">
<?php <?php
print "<h3>" . T_("Operator") . ": " . $rs['username'] . "</h3>"; print "<h3>" . T_("Operator") . ": " . $rs['username'] . "</h3>";
echo "</div></div>"; echo "</div></div>";
@@ -213,78 +213,92 @@ function generate() {
?> ?>
<form action="?" method="post" class="form-horizontal panel-body" name="operform"> <form action="?" method="post" class="form-horizontal panel-body" name="operform">
<div class="form-group"> <div class="form-group">
<label for="username" class="col-sm-3 control-label"><?php echo T_("Username") . ": "; ?></label> <label for="username" class="col-lg-3 control-label"><?php echo T_("Username") . ": "; ?></label>
<div class="col-sm-3"><input type='text' name='username' class="form-control" value="<?php echo $rs['username'];?>"/></div> <div class="col-lg-3"><input type='text' name='username' class="form-control" value="<?php echo $rs['username'];?>"/></div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="password" class="col-sm-3 control-label"><?php echo T_("Password") . ": "; ?></label> <label for="password" class="col-lg-3 control-label"><?php echo T_("Password") . ": "; ?></label>
<div class="col-sm-3"><input type='text' name='password' class="form-control" placeholder="<?php echo T_("leave blank to keep existing password");?>"/></div> <div class="col-lg-3"><input type='text' name='password' class="form-control" placeholder="<?php echo T_("leave blank to keep existing password");?>"/></div>
<div class="col-sm-6 form-inline">&emsp; <div class="col-lg-6 form-inline">&emsp;
<input type="button" onclick="generate();" value="<?php echo T_("Generate");?>" class="btn btn-default"/>&emsp;<?php echo T_("Password with");?>&ensp; <input type="button" onclick="generate();" value="<?php echo T_("Generate");?>" class="btn btn-default"/>&emsp;<?php echo T_("Password with");?>&ensp;
<input type="number" name="number" value="25" min="8" max="50" style="width:5em;" class="form-control" />&ensp;<?php echo T_("characters");?> <input type="number" name="number" value="25" min="8" max="50" style="width:5em;" class="form-control" />&ensp;<?php echo T_("characters");?>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="firstName" class="col-sm-3 control-label"><?php echo T_("First name") . ": "; ?></label> <label for="firstName" class="col-lg-3 control-label"><?php echo T_("First name") . ": "; ?></label>
<div class="col-sm-3"><input type='text' name='firstName' class="form-control" value="<?php echo $rs['firstName'];?>"/></div> <div class="col-lg-3"><input type='text' name='firstName' class="form-control" value="<?php echo $rs['firstName'];?>"/></div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="lastName" class="col-sm-3 control-label"><?php echo T_("Last name") . ": "; ?></label> <label for="lastName" class="col-lg-3 control-label"><?php echo T_("Last name") . ": "; ?></label>
<div class="col-sm-3"><input type='text' name='lastName' class="form-control" value="<?php echo $rs['lastName'];?>"/></div> <div class="col-lg-3"><input type='text' name='lastName' class="form-control" value="<?php echo $rs['lastName'];?>"/></div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="email" class="col-sm-3 control-label"><?php echo T_("Email") . ": "; ?></label> <label for="email" class="col-lg-3 control-label"><?php echo T_("Email") . ": "; ?></label>
<div class="col-sm-3"><input type='text' name='email' class="form-control" value="<?php echo $rs['email'];?>"/></div> <div class="col-lg-3"><input type='text' name='email' class="form-control" value="<?php echo $rs['email'];?>"/></div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="timezone" class="col-sm-3 control-label"><?php echo T_("Timezone") . ": ";?></label> <label for="timezone" class="col-lg-3 control-label"><?php echo T_("Timezone") . ": ";?></label>
<div class="col-sm-3"><?php display_chooser($tz,"timezone","timezone",false,false,false,true,array("value",$rs['Time_zone_name']),true,"form-inline"); ?></div> <div class="col-lg-3"><?php display_chooser($tz,"timezone","timezone",false,false,false,true,array("value",$rs['Time_zone_name']),true,"form-inline"); ?></div>
<div class="col-sm-6 form-inline"> <div class="col-lg-6 form-inline">
<?php echo T_("Edit") . "&emsp;";?> <?php echo T_("Edit") . "&emsp;";?>
<a href='timezonetemplate.php' class="btn btn-default"><?php echo T_("TimeZones list");?></a> <a href='timezonetemplate.php' class="btn btn-default"><?php echo T_("TimeZones list");?></a>
</div> </div>
</div> </div>
<div class="form-group">
<label for="extension_id" class="col-sm-3 control-label"><?php echo T_("Extension") . ": "; ?></label> <?php if (FREEPBX_PATH != false) { ?>
<div class="col-sm-3"><?php echo display_chooser($ers,"extension_id","extension_id",true,false,false,true,false,true,"form-inline"); ?> </div> <div class="form-group">
<div class="col-sm-6 form-inline"> <label for="voip" class="col-lg-3 control-label"><?php echo T_("Uses VoIP") . "? ";?></label>
<?php echo T_("Edit") . "&emsp;";?> <div class="col-lg-3"><input name="voip" type="checkbox" onchange="if(this.checked==true){show(this,'usesvoip');} else{ hide(this,'usesvoip');}" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" <?php if ($rs['voip'] == 1) echo "checked=\"checked\"";?> value="1" /></div>
<a href='extensionstatus.php' class="btn btn-default"><?php echo T_("Extensions");?></a> </div>
<div id="usesvoip" style="display:none" >
<div class="form-group">
<label class="col-lg-3 control-label"><?php echo T_("Extension") . ": ";?></label>
<?php if (!empty($ers) ){ ?>
<div class="col-lg-3"><?php display_chooser($ers,"extension_id","extension_id",true,false,false,true,false,true,"form-inline");?></div>
<div class="col-lg-6 form-inline"> <?php echo T_("Edit") . "&emsp;"; }
else{ ?> <div class="col-lg-6 form-inline"> <?php echo T_("Add") . "&emsp;"; }?>
<a href='extensionstatus.php' class="btn btn-default fa"><?php echo T_("Extensions");?></a>
</div>
</div> </div>
</div> </div>
<?php } ?>
<div class="form-group"> <div class="form-group">
<label for="voip" class="col-sm-3 control-label"><?php echo T_("Uses VoIP") . "? ";?></label> <label class="col-lg-3 control-label"><?php echo T_("Uses chat") . "? ";?></label>
<div class="col-sm-3"><input type="checkbox" name="voip" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" <?php if ($rs['voip'] == 1) echo "checked=\"checked\"";?> value="1" /></div> <div class="col-lg-3"><input name="chat_enable" type="checkbox" onchange="if(this.checked==true){show(this,'jabdata');} else{ hide(this,'jabdata');}" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" <?php if ($rs['chat_enable'] == 1) echo "checked=\"checked\"";?> value="1"/></div>
</div> </div>
<div class="form-group">
<label for="chat_user" class="col-sm-3 control-label"><?php echo T_("Jabber/XMPP chat user") . ": "; ?></label> <div id="jabdata" style="display:none" >
<div class="col-sm-3"><input type='text' name='chat_user' class="form-control" value="<?php echo $rs['chat_user'];?>"/></div> <div class="form-group">
<label class="col-lg-3 control-label"><?php echo T_("Jabber/XMPP chat user") . ": ";?></label>
<div class="col-lg-3"><input name="chat_user" type="text" class="form-control" value="<?php echo $rs['chat_user'];?>"/></div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label"><?php echo T_("Jabber/XMPP chat password") . ": ";?></label>
<div class="col-lg-3"><input name="chat_password" type="text" class="form-control" value="<?php echo $rs['chat_password'];?>"/></div>
</div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="chat_password" class="col-sm-3 control-label"><?php echo T_("Jabber/XMPP chat password") . ": "; ?></label> <label for="admin" class="col-lg-3 control-label"><?php echo T_("Is the operator a system administrator?");?></label>
<div class="col-sm-3"><input type='text' name='chat_password' class="form-control" value="<?php echo $rs['chat_password'];?>"/></div> <div class="col-lg-3"><input name="admin" type="checkbox" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" data-offstyle="primary" data-onstyle="danger" <?php if ($rs['superadmin'] || ($rs['parent_id'] == 0)) echo " checked=\"checked\" "; if ($rs['parent_id'] == 0) echo " disabled=\"disabled\" "; ?> value="1"/></div>
</div>
<div class="form-group">
<label for="admin" class="col-sm-3 control-label"><?php echo T_("Is the operator a system administrator?");?></label>
<div class="col-sm-3"><input name="admin" type="checkbox" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" data-offstyle="primary" data-onstyle="danger" <?php if ($rs['superadmin'] || ($rs['parent_id'] == 0)) echo " checked=\"checked\" "; if ($rs['parent_id'] == 0) echo " disabled=\"disabled\" "; ?> value="1"/></div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="chat_enable" class="col-sm-3 control-label"><?php echo T_("Uses chat") . "? ";?></label> <label for="enabled" class="col-lg-3 control-label"><?php echo T_("Enabled") . "? ";?></label>
<div class="col-sm-3"><input type="checkbox" name="chat_enable" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" <?php if ($rs['chat_enable'] == 1) echo "checked=\"checked\"";?> value="1"/></div> <div class="col-lg-3"><input type="checkbox" name="enabled" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" <?php if ($rs['enabled'] == 1) echo "checked=\"checked\"";?> value="1" /></div>
</div>
<div class="form-group">
<label for="enabled" class="col-sm-3 control-label"><?php echo T_("Enabled") . "? ";?></label>
<div class="col-sm-3"><input type="checkbox" name="enabled" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" <?php if ($rs['enabled'] == 1) echo "checked=\"checked\"";?> value="1" /></div>
</div> </div>
<div><input type='hidden' name='operator_id' value='<?php echo $operator_id;?>'/></div> <div><input type='hidden' name='operator_id' value='<?php echo $operator_id;?>'/></div>
<div><input type='hidden' name='existing_username' value="<?php echo $rs['username'];?>"/></div> <div><input type='hidden' name='existing_username' value="<?php echo $rs['username'];?>"/></div>
<div class="form-group"><div class="col-sm-3 col-sm-offset-3"><input type="submit" name="submit" class="btn btn-primary btn-block" value="<?php echo T_("Update operator");?>"/></div></div> <div class="form-group"><div class="col-lg-3 col-lg-offset-3"><input type="submit" name="submit" class="btn btn-primary btn-block" value="<?php echo T_("Update operator");?>"/></div></div>
</form> </form>
<?php <?php
xhtml_foot(); xhtml_foot(array("../js/new.js"));
exit(); exit();
} }
@@ -402,11 +416,11 @@ if ($display)
$titles[] = T_("Win file");//Windows VoIP $titles[] = T_("Win file");//Windows VoIP
$titles[] = T_("*nix flle");//*nix VoIP $titles[] = T_("*nix flle");//*nix VoIP
} }
echo "<div class='col-sm-9'><div class='panel-body'>"; echo "<div class='col-lg-9'><div class='panel-body'>";
xhtml_table($rs,$columns,$titles); xhtml_table($rs,$columns,$titles);
echo "</div></div>"; echo "</div></div>";
echo "<div class='form-group col-sm-3'> echo "<div class='form-group col-lg-3'>
<div class='panel-body'><a href='operators.php?add=add' class='btn btn-default btn-block'><i class='fa fa-lg fa-user-plus'></i>&emsp;" . T_("Add an operator") . "</a></div> <div class='panel-body'><a href='operators.php?add=add' class='btn btn-default btn-block'><i class='fa fa-lg fa-user-plus'></i>&emsp;" . T_("Add an operator") . "</a></div>
<div class='panel-body'><a href='extensionstatus.php' class='btn btn-default btn-block'><i class='fa fa-lg fa-whatsapp'></i>&emsp;" . T_("Extensions") . "</a></div> <div class='panel-body'><a href='extensionstatus.php' class='btn btn-default btn-block'><i class='fa fa-lg fa-whatsapp'></i>&emsp;" . T_("Extensions") . "</a></div>
<div class='panel-body'><a href='operatorquestionnaire.php' class='btn btn-default btn-block'><i class='fa fa-lg fa-link'></i> " . T_("Assign to questionnaire") . "</a></div> <div class='panel-body'><a href='operatorquestionnaire.php' class='btn btn-default btn-block'><i class='fa fa-lg fa-link'></i> " . T_("Assign to questionnaire") . "</a></div>

View File

@@ -41,7 +41,7 @@ include ("../db.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions

View File

@@ -42,7 +42,7 @@ include ("../db.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions

View File

@@ -42,7 +42,7 @@ include ("../db.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions
@@ -96,15 +96,11 @@ if (isset($_POST['operator']) && isset($_POST['adduser']))
$extensionp = "'$extensionnp'"; $extensionp = "'$extensionnp'";
} }
$supervisor = 0;
$temporary = 0;
$admin = 0; $admin = 0;
$refusal = 0;
$voip = 0; $voip = 0;
$chat = 0; $chat = 0;
if (isset($_POST['supervisor']) && $_POST['supervisor'] == "on") $supervisor = 1;
if (isset($_POST['refusal']) && $_POST['refusal'] == "on") $refusal = 1;
if (isset($_POST['temporary']) && $_POST['temporary'] == "on") $temporary = 1;
if (isset($_POST['admin']) && $_POST['admin'] == "on") $admin = 1; if (isset($_POST['admin']) && $_POST['admin'] == "on") $admin = 1;
if (isset($_POST['voip']) && $_POST['voip'] == "on") $voip = 1; if (isset($_POST['voip']) && $_POST['voip'] == "on") $voip = 1;
if (isset($_POST['chat_enable']) && $_POST['chat_enable'] == "on") $chat = 1; if (isset($_POST['chat_enable']) && $_POST['chat_enable'] == "on") $chat = 1;
@@ -152,23 +148,15 @@ if (isset($_POST['operator']) && isset($_POST['adduser']))
if (FREEPBX_PATH !== false) if (FREEPBX_PATH !== false)
$a .= "<br/><a href='/voip/admin/'>" . T_("FreePBX needs to be reloaded for the new VoIP extension to take effect") . "</a>"; $a .= "<br/><a href='/voip/admin/'>" . T_("FreePBX needs to be reloaded for the new VoIP extension to take effect") . "</a>";
print "</div>"; $a .= "</div>";
// set default skills = 1 and 5 for all new operators
if ($temporary)
{
$db->Execute(" INSERT INTO operator_skill (operator_id,outcome_type_id) $db->Execute(" INSERT INTO operator_skill (operator_id,outcome_type_id)
VALUES ('$oid','1')"); VALUES ('$oid','1')");
$db->Execute(" INSERT INTO operator_skill (operator_id,outcome_type_id) $db->Execute(" INSERT INTO operator_skill (operator_id,outcome_type_id)
VALUES ('$oid','5')"); //and appointment VALUES ('$oid','5')"); //and appointment
}
if ($supervisor)
$db->Execute(" INSERT INTO operator_skill (operator_id,outcome_type_id)
VALUES ('$oid','2')");
if ($refusal)
$db->Execute(" INSERT INTO operator_skill (operator_id,outcome_type_id)
VALUES ('$oid','3')");
} }
else else
{ {
@@ -242,84 +230,87 @@ function generate() {
<form enctype="multipart/form-data" action="" method="post" class="form-horizontal panel-body" name="operform"> <form enctype="multipart/form-data" action="" method="post" class="form-horizontal panel-body" name="operform">
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label"><?php echo T_("Username") . ": ";?></label> <label class="col-lg-3 control-label"><?php echo T_("Username") . ": ";?></label>
<div class="col-sm-3"><input name="operator" type="text" class="form-control" required /></div> <div class="col-lg-3"><input name="operator" type="text" class="form-control" required /></div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label"><?php echo T_("Password") . ": ";?></label> <label class="col-lg-3 control-label"><?php echo T_("Password") . ": ";?></label>
<div class="col-sm-3"><input name="password" id="password" type="text" class="form-control" required /></div> <div class="col-lg-3"><input name="password" id="password" type="text" class="form-control" required /></div>
<div class="col-sm-6 form-inline">&emsp; <div class="col-lg-6 form-inline">&emsp;
<input type="button" onclick="generate();" value="<?php echo T_("Generate");?>" class="btn btn-default fa" />&emsp;<?php echo T_("Password with");?>&ensp; <input type="button" onclick="generate();" value="<?php echo T_("Generate");?>" class="btn btn-default fa" />&emsp;<?php echo T_("Password with");?>&ensp;
<input type="number" name="number" value="25" min="8" max="50" style="width:5em;" class="form-control" />&ensp;<?php echo T_("characters");?> <input type="number" name="number" value="25" min="8" max="50" style="width:5em;" class="form-control" />&ensp;<?php echo T_("characters");?>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label"><?php echo T_("First name") . ": ";?></label> <label class="col-lg-3 control-label"><?php echo T_("First name") . ": ";?></label>
<div class="col-sm-3"><input name="firstname" type="text" class="form-control" required/></div> <div class="col-lg-3"><input name="firstname" type="text" class="form-control" required/></div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label"><?php echo T_("Last name") . ": ";?></label> <label class="col-lg-3 control-label"><?php echo T_("Last name") . ": ";?></label>
<div class="col-sm-3"><input name="lastname" type="text" class="form-control"/></div> <div class="col-lg-3"><input name="lastname" type="text" class="form-control"/></div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label"><?php echo T_("Email") . ": ";?></label> <label class="col-lg-3 control-label"><?php echo T_("Email") . ": ";?></label>
<div class="col-sm-3"><input name="email" type="text" class="form-control"/></div> <div class="col-lg-3"><input name="email" type="text" class="form-control"/></div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label"><?php echo T_("Timezone") . ": ";?></label> <label class="col-lg-3 control-label"><?php echo T_("Timezone") . ": ";?></label>
<div class="col-sm-3"><?php display_chooser($rs,"Time_zone_name","Time_zone_name",false,false,false,true,array("value",get_setting("DEFAULT_TIME_ZONE")),true,"form-inline");?></div> <div class="col-lg-3"><?php display_chooser($rs,"Time_zone_name","Time_zone_name",false,false,false,true,array("value",get_setting("DEFAULT_TIME_ZONE")),true,"form-inline");?></div>
<div class="col-sm-6 form-inline"> <div class="col-lg-6 form-inline">
<?php echo T_("Edit") . "&emsp;";?> <?php echo T_("Edit") . "&emsp;";?>
<a href='timezonetemplate.php' class="btn btn-default fa"><?php echo T_("TimeZones list");?></a> <a href='timezonetemplate.php' class="btn btn-default fa"><?php echo T_("TimeZones list");?></a>
</div> </div>
</div> </div>
<?php if (FREEPBX_PATH == false) { ?> <?php if (VOIP_ENABLED != false) { ?>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label"><?php echo T_("Extension") . ": ";?></label> <label class="col-lg-3 control-label"><?php echo T_("Uses VoIP") . "? ";?></label>
<div class="col-sm-3"><?php display_chooser($ers,"extension_id","extension_id",true,false,false,true,false,true,"form-inline");?></div> <div class="col-lg-3"><input name="voip" type="checkbox" onchange="if(this.checked==true){show(this,'usesvoip');} else{ hide(this,'usesvoip');}" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" /></div><!-- checked="checked" -->
<div class="col-sm-6 form-inline"> </div>
<div id="usesvoip" style="display:none" >
<div class="form-group">
<label class="col-lg-3 control-label"><?php echo T_("Extension") . ": ";?></label>
<div class="col-lg-3"><?php display_chooser($ers,"extension_id","extension_id",true,false,false,true,false,true,"form-inline");?></div>
<div class="col-lg-6 form-inline">
<?php echo T_("Edit") . "&emsp;";?> <?php echo T_("Edit") . "&emsp;";?>
<a href='extensionstatus.php' class="btn btn-default fa"><?php echo T_("Extensions");?></a> <a href='extensionstatus.php' class="btn btn-default fa"><?php echo T_("Extensions");?></a>
</div> </div>
</div> </div>
</div>
<?php } ?> <?php } ?>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label"><?php echo T_("Uses VoIP") . "? ";?></label> <label class="col-lg-3 control-label"><?php echo T_("Uses chat") . "? ";?></label>
<div class="col-sm-3"><input name="voip" type="checkbox" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" checked="checked"/></div> <div class="col-lg-3"><input name="chat_enable" type="checkbox" onchange="if(this.checked==true){show(this,'jabdata');} else{ hide(this,'jabdata');}" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" /></div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"><?php echo T_("Jabber/XMPP chat user") . ": ";?></label>
<div class="col-sm-3"><input name="chat_user" type="text" class="form-control"/></div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"><?php echo T_("Jabber/XMPP chat password") . ": ";?></label>
<div class="col-sm-3"><input name="chat_password" type="text" class="form-control"/></div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"><?php echo T_("Uses chat") . "? ";?></label>
<div class="col-sm-3"><input name="chat_enable" type="checkbox" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" /></div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"><?php echo T_("Is the operator a system administrator?");?></label>
<div class="col-sm-3"><input name="admin" type="checkbox" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" data-offstyle="primary" data-onstyle="danger"/></div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"><?php echo T_("Is the operator a normal interviewer?");?></label>
<div class="col-sm-3"><input name="temporary" type="checkbox" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" data-offstyle="danger" checked="checked"/></div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"><?php echo T_("Is the operator a supervisor?");?></label>
<div class="col-sm-3"><input name="supervisor" type="checkbox" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" data-onstyle="danger" data-offstyle="primary"/></div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"><?php echo T_("Is the operator a refusal converter?");?></label>
<div class="col-sm-3"><input name="refusal" type="checkbox" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" data-onstyle="danger" data-offstyle="primary"/></div>
</div> </div>
<div class="form-group"><div class="col-sm-3 col-sm-offset-3"><input type="submit" name="adduser" class="btn btn-primary btn-block" value="<?php echo T_("Add an operator"); ?>" /></div></div> <div id="jabdata" style="display:none" >
<div class="form-group">
<label class="col-lg-3 control-label"><?php echo T_("Jabber/XMPP chat user") . ": ";?></label>
<div class="col-lg-3"><input name="chat_user" type="text" class="form-control"/></div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label"><?php echo T_("Jabber/XMPP chat password") . ": ";?></label>
<div class="col-lg-3"><input name="chat_password" type="text" class="form-control"/></div>
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label"><?php echo T_("Is the operator a system administrator?");?></label>
<div class="col-lg-3"><input name="admin" type="checkbox" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" data-onstyle="danger"/></div>
</div>
<br/>
<div class="form-group form-inline">
<div class='col-lg-3'>
<a href='operatorlist.php' class='btn btn-default col-lg-6'><?php echo T_("Cancel") ;?></a>
</div>
<div class="col-lg-3">
<input type="submit" name="adduser" class="btn btn-primary btn-block" value="<?php echo T_("Add an operator"); ?>" />
</div>
</div>
</form> </form>
<?php <?php
xhtml_foot(); xhtml_foot(array("../js/new.js"));
?> ?>

View File

@@ -42,7 +42,7 @@ include ("../db.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions

View File

@@ -1,4 +1,5 @@
<?php /** <?php
/**
* Display outcomes by questionnaire * Display outcomes by questionnaire
*/ */
@@ -15,7 +16,7 @@ include_once(dirname(__FILE__).'/../db.inc.php');
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions
@@ -67,7 +68,7 @@ $js_foot = array(
"../js/custom.js" "../js/custom.js"
); );
xhtml_head(T_("Questionnaire Outcomes"),true,$css,$js_head);//array("../css/table.css"),array("../js/window.js") xhtml_head(T_("Questionnaire Outcomes"),true,$css,$js_head);
print "<h3 class='col-sm-4 pull-left text-right'>" . T_("Select a questionnaire") . "</h3>"; print "<h3 class='col-sm-4 pull-left text-right'>" . T_("Select a questionnaire") . "</h3>";
@@ -84,7 +85,7 @@ if ($questionnaire_id != false)
JOIN questionnaire_sample as qs ON (qs.questionnaire_id = '$questionnaire_id' and qs.sample_import_id = s.import_id) JOIN questionnaire_sample as qs ON (qs.questionnaire_id = '$questionnaire_id' and qs.sample_import_id = s.import_id)
LEFT JOIN `case` as c ON (c.questionnaire_id = qs.questionnaire_id and c.sample_id = s.sample_id) LEFT JOIN `case` as c ON (c.questionnaire_id = qs.questionnaire_id and c.sample_id = s.sample_id)
GROUP BY (c.sample_id is not null)"; GROUP BY (c.sample_id is not null)";
if ($db->GetAll($sql)) xhtml_table($db->GetAll($sql),array("drawn","count"),array(T_("Status"),T_("Number")), "table-hover table table-condensed", false, array("count")); if ($db->GetAll($sql)) xhtml_table($db->GetAll($sql),array("drawn","count"),array(T_("Status"),T_("Number")), "tclass", false, array("count"));
else print "<div class='alert text-danger'>" . T_("No samples assigned") . ".&emsp;</div>"; else print "<div class='alert text-danger'>" . T_("No samples assigned") . ".&emsp;</div>";
print "</div>"; print "</div>";
@@ -143,7 +144,7 @@ group by s.import_id";
$a = $db->GetAssoc($sql); $a = $db->GetAssoc($sql);
$a = aapor_clean($a); $a = aapor_clean($a);
print "<table class='col-sm-10'><thead><tr><th class='col-sm-8'>" . T_("Outcome") . "</th><th>" . T_("Rate") . "</th></tr></thead>"; // table-hover table table-condensed print "<table class='col-sm-10'><thead><tr><th class='col-sm-8'>" . T_("Outcome") . "</th><th>" . T_("Rate") . "</th></tr></thead>";
print "<tr><td>" . T_("Response Rate 1") . "</td><td>" . round(aapor_rr1($a),2) . "</td></tr>"; print "<tr><td>" . T_("Response Rate 1") . "</td><td>" . round(aapor_rr1($a),2) . "</td></tr>";
print "<tr><td>" . T_("Refusal Rate 1") . "</td><td>" . round(aapor_ref1($a),2) . "</td></tr>"; print "<tr><td>" . T_("Refusal Rate 1") . "</td><td>" . round(aapor_ref1($a),2) . "</td></tr>";
print "<tr><td>" . T_("Cooperation Rate 1") . "</td><td>" . round(aapor_coop1($a),2) . "</td></tr>"; print "<tr><td>" . T_("Cooperation Rate 1") . "</td><td>" . round(aapor_coop1($a),2) . "</td></tr>";
@@ -153,7 +154,7 @@ group by s.import_id";
$sql = "SELECT count(case_id) FROM `case` WHERE `case`.questionnaire_id = '$questionnaire_id'"; $sql = "SELECT count(case_id) FROM `case` WHERE `case`.questionnaire_id = '$questionnaire_id'";
$cases = $db->GetOne($sql); $cases = $db->GetOne($sql);
$sql = "SELECT CONCAT('<a href=\'casesbyoutcome.php?questionnaire_id=$questionnaire_id&amp;outcome_id=', o.outcome_id, '\'>', o.description, '</a>') as des, o.outcome_id, count( c.case_id ) as count, ROUND((count( c.case_id ) / $cases) * 100,2) as perc $sql = "SELECT CONCAT('&emsp;<a href=\'casesbyoutcome.php?questionnaire_id=$questionnaire_id&amp;outcome_id=', o.outcome_id, '\'><b>', '=>' ,'</b></a>&emsp;')as link, o.description as des, o.outcome_id, count(c.case_id) as count, ROUND((count( c.case_id ) / $cases) * 100,2) as perc
FROM `case` AS c, `outcome` AS o FROM `case` AS c, `outcome` AS o
WHERE c.questionnaire_id = '$questionnaire_id' WHERE c.questionnaire_id = '$questionnaire_id'
AND c.current_outcome_id = o.outcome_id AND c.current_outcome_id = o.outcome_id
@@ -165,7 +166,7 @@ group by s.import_id";
{ print "<div class='col-sm-8'><div class='panel panel-body'>"; { print "<div class='col-sm-8'><div class='panel panel-body'>";
//print "<h4>" . T_("Total cases for questionnaire") . " = <b>$cases</b></h4>"; //print "<h4>" . T_("Total cases for questionnaire") . " = <b>$cases</b></h4>";
translate_array($rs,array("des")); translate_array($rs,array("des"));
xhtml_table($rs,array("des","count","perc"),array(T_("Outcome"),T_("Count"),"&emsp;" . T_("%")),"tclass",false,array("count","perc"));//array("des" => "Complete") xhtml_table($rs,array("outcome_id","des","link","count","perc"),array(T_("ID"),T_("Outcome"),"",T_("Count"),"&emsp;" . T_("%")),"tclass",false,array("count","perc"));//array("des" => "Complete")
print "</div></div>"; print "</div></div>";
$sample_import_id = false; $sample_import_id = false;
@@ -202,7 +203,7 @@ group by s.import_id";
print "<div class='col-sm-8'><div class='panel panel-body'>"; //<p>" . T_("Outcomes") . "</p>"; print "<div class='col-sm-8'><div class='panel panel-body'>"; //<p>" . T_("Outcomes") . "</p>";
$sql = "SELECT CONCAT('<a href=\'casesbyoutcome.php?questionnaire_id=$questionnaire_id&amp;sample_import_id=$sample_import_id&amp;outcome_id=', o.outcome_id, '\'>', o.description, '</a>') as des, o.outcome_id, count( c.case_id ) as count,ROUND(count(c.case_id) / (SELECT count(case_id) FROM `case` JOIN sample ON (`case`.sample_id = sample.sample_id AND sample.import_id = '$sample_import_id') WHERE questionnaire_id = '$questionnaire_id' ) * 100,2) as perc $sql = "SELECT CONCAT('&emsp;<a href=\'casesbyoutcome.php?questionnaire_id=$questionnaire_id&amp;sample_import_id=$sample_import_id&amp;outcome_id=', o.outcome_id, '\'><b>', '=>' ,'</b></a>&emsp;')as link, o.description as des, o.outcome_id, count( c.case_id ) as count, ROUND(count(c.case_id) / (SELECT count(case_id) FROM `case` JOIN sample ON (`case`.sample_id = sample.sample_id AND sample.import_id = '$sample_import_id') WHERE questionnaire_id = '$questionnaire_id' ) * 100,2) as perc
FROM `case` AS c, `outcome` AS o, sample as s FROM `case` AS c, `outcome` AS o, sample as s
WHERE c.questionnaire_id = '$questionnaire_id' WHERE c.questionnaire_id = '$questionnaire_id'
@@ -216,7 +217,7 @@ group by s.import_id";
if (!empty($rs)) if (!empty($rs))
{ {
translate_array($rs,array("des")); translate_array($rs,array("des"));
xhtml_table($rs,array("des","count","perc"),array(T_("Outcome"),T_("Count"),T_("%")),"tclass",array("des" => "Complete"),array("count","perc")); xhtml_table($rs,array("outcome_id","des","link","count","perc"),array(T_("ID"),T_("Outcome"),"",T_("Count"),"&emsp;" . T_("%")),"tclass",array("des" => "Complete"),array("count","perc"));
} }
else else
print "<p>" . T_("No outcomes recorded for this sample") . "</p>"; print "<p>" . T_("No outcomes recorded for this sample") . "</p>";

View File

@@ -42,7 +42,7 @@ include("../db.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions
@@ -563,7 +563,7 @@ else
CASE WHEN enabled = 0 THEN CASE WHEN enabled = 0 THEN
CONCAT('<i class=\'btn fa fa-calendar fa-2x\' style=\'color:lightgrey;\'></i>') CONCAT('<i class=\'btn fa fa-calendar fa-2x\' style=\'color:lightgrey;\'></i>')
ELSE ELSE
CONCAT('<a href=\'addshift.php?questionnaire_id=',questionnaire_id,'\' class=\'btn\' title=\'" . TQ_("Shifts") . "&ensp;\n" . TQ_("questionnaire") . "&ensp;',questionnaire_id,'\' data-toggle=\'tooltip\'><i class=\'fa fa-calendar fa-2x\'></i></a>') CONCAT('<a href=\'addshift.php?questionnaire_id=',questionnaire_id,'\' class=\'btn\' title=\'" . TQ_("Shifts") . " " . TQ_("questionnaire") . "&ensp;',questionnaire_id,'\' data-toggle=\'tooltip\'><i class=\'fa fa-calendar fa-2x\'></i></a>')
END as shifts, END as shifts,
CASE WHEN enabled = 0 THEN CASE WHEN enabled = 0 THEN
CONCAT('<i class=\'btn fa fa-square-o fa-2x\' style=\'color:lightgrey;\'></i>') CONCAT('<i class=\'btn fa fa-square-o fa-2x\' style=\'color:lightgrey;\'></i>')
@@ -580,18 +580,22 @@ else
ELSE ELSE
CONCAT('<a href=\'outcomes.php?questionnaire_id=',questionnaire_id,'\' class=\'btn\' title=\'" . TQ_("Outcomes for questionnaire"). "&ensp;',questionnaire_id,'\' data-toggle=\'tooltip\'><i class=\'fa fa-bar-chart fa-2x\'></i></a>') CONCAT('<a href=\'outcomes.php?questionnaire_id=',questionnaire_id,'\' class=\'btn\' title=\'" . TQ_("Outcomes for questionnaire"). "&ensp;',questionnaire_id,'\' data-toggle=\'tooltip\'><i class=\'fa fa-bar-chart fa-2x\'></i></a>')
END as outcomes, END as outcomes,
CONCAT('<a href=\'callhistory.php?questionnaire_id=',questionnaire_id,'\' class=\'btn\' title=\'" . TQ_("Call history"). "&ensp;\n" . TQ_("questionnaire"). "&ensp;',questionnaire_id,'\' data-toggle=\'tooltip\'><i class=\'fa fa-phone fa-2x\'></i></a>') as calls, CONCAT('<a href=\'callhistory.php?questionnaire_id=',questionnaire_id,'\' class=\'btn\' title=\'" . TQ_("Call history"). " " . TQ_("questionnaire"). " ',questionnaire_id,'\' data-toggle=\'tooltip\'><i class=\'fa fa-phone fa-2x\'></i></a>') as calls,
CONCAT('<a href=\'set_outcomes.php?qid=',questionnaire_id,'\' class=\'btn\' title=\'" . TQ_("Set outcomes"). "&ensp;\n" . TQ_("questionnaire"). "&ensp;',questionnaire_id,'\' data-toggle=\'tooltip\'><i class=\'fa fa-list-ol fa-2x\'></i></a>') as setoutcomes,
CASE WHEN enabled = 0 THEN CASE WHEN enabled = 0 THEN
CONCAT('<i class=\'btn fa fa-download fa-2x\' style=\'color:lightgrey;\'></i>') CONCAT('<i class=\'btn fa fa-download fa-2x\' style=\'color:lightgrey;\'></i>')
ELSE ELSE
CONCAT('<a href=\'dataoutput.php?questionnaire_id=',questionnaire_id,'\' class=\'btn\' title=\'" . TQ_("Data output"). "&ensp;\n" . TQ_("questionnaire"). "&ensp;',questionnaire_id,'\' data-toggle=\'tooltip\'><i class=\'fa fa-download fa-2x\'></i></a>') CONCAT('<a href=\'dataoutput.php?questionnaire_id=',questionnaire_id,'\' class=\'btn\' title=\'" . TQ_("Data output"). " " . TQ_("questionnaire"). "&ensp;',questionnaire_id,'\' data-toggle=\'tooltip\'><i class=\'fa fa-download fa-2x\'></i></a>')
END as dataout, END as dataout,
CASE WHEN enabled = 0 THEN CASE WHEN enabled = 0 THEN
CONCAT('<i class=\'btn fa fa-book fa-2x\' style=\'color:lightgrey;\'></i>') CONCAT('<i class=\'btn fa fa-book fa-2x\' style=\'color:lightgrey;\'></i>')
ELSE ELSE
CONCAT('<a href=\'assignsample.php?questionnaire_id=',questionnaire_id,'\' class=\'btn\' title=\'" . TQ_("Assigned samples"). "\' data-toggle=\'tooltip\'><i class=\'fa fa-book fa-2x\'></i></a>') CONCAT('<a href=\'assignsample.php?questionnaire_id=',questionnaire_id,'\' class=\'btn\' title=\'" . TQ_("Assigned samples"). "\' data-toggle=\'tooltip\'><i class=\'fa fa-book fa-2x\'></i></a>')
END as assample, END as assample,
CASE WHEN enabled = 0 THEN
CONCAT('<i class=\'btn fa fa-filter fa-2x\' style=\'color:lightgrey;\'></i>')
ELSE
CONCAT('<a href=\'quotareport.php?questionnaire_id=',questionnaire_id,'\' class=\'btn\' title=\'" . T_("Quota report"). " " . TQ_("questionnaire"). "&ensp;',questionnaire_id,'\' data-toggle=\'tooltip\'><i class=\'fa fa-filter fa-2x\'></i></a>')
END as quotareport,
CASE WHEN enabled = 0 THEN CASE WHEN enabled = 0 THEN
CONCAT('<i class=\'btn fa fa-question-circle fa-2x\' style=\'color:lightgrey;\'></i>') CONCAT('<i class=\'btn fa fa-question-circle fa-2x\' style=\'color:lightgrey;\'></i>')
ELSE ELSE
@@ -600,7 +604,7 @@ else
FROM questionnaire"; FROM questionnaire";
$rs = $db->GetAll($sql); $rs = $db->GetAll($sql);
$columns = array("qid","description","status","enabledisable","outcomes","calls","casestatus","shifts","assample","dataout","modify","setoutcomes","inlime","prefill","deletee"); $columns = array("qid","description","status","enabledisable","outcomes","calls","casestatus","shifts","assample","quotareport","dataout","modify","inlime","prefill","deletee");
xhtml_table($rs,$columns,false,"table-hover table-condensed "); xhtml_table($rs,$columns,false,"table-hover table-condensed ");
print "</div>"; print "</div>";

View File

@@ -43,7 +43,7 @@ include ("../db.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions
@@ -101,7 +101,9 @@ if (isset($_GET['questionnaire_id']) && isset($_GET['questionnaire_prefill_id'])
$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']);
xhtml_head(T_("Pre fill questionnaire: Set values for questionnaire to prefill"),true,array("../include/bootstrap/css/bootstrap.min.css","../css/custom.css"),array("../js/window.js")); $subtitle = T_("Set values for questionnaire to prefill");
xhtml_head(T_("Prefill questionnaire:"),true,array("../include/bootstrap/css/bootstrap.min.css","../css/custom.css"),array("../js/window.js"), false, false, false, $subtitle);
print "<h3 class='form-inline pull-left'>" . T_("Select a questionnaire") . ":&emsp;</h3>"; print "<h3 class='form-inline pull-left'>" . T_("Select a questionnaire") . ":&emsp;</h3>";
$sql = "SELECT questionnaire_id as value,description, $sql = "SELECT questionnaire_id as value,description,
@@ -182,14 +184,16 @@ if ($questionnaire_id != false)
AND sivr.sample_import_id = qs.sample_import_id"; AND sivr.sample_import_id = qs.sample_import_id";
?> ?>
<form action="" method="get" class="form-inline form-group"> <form action="" method="get" class="form-inline form-group">
<label for="value"><?php echo T_("The value to pre fill"); ?>:&emsp;</label><input type="text" name="value" id="value" size="50" class="form-control"/> <p><label for="value"><?php echo T_("The value to pre fill"); ?>:&emsp;</label><input type="text" name="value" id="value" size="50" class="form-control"/></p>
<label for="svar">&emsp;<?php echo T_("or: Select pre fill from sample list"); ?>&emsp;</label> <p><label for="svar"><?php echo T_("or: Select pre fill from sample list"); ?>&emsp;</label>
<?php //display a list of possible sample variables for this questionnaire <?php //display a list of possible sample variables for this questionnaire
display_chooser($db->GetAll($sql),"svar","svar",true,false,false,true,false,true,"form-group"); display_chooser($db->GetAll($sql),"svar","svar",true,false,false,false,false,true,"form-group");
?> ?>
</p>
<input type="hidden" name="questionnaire_id" value="<?php print($questionnaire_id); ?>"/> <input type="hidden" name="questionnaire_id" value="<?php print($questionnaire_id); ?>"/>
<input type="hidden" name="sgqa" value="<?php print($sgqa); ?>"/> <input type="hidden" name="sgqa" value="<?php print($sgqa); ?>"/>
<input type="submit" name="add_prefill" class="btn btn-primary fa" value="<?php print(T_("Add pre fill")); ?>"/> </br>
<p><input type="submit" name="add_prefill" class="btn btn-primary fa" value="<?php print(T_("Add pre fill")); ?>"/></p>
</form> </form>
<?php <?php
} }

View File

@@ -43,7 +43,7 @@ include ("../db.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions
@@ -129,7 +129,8 @@ if ($questionnaire_id != false)
$sql = "SELECT s.sample_import_id as value,s.description, CASE WHEN s.sample_import_id = '$sample_import_id' THEN 'selected=\'selected\'' ELSE '' END AS selected $sql = "SELECT s.sample_import_id as value,s.description, CASE WHEN s.sample_import_id = '$sample_import_id' THEN 'selected=\'selected\'' ELSE '' END AS selected
FROM sample_import as s, questionnaire_sample as q FROM sample_import as s, questionnaire_sample as q
WHERE q.questionnaire_id = $questionnaire_id WHERE q.questionnaire_id = $questionnaire_id
AND q.sample_import_id = s.sample_import_id"; AND q.sample_import_id = s.sample_import_id
AND s.enabled = 1";
$s = $db->GetAll($sql); $s = $db->GetAll($sql);
if (!empty($s)){ if (!empty($s)){

View File

@@ -44,7 +44,7 @@ include ("../db.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions

View File

@@ -44,7 +44,7 @@ include ("../db.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions
@@ -305,7 +305,8 @@ if ($questionnaire_id != false)
$sql = "SELECT s.sample_import_id as value,s.description, CASE WHEN s.sample_import_id = '$sample_import_id' THEN 'selected=\'selected\'' ELSE '' END AS selected $sql = "SELECT s.sample_import_id as value,s.description, CASE WHEN s.sample_import_id = '$sample_import_id' THEN 'selected=\'selected\'' ELSE '' END AS selected
FROM sample_import as s, questionnaire_sample as q FROM sample_import as s, questionnaire_sample as q
WHERE q.questionnaire_id = $questionnaire_id WHERE q.questionnaire_id = $questionnaire_id
AND q.sample_import_id = s.sample_import_id"; AND q.sample_import_id = s.sample_import_id
AND s.enabled = 1";
$s = $db->GetAll($sql); $s = $db->GetAll($sql);
if (!empty($s)){ if (!empty($s)){
print "<h3 class='form-inline pull-left'>&emsp;&emsp;&emsp;" . T_("Sample") . ":&emsp;</h3>"; print "<h3 class='form-inline pull-left'>&emsp;&emsp;&emsp;" . T_("Sample") . ":&emsp;</h3>";
@@ -317,9 +318,6 @@ if ($questionnaire_id != false)
print "<div class='col-sm-2 pull-right'><a href='quotareport.php?questionnaire_id=$questionnaire_id&amp;sample_import_id=$sample_import_id' class='btn btn-info btn-block'><i class='fa fa-filter fa-lg'></i>&emsp;" . T_("To quota report") . "</a></div>"; print "<div class='col-sm-2 pull-right'><a href='quotareport.php?questionnaire_id=$questionnaire_id&amp;sample_import_id=$sample_import_id' class='btn btn-info btn-block'><i class='fa fa-filter fa-lg'></i>&emsp;" . T_("To quota report") . "</a></div>";
print "<div class='clearfix'></div>";
if ($sample_import_id != false) if ($sample_import_id != false)
{ {
if (isset($_POST['import_quota'])) if (isset($_POST['import_quota']))
@@ -387,8 +385,9 @@ if ($questionnaire_id != false)
if ($qsqri != false) if ($qsqri != false)
{ {
print "<h2 class='col-sm-2'><a href='?questionnaire_id=$questionnaire_id&amp;sample_import_id=$sample_import_id' class='btn btn-default'><i class='fa fa-arrow-up fa-lg text-primary'></i>&emsp;" . T_("To Row quotas") . "</a></h2>"; print "<div class='col-lg-3 pull-right'><a href='?questionnaire_id=$questionnaire_id&amp;sample_import_id=$sample_import_id' class='btn btn-default'><i class='fa fa-arrow-up fa-lg text-primary'></i>&emsp;" . T_("To Row quotas") . "</a></div>";
print "<h2>" . T_("Quota") . ": $qsqrid</h2>"; print "<div class='clearfix form-group'></div>";
print "<h2 class='col-lg-offset-4'>" . T_("Quota") . ": $qsqrid</h2>";
?> ?>
<div class='panel-body' > <div class='panel-body' >

View File

@@ -42,7 +42,7 @@ include ("../db.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions
@@ -121,8 +121,6 @@ function sample_call_attempt_report($questionnaire_id = false, $sample_id = fals
$outcomes = $db->GetAssoc($sql); $outcomes = $db->GetAssoc($sql);
translate_array($outcomes,array("description"));
$rep = array("callattempts","sample"); $rep = array("callattempts","sample");
$rept = array(T_("Call attempts made"),T_("Number of cases")); $rept = array(T_("Call attempts made"),T_("Number of cases"));
$totals = array("sample"); $totals = array("sample");
@@ -132,7 +130,7 @@ function sample_call_attempt_report($questionnaire_id = false, $sample_id = fals
foreach($outcomes as $key => $val) foreach($outcomes as $key => $val)
{ {
$rep[] = $key; $rep[] = $key;
$rept[] = $val; $rept[] = T_($val);
$outcomesfilled[$key] = 0; $outcomesfilled[$key] = 0;
} }

View File

@@ -42,7 +42,7 @@ include_once(dirname(__FILE__).'/../db.inc.php');
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions
@@ -298,15 +298,13 @@ if (isset($_GET['edit']) )
$sql = "SELECT type, description $sql = "SELECT type, description
FROM sample_var_type"; FROM sample_var_type";
$rd = $db->GetAll($sql); $rd = $db->GetAll($sql);
$selected = "selected=\"selected\"";
$sql = "SELECT sir.var_id, $sql = "SELECT sir.var_id,
CONCAT('<input type=\"text\" onInput=\"$(this).attr(\'name\',\'var[',sir.var_id,']\');\" value=\"' ,sir.var, '\" required class=\"form-control\" style=\"min-width: 300px;\" $dis />') as var, CONCAT('<input type=\"text\" onInput=\"$(this).attr(\'name\',\'var[',sir.var_id,']\');\" value=\"' ,sir.var, '\" required class=\"form-control\" style=\"min-width: 300px;\" $dis />') as var,
CONCAT ('<select name=\"type[',sir.var_id,']\" class=\"form-control\" $dis > CONCAT ('<select name=\"type[',sir.var_id,']\" class=\"form-control\" $dis >";
<option value=\"' ,svt.type, '\" $selected>' ,svt.description, '</option>";
foreach($rd as $r) foreach($rd as $r)
{ {
$sql .= "<option value=\"{$r['type']}\">" . T_($r['description']) . "</option>"; $sql .= "<option value=\"{$r['type']}\"', CASE WHEN ( svt.type = {$r['type']}) THEN 'selected=\"selected\"' ELSE '' END , ' >" . T_($r['description']) . "</option>";
} }
$sql .= "</select>') as type, sv.val, $sql .= "</select>') as type, sv.val,
CONCAT('<input type=\'checkbox\' ', CASE WHEN (sir.restrict IS NULL || sir.restrict = 0) THEN 'checked=\"checked\"' ELSE '' END ,' name=\"see[]\" value=\'',sir.var_id,'\' data-toggle=\"toggle\" data-size=\"small\" data-style=\"center-block\" data-on=" . TQ_("Yes") . " data-off=" . TQ_("No") . " data-width=\"70\"/>') as see, CONCAT('<input type=\'checkbox\' ', CASE WHEN (sir.restrict IS NULL || sir.restrict = 0) THEN 'checked=\"checked\"' ELSE '' END ,' name=\"see[]\" value=\'',sir.var_id,'\' data-toggle=\"toggle\" data-size=\"small\" data-style=\"center-block\" data-on=" . TQ_("Yes") . " data-off=" . TQ_("No") . " data-width=\"70\"/>') as see,

View File

@@ -44,7 +44,7 @@ include ("../db.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions

View File

@@ -42,7 +42,7 @@ include ("../db.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions

View File

@@ -42,7 +42,7 @@ include ("../db.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions

View File

@@ -16,7 +16,7 @@ include ("../db.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions
@@ -122,7 +122,7 @@ if (isset($_GET['case_note_id']))
$db->Execute($sql); $db->Execute($sql);
} }
xhtml_head(T_("Assign outcomes to cases"),true,$css,$js_head);//array("../css/table.css"),array("../js/window.js") xhtml_head(T_("Assign outcomes to cases"),true,$css,$js_head);
?> ?>
@@ -137,13 +137,18 @@ xhtml_head(T_("Assign outcomes to cases"),true,$css,$js_head);//array("../css/ta
<?php <?php
$sql = "SELECT c.case_id as value, c.case_id as description, CASE WHEN c.case_id = '$case_id' THEN 'selected=\'selected\'' ELSE '' END AS selected $sql = "SELECT c.case_id as value, c.case_id as description, CASE WHEN c.case_id = '$case_id' THEN 'selected=\'selected\'' ELSE '' END AS selected
FROM `case` AS c, `outcome` AS o, `questionnaire` AS q, `sample` AS s, `sample_import` AS si FROM `case` AS c, `outcome` AS o, `questionnaire` AS q, `sample` AS s, `sample_import` AS si
LEFT JOIN (questionnaire_sample_quota as qsq) on (si.sample_import_id = qsq.sample_import_id)
LEFT JOIN (questionnaire_sample_quota_row as qsqr) on (si.sample_import_id = qsqr.sample_import_id)
WHERE c.current_outcome_id = o.outcome_id WHERE c.current_outcome_id = o.outcome_id
AND q.questionnaire_id = c.questionnaire_id AND q.questionnaire_id = c.questionnaire_id
AND s.sample_id = c.sample_id AND s.sample_id = c.sample_id
AND s.import_id = si.sample_import_id AND s.import_id = si.sample_import_id
AND q.enabled = 1 AND q.enabled = 1
AND si.enabled =1 AND si.enabled =1
AND o.outcome_type_id =2"; AND (qsq.quota_reached IS NULL OR qsq.quota_reached != 1 )
AND (qsqr.quota_reached IS NULL OR qsqr.quota_reached != 1)
AND o.outcome_type_id =2
ORDER BY c.case_id ASC";
$rs = $db->GetAll($sql); $rs = $db->GetAll($sql);

View File

@@ -43,7 +43,7 @@ include ("../db.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions

View File

@@ -42,7 +42,7 @@ include ("../db.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* Process * Process

View File

@@ -43,7 +43,7 @@ include ("../db.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* XHTML functions * XHTML functions

View File

@@ -42,7 +42,7 @@ include ("../db.inc.php");
/** /**
* Authentication file * Authentication file
*/ */
include ("auth-admin.php"); require ("auth-admin.php");
/** /**
* Process * Process

View File

@@ -42,7 +42,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**
* XHTML functions * XHTML functions
@@ -69,10 +69,12 @@ $db->StartTrans();
$operator_id = get_operator_id(); $operator_id = get_operator_id();
$questionnaire_id = get_questionnaire_id($operator_id); $questionnaire_id = get_questionnaire_id($operator_id);
$case_id = get_case_id($operator_id); $case_id = get_case_id($operator_id);
$call_attempt_id = get_call_attempt($operator_id, false);
if (isset($_GET['respondent_id']))$respondent_id = bigintval($_GET['respondent_id']); else $respondent_id = get_respondent_id($call_attempt_id);
if (!$case_id){ if (!$case_id){
xhtml_head(T_("Appointment error")); xhtml_head(T_("Appointment error"));
print("<div>" . T_("You have not been assigned a case therefore cannot create an appointment") . "</div>"); print("<div class='alert alert-danger'>" . T_("You have not been assigned a case therefore cannot create an appointment") . "</div>");
xhtml_foot(); xhtml_foot();
$db->CompleteTrans(); $db->CompleteTrans();
exit(); exit();
@@ -123,28 +125,27 @@ if (AUTO_LOGOUT_MINUTES !== false)
$js[] = "include/jquery/jquery-1.4.2.min.js"; $js[] = "include/jquery/jquery-1.4.2.min.js";
$js[] = "js/childnap.js"; $js[] = "js/childnap.js";
} }
xhtml_head(T_("Create appointment"),false,array("include/bootstrap/css/bootstrap.min.css", "css/respondent.css"),$js);//"include/clockpicker/dist/bootstrap-clockpicker.min.css", xhtml_head(T_("Create appointment"),false,array("include/bootstrap/css/bootstrap.min.css"),$js);
//select a respondent from a list or create a new one //select a respondent from a list or create a new one
print "<h4>" . T_("Respondent") . ":"; print "<h4>" . T_("Respondent") . ":";
$sr = display_respondent_list($case_id,isset($_GET['respondent_id'])?bigintval($_GET['respondent_id']):false,true); if (isset($_GET['respondent_id'])) $respondent_id = bigintval($_GET['respondent_id']);
display_respondent_list($case_id,isset($respondent_id)?$respondent_id:false,true);
print "</h4>"; print "</h4>";
if ($sr != false) $_GET['respondent_id'] = $sr;
if(isset($_GET['respondent_id']) && $_GET['respondent_id'] == 0) if(isset($_GET['respondent_id']) && $_GET['respondent_id'] == 0)
{ {
//ability to create a new one //ability to create a new one
?> ?>
<p><?php echo T_("Create new respondent:"); ?></p> <h4><?php echo T_("Create new respondent:"); ?></h4>
<form id="addRespondent" method="post" action=""> <form id="addRespondent" method="post" action="">
<?php display_respondent_form(); ?> <?php display_respondent_form(); ?>
<p><input type="submit" value="<?php echo T_("Add this respondent"); ?>"/></p> <p><input type="submit" class="btn btn-primary" value="<?php echo T_("Add this respondent"); ?>"/></p>
</form> </form>
<?php <?php
} }
else if(isset($_GET['respondent_id'])) else if($respondent_id)
{ {
$respondent_id = bigintval($_GET['respondent_id']);
$sql = "SELECT TIME(CONVERT_TZ(NOW(),'System',r.Time_zone_name)) as tme, r.Time_zone_name as tzn FROM `respondent` as r WHERE r.respondent_id = $respondent_id"; $sql = "SELECT TIME(CONVERT_TZ(NOW(),'System',r.Time_zone_name)) as tme, r.Time_zone_name as tzn FROM `respondent` as r WHERE r.respondent_id = $respondent_id";
$ct = $db->GetRow($sql); $ct = $db->GetRow($sql);
@@ -161,6 +162,8 @@ else if(isset($_GET['respondent_id']))
display_time($questionnaire_id,$respondent_id,$day,$month,$year,isset($_GET['start'])?$_GET['start']:false,isset($_GET['end'])?$_GET['end']:false); display_time($questionnaire_id,$respondent_id,$day,$month,$year,isset($_GET['start'])?$_GET['start']:false,isset($_GET['end'])?$_GET['end']:false);
print "</div>";
if (isset($_GET['end']) && isset($_GET['start'])) if (isset($_GET['end']) && isset($_GET['start']))
{ {
$list = return_contact_phone_list($case_id); $list = return_contact_phone_list($case_id);
@@ -242,7 +245,7 @@ else if(isset($_GET['respondent_id']))
} }
} }
print "<br/><div class='col-md-12'><a class='btn btn-warning pull-left' href='?'>".T_("Clear")."</a><a class='btn btn-default pull-right' href='javascript:parent.closePopup();'>".T_("Cancel")."</a></div><div class='clearfix'></div>";
xhtml_foot(); xhtml_foot();

View File

@@ -42,7 +42,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**
* XHTML functions * XHTML functions

View File

@@ -42,7 +42,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**
* XHTML functions * XHTML functions

View File

@@ -42,7 +42,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**

View File

@@ -42,7 +42,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**
* XHTML functions * XHTML functions
@@ -119,21 +119,19 @@ function display_outcomes($contacted,$ca,$case_id)
} }
else else
{ {
print "<div class=\"form-group\" ><a href=\"?contacted=1\" class=\"btn btn-info\" style=\"margin-left: 15px; margin-right: 30px; min-width: 200px;\">".T_("CONTACTED")."</a>"; if ($contacted === false)
print "<a href=\"?contacted=0\" class=\"btn btn-default\" style=\"margin-left: 30px; margin-right: 15px; min-width: 200px;\">".T_("NOT CONTACTED")."</a></div>"; {
print "<div class=\"form-group\" ><a href=\"?contacted=1\" class=\"btn btn-info\" style=\"margin-left: 15px; margin-right: 30px; min-width: 150px;\">".T_("CONTACTED")."</a>";
print "<a href=\"?contacted=0\" class=\"btn btn-default\" style=\"margin-left: 30px; margin-right: 15px; min-width: 150px;\">".T_("NOT CONTACTED")."</a></div>";
if (isset ($_GET['contacted'])) $contacted = bigintval($_GET['contacted']); if (isset ($_GET['contacted'])) $contacted = bigintval($_GET['contacted']);
else if ($contacted) $contacted = bigintval($contacted);
if ($contacted || $contacted === 0 ){
$sql = "SELECT outcome_id,description,contacted
FROM outcome
WHERE contacted = '$contacted'
AND outcome_type_id != '5'
AND outcome_id IN ($outcomes)
AND outcome_id NOT IN(10,42,43,44,45)"; //don't show completed if not, hide max calls as the supposed to be automatic or admin
} }
else $contacted = bigintval($contacted);
$sql = "SELECT outcome_id,description,contacted
FROM outcome
WHERE contacted = '$contacted'
AND outcome_id NOT IN(5,10,19,21,40,41,42,43,44,45)";
} }
} }
$rs = $db->GetAll($sql); $rs = $db->GetAll($sql);
@@ -147,8 +145,8 @@ function display_outcomes($contacted,$ca,$case_id)
foreach($rs as $r) foreach($rs as $r)
{ {
if ($do == $r['outcome_id']) $selected = "checked='checked'"; else $selected = ""; if ($do == $r['outcome_id']) $selected = "checked='checked'"; else $selected = "";
if (isset($r['contacted']) && $r['contacted'] == 1) $highlight = "text-primary"; else $highlight = "text-default"; if (isset($r['contacted']) && $r['contacted'] == 1) $highlight = ""; else $highlight = "style='color:black;'";
print "<p><label class='$highlight'><input type='radio' class='radio' name='outcome' id='outcome-{$r['outcome_id']}' value='{$r['outcome_id']}' $selected style='float:left'/>&emsp;" . T_($r['description']) . "</label></p>"; print "<a><label $highlight class='btn-link'><input type='radio' class='radio' name='outcome' id='outcome-{$r['outcome_id']}' value='{$r['outcome_id']}' $selected style='float:left'/>&emsp;" . T_($r['description']) . "</label></a><br/>";
} }
$_POST['confirm'] = true; $_POST['confirm'] = true;
@@ -300,7 +298,7 @@ if (isset($_GET['newstate']))
if (browser_ie()) $js = "js/window_ie6_interface2.js"; else $js = "js/window_interface2.js"; if (browser_ie()) $js = "js/window_ie6_interface2.js"; else $js = "js/window_interface2.js";
xhtml_head(T_("Set outcome"),true,array("include/bootstrap/css/bootstrap.min.css"/* ,"css/call.css" */),array($js,"include/jquery/jquery.min.js")); xhtml_head(T_("Set outcome"),true,array("include/bootstrap/css/bootstrap.min.css"),array($js,"include/jquery/jquery-1.4.2.min.js"));
$state = is_on_call($operator_id); $state = is_on_call($operator_id);
switch($state) switch($state)
@@ -319,8 +317,8 @@ switch($state)
{ {
//end the case //end the case
if (!isset($_GET['end'])) print "<div>" . T_("End work") . "</div>"; if (!isset($_GET['end'])) print "<div>" . T_("End work") . "</div>";
print "<p><a href='javascript:openParent(\"endcase=endcase\")'>" . T_("End case") . "</a></p>"; print "<p><a href='javascript:openParent(\"endcase=endcase\")' class='btn btn-primary'>" . T_("End case") . "</a></p>";
print "<p><a href='javascript:openParent(\"endwork=endwork\")'>" . T_("End work") . "</a></p>"; print "<p><a href='javascript:openParent(\"endwork=endwork\")' class='btn btn-info'>" . T_("End work") . "</a></p>";
} }
else else
{ {
@@ -346,9 +344,11 @@ switch($state)
print "<div>" . T_("Press the call button to dial the number for this appointment:") . "</div>"; print "<div>" . T_("Press the call button to dial the number for this appointment:") . "</div>";
print "<form action='?' method='post'><div>"; print "<form action='?' method='post'>
print "<p>" . T_("Number to call:") . " {$r['phone']} - {$r['description']}</p>"; <div><p>" . T_("Number to call:") . " {$r['phone']} - {$r['description']}</p></div>
print "</div><div><input type='hidden' id='contact_phone' name='contact_phone' value='{$r['contact_phone_id']}'/><input type='submit' value=\"" . T_("Call") . "\" name='submit' id='submit'/></div></form>"; <input type='hidden' id='contact_phone' name='contact_phone' value='{$r['contact_phone_id']}'/>
<div><input type='submit' value=\"" . T_("Call") . "\" name='submit' id='submit' class='btn btn-primary'/></div>
</form>";
} }
else else
print "<div>" . T_("Your VoIP extension is not enabled. Please close this window and enable VoIP by clicking once on the red button that says 'VoIP Off'") . "</div>"; print "<div>" . T_("Your VoIP extension is not enabled. Please close this window and enable VoIP by clicking once on the red button that says 'VoIP Off'") . "</div>";
@@ -419,7 +419,7 @@ switch($state)
{ {
print "<option value='{$r['contact_phone_id']}'>{$r['phone']} - {$r['description']}</option>"; print "<option value='{$r['contact_phone_id']}'>{$r['phone']} - {$r['description']}</option>";
} }
print "</select></div><div><input type='submit' value=\"" . T_("Call") . "\" name='submit' id='submit'/></div></form>"; print "</select></div><div><input type='submit' value=\"" . T_("Call") . "\" name='submit' id='submit' class='btn btn-primary'/></div></form>";
} }
else else
print "<div>" . T_("Your VoIP extension is not enabled. Please close this window and enable VoIP by clicking once on the red button that says 'VoIP Off'") . "</div>"; print "<div>" . T_("Your VoIP extension is not enabled. Please close this window and enable VoIP by clicking once on the red button that says 'VoIP Off'") . "</div>";
@@ -435,13 +435,13 @@ switch($state)
//give focus on load //give focus on load
print '<script type="text/javascript">$(document).ready(function(){$("#note").focus();});</script>'; print '<script type="text/javascript">$(document).ready(function(){$("#note").focus();});</script>';
//put these lower on the screen so they don't get "automatically" clicked //put these lower on the screen so they don't get "automatically" clicked
print "<p><a href='javascript:openParentNote(\"endcase=endcase\")'>" . T_("End case") . "</a></p>"; print "<p><a href='javascript:openParentNote(\"endcase=endcase\")' class='btn btn-primary'>" . T_("End case") . "</a></p>";
print "<p><a href='javascript:openParentNote(\"endwork=endwork\")'>" . T_("End work") . "</a></p>"; print "<p><a href='javascript:openParentNote(\"endwork=endwork\")' class='btn btn-info'>" . T_("End work") . "</a></p>";
} }
else else
{ {
print "<p><a href='javascript:openParent(\"endcase=endcase\")'>" . T_("End case") . "</a></p>"; print "<p><a href='javascript:openParent(\"endcase=endcase\")' class='btn btn-primary'>" . T_("End case") . "</a></p>";
print "<p><a href='javascript:openParent(\"endwork=endwork\")'>" . T_("End work") . "</a></p"; print "<p><a href='javascript:openParent(\"endwork=endwork\")' class='btn btn-info'>" . T_("End work") . "</a></p";
} }
} }
} }
@@ -454,16 +454,16 @@ switch($state)
if ($rn) // a note is required to be entered if ($rn) // a note is required to be entered
{ {
print "<div><label for='note'>" . T_("Enter a reason for this outcome before completing this case:") . "</label><input type='text' id='note' name='note' size='48'/><br/><br/><br/><br/></div>"; print "<div><label for='note' class='control-label'>" . T_("Enter a reason for this outcome before completing this case:") . "</label><textarea type='text' id='note' name='note' class='form-control' rows='3'></textarea><br/></div>";
print '<script type="text/javascript">$(document).ready(function(){$("#note").focus();});</script>'; print '<script type="text/javascript">$(document).ready(function(){$("#note").focus();});</script>';
print "<p><a href='javascript:openParentNote(\"endcase=endcase\")'>" . T_("End case") . "</a></p>"; print "<p><a href='javascript:openParentNote(\"endcase=endcase\")' class='btn btn-primary'>" . T_("End case") . "</a></p></p>";
print "<p><a href='javascript:openParentNote(\"endwork=endwork\")'>" . T_("End work") . "</a></p>"; print "<p><a href='javascript:openParentNote(\"endwork=endwork\")' class='btn btn-info'>" . T_("End work") . "</a></p>";
} }
else else
{ {
if (!isset($_GET['end'])) print "<div>" . T_("The last call completed this call attempt") . "</div>"; if (!isset($_GET['end'])) print "<div class='alert alert-info'>" . T_("The last call completed this call attempt") . "</div>";
print "<p><a href='javascript:openParent(\"endcase=endcase\")'>" . T_("End case") . "</a></p>"; print "<p><a href='javascript:openParent(\"endcase=endcase\")' class='btn btn-primary'>" . T_("End case") . "</a></p></p>";
print "<p><a href='javascript:openParent(\"endwork=endwork\")'>" . T_("End work") . "</a></p>"; print "<p><a href='javascript:openParent(\"endwork=endwork\")' class='btn btn-info'>" . T_("End work") . "</a></p>";
} }
} }
} }
@@ -481,7 +481,7 @@ switch($state)
break; break;
case 5: //done -- shouldn't come here as should be coded + done case 5: //done -- shouldn't come here as should be coded + done
default: default:
print "<div class='status'>" . T_("Error: Close window") . "</div>"; print "<div class='alert alert-danger'>" . T_("Error: Close window") . "</div>";
break; break;
} }

View File

@@ -42,7 +42,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**
* XHTML functions * XHTML functions

View File

@@ -42,7 +42,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**
* XHTML functions * XHTML functions

View File

@@ -42,7 +42,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**

View File

@@ -42,7 +42,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**
@@ -65,7 +65,9 @@ include("functions/functions.operator.php");
*/ */
include("functions/functions.input.php"); include("functions/functions.input.php");
$js = array("js/window.js"); if (isset($_GET['interface2'])) { if (browser_ie()) $jsw = "js/window_ie6_interface2.js"; else $jsw = "js/window_interface2.js"; }
else { if (browser_ie()) $jsw = "js/window_ie6.js"; else $jsw = "js/window.js"; }
$js = array($jsw);
if (AUTO_LOGOUT_MINUTES !== false) if (AUTO_LOGOUT_MINUTES !== false)
{ {

View File

@@ -1,9 +1,3 @@
/** RESET **/
* {
margin: 0;
padding: 0;
}
html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0; margin: 0;
@@ -16,6 +10,11 @@ html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pr
vertical-align: baseline; vertical-align: baseline;
} }
body {
text-align: justify;
font-family: Tahoma, Arial, Helvetica, sans-serif;
}
.clear { .clear {
clear:both; clear:both;
font-size:0; font-size:0;
@@ -23,303 +22,12 @@ html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pr
overflow:hidden; overflow:hidden;
} }
body {
margin: 0px;
padding: 0;
background: #FFFFFF;
text-align: justify;
font-family: Tahoma, Arial, Helvetica, sans-serif;
}
#wrapper_e {
}
.full_height_wrapper{
margin: 0px;
padding: 0;
text-align: justify;
height:285px;
font-family: Tahoma, Arial, Helvetica, sans-serif;
min-width:1024px;
}
.half_height_wrapper{
margin: 0px;
padding: 0;
text-align: justify;
height:94px;
font-family: Tahoma, Arial, Helvetica, sans-serif;
min-width:1024px;
}
#top_page {
}
#top_page_in_e {
}
.full_height_top_page{
height: 207px;
}
.half_height_top_page{
height: 56px;
}
.full_height{
margin: 0px;
padding: 0;
background: #FFF;
text-align: justify;
font-family: Tahoma, Arial, Helvetica, sans-serif;
height: 271px;
padding-top:14px;
}
.half_height{
margin: 0px;
padding: 0;
background: #FFF;
text-align: justify;
font-family: Tahoma, Arial, Helvetica, sans-serif;
height: 80px;
padding-top:14px;
}
#header_line {
margin: 16px 0px 0px 12px;
padding: 0;
text-align: justify;
font-family: Tahoma, Arial, Helvetica, sans-serif;
height: 24px;
}
#menu_left_e {
}
.menu_full_height {
padding: 0;
height: 137px;
width:145px;
display:block;
float:left;
padding:9px 22px 0px 44px;
padding-left:44px;
padding-top:9px;
list-style:none;
}
.menu_half_height {
padding: 0;
height: 47px;
list-style:none;
width:145px;
display:block;
float:left;
padding:9px 22px 0px 44px;
padding-left:44px;
padding-top:9px;
}
#menu_left li {
list-style: none;
}
#item_1 a{
background: url(images/btn_field.jpg) no-repeat left top;
list-style: none;
display: inline;
float: left;
width: 220px;
height: 40px;
color:#9f9f9f;
text-decoration:none;
padding:8px 0px 0px 18px;
border:none;
}
#item_1 a:hover{
list-style: none;
display: inline;
float: left;
width: 220px;
height: 40px;
text-decoration:none;
color:#49b848;
}
#item_2_e a{
}
.item_2_full_height a{
background: url(images/btn_field.jpg) no-repeat left top;
list-style: none;
display: inline;
float: left;
width: 220px;
height: 36px;
text-decoration:none;
color:#9f9f9f;
padding:8px 0px 0px 18px;
border:none;
}
.item_2_half_height a{
float: left;
width: 220px;
height: 1px;
text-decoration:none;
color:#b8b8ba;
display:none;
}
.item_2_full_height a:hover{
list-style: none;
display: inline;
float: left;
width: 220px;
height: 36px;
text-decoration:none;
color:#05b0f7;
background: url(images/btn_field.jpg) no-repeat left top;
}
#item_2_e a:hover{
}
.item_2_half_height {
float: left;
width: 220px;
height: 1px;
display:none;
}
#item_3_e a{
}
.item_3_half_height {
float: left;
width: 220px;
height: 1px;
display:none;
}
.item_3_full_height a{
background: url(images/btn_field.jpg) no-repeat left top;
list-style: none;
display: inline;
float: left;
width: 220px;
height: 36px;
text-decoration:none;
color:#9f9f9f;
padding:8px 0px 0px 18px;
border:none;
}
.item_3_half_height a{
}
.item_3_full_height a:hover{
list-style: none;
display: inline;
float: left;
width: 220px;
height: 36px;
text-decoration:none;
color:#ff3506;
}
#item_3_e a:hover{
}
#info_e {
}
.info_full_height{
margin: 0px;
padding: 0;
background: #CCC;
border: 1px solid #e9e9eb;
text-align: justify;
font-family: Tahoma, Arial, Helvetica, sans-serif;
display:block;
float:left;
height: 137px;
width:214px;
padding-right:115px;
}
.info_half_height{
margin: 0px;
padding: 0;
background: #CCC;
border: 1px solid #e9e9eb;
text-align: justify;
font-family: Tahoma, Arial, Helvetica, sans-serif;
display:block;
float:left;
height: 56px;
width:214px;
padding-right:115px;
}
a:active {
/* border: 4px inset;*/
}
#arrow_up_e {
}
.arrow_up_full_height {
margin: 0 auto;
padding: 0;
background: #EEE;
background: url(images/arrow_up.png) no-repeat left top;
text-align: justify;
font-family: Tahoma, Arial, Helvetica, sans-serif;
height: 20px;
width:20px;
position:absolute;
left:480px;
top:270px;
}
.arrow_up_half_height {
display:none;
}
#arrow_down_e {
}
.arrow_down_full_height {
display:none;
}
.arrow_down_half_height {
margin: 0 auto;
padding: 0;
background: #EEE;
background: url(images/arrow_down.jpg) no-repeat left top;
text-align: justify;
font-family: Tahoma, Arial, Helvetica, sans-serif;
height: 20px;
width:20px;
left:480px;
top:80px;
position:absolute;
}
#bottom_page {
margin: 0px;
padding: 0;
background: #CCC;
text-align: justify;
font-family: Tahoma, Arial, Helvetica, sans-serif;
height: 100%;
}
.headerexpand { .headerexpand {
position: absolute; position: absolute;
height: 20px; left: 41%;
bottom: 0px;
right: 20%;
}
#headerexpandimage {
height: 15px;
} }
.box { .box {
margin: 18px; margin: 18px;
} }
@@ -329,160 +37,19 @@ a:active {
.offline { .offline {
background: #FF0000; background: #FF0000;
} }
a {
/*padding: 3px 0.5em;
margin-left: 3px;
border: 1px solid #778;
background: #DDE;
text-decoration: none;
color: black;*/
}
a:active {
/* border: 4px inset;*/
}
.header {
position : absolute;
width : 50%;
height : 30%;
top : 30%;
right : 0;
bottom : auto;
left : 0;
/*max-height:136px;*/
}
#calllist {
position : absolute;
width : 50%;
height : 28%;
top : 2%;
left : 48%;
right : 1%;
/*max-height:180px;*/
bottom : auto;
}
#qstatus {
position : absolute;
width : 30%;
height : 30%;
top : 2%;
right : 2%;
left: 17%;
bottom : auto;
/*max-height:38%;*/
}
#casefunctions {
position : absolute;
width : 12%;
height : 30%;
top : 0;
right : 0;
left: 0;
font-size:18px;
padding:1%;
bottom : auto;
}
#casefunctions li {
list-style:none;
}
#content {
position : absolute;
top : 31%;
left : 0.5%;
right :0.5%;
bottom : auto;
width : 99%;
height : 69%;
}
.embeddedobject { .embeddedobject {
width:100%; width:100%;
height:100%; height:100%;
position:absolute; position:absolute;
} }
#main-qstatus { #main-qstatus {
width:95%;
/*max-height:116px;*/
position:absolute;
left:3%;
top:1%;
height:90%;
border: 2px solid #e9e9eb; border: 2px solid #e9e9eb;
border-radius: 15px; border-radius: 15px;
-moz-border-radius: 15px; -moz-border-radius: 15px;
}
#main-casenotes{
height:85%;
}
#main-contactdetails{
/*height:85%;*/
}
#main-calllist{
/*height:85%;*/
}
#main-appointmentlist{
height:85%;
}
#main-projectinfo{
height:85%;
}
.wait_wrapper{
margin: 0 auto;
position:absolute;
top:40%;
height:60%;
width:260px;
left:40%;
list-style:none;
} }
.wait_li_1 a{
background: url(images/btn_field.jpg) no-repeat left top;
list-style: none;
display: inline;
float: left;
width: 220px;
height: 40px;
color:#9f9f9f;
text-decoration:none;
padding:8px 0px 0px 18px;
border:none;
margin-bottom: 20px;
}
.wait_li_1 a:hover{
list-style: none;
display: inline;
float: left;
width: 220px;
height: 40px;
text-decoration:none;
color:#49b848;
}
.wait_li_2 a{
background: url(images/btn_field.jpg) no-repeat left top;
list-style: none;
display: inline;
float: left;
width: 220px;
height: 40px;
color:#9f9f9f;
text-decoration:none;
padding:8px 0px 0px 18px;
border:none;
}
.wait_li_2 a:hover{
list-style: none;
display: inline;
float: left;
width: 220px;
height: 40px;
text-decoration:none;
color:#ff3506;
}

View File

@@ -84,7 +84,7 @@ ul.tabbernav li.tabberactive a:hover
Add style only after the tabber interface is set up (.tabberlive) Add style only after the tabber interface is set up (.tabberlive)
--------------------------------------------------*/ --------------------------------------------------*/
.tabberlive .tabbertab { .tabberlive .tabbertab {
position:absolute; /*position:absolute;*/
border: 2px solid #e9e9eb; border: 2px solid #e9e9eb;
border-bottom-left-radius: 15px; border-bottom-left-radius: 15px;
-moz-border-radius-bottomleft: 15px; -moz-border-radius-bottomleft: 15px;

View File

@@ -42,7 +42,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**
@@ -72,7 +72,7 @@ $operator_id = get_operator_id();
$msg = ""; $msg = "";
if (isset($_POST['firstname'])) if (isset($_POST['email']) && ((isset($_POST['firstname']) && !empty($_POST['firstname'])) || (isset($_POST['lastname']) && !empty($_POST['lastname']))))
{ {
//validate email address //validate email address
if (validate_email($_POST['email'])) if (validate_email($_POST['email']))
@@ -278,21 +278,23 @@ if (isset($_POST['firstname']))
} }
//disable recording //disable recording
$newtext = T_("Start REC"); $newtext = T_("Start REC");
$js = "js/window.js";
if (browser_ie()) $js = "js/window_ie6.js"; if (isset($_GET['interface2'])) { if (browser_ie()) $js = "js/window_ie6_interface2.js"; else $js = "js/window_interface2.js";}
else { if (browser_ie()) $js = "js/window_ie6.js"; else $js = "js/window.js"; }
if (isset($_GET['interface2'])) if (isset($_GET['interface2']))
{ {
xhtml_head(T_("Email"),true,array("css/call.css"),array($js),"onload='openParent(\"endcase=endcase\");'"); xhtml_head(T_("Invitation Email"),true,array("css/call.css"),array($js),"onload='openParent(\"endcase=endcase\");'");
} }
else else
{ {
xhtml_head(T_("Email"),true,array("css/call.css"),array($js),"onload='toggleRec(\"$newtext\",\"record.php?start=start\",\"offline\"); openParentObject(\"main-content\",\"" . get_respondentselection_url($operator_id) . "\"); parent.closePopup();'"); xhtml_head(T_("Invitation Email"),true,array("css/call.css"),array($js),"onload='toggleRec(\"$newtext\",\"record.php?start=start\",\"offline\"); openParentObject(\"main-content\",\"" . get_respondentselection_url($operator_id) . "\"); parent.closePopup();'");
} }
} }
else if (isset($_POST['submit'])) else if (isset($_POST['submit']))
{ {
xhtml_head(T_("Email"),true,array("css/call.css"),false,"onload='parent.closePopup();'"); xhtml_head(T_("Invitation Email"),true,array("css/call.css"),false,"onload='parent.closePopup();'");
} }
xhtml_foot(); xhtml_foot();
die(); die();
@@ -310,10 +312,10 @@ if (isset($_POST['firstname']))
$case_id = get_case_id($operator_id); $case_id = get_case_id($operator_id);
$js = "js/window.js"; if (isset($_GET['interface2'])) { if (browser_ie()) $js = "js/window_ie6_interface2.js"; else $js = "js/window_interface2.js"; }
if (browser_ie()) $js = "js/window_ie6.js"; else { if (browser_ie()) $js = "js/window_ie6.js"; else $js = "js/window.js"; }
xhtml_head(T_("Email"),true,array("css/call.css"),array($js)); xhtml_head(T_("Invitation Email"),true,array("include/bootstrap/css/bootstrap.min.css"),array($js));
$sql = "SELECT q.self_complete $sql = "SELECT q.self_complete
FROM questionnaire as q, `case` as c FROM questionnaire as q, `case` as c
@@ -333,22 +335,30 @@ if ($sc == 1)
$rs = $db->GetRow($sql); $rs = $db->GetRow($sql);
print "<div class='status'>" . T_("Email respondent for self completion") . "</div>"; print "<h4>" . T_("Email respondent for self completion") . "</h4>";
if (!empty($msg)) print "<p>$msg</p>"; if (!empty($msg)) print "<p class='alert alert-warning'>$msg</p>";
print "<form action='?"; print "<form action='?";
if (isset($_GET['interface2'])) if (isset($_GET['interface2']))
{ {
print "interface2=true"; print "interface2=true";
} }
print "' method='post'>"; print "' method='post' class='form-horizontal col-md-12'>";
print "<div><label for='firstname'>" . T_("First name") . "</label><input type='text' value='{$rs['firstname']}' name='firstname' id='firstname'/></div>";
print "<div><label for='lastname'>" . T_("Last name") . "</label><input type='text' value='{$rs['lastname']}' name='lastname' id='lastname'/></div>"; print "<div class='form-group '><label for='firstname' class='control-label'>" . T_("First name") . "</label>
print "<div><label for='email'>" . T_("Email") . "</label><input type='text' value='{$rs['email']}' name='email' id='email'/></div>"; <input type='text' value='{$rs['firstname']}' name='firstname' id='firstname' class='form-control'/>
if (!isset($_GET['interface2'])) </div>";
{ print "<div class='form-group '><label for='lastname' class='control-label'>" . T_("Last name") . "</label>
print "<div><input type='submit' value=\"" . T_("Send invitation") . "\" name='submit' id='submit'/></div>"; <input type='text' value='{$rs['lastname']}' name='lastname' id='lastname' class='form-control'/>
</div>";
print "<div class='form-group '><label for='email' class='control-label'>" . T_("Email") . "</label>
<input type='email' value='{$rs['email']}' name='email' id='email' class='form-control' required />
</div>";
if (!isset($_GET['interface2'])) {
print "<div class='form-group '><input type='submit' class='btn btn-primary' value=\"" . T_("Send invitation") . "\" name='submit' id='submit'/></div>";
} }
print "<div><input type='submit' value=\"" . T_("Send invitation and Hang up") . "\" name='submith' id='submith'/></div></form>"; print "<div class='form-group '><input type='submit' class='btn btn-primary' value=\"" . T_("Send invitation and Hang up") . "\" name='submith' id='submith'/>
<div class='col-md-6 pull-right'><a class='btn btn-default pull-right' href='javascript:parent.closePopup();'>".T_("Cancel")."</a></div><div class='clearfix'></div>
</div></form>";
} }
else else
{ {

View File

@@ -39,7 +39,7 @@ include_once("lang.inc.php");
/** /**
* Authentication * Authentication
*/ */
include_once("auth-interviewer.php"); require ("auth-interviewer.php");

View File

@@ -190,26 +190,20 @@ function display_respondent_list($case_id,$respondent_id = false,$first = false)
$rs = $db->GetAll($sql); $rs = $db->GetAll($sql);
if (count($rs) >1 ){ if (count($rs) >1 ){
print "<div><p>" . T_("Select a respondent") . ": print "<div><p><b>" . T_("Select a respondent") . "</b>:
<select id='respondent_id' name='respondent_id' onchange=\"LinkUp('respondent_id')\"><option>" . T_("None") . "</option>"; <select id='respondent_id' name='respondent_id' onchange=\"LinkUp('respondent_id')\">";//<option>" . T_("None") . "</option>
if (!empty($rs)) if (!empty($rs))
{ {
foreach($rs as $r) foreach($rs as $r)
{ {
$rid = $r['respondent_id']; if ($respondent_id == $r['respondent_id']) $selected="selected='selected'"; else $selected = "";
if ($respondent_id == false && $first == true) print "<option value='?respondent_id={$r['respondent_id']}' $selected>{$r['firstName']} {$r['lastName']}</option>";
{
$first = false;
$selected = "selected='selected'";
$respondent_id = $rid;
}
else $selected = "";
if ($rid == $respondent_id) $selected="selected='selected'";
print "<option value='?respondent_id=$rid' $selected>{$r['firstName']} {$r['lastName']}</option>";
} }
if($respondent_id ==0) print "<option value='?respondent_id=0' selected='selected' class='addresp'>" . T_("Add respondent") . "</option>";
} }
print "<option value='?respondent_id=0' class='addresp'>" . T_("Add respondent") . "</option></select></p></div>"; if($respondent_id !=0) print "<option value='?respondent_id=0' class='addresp'>" . T_("Add respondent") . "</option>";
print "</select></p></div>";
} }
else { echo "&emsp;<b>",$rs[0]['firstName'],"&ensp;",$rs[0]['lastName'],"</b>"; $respondent_id =$rs[0]['respondent_id'];} else { echo "&emsp;<b>",$rs[0]['firstName'],"&ensp;",$rs[0]['lastName'],"</b>"; $respondent_id =$rs[0]['respondent_id'];}
@@ -258,13 +252,14 @@ function display_respondent_form($respondent_id = false,$case_id = false)
$rs = $db->Execute($sql); $rs = $db->Execute($sql);
print "<div><label for='firstName'>" . T_("First name:") . "</label><input type=\"text\" id='firstName' name=\"firstName\" value=\"$fn\"/></div>
<div><label for='lastName'>" . T_("Last name:") . " </label><input type=\"text\" id='lastName' name=\"lastName\" value=\"$ln\"/></div>"; print "<p><label for='firstName'>" . T_("First name:") . "</label><input type=\"text\" class=\"form-control\" id='firstName' name=\"firstName\" value=\"$fn\"/></p>
<p><label for='lastName'>" . T_("Last name:") . " </label><input type=\"text\" class=\"form-control\" id='lastName' name=\"lastName\" value=\"$ln\"/></p>";
/** /**
* Display the current respondent zone in a drop down box with other zones from timezone_template * Display the current respondent zone in a drop down box with other zones from timezone_template
*/ */
print "<div><label>" . T_("Time Zone:") . " ".$rs->GetMenu('Time_zone_name',$rzone,false)."</label></div>"; print "<p><label>" . T_("Time Zone:") . "</label> ". $rs->GetMenu('Time_zone_name',$rzone,false,false,0,'class="form-control"'). "</p>";
} }

View File

@@ -111,19 +111,24 @@ function display_shift_chooser($questionnaire_id, $shift_id = false, $divclass=f
* @param int|bool $sample_import_id The sample import id or false if none selected * @param int|bool $sample_import_id The sample import id or false if none selected
* @param bool $disabled Display disabled samples? (default is true) * @param bool $disabled Display disabled samples? (default is true)
*/ */
function display_sample_chooser($questionnaire_id, $sample_import_id = false, $disabled = true, $divclass=false, $selectclass=false) function display_sample_chooser($questionnaire_id, $sample_import_id = false, $disabled = true, $divclass=false, $selectclass=false, $quota_reached=false)
{ {
global $db; global $db;
$s = ""; if (!$disabled) $s = " AND si.enabled = 1 "; else $s = "";
if (!$disabled) if ($quota_reached){
$s = " AND si.enabled = 1 "; $qr = " LEFT JOIN (questionnaire_sample_quota as qsq) on (si.sample_import_id = qsq.sample_import_id)
LEFT JOIN (questionnaire_sample_quota_row as qsqr) on (si.sample_import_id = qsqr.sample_import_id)";
$qrq = " AND (qsq.quota_reached IS NULL OR qsq.quota_reached != 1 )
AND (qsqr.quota_reached IS NULL OR qsqr.quota_reached != 1)";
}
else { $qr = ""; $qrq = ""; }
$sql = "SELECT s.sample_import_id,si.description,CASE WHEN s.sample_import_id = '$sample_import_id' THEN 'selected=\'selected\'' ELSE '' END AS selected $sql = "SELECT s.sample_import_id,si.description,CASE WHEN s.sample_import_id = '$sample_import_id' THEN 'selected=\'selected\'' ELSE '' END AS selected
FROM questionnaire_sample as s, sample_import as si FROM questionnaire_sample as s, sample_import as si $qr
WHERE s.questionnaire_id = '$questionnaire_id' WHERE s.questionnaire_id = '$questionnaire_id'
AND s.sample_import_id = si.sample_import_id $s"; AND s.sample_import_id = si.sample_import_id $s $qrq";
$rs = $db->GetAll($sql); $rs = $db->GetAll($sql);

View File

@@ -135,14 +135,15 @@ function xhtml_table($content,$fields,$head = false,$class = "tclass",$highlight
foreach ($fields as $e) foreach ($fields as $e)
{ {
print "<td>"; print "<td>";
if (isset($row[$e])) print $row[$e]; if (isset($row[$e])) {
print "</td>"; if ($total && in_array($e,$total)) {
if ($total && in_array($e,$total)) if (!isset($tot[$e])) $tot[$e] = 0;
{ $tot[$e] += $row[$e];
if (!isset($tot[$e])) print "<span class=\"pull-right\">" . $row[$e] . "</span>";
$tot[$e] = 0; }
$tot[$e] += $row[$e]; else print $row[$e];
} }
print "</td>";
} }
print "</tr>"; print "</tr>";
} }
@@ -151,7 +152,7 @@ function xhtml_table($content,$fields,$head = false,$class = "tclass",$highlight
print "</tbody><tfoot><tr>"; print "</tbody><tfoot><tr>";
foreach ($fields as $e) foreach ($fields as $e)
{ {
print "<td><b>"; print "<td><b class=\"pull-right\">";
if (in_array($e,$total)) if (in_array($e,$total))
print $tot[$e]; print $tot[$e];
print "</b></td>"; print "</b></td>";

View File

@@ -155,9 +155,9 @@ if(!isset($_SESSION['loginID']) && $action != "forgotpass" && ($action != "logou
$loginsummary = ' $loginsummary = '
<form class="form-signin" name="forgotpassword" id="forgotpassword" method="post" action="'.$homeurl.'/admin.php" > <form class="form-signin" name="forgotpassword" id="forgotpassword" method="post" action="'.$homeurl.'/admin.php" >
<h2>'.$clang->gT('You have to enter user name and email.').'</h2><p><br /> <br /> <h2>'.$clang->gT('You have to enter user name and email.').'</h2><br/>
<label for="user">'.$clang->gT('Username').'</label><input name="user" id="user" class="form-control" placeholder="User name" required autofocus type="text" size="60" maxlength="60" value="" /> <p><label for="user">'.$clang->gT('Username').'</label><input name="user" id="user" class="form-control" placeholder="'.$clang->gT('Username').'" required autofocus type="text" size="60" maxlength="60" value="" /></p>
<label for="email">'.$clang->gT('Email').'</label><input name="email" id="email" class="form-control" placeholder="Email" required type="text" size="60" maxlength="60" value="" /></p> <p><label for="email">'.$clang->gT('Email').'</label><input name="email" id="email" class="form-control" placeholder="'.$clang->gT('Email').'" required type="text" size="60" maxlength="60" value="" /></p>
<input type="hidden" name="action" value="forgotpass" /> <input type="hidden" name="action" value="forgotpass" />
<p><button class="action btn btn-lg btn-primary btn-block" type="submit">'.$clang->gT('Check Data').'</button></p> <p><button class="action btn btn-lg btn-primary btn-block" type="submit">'.$clang->gT('Check Data').'</button></p>
<p><a href="'.$scriptname.'">'.$clang->gT('Main Admin Screen').'</a></p> <p><a href="'.$scriptname.'">'.$clang->gT('Main Admin Screen').'</a></p>
@@ -208,18 +208,18 @@ if(!isset($_SESSION['loginID']) && $action != "forgotpass" && ($action != "logou
{ {
if (!isset($logoutsummary)) if (!isset($logoutsummary))
{ {
$loginsummary = "<form name='loginform' id='loginform' class='form-signin' method='post' action='$homeurl/admin.php' ><h2>".$clang->gT("You have to login first.")."</h2><p><br /> <br />"; $loginsummary = "<form name='loginform' id='loginform' class='form-signin' method='post' action='$homeurl/admin.php' ><h2>".$clang->gT("You have to login first.")."</h2><br />";
} }
else else
{ {
$loginsummary = "<form name='loginform' id='loginform' class='form-signin' method='post' action='$homeurl/admin.php' ><br /><strong>".$logoutsummary."</strong><br /> <br />"; $loginsummary = "<form name='loginform' id='loginform' class='form-signin' method='post' action='$homeurl/admin.php' ><br /><strong>".$logoutsummary."</strong><br /><br />";
} }
$loginsummary .= "<label for='user'>".$clang->gT("Username")."</label> $loginsummary .= "<p><label for='user'>".$clang->gT("Username")."</label>
<input class='form-control' placeholder='User name' required autofocus name='user' id='user' type='text' size='40' maxlength='40' value='' /> <input class='form-control' placeholder='".$clang->gT("Username")."' required autofocus name='user' id='user' type='text' size='40' maxlength='40' value='' /></p>
<label for='password'>".$clang->gT("Password")."</label> <p><label for='password'>".$clang->gT("Password")."</label>
<input name='password' id='password' class='form-control' placeholder='Password' required type='password' size='40' maxlength='40' /> <input name='password' id='password' class='form-control' placeholder='".$clang->gT("Password")."' required type='password' size='40' maxlength='40' /></p>
<label for='loginlang'>".$clang->gT("Language")."</label> <p><label for='loginlang'>".$clang->gT("Language")."</label>
<select id='loginlang' class='form-control' name='loginlang'>\n"; <select id='loginlang' class='form-control' name='loginlang'>\n";
$loginsummary .='<option value="default" selected="selected">'.$clang->gT('Default').'</option>'; $loginsummary .='<option value="default" selected="selected">'.$clang->gT('Default').'</option>';
$lan=array(); $lan=array();
@@ -233,10 +233,10 @@ if(!isset($_SESSION['loginID']) && $action != "forgotpass" && ($action != "logou
//The following conditional statements select the browser language in the language drop down box and echoes the other options. //The following conditional statements select the browser language in the language drop down box and echoes the other options.
$loginsummary .= "\t\t\t\t<option value='$langkey'>".$languagekind['nativedescription']." - ".$languagekind['description']."</option>\n"; $loginsummary .= "\t\t\t\t<option value='$langkey'>".$languagekind['nativedescription']." - ".$languagekind['description']."</option>\n";
} }
$loginsummary .= "\t\t\t</select>\n $loginsummary .= "\t\t\t</select></p>\n
<p><input type='hidden' name='action' value='login' /> <input type='hidden' name='action' value='login' />
<input type='hidden' name='refererargs' value='".$refererargs."' /> <input type='hidden' name='refererargs' value='".$refererargs."' />
<button class='action btn btn-lg btn-primary btn-block' type='submit'>".$clang->gT("Login")."</button>"; <p><button class='action btn btn-lg btn-primary btn-block' type='submit'>".$clang->gT("Login")."</button></p>";
} }
else{ else{
$loginsummary .= "<p>".sprintf($clang->gT("You have exceeded you maximum login attempts. Please wait %d minutes before trying again"),($timeOutTime/60))."<br /></p>"; $loginsummary .= "<p>".sprintf($clang->gT("You have exceeded you maximum login attempts. Please wait %d minutes before trying again"),($timeOutTime/60))."<br /></p>";
@@ -244,9 +244,9 @@ if(!isset($_SESSION['loginID']) && $action != "forgotpass" && ($action != "logou
if ($display_user_password_in_email === true) if ($display_user_password_in_email === true)
{ {
$loginsummary .= "<p><a href='$scriptname?action=forgotpassword'>".$clang->gT("Forgot Your Password?")."</a><br />&nbsp;\n"; $loginsummary .= "<a href='$scriptname?action=forgotpassword'>".$clang->gT("Forgot Your Password?")."</a><br />&nbsp;\n";
} }
$loginsummary .= " </form><br /><p>"; $loginsummary .= " </form><br />";
$loginsummary .= " <script type='text/javascript'>\n"; $loginsummary .= " <script type='text/javascript'>\n";
$loginsummary .= " document.getElementById('user').focus();\n"; $loginsummary .= " document.getElementById('user').focus();\n";
$loginsummary .= " </script>\n"; $loginsummary .= " </script>\n";

View File

@@ -31,7 +31,7 @@ p {
background: #121a28; background: #121a28;
margin: 0; margin: 0;
padding: 5px; padding: 5px;
margin-bottom:400px; margin-bottom:20px;
clear:left; clear:left;
} }

View File

@@ -139,7 +139,7 @@ if (!isset($_SESSION['loginID']))
if ($result) if ($result)
{ {
// wrong or unknown username // wrong or unknown username
$loginsummary .= "<p>".$clang->gT("Incorrect username and/or password!")."<br />"; $loginsummary .= "<p>".$clang->gT("Incorrect username and/or password!")."</p><br />";
if ($intNthAttempt+1>=$maxLoginAttempt) if ($intNthAttempt+1>=$maxLoginAttempt)
$loginsummary .= sprintf($clang->gT("You have exceeded you maximum login attempts. Please wait %d minutes before trying again"),($timeOutTime/60))."<br />"; $loginsummary .= sprintf($clang->gT("You have exceeded you maximum login attempts. Please wait %d minutes before trying again"),($timeOutTime/60))."<br />";
$loginsummary .= "<br /><a href='$scriptname'>".$clang->gT("Continue")."</a><br />&nbsp;\n"; $loginsummary .= "<br /><a href='$scriptname'>".$clang->gT("Continue")."</a><br />&nbsp;\n";

View File

@@ -38,7 +38,7 @@ include ("config.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**
* XHTML functions * XHTML functions

View File

@@ -48,7 +48,7 @@ include("functions/functions.operator.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
@@ -200,7 +200,7 @@ else if (HEADER_EXPANDER_MANUAL)
} }
xhtml_head(T_("Case"), $body, array("include/bootstrap/css/bootstrap.min.css","css/index_interface2.css","css/tabber_interface2.css","include/jquery-ui/jquery-ui.min.css") , $js); xhtml_head(T_("Case"), $body, array("include/bootstrap/css/bootstrap.min.css","include/bootstrap/css/bootstrap-theme.min.css","include/font-awesome/css/font-awesome.css","css/index_interface2.css","css/tabber_interface2.css","include/jquery-ui/jquery-ui.min.css"),$js,false,false, false,false,false);
print $script; print $script;
$case_id = get_case_id($operator_id,true); $case_id = get_case_id($operator_id,true);
@@ -217,212 +217,215 @@ $ref = $scr['referral'];
$availability = is_using_availability($case_id); $availability = is_using_availability($case_id);
?> ?>
<div id="casefunctions" class="col-sm-2"> <div class="container-fluid ">
<ul id="casefunctions" class="header "> <div class="row ">
<li id="item_1"><a href="javascript:poptastic('call_interface2.php');"><?php echo T_("Outcome"); ?> <img src="css/images/play.jpg" /></a></li>
<li id="item_2_e" class="item_2_full_height"><a href="javascript:poptastic('appointment.php');"><?php echo T_("Appointment"); ?><img src="css/images/plius.jpg" /></a></li>
<?php if ($sc == 1) { ?>
<li id='item_4_e' class="item_2_full_height"><a href="javascript:poptastic('email.php?interface2=true');"><?php echo T_("Email"); ?> <img src="css/images/plius.jpg" /></a></li>
<?php } ?>
<?php if ($ref == 1) { ?>
<li id='item_5_e' class="item_2_full_height"><a href="javascript:poptastic('referral.php?interface2=true');"><?php echo T_("Referral"); ?> <img src="css/images/plius.jpg" /></a></li>
<?php } ?>
<li id="item_3_e" class="item_3_full_height"><a href="?endwork=endwork"><?php echo T_("End work"); ?> <img src="css/images/end.jpg" /></a></li>
</ul>
</div>
<div id="qstatus" class="header col-sm-4"> <div id="casefunctions" class="col-sm-2 panel-body">
<?php xhtml_object("status_interface2.php","main-qstatus");?>
<?php if (HEADER_EXPANDER_MANUAL){ ?> <div class='headerexpand'><img id='headerexpandimage' src='./images/arrow-up-2.jpg' alt='<?php echo T_('Arrow for expanding or contracting'); ?>'/></div> <?php } ?> <a href="javascript:poptastic('call_interface2.php');" class="btn btn-default btn-block" style="border-radius:15px; color:blue"><strong><?php echo T_("Outcome"); ?> <i class="fa fa-lg fa-check-square-o fa-fw"></i></strong></a></br>
</div> <a href="javascript:poptastic('appointment.php');" class="btn btn-default btn-block " style="border-radius:15px; color:green"><strong><?php echo T_("Appointment"); ?> <i class="fa fa-lg fa-clock-o fa-fw"></i></strong></a></br>
<?php if ($sc == 1) { ?>
<a href="javascript:poptastic('email.php?interface2=true');" class="btn btn-default btn-block" style="border-radius:15px; color:blue"><strong><?php echo T_("Invitation Email"); ?> <i class="fa fa-lg fa-envelope-o fa-fw"></i></strong></a></br>
<?php } ?>
<?php if ($ref == 1) { ?>
<a href="javascript:poptastic('referral.php?interface2=true');" class="btn btn-default btn-block" style="border-radius:15px; color:blue"><strong><?php echo T_("Referral"); ?> <i class="fa fa-lg fa-link fa-fw"></i></strong></a></br>
<?php } ?>
<a href="?endwork=endwork"; class="btn btn-default btn-block" style="border-radius:15px; color:red"><strong><?php echo T_("End work"); ?> <i class="fa fa-lg fa-ban fa-fw"></i></strong></a>
</div>
<div id="qstatus" class="col-sm-3 panel-body">
<?php xhtml_object("status_interface2.php","main-qstatus", "col-sm-12" );?>
</div>
<?php if (HEADER_EXPANDER_MANUAL){ ?><div class="headerexpand"><i id='headerexpandimage' class="fa fa-lg fa-toggle-down fa-fw" title='<?php echo T_('Arrow for expanding or contracting'); ?>'></i></div> <?php } ?>
<div id="calllist" class="col-sm-7">
<div class="tabber" id="tab-main">
<?php
if (isset($appointment)) {} else {$appointment = "";}
if (TAB_CASENOTES) { ?>
<div class="tabbertab <?php if ((DEFAULT_TAB == 'casenotes' && !$appointment) || (DEFAULT_TAB_APPOINTMENT == 'casenotes' && $appointment))
print "tabbertabdefault"; ?>">
<h2><?php echo T_("Notes"); ?></h2>
<div id="div-casenotes" class="tabberdiv"><?php xhtml_object("casenote.php","main-casenotes","col-sm-12");?></div>
</div>
<?php }?>
<?php if ($availability) { ?>
<div class="tabbertab <?php if ((DEFAULT_TAB == 'availability' && !$appointment) || (DEFAULT_TAB_APPOINTMENT == 'availability' && $appointment))
print "tabbertabdefault"; ?>">
<h2><?php echo T_("Availability"); ?></h2>
<div id="div-casenotes" class="tabberdiv"><?php xhtml_object("availability.php","main-availability","col-sm-12");?></div>
</div>
<?php }?>
<?php if (TAB_CONTACTDETAILS) { ?>
<div class="tabbertab <?php if ((DEFAULT_TAB == 'contactdetails' && !$appointment) || (DEFAULT_TAB_APPOINTMENT == 'contactdetails' && $appointment))
print "tabbertabdefault"; ?>">
<h2><?php echo T_("Contact details"); ?></h2>
<div id="div-contactdetails" class="tabberdiv"><?php xhtml_object("contactdetails.php","main-contactdetails","col-sm-12");?></div>
</div>
<?php }?>
<?php if (TAB_CALLLIST) { ?>
<div class="tabbertab <?php if ((DEFAULT_TAB == 'calllist' && !$appointment) || (DEFAULT_TAB_APPOINTMENT == 'calllist' && $appointment))
print "tabbertabdefault"; ?>">
<h2><?php echo T_("Call history"); ?></h2>
<div id="div-calllist" class="tabberdiv"><?php xhtml_object("calllist.php","main-calllist","col-sm-12");?></div>
</div>
<?php }?>
<?php if (TAB_SHIFTS) { ?>
<div class="tabbertab <?php if ((DEFAULT_TAB == 'shifts' && !$appointment) || (DEFAULT_TAB_APPOINTMENT == 'shifts' && $appointment))
print "tabbertabdefault"; ?>" id="tab-shifts">
<h2><?php echo T_("Shifts"); ?></h2>
<div id="div-shifts" class="tabberdiv"><?php xhtml_object("shifts.php","main-shifts","col-sm-12");?></div>
</div>
<?php }?>
<?php if (TAB_APPOINTMENTLIST) { ?>
<div class="tabbertab <?php if ((DEFAULT_TAB == 'appointmentlist' && !$appointment) || (DEFAULT_TAB_APPOINTMENT == 'appointmentlist' && $appointment))
print "tabbertabdefault"; ?>">
<h2><?php echo T_("Appointments"); ?></h2>
<div id="div-appointmentlist" class="tabberdiv"><?php xhtml_object("appointmentlist.php","main-appointmentlist","col-sm-12");?></div>
</div>
<?php }?>
<?php if (TAB_PERFORMANCE) { ?>
<div class="tabbertab <?php if ((DEFAULT_TAB == 'performance' && !$appointment) || (DEFAULT_TAB_APPOINTMENT == 'performance' && $appointment))
print "tabbertabdefault"; ?>">
<h2><?php echo T_("Performance"); ?></h2>
<div id="div-performance" class="tabberdiv"><?php xhtml_object("performance.php","main-performance","col-sm-12");?></div>
</div>
<?php }?>
<?php if (TAB_CALLHISTORY) { ?>
<div class="tabbertab <?php if ((DEFAULT_TAB == 'callhistory' && !$appointment) || (DEFAULT_TAB_APPOINTMENT == 'callhistory' && $appointment))
print "tabbertabdefault"; ?>">
<h2><?php echo T_("Work history"); ?></h2>
<div id="div-callhistory" class="tabberdiv"><?php xhtml_object("callhistory.php","main-callhistory","col-sm-12");?></div>
</div>
<?php }?>
<?php if (TAB_PROJECTINFO) { ?>
<div class="tabbertab <?php if ((DEFAULT_TAB == 'projectinfo' && !$appointment) || (DEFAULT_TAB_APPOINTMENT == 'projectinfo' && $appointment))
print "tabbertabdefault"; ?>">
<h2><?php echo T_("Project information"); ?></h2>
<div id="div-projectinfo" class="tabberdiv"><?php xhtml_object("project_info.php","main-projectinfo","col-sm-12");?></div>
</div>
<?php }?>
<div id="calllist" class="header col-sm-6"> <?php if (TAB_INFO) { ?>
<div class="tabbertab <?php if ((DEFAULT_TAB == 'info' && !$appointment) || (DEFAULT_TAB_APPOINTMENT == 'info' && $appointment))
print "tabbertabdefault"; ?>">
<h2><?php echo T_("Info"); ?></h2>
<div id="div-info" class="tabberdiv"><?php xhtml_object("info.php","main-info","col-sm-12");?></div>
</div>
<?php }?>
</div>
<div class="tabber" id="tab-main"> </div>
<?php if (TAB_CASENOTES) { ?> </div>
<div class="tabbertab <?php if ((DEFAULT_TAB == 'casenotes' && !$appointment) || (DEFAULT_TAB_APPOINTMENT == 'casenotes' && $appointment))
print "tabbertabdefault"; ?>">
<h2><?php echo T_("Notes"); ?></h2>
<div id="div-casenotes" class="tabberdiv"><?php xhtml_object("casenote.php","main-casenotes");?></div>
</div>
<?php }?>
<?php if ($availability) { ?>
<div class="tabbertab <?php if ((DEFAULT_TAB == 'availability' && !$appointment) || (DEFAULT_TAB_APPOINTMENT == 'availability' && $appointment))
print "tabbertabdefault"; ?>">
<h2><?php echo T_("Availability"); ?></h2>
<div id="div-casenotes" class="tabberdiv"><?php xhtml_object("availability.php","main-casenotes");?></div>
</div>
<?php }?>
<?php if (TAB_CONTACTDETAILS) { ?>
<div class="tabbertab <?php if ((DEFAULT_TAB == 'contactdetails' && !$appointment) || (DEFAULT_TAB_APPOINTMENT == 'contactdetails' && $appointment))
print "tabbertabdefault"; ?>">
<h2><?php echo T_("Contact details"); ?></h2>
<div id="div-contactdetails" class="tabberdiv"><?php xhtml_object("contactdetails.php","main-contactdetails");?></div>
</div>
<?php }?>
<?php if (TAB_CALLLIST) { ?>
<div class="tabbertab <?php if ((DEFAULT_TAB == 'calllist' && !$appointment) || (DEFAULT_TAB_APPOINTMENT == 'calllist' && $appointment))
print "tabbertabdefault"; ?>">
<h2><?php echo T_("Call history"); ?></h2>
<div id="div-calllist" class="tabberdiv"><?php xhtml_object("calllist.php","main-calllist");?></div>
</div>
<?php }?>
<?php if (TAB_SHIFTS) { ?>
<div class="tabbertab <?php if ((DEFAULT_TAB == 'shifts' && !$appointment) || (DEFAULT_TAB_APPOINTMENT == 'shifts' && $appointment))
print "tabbertabdefault"; ?>" id="tab-shifts">
<h2><?php echo T_("Shifts"); ?></h2>
<div id="div-shifts" class="tabberdiv"><?php xhtml_object("shifts.php","main-shifts");?></div>
</div>
<?php }?>
<?php if (TAB_APPOINTMENTLIST) { ?>
<div class="tabbertab <?php if ((DEFAULT_TAB == 'appointmentlist' && !$appointment) || (DEFAULT_TAB_APPOINTMENT == 'appointmentlist' && $appointment))
print "tabbertabdefault"; ?>">
<h2><?php echo T_("Appointments"); ?></h2>
<div id="div-appointmentlist" class="tabberdiv"><?php xhtml_object("appointmentlist.php","main-appointmentlist");?></div>
</div>
<?php }?>
<?php if (TAB_PERFORMANCE) { ?>
<div class="tabbertab <?php if ((DEFAULT_TAB == 'performance' && !$appointment) || (DEFAULT_TAB_APPOINTMENT == 'performance' && $appointment))
print "tabbertabdefault"; ?>">
<h2><?php echo T_("Performance"); ?></h2>
<div id="div-performance" class="tabberdiv"><?php xhtml_object("performance.php","main-performance");?></div>
</div>
<?php }?>
<?php if (TAB_CALLHISTORY) { ?>
<div class="tabbertab <?php if ((DEFAULT_TAB == 'callhistory' && !$appointment) || (DEFAULT_TAB_APPOINTMENT == 'callhistory' && $appointment))
print "tabbertabdefault"; ?>">
<h2><?php echo T_("Work history"); ?></h2>
<div id="div-callhistory" class="tabberdiv"><?php xhtml_object("callhistory.php","main-callhistory");?></div>
</div>
<?php }?>
<?php if (TAB_PROJECTINFO) { ?>
<div class="tabbertab <?php if ((DEFAULT_TAB == 'projectinfo' && !$appointment) || (DEFAULT_TAB_APPOINTMENT == 'projectinfo' && $appointment))
print "tabbertabdefault"; ?>">
<h2><?php echo T_("Project information"); ?></h2>
<div id="div-projectinfo" class="tabberdiv"><?php xhtml_object("project_info.php","main-projectinfo");?></div>
</div>
<?php }?>
<?php if (TAB_INFO) { ?>
<div class="tabbertab <?php if ((DEFAULT_TAB == 'info' && !$appointment) || (DEFAULT_TAB_APPOINTMENT == 'info' && $appointment))
print "tabbertabdefault"; ?>">
<h2><?php echo T_("Info"); ?></h2>
<div id="div-info" class="tabberdiv"><?php xhtml_object("info.php","main-info");?></div>
</div>
<?php }?>
</div>
</div>
<div id="content" class="content "> <div class="row">
<?php
$ca = get_call_attempt($operator_id,true); <?php
$call_id = get_call($operator_id);
$appointment = false;
if ($ca)
{
$appointment = is_on_appointment($ca);
$respondent_id = get_respondent_id($ca);
}
if (!$call_id) $ca = get_call_attempt($operator_id,true);
{ $call_id = get_call($operator_id);
if ($appointment) $appointment = false;
{ if ($ca)
//create a call on the appointment number {
$sql = "SELECT cp.*, a.respondent_id $appointment = is_on_appointment($ca);
FROM contact_phone as cp, appointment as a $respondent_id = get_respondent_id($ca);
WHERE cp.case_id = '$case_id' }
AND a.appointment_id = '$appointment'
AND a.contact_phone_id = cp.contact_phone_id"; if (!$call_id)
} {
else if ($appointment)
{ {
//create a call on the first available number by priority //create a call on the appointment number
$sql = "SELECT c. * $sql = "SELECT cp.*, a.respondent_id
FROM contact_phone AS c FROM contact_phone as cp, appointment as a
LEFT JOIN ( WHERE cp.case_id = '$case_id'
SELECT contact_phone.contact_phone_id AND a.appointment_id = '$appointment'
FROM contact_phone AND a.contact_phone_id = cp.contact_phone_id";
LEFT JOIN `call` ON ( call.contact_phone_id = contact_phone.contact_phone_id ) }
LEFT JOIN outcome ON ( call.outcome_id = outcome.outcome_id ) else
WHERE contact_phone.case_id = '$case_id' {
AND outcome.tryagain =0 //create a call on the first available number by priority
) AS l ON l.contact_phone_id = c.contact_phone_id $sql = "SELECT c. *
LEFT JOIN FROM contact_phone AS c
( LEFT JOIN (
SELECT contact_phone_id SELECT contact_phone.contact_phone_id
FROM `call` FROM contact_phone
WHERE call_attempt_id = '$ca' LEFT JOIN `call` ON ( call.contact_phone_id = contact_phone.contact_phone_id )
AND outcome_id NOT IN (15,18) LEFT JOIN outcome ON ( call.outcome_id = outcome.outcome_id )
) as ca on ca.contact_phone_id = c.contact_phone_id WHERE contact_phone.case_id = '$case_id'
WHERE c.case_id = '$case_id' AND outcome.tryagain =0
AND l.contact_phone_id IS NULL ) AS l ON l.contact_phone_id = c.contact_phone_id
AND ca.contact_phone_id IS NULL LEFT JOIN
order by c.priority ASC"; (
SELECT contact_phone_id
FROM `call`
WHERE call_attempt_id = '$ca'
AND outcome_id NOT IN (15,18)
) as ca on ca.contact_phone_id = c.contact_phone_id
WHERE c.case_id = '$case_id'
AND l.contact_phone_id IS NULL
AND ca.contact_phone_id IS NULL
order by c.priority ASC";
} }
$rs = $db->GetRow($sql); $rs = $db->GetRow($sql);
if (!empty($rs)) if (!empty($rs))
{ {
$contact_phone_id = $rs['contact_phone_id']; $contact_phone_id = $rs['contact_phone_id'];
if (!isset($rs['respondent_id'])) if (!isset($rs['respondent_id']))
{ {
$sql = "SELECT respondent_id $sql = "SELECT respondent_id
FROM respondent FROM respondent
WHERE case_id = $case_id"; WHERE case_id = $case_id";
$respondent_id = $db->GetOne($sql); $respondent_id = $db->GetOne($sql);
} }
else else
{ {
$respondent_id = $rs['respondent_id']; $respondent_id = $rs['respondent_id'];
} }
$call_id = get_call($operator_id,$respondent_id,$contact_phone_id,true); $call_id = get_call($operator_id,$respondent_id,$contact_phone_id,true);
} }
} }
if (!is_respondent_selection($operator_id))
$data = get_limesurvey_url($operator_id);
else
$data = get_respondentselection_url($operator_id,true,true); //use second interface
xhtml_object($data,"main-content", "embeddedobject content");
?>
if (!is_respondent_selection($operator_id)) </div>
$data = get_limesurvey_url($operator_id);
else
$data = get_respondentselection_url($operator_id,true,true); //use second interface
xhtml_object($data,"main-content");
?>
</div> </div>
<?php <?php
xhtml_foot(); xhtml_foot();
//if ($db->HasFailedTrans()){ print "<p>FAILED AT END of index</p>"; exit();} //if ($db->HasFailedTrans()){ print "<p>FAILED AT END of index</p>"; exit();}
$db->CompleteTrans(); $db->CompleteTrans();

View File

@@ -52,7 +52,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
$js = false; $js = false;

View File

@@ -1,20 +1,17 @@
function headerexpand() function headerexpand()
{ {
$(".header").css("height","38%"); $(".headerexpand").css("top","35%");
$(".content").css("height","60%"); $(".content").css("height","63%");
$(".content").css("top","40%"); $(".content").css("top","37%");
$(".box:not(.important)").css("display",""); $(".box:not(.important)").css("display","");
// $(".item_2_half_height").removeClass("item_2_half_height").addClass("item_2_full_height");
$(".item_3_half_height").removeClass("item_3_half_height").addClass("item_3_full_height");
} }
function headercontract() function headercontract()
{ {
$(".header").css("height","13%"); $(".headerexpand").css("top","18%");
$(".content").css("height","85%"); $(".content").css("height","80%");
$(".content").css("top","15%"); $(".content").css("top","20%");
$(".box:not(.important)").css("display","none"); $(".box:not(.important)").css("display","none");
// $(".item_2_full_height").removeClass("item_2_full_height").addClass("item_2_half_height");
$(".item_3_full_height").removeClass("item_3_full_height").addClass("item_3_half_height");
} }

View File

@@ -6,20 +6,20 @@ $(document).ready(function(){
function headerforcecontract() function headerforcecontract()
{ {
$("#headerexpandimage").attr('src',"./images/arrow-down-2.jpg"); $("#headerexpandimage").attr('class',"fa fa-lg fa-fw fa-toggle-down ");
headercontract(); headercontract();
} }
function headertogglemanual() function headertogglemanual()
{ {
if ($("#headerexpandimage").attr('src') == './images/arrow-up-2.jpg') if ($("#headerexpandimage").attr('class') == 'fa fa-lg fa-fw fa-toggle-up')
{ {
$("#headerexpandimage").attr('src',"./images/arrow-down-2.jpg"); $("#headerexpandimage").attr('class',"fa fa-lg fa-fw fa-toggle-down");
headercontract(); headercontract();
} }
else else
{ {
$("#headerexpandimage").attr('src',"./images/arrow-up-2.jpg"); $("#headerexpandimage").attr('class',"fa fa-lg fa-fw fa-toggle-up");
headerexpand(); headerexpand();
} }

View File

@@ -42,7 +42,7 @@ include ("functions/functions.xhtml.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**
* Language functions * Language functions
@@ -77,8 +77,8 @@ $js = array();
if (AUTO_LOGOUT_MINUTES !== false) if (AUTO_LOGOUT_MINUTES !== false)
$js = array("include/jquery/jquery-1.4.2.min.js","js/childnap.js"); $js = array("include/jquery/jquery-1.4.2.min.js","js/childnap.js");
$jsw = "js/window.js"; if (isset($_GET['interface2'])) { if (browser_ie()) $jsw = "js/window_ie6_interface2.js"; else $jsw = "js/window_interface2.js"; }
if (browser_ie()) $jsw = "js/window_ie6.js"; else { if (browser_ie()) $jsw = "js/window_ie6.js"; else $jsw = "js/window.js"; }
$js[] = $jsw; $js[] = $jsw;

View File

@@ -44,7 +44,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**

View File

@@ -42,7 +42,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**

View File

@@ -52,7 +52,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**

View File

@@ -42,7 +42,7 @@ include ("functions/functions.xhtml.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**

View File

@@ -42,7 +42,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**
@@ -198,26 +198,26 @@ if (isset($_POST['submit']))
if ($db->CompleteTrans()) if ($db->CompleteTrans())
{ {
$msg = T_("Created referral case - you may now close this window"); $msg = "<p class='alert alert-info'>" . T_("Created referral case - you may now close this window") . "</p>";
} }
else else
{ {
$msg = T_("Failed to create referral case - please check your input and try again"); $msg = "<p class='alert alert-warning'>" . T_("Failed to create referral case - please check your input and try again") . "</p>";
} }
} }
else else
{ {
$msg = T_("You must supply a primary phone number"); $msg = "<p class='alert alert-warning'>" . T_("You must supply a primary phone number") . "</p>";
} }
} }
$case_id = get_case_id($operator_id); $case_id = get_case_id($operator_id);
$js = "js/window.js"; if (isset($_GET['interface2'])) { if (browser_ie()) $js = "js/window_ie6_interface2.js"; else $js = "js/window_interface2.js"; }
if (browser_ie()) $js = "js/window_ie6.js"; else { if (browser_ie()) $js = "js/window_ie6.js"; else $js = "js/window.js"; }
xhtml_head(T_("Referral"),true,array("css/call.css"),array($js)); xhtml_head(T_("Referral"),false,array("include/bootstrap/css/bootstrap.min.css"),array($js));
$sql = "SELECT q.referral $sql = "SELECT q.referral
FROM questionnaire as q, `case` as c FROM questionnaire as q, `case` as c
@@ -228,13 +228,13 @@ $sc = $db->GetOne($sql);
if ($sc == 1) if ($sc == 1)
{ {
print "<div class='status'>" . T_("Create referral") . "</div>"; print "<div class='col-md-12 '><h3>" . T_("Create referral") . "</h3>";
if (!empty($msg)) print "<p>$msg</p>"; if (!empty($msg)) print $msg;
print "<form action='?' method='post'>"; print "<form action='?' method='post' class='form-horizontal'>";
//Create a list of sample records matching this current case //Create a list of sample records matching this current case
$sql = "SELECT sivr.var,t.description,sivr.type $sql = "SELECT sivr.var,t.description,sivr.type, sv.val
FROM `sample_import_var_restrict` as sivr,`sample_var` as sv, `case` as c, `sample_var_type` as t FROM `sample_import_var_restrict` as sivr,`sample_var` as sv, `case` as c, `sample_var_type` as t
WHERE c.case_id = '$case_id' WHERE c.case_id = '$case_id'
AND sv.sample_id = c.sample_id AND sv.sample_id = c.sample_id
@@ -246,25 +246,29 @@ if ($sc == 1)
foreach ($rs as $r) foreach ($rs as $r)
{ {
$var = $r['var']; $var = $r['var'];
print "<div><label for='v_$var'>"; print "<label for='v_$var' class='control-label'>";
if ($r['type'] != 1) if ($r['type'] != 1)
print T_($r['description']); print T_($r['description']);
else else
print $var; print $var;
print "</label><input type='text' name='v_$var' id='v_$var' "; print "</label><div><input type='text' name='v_$var' id='v_$var' class='form-control'";
if (isset($_POST['v_' . $var])) if (isset($_POST['v_' . $var]))
print "value='" . $_POST['v_' .$var] . "' "; print "value='" . $_POST['v_' .$var] . "' ";
if ($r['type'] == 3) print "required";
print " /></div>"; print " /></div>";
} }
print "<div><label for='makecase'>" . T_("Call this new referral immediately after this case?") . "</label><input type='checkbox' name='makecase' id='makecase' checked='checked'/></div>"; print "<br/><p><label for='makecase' class='control-label pull-left'>" . T_("Call this new referral immediately after this case?") . "&emsp;</label> <input type='checkbox' name='makecase' id='makecase' checked='checked'/></p>";
print "<div><input type='submit' value='" . T_("Create referral") . "' name='submit' id='submit'/></div>"; print "<input type='submit' value='" . T_("Create referral") . "' name='submit' id='submit' class='btn btn-primary'/>";
print "</form>"; print "<div class='col-md-6 pull-right'><a class='btn btn-default pull-right' href='javascript:parent.closePopup();'>".T_("Cancel")."</a></div><div class='clearfix'></div>";
print "</form></div>";
} }
else else
{ {

View File

@@ -42,7 +42,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**

View File

@@ -42,7 +42,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**

View File

@@ -42,7 +42,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**

View File

@@ -37,7 +37,7 @@ include ("config.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**

View File

@@ -37,7 +37,7 @@ include ("config.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**

View File

@@ -42,7 +42,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**

View File

@@ -42,7 +42,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**

View File

@@ -42,7 +42,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**

View File

@@ -42,7 +42,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**

View File

@@ -43,7 +43,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**

View File

@@ -42,7 +42,7 @@ include_once ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**

View File

@@ -42,7 +42,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**

View File

@@ -42,7 +42,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**

View File

@@ -42,7 +42,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**

View File

@@ -38,7 +38,7 @@ include_once("config.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**

View File

@@ -42,7 +42,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**

View File

@@ -42,7 +42,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**

View File

@@ -42,7 +42,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**
@@ -63,9 +63,9 @@ $state = is_on_call($operator_id);
$js = array("js/popup.js"); $js = array("js/popup.js");
if (browser_ie()) if (browser_ie())
$js[] = "js/window_ie6.js"; $js[] = "js/window_ie6_interface2.js";
else else
$js[] = "js/window.js"; $js[] = "js/window_interface2.js";
if (AUTO_LOGOUT_MINUTES !== false) if (AUTO_LOGOUT_MINUTES !== false)
{ {
@@ -178,9 +178,8 @@ if ($ca)
$apdate = $rs['time']; $apdate = $rs['time'];
if (missed_appointment($ca)) print "<div class='alert alert-warning'>" . T_("MISSED") . ": " . $apdate . "</div>";
print "<div class='tobecoded statusbox'>" . T_("Appointment") . ": " . $apdate . "</div><div style='clear: both;'/>"; else print "<div class='alert alert-info'>" . T_("Appointment") . ": " . $apdate . "</div>";
//if (missed_appointment($ca)) print "<div class='tobecoded statusbutton'>" . T_("MISSED") . "</div>";
} }
if ($call_id) if ($call_id)
@@ -215,18 +214,20 @@ if ($ca)
//Display all available numbers for this case as a list of radio buttons //Display all available numbers for this case as a list of radio buttons
//By default, the selected radio button should have a "call" started for it //By default, the selected radio button should have a "call" started for it
//When then next one clicked, it should bring up call screen if no outcome otherwise start new call //When then next one clicked, it should bring up call screen if no outcome otherwise start new call
print "<div>"; //print "<div>";print "</div>";
foreach($rs as $r) foreach($rs as $r)
{ {
print "<form method='post' action='?'><div class='text'>"; print "<form method='post' action='?'>
print "<input onclick='this.form.submit();' type='radio' name='contactphone' value='{$r['contact_phone_id']}' id='contactphone{$r['contact_phone_id']}' {$r['checked']}/>"; <p>
print "<label for='contactphone{$r['contact_phone_id']}'>{$r['phone']}"; <input onclick='this.form.submit();' type='radio' name='contactphone' value='{$r['contact_phone_id']}' id='contactphone{$r['contact_phone_id']}' {$r['checked']}/>&ensp;
if ($r['checked']) print "&emsp;<a href='callto:{$r['phone']}'>" . T_('Dial') . "</a>"; <label for='contactphone{$r['contact_phone_id']}'>{$r['phone']}";
if (!empty($r['description'])) print " - " . $r['description']; if ($r['checked']) print "&emsp;<a href='callto:{$r['phone']}' class='btn btn-primary btn-xs'><i class='fa fa-phone fa-fw'></i>&ensp;" . T_('Dial') . "</a>";
print "</label>"; if (!empty($r['description'])) print " - " . $r['description'];
print "</div></form></br>"; print "</label>
</p>
</form>";
} }
print "</div>";
} }
else else
print "<div class='text'>" . T_("No more numbers to call") . "</div>"; print "<div class='text'>" . T_("No more numbers to call") . "</div>";

View File

@@ -42,7 +42,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**

View File

@@ -42,7 +42,7 @@ include ("db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**

View File

@@ -36,7 +36,7 @@ include_once("../db.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("../auth-interviewer.php"); require ("../auth-interviewer.php");
include_once("../functions/functions.operator.php"); include_once("../functions/functions.operator.php");

View File

@@ -38,7 +38,7 @@ include_once("lang.inc.php");
/** /**
* Authentication * Authentication
*/ */
include ("auth-interviewer.php"); require ("auth-interviewer.php");
/** /**
@@ -46,7 +46,7 @@ include ("auth-interviewer.php");
*/ */
include_once("functions/functions.xhtml.php"); include_once("functions/functions.xhtml.php");
xhtml_head(T_("Standby"),false,array("include/bootstrap/css/bootstrap.min.css","css/index_interface2.css"), array(), false, 300); xhtml_head(T_("Standby"),false,array("include/bootstrap/css/bootstrap.min.css","include/bootstrap/css/bootstrap-theme.min.css","include/font-awesome/css/font-awesome.css","css/index_interface2.css"), array(), false, 300);
if (isset($_GET['auto'])) if (isset($_GET['auto']))
{ {
@@ -91,7 +91,7 @@ if (empty($rs))
else else
{ {
print "<div class='col-sm-3'>"; print "<div class='col-sm-4'>";
print "<div class=' well' style='padding:2%;'><p>" . T_("Assigned questionnaires:") . ""; print "<div class=' well' style='padding:2%;'><p>" . T_("Assigned questionnaires:") . "";
/* if (isset($_GET['auto'])) { /* if (isset($_GET['auto'])) {
@@ -191,13 +191,14 @@ else
} }
?> ?>
<div id=""> <div class="col-sm-3 col-sm-offset-1" style="top: 150px;">
<ul class="wait_wrapper">
<?php if ($cases_count['count_samples'] > 0 or $new_samples['count_samples'] > 0){ ?> <?php if ((isset($cases_count['count_samples']) && $cases_count['count_samples'] > 0) or (isset($new_samples['count_samples']) && $new_samples['count_samples'] > 0)){ ?>
<li class="wait_li_1"><a href="index_interface2.php"><?php echo T_("Get a new case"); ?> <img src="css/images/play.jpg" /></a></li> <a href="index_interface2.php" class="btn btn-default btn-lg btn-block" style="border-radius:25px; color:blue"><?php echo T_("Get a new case"); ?> <i class="fa fa-lg fa-play fa-fw"></i></a>
</br>
<?php } ?> <?php } ?>
<li class="wait_li_2"><a href="endwork.php"><?php echo T_("End work"); ?> <img src="css/images/end.jpg" /></a></li> <a href="endwork.php" class="btn btn-default btn-lg btn-block" style="border-radius:25px; color:red;"><?php echo T_("End work"); ?> <i class="fa fa-lg fa-ban fa-fw "></i></a>
</ul>
</div> </div>
<?php <?php