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:
@@ -117,6 +117,10 @@ if (isset($_POST['submit']))
|
|||||||
WHERE questionnaire_id IN (
|
WHERE questionnaire_id IN (
|
||||||
SELECT questionnaire_id
|
SELECT questionnaire_id
|
||||||
FROM questionnaire
|
FROM questionnaire
|
||||||
|
WHERE enabled = 1)
|
||||||
|
AND operator_id IN (
|
||||||
|
SELECT operator_id
|
||||||
|
FROM operator
|
||||||
WHERE enabled = 1)";
|
WHERE enabled = 1)";
|
||||||
|
|
||||||
$db->Execute($sql);
|
$db->Execute($sql);
|
||||||
@@ -142,6 +146,7 @@ $questionnaires = $db->GetAll($sql);
|
|||||||
|
|
||||||
$sql = "SELECT operator_id,firstname as description
|
$sql = "SELECT operator_id,firstname as description
|
||||||
FROM operator
|
FROM operator
|
||||||
|
WHERE enabled = 1
|
||||||
ORDER by operator_id ASC";
|
ORDER by operator_id ASC";
|
||||||
|
|
||||||
$operators = $db->GetAll($sql);
|
$operators = $db->GetAll($sql);
|
||||||
|
|||||||
@@ -113,7 +113,10 @@ if (isset($_POST['submit']))
|
|||||||
|
|
||||||
$sql = "DELETE
|
$sql = "DELETE
|
||||||
FROM operator_skill
|
FROM operator_skill
|
||||||
WHERE 1";
|
WHERE operator_id IN (
|
||||||
|
SELECT operator_id
|
||||||
|
FROM operator
|
||||||
|
WHERE enabled = 1)";
|
||||||
|
|
||||||
$db->Execute($sql);
|
$db->Execute($sql);
|
||||||
|
|
||||||
@@ -137,6 +140,7 @@ $outcome_types = $db->GetAll($sql);
|
|||||||
|
|
||||||
$sql = "SELECT operator_id,firstname as description
|
$sql = "SELECT operator_id,firstname as description
|
||||||
FROM operator
|
FROM operator
|
||||||
|
WHERE enabled = 1
|
||||||
ORDER by operator_id ASC";
|
ORDER by operator_id ASC";
|
||||||
|
|
||||||
$operators = $db->GetAll($sql);
|
$operators = $db->GetAll($sql);
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ function get_CPH_by_shift($qid,$sid)
|
|||||||
AND s.`start` <= a.`start`
|
AND s.`start` <= a.`start`
|
||||||
AND s.`end` >= a.`start`
|
AND s.`end` >= a.`start`
|
||||||
GROUP BY operator_id) as ca on (ca.operator_id = o.operator_id)
|
GROUP BY operator_id) as ca on (ca.operator_id = o.operator_id)
|
||||||
|
WHERE o.enabled = 1
|
||||||
ORDER BY cph DESC";
|
ORDER BY cph DESC";
|
||||||
|
|
||||||
return $db->GetAll($sql);
|
return $db->GetAll($sql);
|
||||||
@@ -98,6 +99,7 @@ function get_CPH_by_questionnaire($qid)
|
|||||||
WHERE a.case_id = b.case_id
|
WHERE a.case_id = b.case_id
|
||||||
AND b.questionnaire_id = '$qid'
|
AND b.questionnaire_id = '$qid'
|
||||||
GROUP BY operator_id) as ca on (ca.operator_id = o.operator_id)
|
GROUP BY operator_id) as ca on (ca.operator_id = o.operator_id)
|
||||||
|
WHERE o.enabled = 1
|
||||||
ORDER BY cph DESC";
|
ORDER BY cph DESC";
|
||||||
|
|
||||||
|
|
||||||
@@ -157,6 +159,7 @@ function get_stats_by_shift($questionnaire_id,$shift_id)
|
|||||||
AND s.`end` >= a.`start`
|
AND s.`end` >= a.`start`
|
||||||
AND b.questionnaire_id = '$questionnaire_id'
|
AND b.questionnaire_id = '$questionnaire_id'
|
||||||
GROUP BY a.operator_id) as calls on (calls.operator_id = o.operator_id)
|
GROUP BY a.operator_id) as calls on (calls.operator_id = o.operator_id)
|
||||||
|
WHERE o.enabled = 1
|
||||||
ORDER BY effectiveness DESC";
|
ORDER BY effectiveness DESC";
|
||||||
|
|
||||||
return $db->GetAll($sql);
|
return $db->GetAll($sql);
|
||||||
@@ -255,6 +258,7 @@ function get_stats()
|
|||||||
JOIN ( SELECT count(*) as calls,a.operator_id
|
JOIN ( SELECT count(*) as calls,a.operator_id
|
||||||
FROM `call` as a
|
FROM `call` as a
|
||||||
GROUP BY a.operator_id) as calls on (calls.operator_id = o.operator_id)
|
GROUP BY a.operator_id) as calls on (calls.operator_id = o.operator_id)
|
||||||
|
WHERE o.enabled = 1
|
||||||
ORDER BY effectiveness DESC";
|
ORDER BY effectiveness DESC";
|
||||||
|
|
||||||
return $db->GetAll($sql);
|
return $db->GetAll($sql);
|
||||||
@@ -301,6 +305,7 @@ function get_stats_by_questionnaire($questionnaire_id)
|
|||||||
WHERE a.case_id = b.case_id
|
WHERE a.case_id = b.case_id
|
||||||
AND b.questionnaire_id = '$questionnaire_id'
|
AND b.questionnaire_id = '$questionnaire_id'
|
||||||
GROUP BY a.operator_id) as calls on (calls.operator_id = o.operator_id)
|
GROUP BY a.operator_id) as calls on (calls.operator_id = o.operator_id)
|
||||||
|
WHERE o.enabled = 1
|
||||||
ORDER BY effectiveness DESC";
|
ORDER BY effectiveness DESC";
|
||||||
|
|
||||||
return $db->GetAll($sql);
|
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
|
JOIN ( SELECT SUM( TIMESTAMPDIFF(SECOND , start, IFNULL(end,CONVERT_TZ(NOW(),'System','UTC')))) as time, operator_id
|
||||||
FROM `call_attempt`
|
FROM `call_attempt`
|
||||||
GROUP BY operator_id) as ca on (ca.operator_id = o.operator_id)
|
GROUP BY operator_id) as ca on (ca.operator_id = o.operator_id)
|
||||||
|
WHERE o.enabled = 1
|
||||||
ORDER BY cph DESC";
|
ORDER BY cph DESC";
|
||||||
|
|
||||||
return $db->GetAll($sql);
|
return $db->GetAll($sql);
|
||||||
@@ -360,6 +366,7 @@ function get_effectiveness_by_questionnaire($questionnaire_id)
|
|||||||
AND b.questionnaire_id = '$questionnaire_id'
|
AND b.questionnaire_id = '$questionnaire_id'
|
||||||
GROUP BY operator_id
|
GROUP BY operator_id
|
||||||
) AS callattempttime ON ( callattempttime.operator_id = o.operator_id )
|
) AS callattempttime ON ( callattempttime.operator_id = o.operator_id )
|
||||||
|
WHERE o.enabled = 1
|
||||||
ORDER BY effectiveness DESC";
|
ORDER BY effectiveness DESC";
|
||||||
|
|
||||||
return $db->GetAll($sql);
|
return $db->GetAll($sql);
|
||||||
@@ -390,6 +397,7 @@ function get_effectiveness()
|
|||||||
FROM `call_attempt` AS c
|
FROM `call_attempt` AS c
|
||||||
GROUP BY operator_id
|
GROUP BY operator_id
|
||||||
) AS callattempttime ON ( callattempttime.operator_id = o.operator_id )
|
) AS callattempttime ON ( callattempttime.operator_id = o.operator_id )
|
||||||
|
WHERE o.enabled = 1
|
||||||
ORDER BY effectiveness DESC";
|
ORDER BY effectiveness DESC";
|
||||||
|
|
||||||
return $db->GetAll($sql);
|
return $db->GetAll($sql);
|
||||||
|
|||||||
Reference in New Issue
Block a user