diff --git a/app/operator_panel/index_inc.php b/app/operator_panel/index_inc.php index 724354b99a..4a286eae62 100644 --- a/app/operator_panel/index_inc.php +++ b/app/operator_panel/index_inc.php @@ -17,46 +17,56 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2015 + Portions created by the Initial Developer are Copyright (C) 2008-2016 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane */ -include "root.php"; -require_once "resources/require.php"; -require_once "resources/check_auth.php"; -require_once "./resources/functions/get_call_activity.php"; -if (permission_exists('operator_panel_view')) { - //access granted -} -else { - echo "access denied"; - exit; -} + +//includes + include "root.php"; + require_once "resources/require.php"; + require_once "resources/check_auth.php"; + require_once "./resources/functions/get_call_activity.php"; + +//check permissions + if (permission_exists('operator_panel_view')) { + //access granted + } + else { + echo "access denied"; + exit; + } //add multi-lingual support $language = new text; $text = $language->get(); -$activity = get_call_activity(); - -if (is_array($activity)) foreach ($activity as $extension => $fields) { - if (substr_count($fields['call_group'], ',')) { - $tmp = explode(',', $fields['call_group']); - if (is_array($tmp)) foreach ($tmp as $tmp_index => $tmp_value) { - if (trim($tmp_value) == '') { unset($tmp[$tmp_index]); } - else { $groups[] = $tmp_value; } +//get the call activity + $activity = get_call_activity(); + if (is_array($activity)) foreach ($activity as $extension => $fields) { + if (substr_count($fields['call_group'], ',')) { + $tmp = explode(',', $fields['call_group']); + if (is_array($tmp)) foreach ($tmp as $tmp_index => $tmp_value) { + if (trim($tmp_value) == '') { unset($tmp[$tmp_index]); } + else { $groups[] = $tmp_value; } + } + } + else if ($fields['call_group'] != '') { + $groups[] = $fields['call_group']; } } - else if ($fields['call_group'] != '') { - $groups[] = $fields['call_group']; + if (is_array($groups)) { + $groups = array_unique($groups); + sort($groups); } -} -if (is_array($groups)) { - $groups = array_unique($groups); - sort($groups); -} + +//prevent warnings + if (!is_array($_SESSION['user']['extensions'])) { + $_SESSION['user']['extensions'] = array(); + } + $onhover_pause_refresh = " onmouseover='refresh_stop();' onmouseout='refresh_start();'";