From ed511a229fe27df3f2eee4774ce4d40d97defcab Mon Sep 17 00:00:00 2001 From: Nate Jones Date: Fri, 12 Dec 2014 22:04:27 +0000 Subject: [PATCH] Operator Panel: Stylized status buttons, moved CSS to templates. --- app/operator_panel/index.php | 181 ++++++------------------------- app/operator_panel/index_inc.php | 47 ++++---- themes/enhanced/template.php | 150 +++++++++++++++++++++++++ themes/minimized/template.php | 150 +++++++++++++++++++++++++ 4 files changed, 361 insertions(+), 167 deletions(-) diff --git a/app/operator_panel/index.php b/app/operator_panel/index.php index 982ed20aa8..b1395702e3 100644 --- a/app/operator_panel/index.php +++ b/app/operator_panel/index.php @@ -263,41 +263,39 @@ require_once "resources/header.php"; document.getElementById('cmd_reponse').innerHTML=xmlhttp.responseText; } -"; + return cmd; + } - echo "function get_originate_cmd(source, destination) {\n"; - echo " cmd = \"bgapi originate {sip_auto_answer=true,origination_caller_id_number=\"+destination+\",sip_h_Call-Info=_undef_}user/\"+source+\" \"+destination+\" XML ".trim($_SESSION['user_context'])."\";\n"; - echo " return cmd;\n"; - echo "}\n"; + function get_originate_cmd(source, destination) { + cmd = "bgapi originate {sip_auto_answer=true,origination_caller_id_number=" + destination + ",sip_h_Call-Info=_undef_}user/" + source + " " + destination + " XML "; + return cmd; + } - echo "function get_eavesdrop_cmd(ext, chan_uuid) {\n"; - echo " cmd = \"bgapi originate {origination_caller_id_name=".$text['label-eavesdrop'].",origination_caller_id_number=\"+ext+\"}user/".$_SESSION['user']['extensions'][0]."@".$_SESSION['domain_name']." &eavesdrop(\"+chan_uuid+\")\";"; - echo " return cmd;\n"; - echo "}\n"; + function get_eavesdrop_cmd(ext, chan_uuid) { + cmd = "bgapi originate {origination_caller_id_name=,origination_caller_id_number=" + ext + "}user/@ &eavesdrop(" + chan_uuid + ")"; + return cmd; + } - echo "function get_record_cmd(uuid) {\n"; - echo " cmd = \"uuid_record \"+uuid+\" start ".$_SESSION['switch']['recordings']['dir']."/archive/".date("Y")."/".date("M")."/".date("d")."/\"+uuid+\".wav\";\n"; - echo " return cmd;\n"; - echo "}\n"; -?> + function get_record_cmd(uuid) { + cmd = "uuid_record " + uuid + " start /archive////" + uuid + ".wav"; + return cmd; + } //virtual functions function virtual_drag(call_id, ext) { @@ -357,138 +355,25 @@ require_once "resources/header.php"; -echo "
"; -// include("index_inc.php"); -echo "
\n"; -echo ""; -echo "

"; - +
+ +

+ \ No newline at end of file diff --git a/app/operator_panel/index_inc.php b/app/operator_panel/index_inc.php index 5ff78fdcdb..6bc8850ecb 100644 --- a/app/operator_panel/index_inc.php +++ b/app/operator_panel/index_inc.php @@ -59,7 +59,7 @@ foreach ($activity as $extension => $fields) { $groups = array_unique($groups); sort($groups); -echo ""; +echo "
"; echo " "; echo " "; echo "
"; echo " ".$text['title-operator_panel'].""; @@ -67,15 +67,24 @@ echo " "; if (sizeof($_SESSION['user']['extensions']) > 0) { - $status_options = Array( - "Available" => $text['label-status_available'], - "Available (On Demand)" => $text['label-status_on_demand'], - "On Break" => $text['label-status_on_break'], - "Do Not Disturb" => $text['label-status_do_not_disturb'], - "Logged Out" => $text['label-status_logged_out'] - ); - foreach ($status_options as $status_value => $status_label) { - echo " "; + $status_options[1]['status'] = "Available"; + $status_options[1]['label'] = $text['label-status_available']; + $status_options[1]['style'] = "op_btn_status_available"; + $status_options[2]['status'] = "Available (On Demand)"; + $status_options[2]['label'] = $text['label-status_on_demand']; + $status_options[2]['style'] = "op_btn_status_available_on_demand"; + $status_options[3]['status'] = "On Break"; + $status_options[3]['label'] = $text['label-status_on_break']; + $status_options[3]['style'] = "op_btn_status_on_break"; + $status_options[4]['status'] = "Do Not Disturb"; + $status_options[4]['label'] = $text['label-status_do_not_disturb']; + $status_options[4]['style'] = "op_btn_status_do_not_disturb"; + $status_options[5]['status'] = "Logged Out"; + $status_options[5]['label'] = $text['label-status_logged_out']; + $status_options[5]['style'] = "op_btn_status_logged_out"; + + foreach ($status_options as $status_option) { + echo " \n"; } } @@ -157,7 +166,7 @@ foreach ($activity as $extension => $ext) { } //determine block style by state (if any) - $style = ($ext_state != '') ? "state_".$ext_state : null; + $style = ($ext_state != '') ? "op_state_".$ext_state : null; //determine the call identifier passed on drop if ($ext['uuid'] == $ext['call_uuid'] && $ext['variable_bridge_uuid'] == '') { // transfer an outbound internal call @@ -237,19 +246,19 @@ foreach ($activity as $extension => $ext) { $status_hover = $text['label-status_logged_out_or_unknown']; } - $block .= "
"; // DRAG TO - $block .= ""; + $block .= "
"; // DRAG TO + $block .= "
"; $block .= " "; - $block .= " "; - $block .= "
"; + $block .= " "; $block .= " "; // DRAG FROM - $block .= ""; + $block .= ""; $block .= ""; $block .= " "; + $block .= " "; if ($dir_icon != '') { $block .= " "; } - $block .= "