mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
3 in 1 page for better usage and simulaneous view,
updated sidebar menu in index.php
This commit is contained in:
313
admin/assigntimeslots.php
Normal file
313
admin/assigntimeslots.php
Normal file
@@ -0,0 +1,313 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Assign availability groups to a questionnaire
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* This file is part of queXS
|
||||||
|
*
|
||||||
|
* queXS is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* queXS is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with queXS; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author Adam Zammit <adam.zammit@acspri.org.au>
|
||||||
|
* @copyright Australian Consortium for Social and Political Research Inc (ACSPRI) 2011
|
||||||
|
* @package queXS
|
||||||
|
* @subpackage admin
|
||||||
|
* @link http://www.acspri.org.au queXS was writen for ACSPRI
|
||||||
|
* @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configuration file
|
||||||
|
*/
|
||||||
|
include("../config.inc.php");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Database file
|
||||||
|
*/
|
||||||
|
include ("../db.inc.php");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* XHTML functions
|
||||||
|
*/
|
||||||
|
include("../functions/functions.xhtml.php");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display functions
|
||||||
|
*/
|
||||||
|
include("../functions/functions.display.php");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Input functions
|
||||||
|
*/
|
||||||
|
include("../functions/functions.input.php");
|
||||||
|
|
||||||
|
$css = array(
|
||||||
|
"../include/bootstrap-3.3.2/css/bootstrap.min.css",
|
||||||
|
"../include/bootstrap-3.3.2/css/bootstrap-theme.min.css",
|
||||||
|
//"../include/font-awesome-4.3.0/css/font-awesome.css",
|
||||||
|
"../css/custom.css"
|
||||||
|
);
|
||||||
|
$js_head = array(
|
||||||
|
);
|
||||||
|
$js_foot = array(
|
||||||
|
"../js/window.js",
|
||||||
|
//"../js/custom.js"
|
||||||
|
);
|
||||||
|
|
||||||
|
global $db;
|
||||||
|
|
||||||
|
//block availability
|
||||||
|
if (isset($_GET['questionnaire_id']) && isset($_GET['av_availability_group']))
|
||||||
|
{
|
||||||
|
//need to add availability_group to questionnaire
|
||||||
|
$questionnaire_id = bigintval($_GET['questionnaire_id']);
|
||||||
|
$availability_group = bigintval($_GET['av_availability_group']);
|
||||||
|
|
||||||
|
$sql = "INSERT INTO questionnaire_availability(questionnaire_id,availability_group_id)
|
||||||
|
VALUES('$questionnaire_id','$availability_group')";
|
||||||
|
$db->Execute($sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($_GET['questionnaire_id']) && isset($_GET['av_ravailability_group']))
|
||||||
|
{
|
||||||
|
//need to remove rsid from questionnaire
|
||||||
|
$questionnaire_id = bigintval($_GET['questionnaire_id']);
|
||||||
|
$availability_group = bigintval($_GET['av_ravailability_group']);
|
||||||
|
|
||||||
|
$sql = "DELETE FROM questionnaire_availability
|
||||||
|
WHERE questionnaire_id = '$questionnaire_id'
|
||||||
|
AND availability_group_id = '$availability_group'";
|
||||||
|
$db->Execute($sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
//block call_attempts
|
||||||
|
if (isset($_GET['questionnaire_id']) && isset($_GET['ca_availability_group']))
|
||||||
|
{
|
||||||
|
//need to add availability_group to questionnaire
|
||||||
|
$questionnaire_id = bigintval($_GET['questionnaire_id']);
|
||||||
|
$availability_group = bigintval($_GET['ca_availability_group']);
|
||||||
|
|
||||||
|
$sql = "INSERT INTO questionnaire_timeslot(questionnaire_id,availability_group_id)
|
||||||
|
VALUES('$questionnaire_id','$availability_group')";
|
||||||
|
$db->Execute($sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($_GET['questionnaire_id']) && isset($_GET['ca_ravailability_group']))
|
||||||
|
{
|
||||||
|
//need to remove rsid from questionnaire
|
||||||
|
$questionnaire_id = bigintval($_GET['questionnaire_id']);
|
||||||
|
$availability_group = bigintval($_GET['ca_ravailability_group']);
|
||||||
|
|
||||||
|
$sql = "DELETE FROM questionnaire_timeslot
|
||||||
|
WHERE questionnaire_id = '$questionnaire_id'
|
||||||
|
AND availability_group_id = '$availability_group'";
|
||||||
|
$db->Execute($sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//block call_attempts by sample
|
||||||
|
if (isset($_GET['questionnaire_id']) && isset($_GET['sample_import_id']) && isset($_GET['qs_availability_group']))
|
||||||
|
{
|
||||||
|
//need to add availability_group to questionnaire
|
||||||
|
$questionnaire_id = bigintval($_GET['questionnaire_id']);
|
||||||
|
$sample_import_id = bigintval($_GET['sample_import_id']);
|
||||||
|
$availability_group = bigintval($_GET['qs_availability_group']);
|
||||||
|
|
||||||
|
$sql = "INSERT INTO questionnaire_sample_timeslot (questionnaire_id,sample_import_id,availability_group_id)
|
||||||
|
VALUES('$questionnaire_id','$sample_import_id','$availability_group')";
|
||||||
|
$db->Execute($sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($_GET['questionnaire_id']) && isset($_GET['sample_import_id']) && isset($_GET['qs_ravailability_group']))
|
||||||
|
{
|
||||||
|
//need to remove rsid from questionnaire
|
||||||
|
$questionnaire_id = bigintval($_GET['questionnaire_id']);
|
||||||
|
$sample_import_id = bigintval($_GET['sample_import_id']);
|
||||||
|
$availability_group = bigintval($_GET['qs_ravailability_group']);
|
||||||
|
|
||||||
|
$sql = "DELETE FROM questionnaire_sample_timeslot
|
||||||
|
WHERE questionnaire_id = '$questionnaire_id'
|
||||||
|
AND sample_import_id = '$sample_import_id'
|
||||||
|
AND availability_group_id = '$availability_group'";
|
||||||
|
$db->Execute($sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
$questionnaire_id = false;
|
||||||
|
if (isset($_GET['questionnaire_id'])) $questionnaire_id = bigintval($_GET['questionnaire_id']);
|
||||||
|
$sample_import_id = false;
|
||||||
|
if (isset($_GET['sample_import_id'])) $sample_import_id = bigintval($_GET['sample_import_id']);
|
||||||
|
|
||||||
|
xhtml_head(T_("Assign Time slots"),true,$css,$js_head);//false,array("../js/window.js")
|
||||||
|
|
||||||
|
print "<div class='clearfix form-group'><h3 class='col-sm-6 text-right text-uppercase'>" . T_("Select a questionnaire") . ":</h3>";
|
||||||
|
display_questionnaire_chooser($questionnaire_id,false, "form-inline", "form-control");
|
||||||
|
print "</div>";
|
||||||
|
if ($questionnaire_id != false)
|
||||||
|
{
|
||||||
|
|
||||||
|
//page questionnaireavailability.php
|
||||||
|
print "<div class=col-sm-4><h2>" . T_("Time slot groups") . "</h2>";
|
||||||
|
print "<div class='well'>" . T_("Assigning an availability group to a questionnaire will allow interviewers to select from those groups to restrict calls to a particular case to the times within the group") ."</div>";
|
||||||
|
|
||||||
|
$sql = "SELECT q.availability_group_id,a.description as description, CONCAT('<a href=\'?questionnaire_id=$questionnaire_id&av_ravailability_group=', a.availability_group_id,'\' >" . T_("Click to unassign") . "</a>') as link
|
||||||
|
FROM questionnaire_availability as q, availability_group as a
|
||||||
|
WHERE q.availability_group_id = a.availability_group_id
|
||||||
|
AND q.questionnaire_id = '$questionnaire_id'";
|
||||||
|
|
||||||
|
$qs = $db->GetAll($sql);
|
||||||
|
print "</br></br></br><div class='panel-body'>";
|
||||||
|
|
||||||
|
if (empty($qs))
|
||||||
|
{
|
||||||
|
print "<h4 class='alert text-danger'>" . T_("There are no time slots groups selected for this questionnaire") . "</h4>";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "<h4>" . T_("Time slots groups selected for this questionnaire") . "</h4>";
|
||||||
|
xhtml_table ($qs,array("availability_group_id","description","link"),false,"table table-hover");
|
||||||
|
}
|
||||||
|
print "</div>";
|
||||||
|
$sql = "SELECT si.availability_group_id,si.description
|
||||||
|
FROM availability_group as si
|
||||||
|
LEFT JOIN questionnaire_availability as q ON (q.questionnaire_id = '$questionnaire_id' AND q.availability_group_id = si.availability_group_id)
|
||||||
|
WHERE q.questionnaire_id is NULL";
|
||||||
|
|
||||||
|
$qs = $db->GetAll($sql);
|
||||||
|
|
||||||
|
if (!empty($qs))
|
||||||
|
{
|
||||||
|
print "<div class='panel-body'>";
|
||||||
|
//print "<h3>" . T_("Add time slot to this questionnaire:") . "</h3>";
|
||||||
|
print "<form action='' method='get'><div class='pull-left'><select class='form-control ' name='av_availability_group' id='av_availability_group'>";
|
||||||
|
foreach($qs as $q)
|
||||||
|
{
|
||||||
|
print "<option value=\"{$q['availability_group_id']}\">{$q['description']}</option>";
|
||||||
|
}
|
||||||
|
print "</select></div>
|
||||||
|
<input type='hidden' name='questionnaire_id' value='$questionnaire_id'/>
|
||||||
|
 <input type='submit' class='btn btn-default' name='add_av_availability' value='" . T_("Add time slot group") . "'/>
|
||||||
|
</form></div>";
|
||||||
|
}
|
||||||
|
|
||||||
|
print "</div>";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//page questionnairecatimeslots.php
|
||||||
|
print "<div class=col-sm-4><h2>" . T_("Call attempt time slots") . "</h2>";
|
||||||
|
print "<div class='well'>" . T_("Assigning call attempt time slots to questionnaires will only allow cases to be attempted in a time slot for the n + 1th time where it has been attempted at least n times in all assigned timeslots. Please note timeslots must cover all possible time periods otherwise no cases will be available during missing timeslots.") ."</div>";
|
||||||
|
|
||||||
|
$sql = "SELECT q.availability_group_id,a.description as description, CONCAT('<a href=\'?questionnaire_id=$questionnaire_id&ca_ravailability_group=', q.availability_group_id,'\' >" . T_("Click to unassign") . "</a>') as link
|
||||||
|
|
||||||
|
FROM questionnaire_timeslot as q, availability_group as a
|
||||||
|
WHERE q.availability_group_id = a.availability_group_id
|
||||||
|
AND q.questionnaire_id = '$questionnaire_id'";
|
||||||
|
|
||||||
|
$qs = $db->GetAll($sql);
|
||||||
|
print "</br><div class='panel-body'>";
|
||||||
|
if (empty($qs))
|
||||||
|
{
|
||||||
|
print "<h4 class='alert text-danger'>" . T_("There are no call attempt time slots selected for this questionnaire") . "</h4>";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "<h4>" . T_("Call attempt time slots selected for this questionnaire") . "</h4>";
|
||||||
|
xhtml_table ($qs,array("availability_group_id","description","link"),false,"table table-hover");
|
||||||
|
}
|
||||||
|
print "</div>";
|
||||||
|
|
||||||
|
$sql = "SELECT si.availability_group_id,si.description
|
||||||
|
FROM availability_group as si
|
||||||
|
LEFT JOIN questionnaire_timeslot as q ON (q.questionnaire_id = '$questionnaire_id' AND q.availability_group_id = si.availability_group_id)
|
||||||
|
WHERE q.questionnaire_id is NULL";
|
||||||
|
|
||||||
|
$qs = $db->GetAll($sql);
|
||||||
|
|
||||||
|
if (!empty($qs))
|
||||||
|
{
|
||||||
|
print "<div class='panel-body'>";
|
||||||
|
//print "<h3>" . T_("Add a call attempt time slot to this questionnaire:") . "</h3>";
|
||||||
|
print "<form action='' method='get'><div class='pull-left'><select class='form-control ' name='ca_availability_group' id='ca_availability_group'>";
|
||||||
|
foreach($qs as $q)
|
||||||
|
{
|
||||||
|
print "<option value=\"{$q['availability_group_id']}\">{$q['description']}</option>";
|
||||||
|
}
|
||||||
|
print "</select></div>
|
||||||
|
<input type='hidden' name='questionnaire_id' value='$questionnaire_id'/>
|
||||||
|
 <input type='submit' class='btn btn-default' name='add_ca_availability' value='" . TQ_("Add call attempt time slot") . "'/>
|
||||||
|
</form></div>";
|
||||||
|
}
|
||||||
|
print "</div>";
|
||||||
|
|
||||||
|
//page questionnairetimeslosample.php
|
||||||
|
print "<div class=col-sm-4><h2>" . T_("Call attempt time slots for sample") . "</h2>";
|
||||||
|
print "<div class='well'>" . T_("Assigning call attempt time slots to questionnaires will only allow cases to be attempted in a time slot for the n + 1th time where it has been attempted at least n times in all assigned timeslots. Please note timeslots must cover all possible time periods otherwise no cases will be available during missing timeslots.") ."</div>";
|
||||||
|
|
||||||
|
print "<h3 class='pull-left'>" . T_("Sample") . ": </h3>";
|
||||||
|
|
||||||
|
$sample_import_id = false;
|
||||||
|
if (isset($_GET['sample_import_id'])) $sample_import_id = bigintval($_GET['sample_import_id']);
|
||||||
|
display_sample_chooser($questionnaire_id,$sample_import_id,false, "form-inline", "form-control");
|
||||||
|
|
||||||
|
if ($sample_import_id !== false)
|
||||||
|
{
|
||||||
|
$sql = "SELECT q.availability_group_id,a.description as description, CONCAT('<a href=\'?sample_import_id=$sample_import_id&questionnaire_id=$questionnaire_id&qs_ravailability_group=', q.availability_group_id,'\' >" . T_("Click to unassign") . "</a>') as link
|
||||||
|
FROM questionnaire_sample_timeslot as q, availability_group as a
|
||||||
|
WHERE q.availability_group_id = a.availability_group_id
|
||||||
|
AND q.questionnaire_id = '$questionnaire_id'
|
||||||
|
AND q.sample_import_id = '$sample_import_id'";
|
||||||
|
|
||||||
|
$qs = $db->GetAll($sql);
|
||||||
|
|
||||||
|
if (empty($qs))
|
||||||
|
{
|
||||||
|
print "<h4 class='alert text-danger'>" . T_("There are no call attempt time slots selected for this questionnaire sample") . "</h4>";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "<h4>" . T_("Call attempt time slots selected for this sample") . ":</h4>";
|
||||||
|
xhtml_table ($qs,array("availability_group_id","description","link"),false,"table table-hover");
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = "SELECT si.availability_group_id,si.description
|
||||||
|
FROM availability_group as si
|
||||||
|
LEFT JOIN questionnaire_sample_timeslot as q ON (q.sample_import_id = '$sample_import_id' AND q.questionnaire_id = '$questionnaire_id' AND q.availability_group_id = si.availability_group_id)
|
||||||
|
WHERE q.questionnaire_id is NULL";
|
||||||
|
|
||||||
|
$qs = $db->GetAll($sql);
|
||||||
|
|
||||||
|
if (!empty($qs))
|
||||||
|
{
|
||||||
|
print "<div class='panel-body'>";
|
||||||
|
//print "<h3>" . T_("Add a call attempt time slot to this questionnaire sample:") . "</h3>";
|
||||||
|
print "<form action='' method='get'><div class='pull-left'><select class='form-control ' name='qs_availability_group' id='qs_availability_group'>";
|
||||||
|
foreach($qs as $q)
|
||||||
|
{
|
||||||
|
print "<option value=\"{$q['availability_group_id']}\">{$q['description']}</option>";
|
||||||
|
}
|
||||||
|
print "</select></div>
|
||||||
|
<input type='hidden' name='questionnaire_id' value='$questionnaire_id'/>
|
||||||
|
<input type='hidden' name='sample_import_id' value='$sample_import_id'/>
|
||||||
|
 <input type='submit' name='add_qs_availability' class='btn btn-default' value='" . T_("Add call attempt time slot for sample") . "'/>
|
||||||
|
</form></div>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print "</div>";
|
||||||
|
}
|
||||||
|
|
||||||
|
xhtml_foot($js_foot);
|
||||||
|
?>
|
||||||
@@ -108,10 +108,10 @@ include ("../lang.inc.php");
|
|||||||
</li>
|
</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>
|
<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="">
|
<ul class="" style="">
|
||||||
<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=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=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=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=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="?page=addshift.php"><i class="fa fa-calendar-o fa-fw"></i><?php print T_("Shift management") ;?></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
@@ -125,7 +125,7 @@ include ("../lang.inc.php");
|
|||||||
<ul class="" style="">
|
<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=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=operatorlist.php"><i class="fa fa-user fa-fw"></i><?php print T_("Operator management") ;?></a></li>
|
||||||
<li><a href="?page=exten_tab.php "><i class="fa fa-phone-square fa-fw"></i><?php print T_("Extension status") ;?></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=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=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>
|
<li><a href="?page=operatorperformance.php"><i class="fa fa-signal fa-fw"></i><?php print T_("Operator performance") ;?></a></li>
|
||||||
@@ -133,7 +133,7 @@ include ("../lang.inc.php");
|
|||||||
</li>
|
</li>
|
||||||
<li class="has_sub"><a href="" class=""><i class="fa fa-lg fa-line-chart"></i><span><?php print T_("Results") ;?></span></a>
|
<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="">
|
<ul class="" style="">
|
||||||
<li><a href="?page=displayappointments.php"><i class="fa fa-list-ul fa-fw"></i><span><?php print T_("Display all future appointments") ;?></span></a></li>
|
<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=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=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=shiftreport.php"><i class="fa fa-th-large fa-fw"></i><?php print T_("Shift reports") ;?></a></li>
|
||||||
@@ -158,6 +158,7 @@ include ("../lang.inc.php");
|
|||||||
<li class="has_sub"><a href="" class=""><i class="fa fa-lg fa-gear"></i><span><?php print T_("System settings") ;?></span></a>
|
<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="">
|
<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=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=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=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=centreinfo.php"><i class="fa fa-university fa-fw"></i><?php print T_("Set centre information") ;?></a></li>
|
||||||
@@ -172,7 +173,7 @@ include ("../lang.inc.php");
|
|||||||
<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>
|
<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="">
|
<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>
|
<li><a href="?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>
|
<!-- <li><a href="?page=extensionstatus.php"><i class="fa fa-asterisk fa-fw"></i><?php //print T_("Extension status") ;?></a></li> -->
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@@ -183,7 +184,7 @@ include ("../lang.inc.php");
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Main page container -->
|
<!-- Main page container -->
|
||||||
<?php $page = "callhistory.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="mainbar" id=" "><?php xhtml_object($page,' '); ?></div>
|
||||||
|
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
|
|||||||
@@ -1,157 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Assign availability groups to a questionnaire
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* This file is part of queXS
|
|
||||||
*
|
|
||||||
* queXS is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* queXS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with queXS; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @author Adam Zammit <adam.zammit@acspri.org.au>
|
|
||||||
* @copyright Australian Consortium for Social and Political Research Inc (ACSPRI) 2011
|
|
||||||
* @package queXS
|
|
||||||
* @subpackage admin
|
|
||||||
* @link http://www.acspri.org.au queXS was writen for ACSPRI
|
|
||||||
* @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Configuration file
|
|
||||||
*/
|
|
||||||
include("../config.inc.php");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Database file
|
|
||||||
*/
|
|
||||||
include ("../db.inc.php");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* XHTML functions
|
|
||||||
*/
|
|
||||||
include("../functions/functions.xhtml.php");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Display functions
|
|
||||||
*/
|
|
||||||
include("../functions/functions.display.php");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Input functions
|
|
||||||
*/
|
|
||||||
include("../functions/functions.input.php");
|
|
||||||
|
|
||||||
global $db;
|
|
||||||
|
|
||||||
|
|
||||||
if (isset($_GET['questionnaire_id']) && isset($_GET['availability_group']))
|
|
||||||
{
|
|
||||||
//need to add availability_group to questionnaire
|
|
||||||
|
|
||||||
$questionnaire_id = bigintval($_GET['questionnaire_id']);
|
|
||||||
$availability_group = bigintval($_GET['availability_group']);
|
|
||||||
|
|
||||||
$sql = "INSERT INTO questionnaire_availability(questionnaire_id,availability_group_id)
|
|
||||||
VALUES('$questionnaire_id','$availability_group')";
|
|
||||||
|
|
||||||
$db->Execute($sql);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_GET['questionnaire_id']) && isset($_GET['ravailability_group']))
|
|
||||||
{
|
|
||||||
//need to remove rsid from questionnaire
|
|
||||||
|
|
||||||
$questionnaire_id = bigintval($_GET['questionnaire_id']);
|
|
||||||
$availability_group = bigintval($_GET['ravailability_group']);
|
|
||||||
|
|
||||||
$sql = "DELETE FROM questionnaire_availability
|
|
||||||
WHERE questionnaire_id = '$questionnaire_id'
|
|
||||||
AND availability_group_id = '$availability_group'";
|
|
||||||
|
|
||||||
$db->Execute($sql);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$questionnaire_id = false;
|
|
||||||
if (isset($_GET['questionnaire_id'])) $questionnaire_id = bigintval($_GET['questionnaire_id']);
|
|
||||||
|
|
||||||
xhtml_head(T_("Assign availability group to questionnaire"),true,false,array("../js/window.js"));
|
|
||||||
|
|
||||||
print "<p>" . T_("Assigning an availability group to a questionnaire will allow interviewers to select from those groups to restrict calls to a particular case to the times within the group") ."</p>";
|
|
||||||
|
|
||||||
print "<h3>" . T_("Select a questionnaire from the list below") . "</h3>";
|
|
||||||
display_questionnaire_chooser($questionnaire_id);
|
|
||||||
|
|
||||||
|
|
||||||
if ($questionnaire_id != false)
|
|
||||||
{
|
|
||||||
|
|
||||||
$sql = "SELECT q.availability_group_id,a.description as description
|
|
||||||
FROM questionnaire_availability as q, availability_group as a
|
|
||||||
WHERE q.availability_group_id = a.availability_group_id
|
|
||||||
AND q.questionnaire_id = '$questionnaire_id'";
|
|
||||||
|
|
||||||
$qs = $db->GetAll($sql);
|
|
||||||
|
|
||||||
if (empty($qs))
|
|
||||||
{
|
|
||||||
print "<h2>" . T_("There are no availability groups selected for this questionnaire") . "</h2>";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print "<h2>" . T_("Availability groups selected for this questionnaire") . "</h2>";
|
|
||||||
foreach($qs as $q)
|
|
||||||
{
|
|
||||||
print "<p><a href=\"?questionnaire_id=$questionnaire_id&ravailability_group={$q['availability_group_id']}\">{$q['availability_group_id']} - {$q['description']} (" . T_("Click to unassign") . ")</a></p>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql = "SELECT si.availability_group_id,si.description
|
|
||||||
FROM availability_group as si
|
|
||||||
LEFT JOIN questionnaire_availability as q ON (q.questionnaire_id = '$questionnaire_id' AND q.availability_group_id = si.availability_group_id)
|
|
||||||
WHERE q.questionnaire_id is NULL";
|
|
||||||
|
|
||||||
$qs = $db->GetAll($sql);
|
|
||||||
|
|
||||||
if (!empty($qs))
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
print "<h2>" . T_("Add an availability group to this questionnaire:") . "</h2>";
|
|
||||||
?>
|
|
||||||
<form action="" method="get">
|
|
||||||
<p><label for="availability_group"><?php echo T_("Select availability group:"); ?></label><select name="availability_group" id="availability_group">
|
|
||||||
<?php
|
|
||||||
|
|
||||||
foreach($qs as $q)
|
|
||||||
{
|
|
||||||
print "<option value=\"{$q['availability_group_id']}\">{$q['description']}</option>";
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
</select><br/>
|
|
||||||
<input type="hidden" name="questionnaire_id" value="<?php print($questionnaire_id); ?>"/>
|
|
||||||
<input type="submit" name="add_availability" value="<?php echo TQ_("Add availability group") ?>"/></p>
|
|
||||||
</form>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
}
|
|
||||||
xhtml_foot();
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -1,157 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Assign call attempt time slots to a questionnaire
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* This file is part of queXS
|
|
||||||
*
|
|
||||||
* queXS is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* queXS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with queXS; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @author Adam Zammit <adam.zammit@acspri.org.au>
|
|
||||||
* @copyright Australian Consortium for Social and Political Research Inc (ACSPRI) 2011
|
|
||||||
* @package queXS
|
|
||||||
* @subpackage admin
|
|
||||||
* @link http://www.acspri.org.au queXS was writen for ACSPRI
|
|
||||||
* @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Configuration file
|
|
||||||
*/
|
|
||||||
include("../config.inc.php");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Database file
|
|
||||||
*/
|
|
||||||
include ("../db.inc.php");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* XHTML functions
|
|
||||||
*/
|
|
||||||
include("../functions/functions.xhtml.php");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Display functions
|
|
||||||
*/
|
|
||||||
include("../functions/functions.display.php");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Input functions
|
|
||||||
*/
|
|
||||||
include("../functions/functions.input.php");
|
|
||||||
|
|
||||||
global $db;
|
|
||||||
|
|
||||||
|
|
||||||
if (isset($_GET['questionnaire_id']) && isset($_GET['availability_group']))
|
|
||||||
{
|
|
||||||
//need to add availability_group to questionnaire
|
|
||||||
|
|
||||||
$questionnaire_id = bigintval($_GET['questionnaire_id']);
|
|
||||||
$availability_group = bigintval($_GET['availability_group']);
|
|
||||||
|
|
||||||
$sql = "INSERT INTO questionnaire_timeslot(questionnaire_id,availability_group_id)
|
|
||||||
VALUES('$questionnaire_id','$availability_group')";
|
|
||||||
|
|
||||||
$db->Execute($sql);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_GET['questionnaire_id']) && isset($_GET['ravailability_group']))
|
|
||||||
{
|
|
||||||
//need to remove rsid from questionnaire
|
|
||||||
|
|
||||||
$questionnaire_id = bigintval($_GET['questionnaire_id']);
|
|
||||||
$availability_group = bigintval($_GET['ravailability_group']);
|
|
||||||
|
|
||||||
$sql = "DELETE FROM questionnaire_timeslot
|
|
||||||
WHERE questionnaire_id = '$questionnaire_id'
|
|
||||||
AND availability_group_id = '$availability_group'";
|
|
||||||
|
|
||||||
$db->Execute($sql);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$questionnaire_id = false;
|
|
||||||
if (isset($_GET['questionnaire_id'])) $questionnaire_id = bigintval($_GET['questionnaire_id']);
|
|
||||||
|
|
||||||
xhtml_head(T_("Assign call attempt time slots to questionnaire"),true,false,array("../js/window.js"));
|
|
||||||
|
|
||||||
print "<p>" . T_("Assigning call attempt time slots to questionnaires will only allow cases to be attempted in a time slot for the n + 1th time where it has been attempted at least n times in all assigned timeslots. Please note timeslots must cover all possible time periods otherwise no cases will be available during missing timeslots.") ."</p>";
|
|
||||||
|
|
||||||
print "<h3>" . T_("Select a questionnaire from the list below") . "</h3>";
|
|
||||||
display_questionnaire_chooser($questionnaire_id);
|
|
||||||
|
|
||||||
|
|
||||||
if ($questionnaire_id != false)
|
|
||||||
{
|
|
||||||
|
|
||||||
$sql = "SELECT q.availability_group_id,a.description as description
|
|
||||||
FROM questionnaire_timeslot as q, availability_group as a
|
|
||||||
WHERE q.availability_group_id = a.availability_group_id
|
|
||||||
AND q.questionnaire_id = '$questionnaire_id'";
|
|
||||||
|
|
||||||
$qs = $db->GetAll($sql);
|
|
||||||
|
|
||||||
if (empty($qs))
|
|
||||||
{
|
|
||||||
print "<h2>" . T_("There are no call attempt time slots selected for this questionnaire") . "</h2>";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print "<h2>" . T_("Call attempt time slots selected for this questionnaire") . "</h2>";
|
|
||||||
foreach($qs as $q)
|
|
||||||
{
|
|
||||||
print "<p><a href=\"?questionnaire_id=$questionnaire_id&ravailability_group={$q['availability_group_id']}\">{$q['availability_group_id']} - {$q['description']} (" . T_("Click to unassign") . ")</a></p>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql = "SELECT si.availability_group_id,si.description
|
|
||||||
FROM availability_group as si
|
|
||||||
LEFT JOIN questionnaire_timeslot as q ON (q.questionnaire_id = '$questionnaire_id' AND q.availability_group_id = si.availability_group_id)
|
|
||||||
WHERE q.questionnaire_id is NULL";
|
|
||||||
|
|
||||||
$qs = $db->GetAll($sql);
|
|
||||||
|
|
||||||
if (!empty($qs))
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
print "<h2>" . T_("Add a call attempt time slot to this questionnaire:") . "</h2>";
|
|
||||||
?>
|
|
||||||
<form action="" method="get">
|
|
||||||
<p><label for="availability_group"><?php echo T_("Select call attempt time slot:"); ?></label><select name="availability_group" id="availability_group">
|
|
||||||
<?php
|
|
||||||
|
|
||||||
foreach($qs as $q)
|
|
||||||
{
|
|
||||||
print "<option value=\"{$q['availability_group_id']}\">{$q['description']}</option>";
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
</select><br/>
|
|
||||||
<input type="hidden" name="questionnaire_id" value="<?php print($questionnaire_id); ?>"/>
|
|
||||||
<input type="submit" name="add_availability" value="<?php echo TQ_("Add call attempt time slot") ?>"/></p>
|
|
||||||
</form>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
}
|
|
||||||
xhtml_foot();
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -1,172 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Assign call attempt time slots to a questionnaire sample
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* This file is part of queXS
|
|
||||||
*
|
|
||||||
* queXS is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* queXS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with queXS; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @author Adam Zammit <adam.zammit@acspri.org.au>
|
|
||||||
* @copyright Australian Consortium for Social and Political Research Inc (ACSPRI) 2011
|
|
||||||
* @package queXS
|
|
||||||
* @subpackage admin
|
|
||||||
* @link http://www.acspri.org.au queXS was writen for ACSPRI
|
|
||||||
* @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Configuration file
|
|
||||||
*/
|
|
||||||
include("../config.inc.php");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Database file
|
|
||||||
*/
|
|
||||||
include ("../db.inc.php");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* XHTML functions
|
|
||||||
*/
|
|
||||||
include("../functions/functions.xhtml.php");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Display functions
|
|
||||||
*/
|
|
||||||
include("../functions/functions.display.php");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Input functions
|
|
||||||
*/
|
|
||||||
include("../functions/functions.input.php");
|
|
||||||
|
|
||||||
global $db;
|
|
||||||
|
|
||||||
|
|
||||||
if (isset($_GET['questionnaire_id']) && isset($_GET['sample_import_id']) && isset($_GET['availability_group']))
|
|
||||||
{
|
|
||||||
//need to add availability_group to questionnaire
|
|
||||||
|
|
||||||
$questionnaire_id = bigintval($_GET['questionnaire_id']);
|
|
||||||
$sample_import_id = bigintval($_GET['sample_import_id']);
|
|
||||||
$availability_group = bigintval($_GET['availability_group']);
|
|
||||||
|
|
||||||
$sql = "INSERT INTO questionnaire_sample_timeslot (questionnaire_id,sample_import_id,availability_group_id)
|
|
||||||
VALUES('$questionnaire_id','$sample_import_id','$availability_group')";
|
|
||||||
|
|
||||||
$db->Execute($sql);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_GET['questionnaire_id']) && isset($_GET['sample_import_id']) && isset($_GET['ravailability_group']))
|
|
||||||
{
|
|
||||||
//need to remove rsid from questionnaire
|
|
||||||
|
|
||||||
$questionnaire_id = bigintval($_GET['questionnaire_id']);
|
|
||||||
$sample_import_id = bigintval($_GET['sample_import_id']);
|
|
||||||
$availability_group = bigintval($_GET['ravailability_group']);
|
|
||||||
|
|
||||||
$sql = "DELETE FROM questionnaire_sample_timeslot
|
|
||||||
WHERE questionnaire_id = '$questionnaire_id'
|
|
||||||
AND sample_import_id = '$sample_import_id'
|
|
||||||
AND availability_group_id = '$availability_group'";
|
|
||||||
|
|
||||||
|
|
||||||
$db->Execute($sql);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$questionnaire_id = false;
|
|
||||||
if (isset($_GET['questionnaire_id'])) $questionnaire_id = bigintval($_GET['questionnaire_id']);
|
|
||||||
|
|
||||||
xhtml_head(T_("Assign call attempt time slots to questionnaire sample"),true,false,array("../js/window.js"));
|
|
||||||
|
|
||||||
print "<p>" . T_("Assigning call attempt time slots to questionnaires will only allow cases to be attempted in a time slot for the n + 1th time where it has been attempted at least n times in all assigned timeslots. Please note timeslots must cover all possible time periods otherwise no cases will be available during missing timeslots.") ."</p>";
|
|
||||||
|
|
||||||
print "<h3>" . T_("Select a questionnaire from the list below") . "</h3>";
|
|
||||||
display_questionnaire_chooser($questionnaire_id);
|
|
||||||
|
|
||||||
|
|
||||||
if ($questionnaire_id != false)
|
|
||||||
{
|
|
||||||
print "<h3>" . T_("Select a sample from the list below") . "</h3>";
|
|
||||||
|
|
||||||
$sample_import_id = false;
|
|
||||||
if (isset($_GET['sample_import_id'])) $sample_import_id = bigintval($_GET['sample_import_id']);
|
|
||||||
display_sample_chooser($questionnaire_id,$sample_import_id);
|
|
||||||
|
|
||||||
if ($sample_import_id !== false)
|
|
||||||
{
|
|
||||||
|
|
||||||
$sql = "SELECT q.availability_group_id,a.description as description
|
|
||||||
FROM questionnaire_sample_timeslot as q, availability_group as a
|
|
||||||
WHERE q.availability_group_id = a.availability_group_id
|
|
||||||
AND q.questionnaire_id = '$questionnaire_id'
|
|
||||||
AND q.sample_import_id = '$sample_import_id'";
|
|
||||||
|
|
||||||
$qs = $db->GetAll($sql);
|
|
||||||
|
|
||||||
if (empty($qs))
|
|
||||||
{
|
|
||||||
print "<h2>" . T_("There are no call attempt time slots selected for this questionnaire sample") . "</h2>";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print "<h2>" . T_("Call attempt time slots selected for this questionnaire sample") . "</h2>";
|
|
||||||
foreach($qs as $q)
|
|
||||||
{
|
|
||||||
print "<p><a href=\"?sample_import_id=$sample_import_id&questionnaire_id=$questionnaire_id&ravailability_group={$q['availability_group_id']}\">{$q['availability_group_id']} - {$q['description']} (" . T_("Click to unassign") . ")</a></p>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql = "SELECT si.availability_group_id,si.description
|
|
||||||
FROM availability_group as si
|
|
||||||
LEFT JOIN questionnaire_sample_timeslot as q ON (q.sample_import_id = '$sample_import_id' AND q.questionnaire_id = '$questionnaire_id' AND q.availability_group_id = si.availability_group_id)
|
|
||||||
WHERE q.questionnaire_id is NULL";
|
|
||||||
|
|
||||||
$qs = $db->GetAll($sql);
|
|
||||||
|
|
||||||
if (!empty($qs))
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
print "<h2>" . T_("Add a call attempt time slot to this questionnaire sample:") . "</h2>";
|
|
||||||
?>
|
|
||||||
<form action="" method="get">
|
|
||||||
<p><label for="availability_group"><?php echo T_("Select call attempt time slot:"); ?></label><select name="availability_group" id="availability_group">
|
|
||||||
<?php
|
|
||||||
|
|
||||||
foreach($qs as $q)
|
|
||||||
{
|
|
||||||
print "<option value=\"{$q['availability_group_id']}\">{$q['description']}</option>";
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
</select><br/>
|
|
||||||
<input type="hidden" name="questionnaire_id" value="<?php print($questionnaire_id); ?>"/>
|
|
||||||
<input type="hidden" name="sample_import_id" value="<?php print($sample_import_id); ?>"/>
|
|
||||||
<input type="submit" name="add_availability" value="<?php echo TQ_("Add call attempt time slot") ?>"/></p>
|
|
||||||
</form>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
xhtml_foot();
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
|
||||||
Reference in New Issue
Block a user