diff --git a/app/ring_groups/app_languages.php b/app/ring_groups/app_languages.php index d43c2eb29c..eb649969b8 100644 --- a/app/ring_groups/app_languages.php +++ b/app/ring_groups/app_languages.php @@ -1,771 +1,761 @@ - \ No newline at end of file + 0) { - $sql = "SELECT * FROM v_ring_group_destinations "; + $sql = "select * from v_ring_group_destinations "; $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; $sql .= "and ring_group_uuid = '".$ring_group_uuid."' "; $sql .= "order by destination_delay, destination_number asc "; @@ -427,7 +431,7 @@ else { //get the ring group users if (strlen($ring_group_uuid) > 0) { - $sql = "SELECT u.username, r.user_uuid, r.ring_group_uuid FROM v_ring_group_users as r, v_users as u "; + $sql = "select u.username, r.user_uuid, r.ring_group_uuid from v_ring_group_users as r, v_users as u "; $sql .= "where r.user_uuid = u.user_uuid "; $sql .= "and u.user_enabled = 'true' "; $sql .= "and r.domain_uuid = '".$_SESSION['domain_uuid']."' "; @@ -455,14 +459,14 @@ else { echo "
\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; echo "\n"; @@ -774,6 +778,21 @@ else { echo "\n"; } + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + if (if_group("superadmin")) { echo "\n"; echo "\n"; echo th_order_by('ring_group_name', $text['label-name'], $order_by, $order); echo th_order_by('ring_group_extension', $text['label-extension'], $order_by, $order); + echo th_order_by('ring_group_strategy', $text['label-strategy'], $order_by, $order); + echo th_order_by('ring_group_forward_enabled', $text['label-forwarding'], $order_by, $order); echo th_order_by('ring_group_enabled', $text['label-enabled'], $order_by, $order); - if (permission_exists('ring_group_forward')) { - echo ""; - } echo th_order_by('ring_group_description', $text['header-description'], $order_by, $order); echo "\n"; echo " \n"; + echo " \n"; + echo " \n"; echo " \n"; - if (permission_exists('ring_group_forward')) { - echo " \n"; - } echo " \n"; echo "
".$text['label-ring-group']."".$text['label-ring-group']."\n"; echo " \n"; echo " \n"; echo "
\n"; + echo "\n"; echo $text['description']."

\n"; echo "
\n"; + echo " ".$text['label-forwarding']."\n"; + echo "\n"; + echo " "; + echo ""; + echo "
\n"; + echo $text['description-ring-group-forward']."\n"; + echo "
\n"; diff --git a/app/ring_groups/ring_group_forward.php b/app/ring_groups/ring_group_forward.php index b4763157d0..c9bd3bddcb 100644 --- a/app/ring_groups/ring_group_forward.php +++ b/app/ring_groups/ring_group_forward.php @@ -27,7 +27,7 @@ require_once "root.php"; require_once "resources/require.php"; require_once "resources/check_auth.php"; -if (permission_exists('ring_group_forward')) { +if (permission_exists('ring_group_edit') || permission_exists('ring_group_forward')) { //access granted } else { @@ -46,123 +46,158 @@ require_once "resources/paging.php"; $order_by = $_GET["order_by"]; $order = $_GET["order"]; -//show the content +//update ring group forwarding + if (sizeof($_POST) > 0) { + $ring_groups = $_POST['ring_group_forward_enabled']; + $destinations = $_POST['ring_group_forward_destination']; - if (!$is_included) { - echo "\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo "
".$text['title-ring_groups']." 
\n"; - echo " ".$text['description']."

\n"; - echo "
\n"; + if (is_array($ring_groups) && sizeof($ring_groups) > 0) { + foreach ($ring_groups as $ring_group_uuid => $ring_group_forward_enabled) { + //remove non-numeric characters + $ring_group_foreward_destination = preg_replace("~[^0-9]~", "", $destinations[$ring_group_uuid]); + //update the ring group + $sql = "update v_ring_groups set "; + $sql .= "ring_group_forward_enabled = '".check_str($ring_group_forward_enabled)."', "; + $sql .= "ring_group_forward_destination = '".check_str($ring_group_foreward_destination)."' "; + $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; + $sql .= "and ring_group_uuid = '".$ring_group_uuid."' "; + $db->exec(check_sql($sql)); + unset($sql); + } + //redirect the user + $_SESSION["message"] = $text['message-update']; + header("Location: ".$_REQUEST['return_url']); + exit; + } } - //prepare to page the results - if (permission_exists('ring_group_add') || permission_exists('ring_group_edit')) { - //show all ring groups - $sql = "select count(*) as num_rows from v_ring_groups "; - $sql .= "where domain_uuid = '$domain_uuid' "; +//prepare to page the results + if (permission_exists('ring_group_add') || permission_exists('ring_group_edit')) { + //show all ring groups + $sql = "select count(*) as num_rows from v_ring_groups "; + $sql .= "where domain_uuid = '$domain_uuid' "; + } + else { + //show only assigned fax extensions + $sql = "select count(*) as num_rows from v_ring_groups as r, v_ring_group_users as u "; + $sql .= "where r.ring_group_uuid = u.ring_group_uuid "; + $sql .= "and r.domain_uuid = '".$_SESSION['domain_uuid']."' "; + $sql .= "and u.user_uuid = '".$_SESSION['user_uuid']."' "; + } + if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; } + $prep_statement = $db->prepare($sql); + if ($prep_statement) { + $prep_statement->execute(); + $row = $prep_statement->fetch(PDO::FETCH_ASSOC); + if ($row['num_rows'] > 0) { + $num_rows = $row['num_rows']; } else { - //show only assigned fax extensions - $sql = "select count(*) as num_rows from v_ring_groups as r, v_ring_group_users as u "; - $sql .= "where r.ring_group_uuid = u.ring_group_uuid "; - $sql .= "and r.domain_uuid = '".$_SESSION['domain_uuid']."' "; - $sql .= "and u.user_uuid = '".$_SESSION['user_uuid']."' "; - } - if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; } - $prep_statement = $db->prepare($sql); - if ($prep_statement) { - $prep_statement->execute(); - $row = $prep_statement->fetch(PDO::FETCH_ASSOC); - if ($row['num_rows'] > 0) { - $num_rows = $row['num_rows']; - } - else { - $num_rows = '0'; - } + $num_rows = '0'; } + } - //prepare to page the results - if ($is_included == 'true') { - $rows_per_page = 10; - if ($num_rows > 10) { - echo "\n"; - } - } - else { - $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; - } - $param = ""; - $page = $_GET['page']; - if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } - list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page); - $offset = $rows_per_page * $page; +//prepare to page the results + if ($is_included == 'true') { + $rows_per_page = 10; + } + else { + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; + } + $param = ""; + $page = $_GET['page']; + if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } + list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page); + $offset = $rows_per_page * $page; - //get the list - if (permission_exists('ring_group_add') || permission_exists('ring_group_edit')) { - //show all ring groups - $sql = "select * from v_ring_groups "; - $sql .= "where domain_uuid = '$domain_uuid' "; - } - else { - //show only assigned fax extensions - $sql = "select r.ring_group_uuid, r.ring_group_extension, r.ring_group_description from v_ring_groups as r, v_ring_group_users as u "; - $sql .= "where r.ring_group_uuid = u.ring_group_uuid "; - $sql .= "and r.domain_uuid = '".$_SESSION['domain_uuid']."' "; - $sql .= "and u.user_uuid = '".$_SESSION['user_uuid']."' "; - } - if (strlen($order_by) == 0) { - $sql .= "order by ring_group_extension asc "; - } - else { - $sql .= "order by $order_by $order "; - } - $sql .= " limit $rows_per_page offset $offset "; - $prep_statement = $db->prepare(check_sql($sql)); - $prep_statement->execute(); - $result = $prep_statement->fetchAll(); - $result_count = count($result); - unset ($prep_statement, $sql); +//get the list + if (permission_exists('ring_group_add') || permission_exists('ring_group_edit')) { + //show all ring groups + $sql = "select * from v_ring_groups "; + $sql .= "where domain_uuid = '".$domain_uuid."' "; + } + else { + //show only assigned ring groups + $sql = "select r.ring_group_uuid, r.ring_group_extension, r.ring_group_description from v_ring_groups as r, v_ring_group_users as u "; + $sql .= "where r.ring_group_uuid = u.ring_group_uuid "; + $sql .= "and r.domain_uuid = '".$_SESSION['domain_uuid']."' "; + $sql .= "and u.user_uuid = '".$_SESSION['user_uuid']."' "; + } + if (strlen($order_by) == 0) { + $sql .= "order by ring_group_extension asc "; + } + else { + $sql .= "order by ".$order_by." ".$order." "; + } + $sql .= " limit ".$rows_per_page." offset ".$offset." "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $result = $prep_statement->fetchAll(); + $result_count = count($result); + unset ($prep_statement, $sql); - $c = 0; - $row_style["0"] = "row_style0"; - $row_style["1"] = "row_style1"; + if ($num_rows > 10) { + echo "
\n"; + } + echo "
"; + echo " ".$text['header-ring-group-forward']."
"; + if (!$is_included) { + echo " ".$text['description-ring-group-forward']."
"; + } + echo "
"; + echo "
\n"; + + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo th_order_by('ring_group_name', $text['label-name'], $order_by, $order); echo th_order_by('ring_group_extension', $text['label-extension'], $order_by, $order); - echo ""; - echo th_order_by('ring_group_description', $text['label-description'], $order_by, $order); + echo ""; + if (!$is_included) { + echo th_order_by('ring_group_description', $text['label-description'], $order_by, $order); + } echo "\n"; + $c = 0; if ($result_count > 0) { foreach($result as $row) { - $tr_link = "href='".PROJECT_PATH."/app/ring_groups/ring_group_forward_edit.php?id=".$row['ring_group_uuid']."&return_url=".urlencode($_SERVER['PHP_SELF'])."'"; - echo "\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; + $onclick = "onclick=\"document.getElementById('".$row['ring_group_uuid']."').selectedIndex = (document.getElementById('".$row['ring_group_uuid']."').selectedIndex) ? 0 : 1; if (document.getElementById('".$row['ring_group_uuid']."').selectedIndex) { document.getElementById('destination').focus(); }\""; + echo "\n"; + echo " \n"; + echo " \n"; + echo " \n"; + if (!$is_included) { + echo " \n"; + } echo "\n"; - if ($c==0) { $c=1; } else { $c=0; } - } //end foreach + $c = ($c) ? 0 : 1; + } unset($sql, $result, $row_count); - } //end if results + } echo "\n"; echo "
".$text['label-tools']."".$text['label-forwarding']."
".$row['ring_group_name']." ".$row['ring_group_extension']." ".$text['link-call-forward']."".$row['ring_group_description']." 
".$row['ring_group_name']." ".$row['ring_group_extension']." "; + echo " "; + echo ""; + echo "
"; - echo "

"; + echo "
"; - echo "
".$paging_controls."
\n"; + if ($result_count > 0) { + echo "
\n"; + echo "

"; + } - echo ""; + echo ""; + + if (!$is_included) { + echo "
".$paging_controls."
\n"; + echo "

"; + } //include the footer require_once "resources/footer.php"; diff --git a/app/ring_groups/ring_group_forward_edit.php b/app/ring_groups/ring_group_forward_edit.php deleted file mode 100644 index 8fbfee03de..0000000000 --- a/app/ring_groups/ring_group_forward_edit.php +++ /dev/null @@ -1,175 +0,0 @@ - - Portions created by the Initial Developer are Copyright (C) 2013 - the Initial Developer. All Rights Reserved. - - Contributor(s): - Mark J Crane -*/ -require_once "root.php"; -require_once "resources/require.php"; -require_once "resources/check_auth.php"; - -//check permissions - if (permission_exists('ring_group_add') || permission_exists('ring_group_edit') || permission_exists('ring_group_forward')) { - //access granted - } - else { - echo "access denied"; - exit; - } - -//add multi-lingual support - $language = new text; - $text = $language->get(); - -//show the header - require_once "resources/header.php"; - //$document['title-ring_groups'] = $text['title-ring_group_forward']; - -//get the hunt_group_uuid - $ring_group_uuid = check_str($_REQUEST["id"]); - -//process the HTTP post - if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { - //get http post variables and set them to php variables - if (count($_POST)>0) { - $ring_group_forward_enabled = check_str($_POST["ring_group_forward_enabled"]); - $ring_group_forward_destination = check_str($_POST["ring_group_forward_destination"]); - if (strlen($ring_group_forward_destination) > 0) { - $ring_group_forward_destination = preg_replace("~[^0-9]~", "",$ring_group_forward_destination); - } - } - - //check for all required data - //if (strlen($ring_group_forward_enabled) == 0) { $msg .= $text['message-required'].$text['label-call_forward']."
\n"; } - //if (strlen($ring_group_forward_destination) == 0) { $msg .= $text['message-required'].$text['label-number']."
\n"; } - if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { - require_once "resources/header.php"; - require_once "resources/persist_form_var.php"; - echo "
\n"; - echo "
\n"; - echo $msg."
"; - echo "
\n"; - persistformvar($_POST); - echo "
\n"; - require_once "resources/footer.php"; - return; - } - - //update the ring group - $sql = "update v_ring_groups set "; - $sql .= "ring_group_forward_enabled = '$ring_group_forward_enabled', "; - $sql .= "ring_group_forward_destination = '$ring_group_forward_destination' "; - $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; - $sql .= "and ring_group_uuid = '$ring_group_uuid' "; - $db->exec(check_sql($sql)); - unset($sql); - - //redirect the user - $_SESSION["message"] = $text['message-update']; - header("Location: ".$_REQUEST['return_url']); - return; - } //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) - -//pre-populate the form - if (count($_GET) > 0 && $_POST["persistformvar"] != "true") { - $ring_group_uuid = $_GET["id"]; - $sql = "select * from v_ring_groups "; - $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; - $sql .= "and ring_group_uuid = '$ring_group_uuid' "; - $prep_statement = $db->prepare(check_sql($sql)); - $prep_statement->execute(); - $result = $prep_statement->fetchAll(); - foreach ($result as &$row) { - $ring_group_name = $row["ring_group_name"]; - $ring_group_extension = $row["ring_group_extension"]; - $ring_group_forward_enabled = $row["ring_group_forward_enabled"]; - $ring_group_forward_destination = $row["ring_group_forward_destination"]; - $ring_group_description = $row["ring_group_description"]; - } - unset ($prep_statement); - } - -//show the content - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo " \n"; - echo " \n"; - echo " "; - echo "
\n"; - echo " ".$text['header-ring-group-forward']."\n"; - echo "\n"; - echo " \n"; - echo " \n"; - echo "
\n"; - echo " ".$text['description-ring-group-forward']." ".$ring_group_extension."

\n"; - echo "
\n"; - echo " ".$text['label-call-forward']."\n"; - echo "\n"; - if ($ring_group_forward_enabled == "true") { - echo " ".$text['option-enabled']." \n"; - } - else { - echo " ".$text['option-enabled']." \n"; - } - if ($ring_group_forward_enabled == "false" || $ring_group_forward_enabled == "") { - echo " ".$text['option-disabled']." \n"; - } - else { - echo " ".$text['option-disabled']." \n"; - } - echo "
\n"; - echo "
\n"; - echo "
\n"; - echo " ".$text['label-forward_destination']."\n"; - echo "\n"; - echo " \n"; - echo "
\n"; - echo "
\n"; - echo " \n"; - echo "
"; - echo " \n"; - echo "
"; - echo "

"; - echo "
"; - -//show the footer - require_once "resources/footer.php"; -?> \ No newline at end of file diff --git a/app/ring_groups/ring_groups.php b/app/ring_groups/ring_groups.php index 425685dca0..5a11b156be 100644 --- a/app/ring_groups/ring_groups.php +++ b/app/ring_groups/ring_groups.php @@ -114,10 +114,9 @@ require_once "resources/paging.php"; echo "
".$text['label-tools'].""; if (permission_exists('ring_group_add')) { @@ -141,10 +140,9 @@ require_once "resources/paging.php"; } echo " ".$row['ring_group_extension']." ".$text['option-'.$row['ring_group_strategy']]." ".(($row['ring_group_forward_enabled'] == 'true') ? format_phone($row['ring_group_forward_destination']) : null)." ".$text['label-'.$row['ring_group_enabled']]." ".$row['ring_group_description']." "; if (permission_exists('ring_group_edit')) { diff --git a/core/user_settings/app_languages.php b/core/user_settings/app_languages.php index bef984dd46..5b6c2d2674 100644 --- a/core/user_settings/app_languages.php +++ b/core/user_settings/app_languages.php @@ -1078,17 +1078,6 @@ $text['header-user_dashboard']['ro'] = "Panou control utilizator"; $text['header-user_dashboard']['fa'] = ""; $text['header-user_dashboard']['ar-eg'] = "الصفحه الرئيسيه للمستخدم"; -$text['header-ring_groups']['en-us'] = "Ring Groups"; -$text['header-ring_groups']['es-cl'] = "Grupo de llamado"; -$text['header-ring_groups']['fr-fr'] = "Groupes de Sonnerie"; -$text['header-ring_groups']['pt-pt'] = "Grupos"; -$text['header-ring_groups']['pt-br'] = "Configurações da Conta"; -$text['header-ring_groups']['pl'] = "Grupy odbiorców rozmów"; -$text['header-ring_groups']['sv-se'] = "Ringgrupper"; -$text['header-ring_groups']['uk'] = "Групи"; -$text['header-ring_groups']['de-at'] = "Rufgruppen"; -$text['header-ring_groups']['he'] = "קבוצות חיוג"; - $text['header-call_routing']['en-us'] = "Call Routing"; $text['header-call_routing']['es-cl'] = "Enrutamiento de Llamadas"; $text['header-call_routing']['pt-pt'] = "Roteamento de Chamadas"; @@ -1293,4 +1282,4 @@ $text['button-view_all']['ro'] = ""; $text['button-view_all']['de-at'] = "Alle anzeigen"; $text['button-view_all']['he'] = "הצג הכל"; -?> \ No newline at end of file +?> \ No newline at end of file diff --git a/core/user_settings/user_dashboard.php b/core/user_settings/user_dashboard.php index fb3772f9be..8a1ebbe938 100644 --- a/core/user_settings/user_dashboard.php +++ b/core/user_settings/user_dashboard.php @@ -1186,7 +1186,7 @@ if (!is_array($selected_blocks) || in_array('routing', $selected_blocks) || in_a if (file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/calls/calls.php")) { if (permission_exists('follow_me') || permission_exists('call_forward') || permission_exists('do_not_disturb')) { $is_included = "true"; - echo "
\n"; + echo "
\n"; echo "
\n"; echo "
".$text['header-call_routing']."

\n"; require_once "app/calls/calls.php"; @@ -1196,7 +1196,6 @@ if (!is_array($selected_blocks) || in_array('routing', $selected_blocks) || in_a } if (!is_array($selected_blocks) || in_array('ring_groups', $selected_blocks)) { - //reload language values $language = new text; $text = $language->get(); @@ -1205,11 +1204,9 @@ if (!is_array($selected_blocks) || in_array('routing', $selected_blocks) || in_a if (file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/ring_groups/ring_group_forward.php")) { if (permission_exists('ring_group_forward')) { $is_included = "true"; - echo "
\n"; - echo "
\n"; - echo "
".$text['header-ring_groups']."

\n"; + echo "
\n"; require_once "app/ring_groups/ring_group_forward.php"; - echo "
\n"; + echo "
"; } } } diff --git a/themes/default/template.php b/themes/default/template.php index c0c117b245..a5c82687df 100644 --- a/themes/default/template.php +++ b/themes/default/template.php @@ -625,7 +625,6 @@ input.btn, input.button { font-family: Candara, Calibri, Segoe, "Segoe UI", Optima, Arial, sans-serif; padding: 3px 8px 4px 8px; - margin-top: -1px; color: #fff; font-weight: bold; cursor: pointer; @@ -643,6 +642,8 @@ text-shadow: 0px 0px 1px rgba(0, 0, 0, 0.85); opacity: 0.9; -moz-opacity: 0.9; + height: 27px; + margin: 1px; } input.btn:hover, input.button:hover, img.list_control_icon:hover, @@ -662,8 +663,9 @@ font-size: 12px; color: #000; text-align: left; + height: 27px; padding: 4px 6px; - margin: 0 1px 1px 0; + margin: 1px; border: 1px solid #c0c0c0; background-color: #fff; box-shadow: 0 0 3px #cddaf0 inset; @@ -690,6 +692,7 @@ select.formfld { height: 27px; padding: 4px; + margin: 1px; } .formfld_highlight_bad { @@ -706,10 +709,6 @@ box-shadow: 0 0 3px #2fb22f inset; } - input.txt { - width: 98.75%; - } - /* removes spinners (increment/decrement controls) inside input fields */ input[type=number] { -moz-appearance: textfield; } ::-webkit-inner-spin-button { -webkit-appearance: none; } @@ -881,7 +880,8 @@ } .row_style_slim { - padding: 0; + padding-top: 0; + padding-bottom: 0; white-space: nowrap; }