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

When assigning skills and questionnaires to operators, respect their "enabled" or "disabled" state

Only display performance for enabled operators
This commit is contained in:
azammitdcarf
2011-02-03 05:34:05 +00:00
parent 8a2d53be65
commit 0adf4a9d2d
3 changed files with 18 additions and 1 deletions

View File

@@ -117,6 +117,10 @@ if (isset($_POST['submit']))
WHERE questionnaire_id IN (
SELECT questionnaire_id
FROM questionnaire
WHERE enabled = 1)
AND operator_id IN (
SELECT operator_id
FROM operator
WHERE enabled = 1)";
$db->Execute($sql);
@@ -142,6 +146,7 @@ $questionnaires = $db->GetAll($sql);
$sql = "SELECT operator_id,firstname as description
FROM operator
WHERE enabled = 1
ORDER by operator_id ASC";
$operators = $db->GetAll($sql);

View File

@@ -113,7 +113,10 @@ if (isset($_POST['submit']))
$sql = "DELETE
FROM operator_skill
WHERE 1";
WHERE operator_id IN (
SELECT operator_id
FROM operator
WHERE enabled = 1)";
$db->Execute($sql);
@@ -137,6 +140,7 @@ $outcome_types = $db->GetAll($sql);
$sql = "SELECT operator_id,firstname as description
FROM operator
WHERE enabled = 1
ORDER by operator_id ASC";
$operators = $db->GetAll($sql);

View File

@@ -70,6 +70,7 @@ function get_CPH_by_shift($qid,$sid)
AND s.`start` <= a.`start`
AND s.`end` >= a.`start`
GROUP BY operator_id) as ca on (ca.operator_id = o.operator_id)
WHERE o.enabled = 1
ORDER BY cph DESC";
return $db->GetAll($sql);
@@ -98,6 +99,7 @@ function get_CPH_by_questionnaire($qid)
WHERE a.case_id = b.case_id
AND b.questionnaire_id = '$qid'
GROUP BY operator_id) as ca on (ca.operator_id = o.operator_id)
WHERE o.enabled = 1
ORDER BY cph DESC";
@@ -157,6 +159,7 @@ function get_stats_by_shift($questionnaire_id,$shift_id)
AND s.`end` >= a.`start`
AND b.questionnaire_id = '$questionnaire_id'
GROUP BY a.operator_id) as calls on (calls.operator_id = o.operator_id)
WHERE o.enabled = 1
ORDER BY effectiveness DESC";
return $db->GetAll($sql);
@@ -255,6 +258,7 @@ function get_stats()
JOIN ( SELECT count(*) as calls,a.operator_id
FROM `call` as a
GROUP BY a.operator_id) as calls on (calls.operator_id = o.operator_id)
WHERE o.enabled = 1
ORDER BY effectiveness DESC";
return $db->GetAll($sql);
@@ -301,6 +305,7 @@ function get_stats_by_questionnaire($questionnaire_id)
WHERE a.case_id = b.case_id
AND b.questionnaire_id = '$questionnaire_id'
GROUP BY a.operator_id) as calls on (calls.operator_id = o.operator_id)
WHERE o.enabled = 1
ORDER BY effectiveness DESC";
return $db->GetAll($sql);
@@ -325,6 +330,7 @@ function get_CPH()
JOIN ( SELECT SUM( TIMESTAMPDIFF(SECOND , start, IFNULL(end,CONVERT_TZ(NOW(),'System','UTC')))) as time, operator_id
FROM `call_attempt`
GROUP BY operator_id) as ca on (ca.operator_id = o.operator_id)
WHERE o.enabled = 1
ORDER BY cph DESC";
return $db->GetAll($sql);
@@ -360,6 +366,7 @@ function get_effectiveness_by_questionnaire($questionnaire_id)
AND b.questionnaire_id = '$questionnaire_id'
GROUP BY operator_id
) AS callattempttime ON ( callattempttime.operator_id = o.operator_id )
WHERE o.enabled = 1
ORDER BY effectiveness DESC";
return $db->GetAll($sql);
@@ -390,6 +397,7 @@ function get_effectiveness()
FROM `call_attempt` AS c
GROUP BY operator_id
) AS callattempttime ON ( callattempttime.operator_id = o.operator_id )
WHERE o.enabled = 1
ORDER BY effectiveness DESC";
return $db->GetAll($sql);