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

merged main to rev 474

This commit is contained in:
Alex
2015-08-09 02:45:41 +03:00
71 changed files with 34155 additions and 23097 deletions

View File

@@ -2,7 +2,7 @@ queXS 1.13.0 - Changes since 1.12.1
Overall changes:
*Very big changes to the Administrative interface - thank you to Alex for your hard work.
*Very big changes to the Administrative interface - thank you to Alex (https://launchpad.net/~ddrmoscow) for your hard work.
*Sample variables are now stored in a more efficient way in the database.
Specific changes (see this branch for details: https://bazaar.launchpad.net/~ddrmoscow/quexs/Features/changes):
@@ -66,8 +66,8 @@ Database updates required:
/* New outcomes */
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(42, '3.13', 'Max call attempts reached', 0, 4, 0, 1, 0, 1, 0, 'UH');
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(43, '3.13', 'Max calls reached', 0, 4, 0, 1, 0, 1, 0, 'UH');
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(42, '3.13', 'Max call attempts reached', 0, 1, 0, 1, 0, 1, 0, 'UH');
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(43, '3.13', 'Max calls reached', 0, 1, 0, 1, 0, 1, 0, 'UH');
/* Add var_id sample var identifier */

View File

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

View File

@@ -111,7 +111,7 @@ xhtml_head(T_("Modify time slots"),true,$css,$js_head);//,true,array("../css/shi
*
*/
$sql = "SELECT CONVERT_TZ(NOW(),'" . DEFAULT_TIME_ZONE . "','UTC') as t";//'Australia/Victoria'
$sql = "SELECT CONVERT_TZ(NOW(),'" . get_setting("DEFAULT_TIME_ZONE") . "','UTC') as t";//'Australia/Victoria'
$rs = $db->GetRow($sql);
if (empty($rs) || !$rs || empty($rs['t']))

View File

@@ -86,8 +86,8 @@ if ($operator_id)
$sql .= " as case_id, q.description as qd , contact_phone.phone as cpi, sample_import.description as spl
FROM `call` as c
JOIN (operator as op, respondent as r) on (op.operator_id = '$operator_id' and r.respondent_id = c.respondent_id)";
if ($qid) $quest = "$qid and q.questionnaire_id= $qid"; else $quest = "q.questionnaire_id";
if ($sid) $samimpid = "$sid and sample_import.sample_import_id=$sid"; else $samimpid = "sample_import.sample_import_id";
if (isset($qid)) $quest = "$qid and q.questionnaire_id= $qid"; else $quest = "q.questionnaire_id";
if (isset($sid)) $samimpid = "$sid and sample_import.sample_import_id=$sid"; else $samimpid = "sample_import.sample_import_id";
$sql .= "
JOIN (`case` as ca, questionnaire as q) ON (ca.case_id = c.case_id AND ca.questionnaire_id = $quest)

View File

@@ -103,7 +103,7 @@ xhtml_head(T_("Set call restriction times"),true,$css,$js_head);//,array("../css
*
*/
$sql = "SELECT CONVERT_TZ(NOW(),'" . DEFAULT_TIME_ZONE . "','UTC') as t";//'Australia/Victoria'
$sql = "SELECT CONVERT_TZ(NOW(),'" . get_setting('DEFAULT_TIME_ZONE') . "','UTC') as t";//'Australia/Victoria'
$rs = $db->GetRow($sql);
if (empty($rs) || !$rs || empty($rs['t']))

View File

@@ -199,7 +199,9 @@ function checkQid(q)
if (QidOn == 0)
QidOn = 1;
else
QidOn = 0;
QidOn = 0;
$('input').iCheck('update');
}
@@ -222,15 +224,13 @@ function checkVid(v)
if (VidOn == 0)
VidOn = 1;
else
VidOn = 0;
VidOn = 0;
$('input').iCheck('update');
}
</script>
</head>
<body>
<?php
print "<form action=\"\" method=\"post\" class=''><table class='table-bordered table-hover table-condensed form-group'><thead>";
@@ -261,14 +261,13 @@ foreach($clients as $v)
print "</table><input type=\"submit\" class='btn btn-default fa' name=\"submit\" value=\"" . T_("Assign clients to questionnaires") . "\"/></form>";
xhtml_foot();
?>
<script type="text/javascript">
$('input').iCheck({
checkboxClass: 'icheckbox_square-blue',
increaseArea: '30%'
});
</script>
<?php
xhtml_foot();

View File

