Stop warning message appearing (#2301)

Stops php warning message appearing when there are no assigned agents

(Warning: Invalid argument supplied for foreach() in /var/www/fusionpbx/app/call_centers/call_center_queue_edit.php on line 635)
This commit is contained in:
DigiDaz 2017-01-16 01:43:26 +00:00 committed by FusionPBX
parent 98f20b78f2
commit d419a459f7
1 changed files with 5 additions and 3 deletions

View File

@ -631,8 +631,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
if (permission_exists('call_center_tier_add')) {
//get agents
$sql = "select agent_name from v_call_center_agents where domain_uuid = '".$_SESSION['domain_uuid']."' ";
foreach($assigned_agents as $assigned_agent) {
$sql .= "and agent_name <> '".$assigned_agent."' ";
if ($assigned_agents){
foreach($assigned_agents as $assigned_agent) {
$sql .= "and agent_name <> '".$assigned_agent."' ";
}
}
$sql .= "order by agent_name asc";
$prep_statement = $db->prepare(check_sql($sql));
@ -965,4 +967,4 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
require_once "resources/footer.php";
?>
?>