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

fix differences between working installation and tree

nocaseavailable.php: enabled call restrictions and outside times calculation, modified querry to count samples 
 waitnextcase_interface2.php: added quota filter for sample search , display "End work" button if no case aailable
This commit is contained in:
Alex
2015-07-08 15:00:51 +03:00
parent 8a700c8ecc
commit 41d6a89942
3 changed files with 25 additions and 25 deletions

View File

@@ -111,19 +111,19 @@ function xhtml_table($content,$fields,$head = false,$class = "tclass",$highlight
{
$tot = array();
if ($class == "tclass") $class = "table-hover table-bordered table-condensed tclass";
print "<table class=\"$class\" id=\"$id\" name=\"$name\">";
print "<table class=\"$class\" id=\"$id\" name=\"$name\" data-toggle=\"table\" data-toolbar=\"filter-bar\" data-show-filter=\"true\" >";
if ($head)
{
print "<thead class='highlight'><tr>"; // ! added <thead> to table formatting
print "<thead class=\"highlight\"><tr>";
foreach ($head as $e)
print"<th>$e</th>";
print"<th data-field=\"$e\" data-sortable=\"true\">$e</th>";
print "</tr></thead>";
}
print "<tbody>";
foreach($content as $row)
{
if ($highlight && isset($row[key($highlight)]) && $row[key($highlight)] == current($highlight))
print "<tr class='highlight'>";
print "<tr class=\"highlight\">";
else
print "<tr>";

View File

@@ -141,43 +141,40 @@ else
?> <p class='error'><?php echo T_("ERROR: No shifts at this time"); ?></p> <?php
}
/* Disable as too time consuming
/* Disable as too time consuming */
//call restrictions and outside times
$sql = "SELECT count(*) as c
$sql = "SELECT count(s.sample_id) as count_samples
FROM operator_questionnaire as oq
JOIN (questionnaire_sample as qs, sample_import as si, sample as s) on (
qs.questionnaire_id = oq.questionnaire_id
and si.sample_import_id = qs.sample_import_id
and s.import_id = si.sample_import_id)
LEFT JOIN call_restrict as cr on (
cr.day_of_week = DAYOFWEEK(CONVERT_TZ(NOW(), 'System' , s.Time_zone_name))
and TIME(CONVERT_TZ(NOW(), 'System' , s.Time_zone_name)) >= cr.start
and TIME(CONVERT_TZ(NOW(), 'System' , s.Time_zone_name)) <= cr.end)
JOIN (questionnaire_sample as qs, sample_import as si, sample as s) on (qs.questionnaire_id = oq.questionnaire_id and si.sample_import_id = qs.sample_import_id and s.import_id = si.sample_import_id)
LEFT JOIN (`case` as c , `outcome` as ou) on (s.sample_id = c.sample_id and (ou.outcome_id = c.current_outcome_id || c.case_id IS NULL))
LEFT JOIN call_restrict as cr on ( cr.day_of_week = DAYOFWEEK(CONVERT_TZ(NOW(), 'System' , s.Time_zone_name)) and TIME(CONVERT_TZ(NOW(), 'System' , s.Time_zone_name)) >= cr.start and TIME(CONVERT_TZ(NOW(), 'System' , s.Time_zone_name)) <= cr.end)
WHERE operator_id = '$operator_id'
AND !(si.call_restrict = 1 AND cr.day_of_week IS NULL)";
AND si.enabled = 1
AND !(si.call_restrict = 1 AND cr.day_of_week IS NULL)
AND ou.outcome_type_id IN( SELECT outcome_type_id FROM operator_skill WHERE operator_id = '$operator_id')
AND ou.outcome_id NOT IN (10,25,28,33,34,40) ";
$rs = $db->GetRow($sql);
?>
<p><?php echo T_("Call restrictions:"); ?></p>
<?php
if ($rs['c'] == 0)
if ($rs['count_samples'] == 0)
{
?> <p class='error'><?php echo T_("ERROR: There are no cases available that fall within call restrictions"); ?></p> <?php
}
else
{
print "<p>" . T_("There are ") . $rs['c'] . T_(" unassigned case(s) available within the specified call restrictions") . "</p>";
print "<p>" . T_("There are ") . $rs['count_samples'] . T_(" unassigned case(s) available within the specified call restrictions") . "</p>";
}
*/
?>
<p><?php echo T_("Limesurvey links:"); ?></p>
<?php
//no link to limesurvey
echo "<p>" . T_("Limesurvey links:") . "</p>";
$sql = "SELECT q.lime_sid, q.description
FROM questionnaire as q, operator_questionnaire as oq
WHERE oq.operator_id = '$operator_id'

View File

@@ -101,11 +101,13 @@ else
//no sample
$sql = "SELECT q.questionnaire_id, q.description, si.description as sdescription, si.sample_import_id
FROM questionnaire as q, sample_import as si, questionnaire_sample as qs
FROM questionnaire as q, sample_import as si LEFT JOIN questionnaire_sample_quota AS qsq ON (qsq.sample_import_id = si.sample_import_id), questionnaire_sample as qs
WHERE q.questionnaire_id IN ($oqid)
AND si.enabled = 1
AND (qsq.quota_reached = 0 OR qsq.quota_reached IS NULL)
AND qs.questionnaire_id = q.questionnaire_id
AND si.sample_import_id = qs.sample_import_id";
AND si.sample_import_id = qs.sample_import_id
GROUP BY si.sample_import_id";
$rs = $db->GetAll($sql);
@@ -182,16 +184,17 @@ else
print "</div>";
}
if ($cases_count['count_samples'] != 0 or $new_samples['count_samples'] != 0){
?>
<div id="">
<ul class="wait_wrapper">
<?php if ($cases_count['count_samples'] != 0 or $new_samples['count_samples'] != 0){ ?>
<li class="wait_li_1"><a href="index_interface2.php"><?php echo T_("Get a new case"); ?> <img src="css/images/play.jpg" /></a></li>
<?php } ?>
<li class="wait_li_2"><a href="endwork.php"><?php echo T_("End work"); ?> <img src="css/images/end.jpg" /></a></li>
</ul>
</div>
<?php
}
xhtml_foot();
?>