@@ -126,10 +126,17 @@ if ( (isset($_GET['appointment_id']) && isset($_GET['case_id'])) ||(isset($_GET[
if ($_GET['new'] == 'new'){$title = T_("Create NEW appointment");} else{$title = T_("Edit appointment"); $subtitle = "ID&ensp;" . $appointment_id;}
xhtml_head($title,true,$css,$js_head,false,false,false,$subtitle);
$lang = DEFAULT_LOCALE;
$sql = "SELECT CONVERT_TZ(NOW(),'SYSTEM',r.Time_zone_name) as startdate, CONVERT_TZ(s.end,'UTC',r.Time_zone_name) as enddate FROM `shift` as s, `case` as c, `respondent` as r WHERE s.questionnaire_id = c.questionnaire_id AND c.case_id = $case_id AND r.case_id = c.case_id ORDER BY s.end DESC LIMIT 1";
$rs = $db->GetRow($sql); $startdate = $rs['startdate'];$enddate = $rs['enddate'];
$lang = DEFAULT_LOCALE;
$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
FROM `case` as c, `respondent` as r
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(
@@ -140,13 +147,13 @@ if ( (isset($_GET['appointment_id']) && isset($_GET['case_id'])) ||(isset($_GET[
timeFormat: 'HH:mm:ss',
showSecond: false,
regional: '$lang',
hourMin: 9,
hourMax: 21,
hourMin: 0,
hourMax: 23,
stepMinute: 5,
hourGrid: 2,
minuteGrid: 10,
minDate: '$startdate',
maxDate: '$enddate',
minDate: '$startdate',
maxDate: '$enddate'
});});</script>";
if ($_GET['new'] =='new'){

View File

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

View File

@@ -40,11 +40,14 @@ include ("../lang.inc.php");
include ("../config.inc.php");
include ("../functions/functions.xhtml.php");
$username = $_SERVER['PHP_AUTH_USER'];
$g = 0;
if (isset($_GET['g']))
$g = intval($_GET['g']);
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" style="" class=" " >
<head>
<meta charset="utf-8" >
<title><?php echo T_("Administrative Tools") ;?> </title>
<title><?php echo T_("queXS Administration") ;?> </title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -85,85 +88,86 @@ include ("../lang.inc.php");
<div class="content ">
<!-- Sidebar menu -->
<div class="sidebar" >
<ul class="panel-group nav" id="nav">
<li><a class="" href="?"><i class="fa fa-tachometer fa-lg"></i><span><?php print T_("Dashboard") ;?></span></a></li>
<li class="has_sub"><a href="" class=""><i class="fa fa-list-alt fa-lg"></i><span class="arrow"><?php print T_("Questionnairies") ;?></span></a>
<ul style="">
<li><a href="?page=<?php echo LIME_URL ;?>admin/admin.php?action=newsurvey"><i class="fa fa-file-text-o lime fa-fw"></i><?php print T_("Create an instrument in Limesurvey") ;?></a></li>
<li><a href="?page=new.php"><i class="fa fa-plus-circle fa-fw"></i><?php print T_("Create a new questionnaire") ;?></a></li>
<li><a href="?page=questionnairelist.php"><i class="fa fa-list fa-fw"></i><?php print T_("Questionnaire management") ;?></a></li>
<li><a href="?page=<?php echo LIME_URL ;?>admin/admin.php"><i class="fa fa-lemon-o lime fa-fw"></i><?php print T_("Administer instruments with Limesurvey") ;?></a></li>
<li><a href="?page=questionnaireprefill.php"><i class="fa fa-thumb-tack fa-fw"></i><?php print T_("Pre-fill questionnaire") ;?></a></li>
<ul style="<?php if ($g == 1) echo "display:block";?>">
<li><a href="?g=1&amp;page=<?php echo LIME_URL ;?>admin/admin.php?action=newsurvey"><i class="fa fa-file-text-o lime fa-fw"></i><?php print T_("Create an instrument in Limesurvey") ;?></a></li>
<li><a href="?g=1&amp;page=new.php"><i class="fa fa-plus-circle fa-fw"></i><?php print T_("Create a new questionnaire") ;?></a></li>
<li><a href="?g=1&amp;page=questionnairelist.php"><i class="fa fa-list fa-fw"></i><?php print T_("Questionnaire management") ;?></a></li>
<li><a href="?g=1&amp;page=<?php echo LIME_URL ;?>admin/admin.php"><i class="fa fa-lemon-o lime fa-fw"></i><?php print T_("Administer instruments with Limesurvey") ;?></a></li>
<li><a href="?g=1&amp;page=questionnaireprefill.php"><i class="fa fa-thumb-tack fa-fw"></i><?php print T_("Pre-fill questionnaire") ;?></a></li>
</ul>
</li>
<li class="has_sub"><a href="" class=""><i class="fa fa-book fa-lg"></i><span><?php print T_("Samples") ;?></span></a>
<ul style="">
<li><a href="?page=import.php"><i class="fa fa-upload fa-fw"></i><?php print T_("Import a sample file") ;?></a></li>
<li><a href="?page=samplelist.php"><i class="fa fa-list fa-fw"></i><?php print T_("Sample management") ;?></a></li>
<li><a href="?page=samplesearch.php"><i class="fa fa-search fa-fw"></i><?php print T_("Search the sample") ;?></a></li>
<li><a href="?page=assignsample.php"><i class="fa fa-link fa-fw"></i><?php print T_("Assign samples to questionnaires") ;?></a></li>
<ul style="<?php if ($g == 2) echo "display:block";?>">
<li><a href="?g=2&amp;page=import.php"><i class="fa fa-upload fa-fw"></i><?php print T_("Import a sample file") ;?></a></li>
<li><a href="?g=2&amp;page=samplelist.php"><i class="fa fa-list fa-fw"></i><?php print T_("Sample management") ;?></a></li>
<li><a href="?g=2&amp;page=samplesearch.php"><i class="fa fa-search fa-fw"></i><?php print T_("Search the sample") ;?></a></li>
<li><a href="?g=2&amp;page=assignsample.php"><i class="fa fa-link fa-fw"></i><?php print T_("Assign samples to questionnaires") ;?></a></li>
</ul>
</li>
<li class="has_sub"><a href="" class=""><i class="fa fa-calendar fa-lg"></i><span><?php print T_("Time slots and shifts") ;?></span></a>
<ul class="" style="">
<li><a href="?page=assigntimeslots.php"><i class="fa fa-link fa-fw"></i><?php print T_("Assign Time slots") ;?></a></li>
<ul style="<?php if ($g == 3) echo "display:block";?>">
<li><a href="?g=3&amp;page=assigntimeslots.php"><i class="fa fa-link fa-fw"></i><?php print T_("Assign Time slots") ;?></a></li>
<!-- <li><a href="?page=questionnaireavailability.php"><i class="fa fa-thumb-tack fa-fw"></i><?php // print T_("Assign Time slots to questionnaires") ;?></a></li>
<li><a href="?page=questionnairecatimeslots.php"><i class="fa fa-link fa-fw"></i><?php // print T_("Assign call attempt time slots to questionnaire") ; ?></a></li>
<li><a href="?page=questionnairecatimeslotssample.php"><i class="fa fa-link fa-fw"></i><?php // print T_("Assign call attempt time slots to questionnaire sample") ; ?></a></li> -->
<li><a href="?page=addshift.php"><i class="fa fa-calendar-o fa-fw"></i><?php print T_("Shift management") ;?></a></li>
<li><a href="?g=3&amp;page=addshift.php"><i class="fa fa-calendar-o fa-fw"></i><?php print T_("Shift management") ;?></a></li>
</ul>
</li>
<li class="has_sub"><a href="" class=""><i class="fa fa-filter fa-lg"></i><span><?php print T_("Quotas") ;?></span></a>
<ul style="">
<li><a href="?page=quota.php"><i class="fa fa-list-ol fa-fw"></i><?php print T_("Quota management") ;?></a></li>
<li><a href="?page=quotarow.php"><i class="fa fa-list-ul fa-fw "></i><?php print T_("Quota row management") ;?></a></li>
<ul style="<?php if ($g == 4) echo "display:block";?>">
<li><a href="?g=4&amp;page=quota.php"><i class="fa fa-list-ol fa-fw"></i><?php print T_("Quota management") ;?></a></li>
<li><a href="?g=4&amp;page=quotarow.php"><i class="fa fa-list-ul fa-fw "></i><?php print T_("Quota row management") ;?></a></li>
</ul>
</li>
<li class="has_sub"><a href="" class=""><i class="fa fa-lg fa-users"></i><span><?php print T_("Operators") ;?></span></a>
<ul class="" style="">
<li><a href="?page=operators.php"><i class="fa fa-user-plus fa-fw"></i><?php print T_("Add operators to the system") ;?></a></li>
<li><a href="?page=operatorlist.php"><i class="fa fa-user fa-fw"></i><?php print T_("Operator management") ;?></a></li>
<li><a href="?page=extensionstatus.php "><i class="fa fa-phone fa-fw"></i><?php print T_("Extension status") ;?></a></li>
<li><a href="?page=operatorquestionnaire.php"><i class="fa fa-link fa-fw"></i><?php print T_("Assign operators to questionnaires") ;?></a></li>
<li><a href="?page=operatorskill.php"><i class="fa fa-user-md fa-fw"></i><?php print T_("Modify operator skills") ;?></a></li>
<li><a href="?page=operatorperformance.php"><i class="fa fa-signal fa-fw"></i><?php print T_("Operator performance") ;?></a></li>
<ul style="<?php if ($g == 5) echo "display:block";?>">
<li><a href="?g=5&amp;page=operators.php"><i class="fa fa-user-plus fa-fw"></i><?php print T_("Add operators to the system") ;?></a></li>
<li><a href="?g=5&amp;page=operatorlist.php"><i class="fa fa-user fa-fw"></i><?php print T_("Operator management") ;?></a></li>
<li><a href="?g=5&amp;page=extensionstatus.php "><i class="fa fa-phone fa-fw"></i><?php print T_("Extension status") ;?></a></li>
<li><a href="?g=5&amp;page=operatorquestionnaire.php"><i class="fa fa-link fa-fw"></i><?php print T_("Assign operators to questionnaires") ;?></a></li>
<li><a href="?g=5&amp;page=operatorskill.php"><i class="fa fa-user-md fa-fw"></i><?php print T_("Modify operator skills") ;?></a></li>
<li><a href="?g=5&amp;page=operatorperformance.php"><i class="fa fa-signal fa-fw"></i><?php print T_("Operator performance") ;?></a></li>
</ul>
</li>
<li class="has_sub"><a href="" class=""><i class="fa fa-lg fa-line-chart"></i><span><?php print T_("Results") ;?></span></a>
<ul class="" style="">
<li><a href="?page=displayappointments.php"><i class="fa fa-clock-o fa-fw"></i><span><?php print T_("Display all future appointments") ;?></span></a></li>
<li><a href="?page=samplecallattempts.php"><i class="fa fa-table fa-fw"></i><?php print T_("Sample call attempts report") ;?></a></li>
<li><a href="?page=callhistory.php" class=""><i class="fa fa-history fa-fw"></i><?php print T_("Call history") ;?></a></li>
<li><a href="?page=shiftreport.php"><i class="fa fa-th-large fa-fw"></i><?php print T_("Shift reports") ;?></a></li>
<li><a href="?page=quotareport.php" ><i class="fa fa-filter fa-fw"></i><?php print T_("Quota report") ;?></a></li>
<li><a href="?page=outcomes.php"><i class="fa fa-bar-chart fa-fw"></i><?php print T_("Questionnaire outcomes") ;?></a></li>
<li><a href="?page=dataoutput.php"><i class="fa fa-download fa-fw"></i><?php print T_("Data output") ;?></a></li>
<ul style="<?php if ($g == 6) echo "display:block";?>">
<li><a href="?g=6&amp;page=displayappointments.php"><i class="fa fa-clock-o fa-fw"></i><span><?php print T_("Display all future appointments") ;?></span></a></li>
<li><a href="?g=6&amp;page=samplecallattempts.php"><i class="fa fa-table fa-fw"></i><?php print T_("Sample call attempts report") ;?></a></li>
<li><a href="?g=6&amp;page=callhistory.php" class=""><i class="fa fa-history fa-fw"></i><?php print T_("Call history") ;?></a></li>
<li><a href="?g=6&amp;page=shiftreport.php"><i class="fa fa-th-large fa-fw"></i><?php print T_("Shift reports") ;?></a></li>
<li><a href="?g=6&amp;page=quotareport.php" ><i class="fa fa-filter fa-fw"></i><?php print T_("Quota report") ;?></a></li>
<li><a href="?g=6&amp;page=outcomes.php"><i class="fa fa-bar-chart fa-fw"></i><?php print T_("Questionnaire outcomes") ;?></a></li>
<li><a href="?g=6&amp;page=dataoutput.php"><i class="fa fa-download fa-fw"></i><?php print T_("Data output") ;?></a></li>
</ul>
</li>
<li class="has_sub"><a href="" class=""><i class="fa fa-lg fa-user-secret fa-fw"></i><span><?php print T_("Clients") ;?></span></a>
<ul class="" style="">
<li><a href="?page=clients.php"><i class="fa fa-lg fa-user-plus fa-fw"></i><?php print T_("Add clients to the system") ;?></a></li>
<li><a href="?page=clientquestionnaire.php"><i class="fa fa-link fa-fw"></i><?php print T_("Assign clients to questionnaires") ;?></a></li>
<ul style="<?php if ($g == 7) echo "display:block";?>">
<li><a href="?g=7&amp;page=clients.php"><i class="fa fa-lg fa-user-plus fa-fw"></i><?php print T_("Add clients to the system") ;?></a></li>
<li><a href="?g=7&amp;page=clientquestionnaire.php"><i class="fa fa-link fa-fw"></i><?php print T_("Assign clients to questionnaires") ;?></a></li>
</ul>
</li>
<li class="has_sub"><a href="" class=""><i class="fa fa-lg fa-briefcase"></i><span><?php print T_("Supervisor functions") ;?></span></a>
<ul class="" style="">
<li><a href="?page=supervisor.php"><i class="fa fa-link fa-fw"></i><?php print T_("Assign outcomes to cases") ;?></a></li>
<li><a href="?page=casestatus.php"><i class="fa fa-question-circle fa-fw"></i><?php print T_("Case status and assignment") ;?></a></li>
<li><a href="?page=bulkappointment.php"><i class="fa fa-th-list fa-fw"></i><?php print T_("Bulk appointment generator") ;?></a></li>
<ul style="<?php if ($g == 8) echo "display:block";?>">
<li><a href="?g=8&amp;page=supervisor.php"><i class="fa fa-link fa-fw"></i><?php print T_("Assign outcomes to cases") ;?></a></li>
<li><a href="?g=8&amp;page=casestatus.php"><i class="fa fa-question-circle fa-fw"></i><?php print T_("Case status and assignment") ;?></a></li>
<li><a href="?g=8&amp;page=bulkappointment.php"><i class="fa fa-th-list fa-fw"></i><?php print T_("Bulk appointment generator") ;?></a></li>
</ul>
</li>
<li class="has_sub"><a href="" class=""><i class="fa fa-lg fa-gear"></i><span><?php print T_("System settings") ;?></span></a>
<ul class="" style="">
<li><a href="?page=timezonetemplate.php"><i class="fa fa-globe fa-fw"></i><?php print T_("Set default timezone list") ;?></a></li>
<li><a href="?page=availabilitygroup.php"><i class="fa fa-clock-o fa-fw"></i><?php print T_("Manage Time slots") ;?></a></li>
<li><a href="?page=shifttemplate.php"><i class="fa fa-calendar fa-fw"></i><?php print T_("Set default shift times") ;?></a></li>
<li><a href="?page=callrestrict.php"><i class="fa fa-clock-o fa-fw"></i><?php print T_("Set call restriction times") ;?></a></li>
<li><a href="?page=centreinfo.php"><i class="fa fa-university fa-fw"></i><?php print T_("Set centre information") ;?></a></li>
<li><a href="?page=supervisorchat.php"><i class="fa fa-comments-o fa-fw"></i><?php print T_("Supervisor chat") ;?></a></li>
<li><a href="?page=systemsort.php"><i class="fa fa-sort fa-fw"></i><?php print T_("System wide case sorting") ;?></a></li>
<ul style="<?php if ($g == 9) echo "display:block";?>">
<li><a href="?g=9&amp;page=timezonetemplate.php"><i class="fa fa-globe fa-fw"></i><?php print T_("Set default timezone list") ;?></a></li>
<li><a href="?g=9&amp;page=availabilitygroup.php"><i class="fa fa-clock-o fa-fw"></i><?php print T_("Manage Time slots") ;?></a></li>
<li><a href="?g=9&amp;page=shifttemplate.php"><i class="fa fa-calendar fa-fw"></i><?php print T_("Set default shift times") ;?></a></li>
<li><a href="?g=9&amp;page=callrestrict.php"><i class="fa fa-clock-o fa-fw"></i><?php print T_("Set call restriction times") ;?></a></li>
<li><a href="?g=9&amp;page=centreinfo.php"><i class="fa fa-university fa-fw"></i><?php print T_("Set centre information") ;?></a></li>
<li><a href="?g=9&amp;page=supervisorchat.php"><i class="fa fa-comments-o fa-fw"></i><?php print T_("Supervisor chat") ;?></a></li>
<li><a href="?g=9&amp;page=systemsort.php"><i class="fa fa-sort fa-fw"></i><?php print T_("System wide case sorting") ;?></a></li>
</ul>
</li>
@@ -171,8 +175,8 @@ include ("../lang.inc.php");
if (VOIP_ENABLED == true )
{ ; ?>
<li class="has_sub"><a href="" class=""><i class="fa fa-lg fa-tty"></i><span><?php print T_("VoIP");?><i class="fa fa-toggle-on pull-right" style="font-size:1.5em !important; margin-right:20px;"></i></span></a>
<ul class="" style="">
<li><a href="?page=voipmonitor.php"><i class="fa fa-power-off v"></i><?php print T_("Start and monitor VoIP") ;?></a></li>
<ul style="<?php if ($g == 10) echo "display:block";?>">
<li><a href="?g=10&amp;page=voipmonitor.php"><i class="fa fa-power-off v"></i><?php print T_("Start and monitor VoIP") ;?></a></li>
<!-- <li><a href="?page=extensionstatus.php"><i class="fa fa-asterisk fa-fw"></i><?php //print T_("Extension status") ;?></a></li> -->
</ul>
</li>
@@ -184,7 +188,7 @@ include ("../lang.inc.php");
</div>
<!-- Main page container -->
<?php $page = "questionnairelist.php"; if (isset($_GET['page'])) $page = $_GET['page']; ?>
<?php $page = "questionnairelist.php"; if (isset($_GET['page'])) $page = $_GET['page']; ?>
<div class="mainbar" id=" "><?php xhtml_object($page,' '); ?></div>
<div class="clearfix"></div>

View File

@@ -205,6 +205,8 @@ function checkQid(q)
QidOn = 1;
else
QidOn = 0;
$('input').iCheck('update');
}
function checkVid(v)
@@ -226,15 +228,13 @@ function checkVid(v)
if (VidOn == 0)
VidOn = 1;
else
VidOn = 0;
VidOn = 0;
$('input').iCheck('update');
}
</script>
</head>
<body>
<?php
print "<form action=\"\" method=\"post\" class=''><table class='table-bordered table-hover table-condensed form-group'><thead>";
@@ -266,9 +266,6 @@ foreach($operators as $v)
print "</table><input class='btn btn-default fa' type='submit' name='submit' value='" . T_("Assign operators to questionnaires") . "'/></form>";
xhtml_foot();
?>
<script type="text/javascript">
@@ -277,3 +274,6 @@ $('input').iCheck({
increaseArea: '30%'
});
</script>
<?php
xhtml_foot();

View File

@@ -68,8 +68,8 @@ if (isset($_POST['operator']) && isset($_POST['adduser']))
$laste = $db->GetRow($sql);
$extensionn = "2000";
$extension = "'IAX2/2000'";
$extensionn = "1000";
$extension = "'IAX2/1000'";
//increment if exists
if (!empty($laste))
@@ -147,7 +147,7 @@ if (isset($_POST['operator']) && isset($_POST['adduser']))
$a = "<div class='alert alert-info'><h3>" . T_("Added operator :") . " " . $operator . "</h3>";
if (FREEPBX_PATH !== false)
$a .= "<br/>" . T_("FreePBX has been reloaded for the new VoIP extension to take effect");
$a .= "<br/><a href='/voip/admin/'>" . T_("FreePBX needs to be reloaded for the new VoIP extension to take effect") . "</a>";
print "</div>";
@@ -245,7 +245,7 @@ function generate() {
<?php if (HTPASSWD_PATH !== false && HTGROUP_PATH !== false) { ?>
<div class="form-group">
<label class="col-sm-3 control-label"><?php echo T_("Password") . ": ";?></label>
<div class="col-sm-3"><input name="password" id="password" type="text" class="form-control" required pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}" /></div>
<div class="col-sm-3"><input name="password" id="password" type="text" class="form-control" /></div>
<div class="col-sm-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="number" name="number" value="25" min="8" max="50" style="width:5em;" class="form-control" />&ensp;<?php echo T_("characters");?>

View File

@@ -203,6 +203,8 @@ function checkQid(q)
QidOn = 1;
else
QidOn = 0;
$('input').iCheck('update');
}
@@ -225,12 +227,12 @@ function checkVid(v)
if (VidOn == 0)
VidOn = 1;
else
VidOn = 0;
VidOn = 0;
$('input').iCheck('update');
}
</script>
</head>
<body>
<?php
@@ -267,8 +269,6 @@ foreach($operators as $v)
print "</table><input type=\"submit\" class='btn btn-default fa' name=\"submit\" value=\"" . T_("Modify operator skills") ."\"/></form>";
xhtml_foot();
?>
<script type="text/javascript">
@@ -277,3 +277,6 @@ $('input').iCheck({
increaseArea: '30%'
});
</script>
<?php
xhtml_foot();

View File

@@ -224,6 +224,6 @@ if ($questionnaire_id || $questionnaire_id == -1)
print "<p class='well text-danger'>" . T_("No calls for this questionnaire") . "</p>";
}
xhtml_foot("../js/custom.js");
xhtml_foot(array("../js/custom.js"));
?>

View File

@@ -93,7 +93,7 @@ if (isset($_POST['day']))
xhtml_head(T_("Set default shift times"),true,$css,$js_head);//T_("Modify shift template"),array("../css/shifts.css"),array("../js/addrow-v2.js")
$sql = "SELECT CONVERT_TZ(NOW(),'" . DEFAULT_TIME_ZONE . "','UTC') as t";//'Australia/Victoria'
$sql = "SELECT CONVERT_TZ(NOW(),'" . get_setting("DEFAULT_TIME_ZONE") . "','UTC') as t";//'Australia/Victoria'
$rs = $db->GetRow($sql);

View File

@@ -188,7 +188,7 @@ if (isset($_POST['submit']))
$js = "js/window.js";
if (browser_ie()) $js = "js/window_ie6.js";
xhtml_head(T_("Call"),true,array("css/call.css"),array($js),$btext);
xhtml_head(T_("Call"),true,array("css/call.css"),array($js),$btext,false,false,false,false);
}
}
else if (isset($_POST['outcome']))
@@ -208,7 +208,7 @@ if (isset($_POST['submit']))
$js = "js/window.js";
if (browser_ie()) $js = "js/window_ie6.js";
xhtml_head(T_("Call"),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_("Call"),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();'",false,false,false,false);
}
else
{
@@ -224,7 +224,7 @@ if (isset($_POST['submit']))
$newtext = T_("Start REC");
$js = "js/window.js";
if (browser_ie()) $js = "js/window_ie6.js";
xhtml_head(T_("Call"),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_("Call"),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();'",false,false,false,false);
}
@@ -255,7 +255,7 @@ if (isset($_GET['newstate']))
$js = "js/window.js";
if (browser_ie()) $js = "js/window_ie6.js";
xhtml_head(T_("Call"),true,array("css/call.css"),array($js,"include/jquery/jquery-1.4.2.min.js"));
xhtml_head(T_("Call"),true,array("css/call.css"),array($js,"include/jquery/jquery-1.4.2.min.js"),false,false,false,false,false);
$state = is_on_call($operator_id);
switch($state)

View File

@@ -1,5 +1,3 @@
/*@import url(http://fonts.googleapis.com/css?family=Roboto:400,600,700&subset=latin,latin-ext);*/
body, content {
/**/font-size: 15px;
line-height: 22px;

View File

@@ -1091,7 +1091,8 @@ INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_m
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(33, '2.36', 'Miscellaneous - Unavailable for a week', 10080, 1, 0, 1, 1, 1, 0, 'O');
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(40, '1.1', 'Self completed online', 0, 4, 0, 1, 1, 1, 0, 'I');
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(41, '2.36', 'Self completion email invitation sent', 10080, 1, 0, 1, 1, 1, 0, 'O');
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(42, '3.13', 'Max call attempts reached', 0, 1, 0, 1, 0, 1, 0, 'UH');
INSERT INTO `outcome` (`outcome_id`, `aapor_id`, `description`, `default_delay_minutes`, `outcome_type_id`, `tryanother`, `contacted`, `tryagain`, `eligible`, `require_note`, `calc`) VALUES(43, '3.13', 'Max calls reached', 0, 1, 0, 1, 0, 1, 0, 'UH');
-- --------------------------------------------------------
--

View File

@@ -34,6 +34,8 @@
*/
include_once(dirname(__FILE__).'/../config.inc.php');
include_once(dirname(__FILE__).'/../db.inc.php');
/**
* FreePBX functions to add an extension
* This needs to be re-implemented here as there are too many code conflicts in including freepbx code
@@ -47,457 +49,40 @@ include_once(dirname(__FILE__).'/../config.inc.php');
*/
function freepbx_add_extension($extension,$name,$password)
{
global $amp_conf_defaults;
if (FREEPBX_PATH == false) return false; //break out if not defined
//include freepbx functions
require_once(FREEPBX_PATH . "/functions.inc.php");
require_once(FREEPBX_PATH . "/common/php-asmanager.php");
// get settings
$amp_conf = parse_amportal_conf("/etc/amportal.conf");
$asterisk_conf = parse_asterisk_conf($amp_conf["ASTETCDIR"]."/asterisk.conf");
$astman = new AGI_AsteriskManager();
// attempt to connect to asterisk manager proxy
if (!isset($amp_conf["ASTMANAGERPROXYPORT"]) || !$res = $astman->connect($amp_conf["ASTMANAGERHOST"] . ":" . $amp_conf["ASTMANAGERPROXYPORT"], $amp_conf["AMPMGRUSER"] , $amp_conf["AMPMGRPASS"])) {
// attempt to connect directly to asterisk, if no proxy or if proxy failed
if (!$res = $astman->connect($amp_conf["ASTMANAGERHOST"] . ":" . $amp_conf["ASTMANAGERPORT"], $amp_conf["AMPMGRUSER"] , $amp_conf["AMPMGRPASS"], 'off')) {
// couldn't connect at all
unset( $astman );
}
}
//Defines from bulkextensions module of FreePBX
$vars = array (
"action" => "add",
"extension" => $extension,
"name" => $name,
"cid_masquerade" => $extension,
"ringtimer" => 0,
"callwaiting" => "disabled",
"call_screen" => 0,
"pinless" => "disabled",
"tech" => "iax2",
"devinfo_secret" => $password,
"devinfo_notransfer" => "yes", // for iax2 devices
"devinfo_context" => "from-internal",
"devinfo_host" => "dynamic",
"devinfo_type" => "friend",
"devinfo_port" => 4569,
"devinfo_qualify" => "yes",
"devinfo_dial" => "IAX2/$extension",
"devinfo_mailbox" => $extension . "@device",
"devinfo_deny" => "0.0.0.0/0.0.0.0",
"devinfo_permit" => "0.0.0.0/0.0.0.0",
"deviceid" => $extension,
"devicetype" => "fixed",
"deviceuser" => $extension,
"description" => $name,
"dictenabled" => "disabled",
"dictformat" => "ogg",
"record_in" => "Adhoc",
"record_out" => "Adhoc",
"vm" => "disabled",
"voicemail" => "disabled",
"attach" => "attach=no",
"saycid" => "saycid=no",
"envelope" => "envelope=no",
"delete" => "delete=no",
"requirecalltoken" => "no",
"vmx_play_instructions" => "checked",
"vmx_option_0_system_default" => "checked",
"emergency_cid" => "null"
);
freepbx_core_users_add($amp_conf,$astman,$vars);
freepbx_core_devices_add($amp_conf,$astman,$vars["deviceid"],$vars["tech"],$vars["devinfo_dial"],$vars["devicetype"],$vars["deviceuser"],$vars["description"],$vars["emergency_cid"],false,$vars);
freepbx_do_reload($amp_conf,$astman,$asterisk_conf);
}
function freepbx_do_reload(&$amp_conf,&$astman,&$asterisk_conf)
{
global $db;
array($return);
if (isset($amp_conf["PRE_RELOAD"]) && !empty($amp_conf['PRE_RELOAD'])) {
exec( $amp_conf["PRE_RELOAD"], $output, $exit_val );
}
$retrieve = $amp_conf['AMPBIN'].'/retrieve_conf 2>&1';
//exec($retrieve.'&>'.$asterisk_conf['astlogdir'].'/freepbx-retrieve.log', $output, $exit_val);
exec($retrieve, $output, $exit_val);
if ($exit_val != 0) {
$return['status'] = false;
$return['message'] = sprintf(_('Reload failed because retrieve_conf encountered an error: %s'),$exit_val);
$return['num_errors']++;
$notify->add_critical('freepbx','RCONFFAIL', _("retrieve_conf failed, config not applied"), $return['message']);
return $return;
}
if (!isset($astman) || !$astman) {
$return['status'] = false;
$return['message'] = _('Reload failed because FreePBX could not connect to the asterisk manager interface.');
$return['num_errors']++;
return $return;
}
//reload MOH to get around 'reload' not actually doing that.
$astman->send_request('Command', array('Command'=>'moh reload'));
//reload asterisk (>= 1.4)
$astman->send_request('Command', array('Command'=>'module reload'));
$return['status'] = true;
if ($amp_conf['FOPRUN'] && !$amp_conf['FOPDISABLE']) {
//bounce op_server.pl
$wOpBounce = $amp_conf['AMPBIN'].'/bounce_op.sh';
exec($wOpBounce.' &>'.$asterisk_conf['astlogdir'].'/freepbx-bounce_op.log', $output, $exit_val);
if ($exit_val != 0) {
$desc = _('Could not reload the FOP operator panel server using the bounce_op.sh script. Configuration changes may not be reflected in the panel display.');
$return['num_errors']++;
}
}
if (isset($amp_conf["POST_RELOAD"]) && !empty($amp_conf['POST_RELOAD'])) {
exec( $amp_conf["POST_RELOAD"], $output, $exit_val );
if ($exit_val != 0) {
$desc = sprintf(_("Exit code was %s and output was: %s"), $exit_val, "\n\n".implode("\n",$output));
$return['num_errors']++;
}
}
$sql = "UPDATE ".FREEPBX_DATABASE.".admin SET value = 'false' WHERE variable = 'need_reload'";
$db->Execute($sql);
return $return;
}
function freepbx_need_reload()
{
global $db;
$sql = "UPDATE ".FREEPBX_DATABASE.".admin SET value = 'true' WHERE variable = 'need_reload'";
$db->Execute($sql);
$iaxelements = array(
array('id' => $extension, 'keyword' => 'deny', 'data' => '0.0.0.0', 'flags' => '14'),
array('id' => $extension, 'keyword' => 'mailbox', 'data' => $extension . "@device", 'flags' => '13'),
array('id' => $extension, 'keyword' => 'accountcode', 'data' => '', 'flags' => '12'),
array('id' => $extension, 'keyword' => 'dial', 'data' => "IAX2/" . $extension, 'flags' => '11'),
array('id' => $extension, 'keyword' => 'allow', 'data' => '', 'flags' => '10'),
array('id' => $extension, 'keyword' => 'disallow', 'data' => '', 'flags' => '9'),
array('id' => $extension, 'keyword' => 'qualify', 'data' => 'yes', 'flags' => '8'),
array('id' => $extension, 'keyword' => 'port', 'data' => '4569', 'flags' => '7'),
array('id' => $extension, 'keyword' => 'type', 'data' => 'friend', 'flags' => '6'),
array('id' => $extension, 'keyword' => 'host', 'data' => 'dynamic', 'flags' => '5'),
array('id' => $extension, 'keyword' => 'context', 'data' => 'from-internal', 'flags' => '4'),
array('id' => $extension, 'keyword' => 'transfer', 'data' => 'yes', 'flags' => '3'),
array('id' => $extension, 'keyword' => 'secret', 'data' => $password, 'flags' => '2'),
array('id' => $extension, 'keyword' => 'permit', 'data' => '0.0.0.0/0.0.0.0', 'flags' => '15'),
array('id' => $extension, 'keyword' => 'requirecalltoken', 'data' => 'no', 'flags' => '16'),
array('id' => $extension, 'keyword' => 'account', 'data' => $extension, 'flags' => '17'),
array('id' => $extension, 'keyword' => 'callerid', 'data' => "device <" . $extension . ">", 'flags' => '18'),
array('id' => $extension, 'keyword' => 'setvar', 'data' => "REALCALLERIDNUM=" . $extension, 'flags' => '19'),
);
$devices = array('id' => $extension, 'tech' => 'iax2', 'dial' => "IAX2/$extension", 'devicetype' => 'fixed', 'user' => $extension, 'description' => $name, 'emergency_cid' => '');
$users = array('extension' => $extension, 'password' => '', 'name' => $extension, 'voicemail' => 'novm', 'ringtimer' => '0', 'noanswer' => '', 'recording' => '', 'outboundcid' => '', 'sipname' => '', 'noanswer_cid' => '', 'busy_cid' => '', 'chanunavail_cid' => '', 'noanswer_dest' => '', 'busy_dest' => '', 'chanunavail_dest' => '', 'mohclass' => 'default');
foreach ($iaxelements as $iax)
$db->AutoExecute(FREEPBX_DATABASE . ".iax",$iax,'INSERT');
$db->AutoExecute(FREEPBX_DATABASE . ".devices",$devices,'INSERT');
$db->AutoExecute(FREEPBX_DATABASE . ".users",$users,'INSERT');
}
function freepbx_core_devices_add(&$amp_conf,&$astman,$id,$tech,$dial,$devicetype,$user,$description,$emergency_cid=null,$editmode=false,$vars){
global $db;
//ensure this id is not already in use
$sql = "SELECT *
FROM ".FREEPBX_DATABASE.".devices
WHERE id = '$id'";
$rs = $db->GetAll($sql);
if (!empty($rs))
return false; //device already exists
//unless defined, $dial is TECH/id
if ( $dial == '' ) {
$dial = strtoupper($tech)."/".$id;
}
//check to see if we are requesting a new user
if ($user == "new") {
$user = $id;
$jump = true;
}
//insert into devices table
$sql="INSERT INTO ".FREEPBX_DATABASE.".devices (id,tech,dial,devicetype,user,description,emergency_cid) values (\"$id\",\"$tech\",\"$dial\",\"$devicetype\",\"$user\",\"$description\",\"$emergency_cid\")";
$db->Execute($sql);
//add details to astdb
if ($astman) {
// if adding or editting a fixed device, user property should always be set
if ($devicetype == 'fixed' || !$editmode) {
$astman->database_put("DEVICE",$id."/user",$user);
}
// If changing from a fixed to an adhoc, the user property should be intialized
// to the new default, not remain as the previous fixed user
if ($editmode) {
$previous_type = $astman->database_get("DEVICE",$id."/type");
if ($previous_type == 'fixed' && $devicetype == 'adhoc') {
$astman->database_put("DEVICE",$id."/user",$user);
}
}
$astman->database_put("DEVICE",$id."/dial",$dial);
$astman->database_put("DEVICE",$id."/type",$devicetype);
$astman->database_put("DEVICE",$id."/default_user",$user);
if($emergency_cid != '') {
$astman->database_put("DEVICE",$id."/emergency_cid","\"".$emergency_cid."\"");
}
if ($user != "none") {
$existingdevices = $astman->database_get("AMPUSER",$user."/device");
if (empty($existingdevices)) {
$astman->database_put("AMPUSER",$user."/device",$id);
} else {
$existingdevices_array = explode('&',$existingdevices);
if (!in_array($id, $existingdevices_array)) {
$existingdevices_array[]=$id;
$existingdevices = implode('&',$existingdevices_array);
$astman->database_put("AMPUSER",$user."/device",$existingdevices);
}
}
}
} else {
die("Cannot connect to Asterisk Manager with ".$amp_conf["AMPMGRUSER"]."/".$amp_conf["AMPMGRPASS"]);
}
// create a voicemail symlink if needed
/*
$thisUser = core_users_get($user);
if(isset($thisUser['voicemail']) && ($thisUser['voicemail'] != "novm")) {
if(empty($thisUser['voicemail'])) {
$vmcontext = "default";
} else {
$vmcontext = $thisUser['voicemail'];
}
//voicemail symlink
exec("rm -f /var/spool/asterisk/voicemail/device/".$id);
exec("/bin/ln -s /var/spool/asterisk/voicemail/".$vmcontext."/".$user."/ /var/spool/asterisk/voicemail/device/".$id);
}
*/
//take care of sip/iax/zap config
$funct = "freepbx_core_devices_add".strtolower($tech);
if(function_exists($funct)){
$funct($id,$vars);
}
return true;
}
function freepbx_core_devices_addiax2($account,$vars) {
global $db;
$flag = 2;
foreach ($vars as $req=>$data) {
if ( substr($req, 0, 8) == 'devinfo_' ) {
$keyword = substr($req, 8);
if ( $keyword == 'dial' && $data == '' ) {
$iaxfields[] = array($account, $keyword, 'IAX2/'.$account, $flag++);
} elseif ($keyword == 'mailbox' && $data == '') {
$iaxfields[] = array($account,'mailbox',$account.'@device', $flag++);
} else {
$iaxfields[] = array($account, $keyword, $data, $flag++);
}
}
}
if ( !is_array($iaxfields) ) { // left for compatibilty....lord knows why !
$iaxfields = array(
array($account,'secret',$db->qstr(($vars['secret'])?$vars['secret']:''),$flag++),
array($account,'notransfer',$db->qstr(($vars['notransfer'])?$vars['notransfer']:'yes'),$flag++),
array($account,'context',$db->qstr(($vars['context'])?$vars['context']:'from-internal'),$flag++),
array($account,'host',$db->qstr(($vars['host'])?$vars['host']:'dynamic'),$flag++),
array($account,'type',$db->qstr(($vars['type'])?$vars['type']:'friend'),$flag++),
array($account,'mailbox',$db->qstr(($vars['mailbox'])?$vars['mailbox']:$account.'@device'),$flag++),
array($account,'username',$db->qstr(($vars['username'])?$vars['username']:$account),$flag++),
array($account,'port',$db->qstr(($vars['port'])?$vars['port']:'4569'),$flag++),
array($account,'qualify',$db->qstr(($vars['qualify'])?$vars['qualify']:'yes'),$flag++),
array($account,'deny',$db->qstr((isset($vars['deny']))?$vars['deny']:''),$flag++),
array($account,'permit',$db->qstr((isset($vars['permit']))?$vars['permit']:''),$flag++),
array($account,'disallow',$db->qstr(($vars['disallow'])?$vars['disallow']:''),$flag++),
array($account,'allow',$db->qstr(($vars['allow'])?$vars['allow']:''),$flag++),
array($account,'accountcode',$db->qstr(($vars['accountcode'])?$vars['accountcode']:''),$flag++),
array($account,'requirecalltoken',$db->qstr(($vars['requirecalltoken'])?$vars['requirecalltoken']:'no'),$flag++)
);
}
// Very bad
$iaxfields[] = array($account,'account',($account),$flag++);
$iaxfields[] = array($account,'callerid',((isset($vars['description']) && $vars['description'] != '')?$vars['description']." <".$account.'>':'device'." <".$account.'>'),$flag++);
// Asterisk treats no caller ID from an IAX device as 'hide callerid', and ignores the caller ID
// set in iax.conf. As we rely on this for pretty much everything, we need to specify the
// callerid as a variable which gets picked up in macro-callerid.
// Ref - http://bugs.digium.com/view.php?id=456
$iaxfields[] = array($account,'setvar',"REALCALLERIDNUM=$account",$flag++);
// Where is this in the interface ??????
$iaxfields[] = array($account,'record_in',(($vars['record_in'])?$vars['record_in']:'On-Demand'),$flag++);
$iaxfields[] = array($account,'record_out',(($vars['record_out'])?$vars['record_out']:'On-Demand'),$flag++);
$iaxfields[] = array($account,'requirecalltoken','no',$flag++);
$compiled = $db->Prepare('INSERT INTO '.FREEPBX_DATABASE.'.iax (id, keyword, data, flags) values (?,?,?,?)');
foreach($iaxfields as $i)
$db->Execute($compiled, $i);
}
function freepbx_core_users_add(&$amp_conf, &$astman, $vars, $editmode=false) {
extract($vars);
global $db;
$thisexten = isset($thisexten) ? $thisexten : '';
if (trim($extension) == '' ) {
return false;
}
//ensure this id is not already in use
$sql = "SELECT *
FROM ".FREEPBX_DATABASE.".users
WHERE extension = '$extension'";
$rs = $db->GetAll($sql);
if (!empty($rs))
return false; //device already exists
$newdid_name = isset($newdid_name) ? $db->qstr($newdid_name) : '';
$newdid = isset($newdid) ? $newdid : '';
$newdid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", trim($newdid));
$newdidcid = isset($newdidcid) ? trim($newdidcid) : '';
if (!preg_match('/^priv|^block|^unknown|^restrict|^unavail|^anonym/',strtolower($newdidcid))) {
$newdidcid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", $newdidcid);
}
//build the recording variable
$recording = "out=".$record_out."|in=".$record_in;
//escape quotes and any other bad chddddars:
if(!get_magic_quotes_gpc()) {
$outboundcid = '';
$name = $db->qstr($name);
}
// Clean replace any <> with () in display name - should have javascript stopping this but ...
//
$name = preg_replace(array('/</','/>/'), array('(',')'), trim($name));
//insert into users table
$sql="INSERT INTO ".FREEPBX_DATABASE.".users (extension,password,name,voicemail,ringtimer,noanswer,recording,outboundcid,sipname) values (\"";
$sql.= "$extension\", \"";
$sql.= isset($password)?$password:'';
$sql.= "\", ";
$sql.= isset($name)?$name:'';
$sql.= ", \"";
$sql.= isset($voicemail)?$voicemail:'novm';
$sql.= "\", \"";
$sql.= isset($ringtimer)?$ringtimer:'';
$sql.= "\", \"";
$sql.= isset($noanswer)?$noanswer:'';
$sql.= "\", \"";
$sql.= isset($recording)?$recording:'';
$sql.= "\", \"";
$sql.= isset($outboundcid)?$outboundcid:'';
$sql.= "\", \"";
$sql.= isset($sipname)?$sipname:'';
$sql.= "\")";
$db->Execute($sql);
//write to astdb
if ($astman) {
$cid_masquerade = (isset($cid_masquerade) && trim($cid_masquerade) != "")?trim($cid_masquerade):$extension;
$astman->database_put("AMPUSER",$extension."/password",isset($password)?$password:'');
$astman->database_put("AMPUSER",$extension."/ringtimer",isset($ringtimer)?$ringtimer:'');
$astman->database_put("AMPUSER",$extension."/noanswer",isset($noanswer)?$noanswer:'');
$astman->database_put("AMPUSER",$extension."/recording",isset($recording)?$recording:'');
$astman->database_put("AMPUSER",$extension."/outboundcid",isset($outboundcid)?"\"".$outboundcid."\"":'');
$astman->database_put("AMPUSER",$extension."/cidname",isset($name)?"\"".$name."\"":'');
$astman->database_put("AMPUSER",$extension."/cidnum",$cid_masquerade);
$astman->database_put("AMPUSER",$extension."/voicemail","\"".isset($voicemail)?$voicemail:''."\"");
switch ($call_screen) {
case '0':
$astman->database_del("AMPUSER",$extension."/screen");
break;
case 'nomemory':
$astman->database_put("AMPUSER",$extension."/screen","\"nomemory\"");
break;
case 'memory':
$astman->database_put("AMPUSER",$extension."/screen","\"memory\"");
break;
default:
}
if (!$editmode) {
$astman->database_put("AMPUSER",$extension."/device","\"".((isset($device))?$device:'')."\"");
}
if (trim($callwaiting) == 'enabled') {
$astman->database_put("CW",$extension,"\"ENABLED\"");
} else if (trim($callwaiting) == 'disabled') {
$astman->database_del("CW",$extension);
} else {
echo "ERROR: this state should not exist<br>";
}
if (trim($pinless) == 'enabled') {
$astman->database_put("AMPUSER",$extension."/pinless","\"NOPASSWD\"");
} else if (trim($pinless) == 'disabled') {
$astman->database_del("AMPUSER",$extension."/pinless");
} else {
echo "ERROR: this state should not exist<br>";
}
// Moved VmX setup to voicemail module since it is part of voicemail
//
} else {
die("Cannot connect to Asterisk Manager with ".$amp_conf["AMPMGRUSER"]."/".$amp_conf["AMPMGRPASS"]);
}
// OK - got this far, if they entered a new inbound DID/CID let's deal with it now
// remember - in the nice and ugly world of this old code, $vars has been extracted
// newdid and newdidcid
// Now if $newdid is set we need to add the DID to the routes
//
if ($newdid != '' || $newdidcid != '') {
$did_dest = 'from-did-direct,'.$extension.',1';
$did_vars['extension'] = $newdid;
$did_vars['cidnum'] = $newdidcid;
$did_vars['privacyman'] = '';
$did_vars['alertinfo'] = '';
$did_vars['ringing'] = '';
$did_vars['mohclass'] = 'default';
$did_vars['description'] = $newdid_name;
$did_vars['grppre'] = '';
$did_vars['delay_answer']= '0';
$did_vars['pricid']= '';
freepbx_core_did_add($did_vars, $did_dest);
}
return true;
}
function freepbx_core_did_add($incoming,$target=false){
global $db;
foreach ($incoming as $key => $val) { ${$key} = $val; } // create variables from request
$destination= ($target) ? $target : ${$goto0.'0'};
$sql="INSERT INTO ".FREEPBX_DATABASE.".incoming (cidnum,extension,destination,privacyman,pmmaxretries,pmminlength,alertinfo, ringing, mohclass, description, grppre, delay_answer, pricid) values ('$cidnum','$extension','$destination','$privacyman','$pmmaxretries','$pmminlength','$alertinfo', '$ringing', '$mohclass', '$description', '$grppre', '$delay_answer', '$pricid')";
return($db->Execute($sql));
}
?>

View File

@@ -204,8 +204,8 @@ function import_file($file, $description, $fields, $firstrow = 2)
(sample_import_id, description)
VALUES (NULL, '$description')";
//print("$sql<br/>");
//if ($db->HasFailedTrans()) { print "FAILED"; exit(); }
// print("$sql<br/>");
// if ($db->HasFailedTrans()) { print "FAILED"; exit(); }
$rs = $db->Execute($sql);
$id = $db->Insert_ID();
@@ -234,7 +234,7 @@ function import_file($file, $description, $fields, $firstrow = 2)
VALUES ($id,'" . $fields["n_" . substr($key,2)] . "','" . $fields["t_" . substr($key,2)] . "',$restrict)";
$db->Execute($sql);
$sirv_id[substr($key,2)] = $db->Insert_ID(); //
}
}
@@ -305,6 +305,7 @@ function import_file($file, $description, $fields, $firstrow = 2)
VALUES (NULL,'$id','$tzone','$dppid')";
$db->Execute($sql);
$sid = $db->Insert_Id();
@@ -315,11 +316,11 @@ function import_file($file, $description, $fields, $firstrow = 2)
{
$dkey = $db->Quote($data[$key - 1]);
$sql = "INSERT INTO sample_var (sample_id,var_id,var,val,type)
VALUES ('$sid','{$sirv_id[$key]}','$val',{$dkey},'{$selected_type[$key]}')";
$sql = "INSERT INTO sample_var (sample_id,var_id,val)
VALUES ('$sid','{$sirv_id[$key]}',{$dkey})";
$db->Execute($sql);
}
$imported++;

View File

@@ -345,17 +345,19 @@ function is_respondent_selection($operator_id)
* @param int $questionnaire_id The questionnaire id
* @param int $operator_id The operator id (Default NULL)
* @param int $testing 0 if a live case otherwise 1 for a testing case
* @param int $current_outcome_id The current outcome id (defaults to 1 - not attempted)
* @param bool $addlimeattributes If true, add sample values as lime attributes
*
* @return int The case id
*/
function add_case($sample_id,$questionnaire_id,$operator_id = "NULL",$testing = 0)
function add_case($sample_id,$questionnaire_id,$operator_id = "NULL",$testing = 0, $current_outcome_id = 1, $addlimeattributes = false)
{
global $db;
$token = sRandomChars();
$sql = "INSERT INTO `case` (case_id, sample_id, questionnaire_id, last_call_id, current_operator_id, current_call_id, current_outcome_id,token)
VALUES (NULL, $sample_id, $questionnaire_id, NULL, $operator_id, NULL, 1, '$token')";
VALUES (NULL, $sample_id, $questionnaire_id, NULL, $operator_id, NULL, '$current_outcome_id','$token')";
$db->Execute($sql);
@@ -440,10 +442,75 @@ function add_case($sample_id,$questionnaire_id,$operator_id = "NULL",$testing =
if ($lime_sid)
{
$lfirstname = '';
$llastname = '';
$lemail = '';
if ($addlimeattributes)
{
$lfirstname = $db->GetOne("SELECT sv.val
FROM sample_var as sv, sample_import_var_restrict as s
WHERE sv.var_id = s.var_id
AND sv.sample_id = '$sample_id'
AND s.type = '6'");
$llastname = $db->GetOne("SELECT sv.val
FROM sample_var as sv, sample_import_var_restrict as s
WHERE sv.var_id = s.var_id
AND sv.sample_id = '$sample_id'
AND s.type = '7'");
$lemail = $db->GetOne("SELECT sv.val
FROM sample_var as sv, sample_import_var_restrict as s
WHERE sv.var_id = s.var_id
AND sv.sample_id = '$sample_id'
AND s.type = '8'");
}
$sql = "INSERT INTO ".LIME_PREFIX."tokens_$lime_sid (tid,firstname,lastname,email,token,language,sent,completed,mpid)
VALUES (NULL,'','','','$token','".DEFAULT_LOCALE."','N','N',NULL)";
VALUES (NULL,'$lfirstname','$llastname','$lemail','$token','".DEFAULT_LOCALE."','N','N',NULL)";
$db->Execute($sql);
$tid = $db->Insert_Id();
if ($addlimeattributes)
{
//also add sample values as attributes
//match by name
$sql = "SELECT attributedescriptions
FROM " . LIME_PREFIX . "surveys
WHERE sid = '$lime_sid'";
$names = $db->GetOne($sql);
$attdescriptiondata=explode("\n",$names);
$atts=array();
foreach ($attdescriptiondata as $attdescription)
{
if (!empty($attdescription))
$atts['attribute_'.substr($attdescription,10,strpos($attdescription,'=')-10)] = substr($attdescription,strpos($attdescription,'=')+1);
}
foreach($atts as $key => $val)
{
$lval = $db->GetOne("SELECT sv.val
FROM sample_var as sv, sample_import_var_restrict as s
WHERE sv.var_id = s.var_id
AND sv.sample_id = '$sample_id'
AND s.var LIKE '$val'");
$sql = "UPDATE " . LIME_PREFIX . "tokens_$lime_sid
SET $key = '$lval'
WHERE tid = '$tid'";
$db->Execute($sql);
}
}
}
}

View File

@@ -40,17 +40,19 @@
* @param string $bodytext Space in the body element: good for onload='top.close()' to close validly
* @param bool|int $refresh False or 0 for no refresh otherwise the number of seconds to refresh
* @param bool $clearrefresh False if we want to pass on any GET request in header, True to clear
* @param bool|string $subtitle False if we want no subtitle otherwise display a subtitle
* @param bool $displayinnertitle Whether to display the inner title or not
*
* @see xhtml_foot()
*/
function xhtml_head($title="",$body=true,$css=false,$javascript=false,$bodytext=false,$refresh=false,$clearrefresh=false,$subtitle=false)
function xhtml_head($title="",$body=true,$css=false,$javascript=false,$bodytext=false,$refresh=false,$clearrefresh=false,$subtitle=false,$displayinnertitle=true)
{
print "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head><title><?php if (empty($title)) print "CATI"; else print "CATI: $title"; ?></title>
<head><title><?php if (empty($title)) print "queXS"; else print "queXS: $title"; ?></title>
<?php
if ($css)
foreach ($css as $c) print "<link rel='stylesheet' href='$c' type='text/css'></link>";
@@ -69,8 +71,11 @@ print "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
<meta charset="utf-8"/>
</head>
<?php
if ($bodytext) print "<body $bodytext>"; else print "<body>";
print "<h1 class='header text-primary'>" . "$title" . "&emsp;&emsp;<small class='text-capitalize'>" . "$subtitle" . "</small></h1>";
if ($bodytext) print "<body $bodytext>"; else print "<body>";
if ($displayinnertitle)
{
print "<h1 class='header text-primary'>" . "$title" . "&emsp;&emsp;<small class='text-capitalize'>" . "$subtitle" . "</small></h1>";
}
/* Let's print header that equals to menu item and page title !!!, move previous headers to "subtitles"*/
}
@@ -246,4 +251,4 @@ function browser_ie()
else
return false;
}
?>
?>

View File

@@ -28,7 +28,7 @@
*/
var Timepicker = function () {
this.regional = []; // Available regional settings, indexed by language code
this.regional['en'] = { // Default regional settings
this.regional[''] = { // Default regional settings
currentText: 'Now',
closeText: 'Done',
amNames: ['AM', 'A'],
@@ -104,7 +104,7 @@
defaultValue: null,
parse: 'strict'
};
$.extend(this._defaults, this.regional['en']);
$.extend(this._defaults, this.regional['']);
};
$.extend(Timepicker.prototype, {

View File

@@ -142,7 +142,7 @@ else if (HEADER_EXPANDER_MANUAL)
$js[] = "js/headerexpandmanual.js";
}
xhtml_head(T_("queXS"), $body, array("css/index.css","css/tabber.css","include/jquery-ui/jquery-ui.min.css") , $js);
xhtml_head(T_("queXS"), $body, array("css/index.css","css/tabber.css","include/jquery-ui/jquery-ui.min.css") , $js,false,false,false,false,false);
print $script;
$case_id = get_case_id($operator_id,true);

View File

@@ -53,7 +53,7 @@ $js = false;
if (AUTO_LOGOUT_MINUTES !== false)
$js = array("include/jquery/jquery-1.4.2.min.js","js/childnap.js");
xhtml_head(T_("Information"),true,false,$js);
xhtml_head(T_("Information"),true,false,$js,false,false,false,false,false);
print get_setting("information");

View File

@@ -49,4 +49,5 @@ $(".sidebar #nav").slideUp(350);
$('[data-toggle="tooltip"]').tooltip();
$("a[href*='" + location.search + "']").addClass("active");

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -58,7 +58,7 @@ $js = false;
if (AUTO_LOGOUT_MINUTES !== false)
$js = array("include/jquery/jquery-1.4.2.min.js","js/childnap.js");
xhtml_head(T_("Performance"),true,array("css/table.css"),$js);
xhtml_head(T_("Performance"),true,array("css/table.css"),$js,false,false,false,false,false);
$operator_id = get_operator_id();
$questionnaire_id = get_questionnaire_id($operator_id);

View File

@@ -58,7 +58,7 @@ $js = false;
if (AUTO_LOGOUT_MINUTES !== false)
$js = array("include/jquery/jquery-1.4.2.min.js","js/childnap.js");
xhtml_head(T_("Project information"),true,false,$js);
xhtml_head(T_("Project information"),true,false,$js,false,false,false,false,false);
$operator_id = get_operator_id();

View File

@@ -67,8 +67,7 @@ if (AUTO_LOGOUT_MINUTES !== false)
$js[] = "js/childnap.js";
}
xhtml_head(T_("Respondent Selector"),true,array("css/table.css","css/respondent.css"),$js);
xhtml_head(T_("Respondent Selector"),true,array("css/table.css","css/respondent.css"),$js,false,false,false,false,false);
//display the respondents as a drop down list for this call attempt
// display in the operators time

View File

@@ -74,7 +74,7 @@ if (AUTO_LOGOUT_MINUTES !== false)
$js[] = "js/childnap.js";
}
xhtml_head(T_("Status"),true,array("css/status.css"),$js,$btext,60);
xhtml_head(T_("Status"),true,array("css/status.css"),$js,$btext,60,false,false,false,false);
print "<div class='text'>" . get_operator_time($operator_id,DATE_TIME_FORMAT) ."</div>";

View File

@@ -45,6 +45,14 @@ include (realpath(dirname(__FILE__) . "/../db.inc.php"));
include (realpath(dirname(__FILE__) . "/../functions/functions.process.php"));
//end any other process
$p = is_process_running(2);
if ($p)
{
kill_process($p);
end_process($p);
}
start_process(realpath(dirname(__FILE__) . "/../admin/systemsortprocess.php"),2);
$p = is_process_running();
if ($p)
@@ -54,4 +62,5 @@ if ($p)
}
start_process(realpath(dirname(__FILE__) . "/../admin/process.php"));
?>