Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes for PHP 7.3. Tested on running system. #73

Open
wants to merge 7 commits into
base: release/14.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions Endpointman.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ function get_phone_info($mac_id=NULL) {

//$res = sql($sql);
$res = sql($sql, 'getAll', DB_FETCHMODE_ASSOC);
if (count($res)) {
if (count(array($res))) {
//Returns Brand Name, Brand Directory, Model Name, Mac Address, Extension (FreePBX), Custom Configuration Template, Custom Configuration Data, Product Name, Product ID, Product Configuration Directory, Product Configuration Version, Product XML name,
$sql = "SELECT endpointman_mac_list.specific_settings, endpointman_mac_list.config_files_override, endpointman_mac_list.global_user_cfg_data, endpointman_model_list.id as model_id, endpointman_brand_list.id as brand_id, endpointman_brand_list.name, endpointman_brand_list.directory, endpointman_model_list.model, endpointman_mac_list.mac, endpointman_mac_list.template_id, endpointman_mac_list.global_custom_cfg_data, endpointman_product_list.long_name, endpointman_product_list.id as product_id, endpointman_product_list.cfg_dir, endpointman_product_list.cfg_ver, endpointman_model_list.template_data, endpointman_model_list.enabled, endpointman_mac_list.global_settings_override FROM endpointman_line_list, endpointman_mac_list, endpointman_model_list, endpointman_brand_list, endpointman_product_list WHERE endpointman_mac_list.model = endpointman_model_list.id AND endpointman_brand_list.id = endpointman_model_list.brand AND endpointman_product_list.id = endpointman_model_list.product_id AND endpointman_mac_list.id = endpointman_line_list.mac_id AND endpointman_mac_list.id = " . $mac_id;
$phone_info = sql($sql, 'getRow', DB_FETCHMODE_ASSOC);
Expand Down Expand Up @@ -1100,7 +1100,7 @@ function get_brand_from_mac($mac) {
$brand = sql($oui_sql, 'getRow', DB_FETCHMODE_ASSOC);

$res = sql($oui_sql);
$brand_count = count($res);
$brand_count = count(array($res));

if (!$brand_count) {
//oui doesn't have a matching mysql reference, probably a PC/router/wap/printer of some sort.
Expand Down Expand Up @@ -1207,7 +1207,7 @@ function prepare_configs($phone_info, $reboot=TRUE, $write=TRUE)
$sql = "SELECT original_name,data FROM endpointman_custom_configs WHERE id = " . $list;
//$res = sql($sql);
$res = sql($sql, 'getAll', DB_FETCHMODE_ASSOC);
if (count($res)) {
if (count(array($res))) {
$data = sql($sql, 'getRow', DB_FETCHMODE_ASSOC);
$provisioner_lib->config_files_override[$data['original_name']] = $data['data'];
}
Expand All @@ -1222,7 +1222,7 @@ function prepare_configs($phone_info, $reboot=TRUE, $write=TRUE)
$sql = "SELECT original_name,data FROM endpointman_custom_configs WHERE id = " . $list;
//$res = sql($sql);
$res = sql($sql, 'getAll', DB_FETCHMODE_ASSOC);
if (count($res)) {
if (count(array($res))) {
$data = sql($sql, 'getRow', DB_FETCHMODE_ASSOC);
$provisioner_lib->config_files_override[$data['original_name']] = $data['data'];
}
Expand Down Expand Up @@ -1773,7 +1773,7 @@ function discover_new($netmask, $use_nmap=TRUE) {
$brand = $this->eda->sql($oui_sql, 'getRow', DB_FETCHMODE_ASSOC);

$res = $this->eda->sql($oui_sql);
$brand_count = count($res);
$brand_count = count(array($res));

if (!$brand_count) {
//oui doesn't have a matching mysql reference, probably a PC/router/wap/printer of some sort.
Expand All @@ -1787,7 +1787,7 @@ function discover_new($netmask, $use_nmap=TRUE) {

$res = $this->eda->sql($epm_sql);

$epm = count($res) ? TRUE : FALSE;
$epm = count(array($res)) ? TRUE : FALSE;

//Add into a final array
$final[$z] = array("ip" => $ip, "mac" => $mac, "mac_strip" => $mac_strip, "oui" => $oui, "brand" => $brand['name'], "brand_id" => $brand['id'], "endpoint_managed" => $epm);
Expand Down Expand Up @@ -2059,9 +2059,9 @@ function save_template($id, $custom, $variables) {
while ($i < count($config_files)) {
$config_files[$i] = str_replace(".", "_", $config_files[$i]);

if (isset($variables[config_files][$i])) {
if (isset($variables['config_files'][$i])) {

$variables[$config_files[$i]] = explode("_", $variables[config_files][$i], 2);
$variables[$config_files[$i]] = explode("_", $variables['config_files'][$i], 2);

$variables[$config_files[$i]] = $variables[$config_files[$i]][0];
if ($variables[$config_files[$i]] > 0) {
Expand Down
6 changes: 3 additions & 3 deletions Endpointman_Advanced.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,7 @@ public function epm_advanced_iedl_import()
//$res = sql($sql);
$res = sql($sql, 'getAll', DB_FETCHMODE_ASSOC);

if (count($res) > 0) {
if (count(array($res)) > 0) {
$brand_id = sql($sql, 'getOne');
// $brand_id = $brand_id[0];

Expand All @@ -1181,12 +1181,12 @@ public function epm_advanced_iedl_import()
$line_id = isset($device[4]) ? $device[4] : 1;

$res_model = sql($sql_model);
if (count($res_model)) {
if (count(array($res_model))) {
$model_id = sql($sql_model, 'getRow', DB_FETCHMODE_ASSOC);
$model_id = $model_id['id'];

$res_ext = sql($sql_ext);
if (count($res_ext)) {
if (count(array($res_ext))) {
$ext = sql($sql_ext, 'getRow', DB_FETCHMODE_ASSOC);
$description = $ext['name'];
$ext = $ext['extension'];
Expand Down
6 changes: 3 additions & 3 deletions Endpointman_Config.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ public function epm_config_manager_hardware_get_list_all_hide_show()
$row_out[$i]['installed'] = $row['installed'];
$row_out[$i]['hidden'] = $row['hidden'];
$row_out[$i]['count'] = $i;
$row_out[$i]['products'] = "";
$row_out[$i]['products'] = array();
if ($row['hidden'] == 1)
{
$i++;
Expand All @@ -423,7 +423,7 @@ public function epm_config_manager_hardware_get_list_all_hide_show()
$row_out[$i]['products'][$j]['short_name'] = $row2['short_name'];
$row_out[$i]['products'][$j]['hidden'] = $row2['hidden'];
$row_out[$i]['products'][$j]['count'] = $j;
$row_out[$i]['products'][$j]['models'] = "";
$row_out[$i]['products'][$j]['models'] = array();
if ($row2['hidden'] == 1)
{
$j++;
Expand Down Expand Up @@ -1528,7 +1528,7 @@ function firmware_local_check($id=NULL) {
$sql = "SELECT * FROM endpointman_product_list WHERE hidden = 0 AND id ='" . $id . "'";
$res = sql($sql, 'getAll', DB_FETCHMODE_ASSOC);

if (count($res) > 0) {
if (count(array($res)) > 0) {
$row = sql($sql, 'getRow', DB_FETCHMODE_ASSOC);

$sql = "SELECT directory FROM endpointman_brand_list WHERE hidden = 0 AND id ='" . $row['brand'] . "'";
Expand Down
2 changes: 1 addition & 1 deletion Endpointman_Templates.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ function edit_template_display_files($id, $custom, $namefile = "")
$sql = "SELECT * FROM endpointman_custom_configs WHERE product_id = '" . $row['product_id'] . "' AND original_name = '" . $files . "'";
$alt_configs_list = sql($sql, 'getAll', DB_FETCHMODE_ASSOC );

if ( count($alt_configs_list) > 0)
if ( count(array($alt_configs_list)) > 0)
{
$files = str_replace(".", "_", $files);
foreach ($alt_configs_list as $ccf)
Expand Down
2 changes: 1 addition & 1 deletion ari/modules/phonesettings.module
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class phonesettings {
$sql = "SELECT mac_id, line FROM endpointman_line_list WHERE ext = '".$_SESSION['ari_user']['extension']."' ";

$res = $endpoint->eda->sql($sql);
if(count($res)) {
if(count(array($res))) {

$mac_row = $endpoint->eda->sql($sql, 'getrow', DB_FETCHMODE_ASSOC);

Expand Down
41 changes: 41 additions & 0 deletions assets/js/default.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*!
* Bootstrap-select v1.11.2 (http://silviomoreto.github.io/bootstrap-select)
*
* Copyright 2013-2016 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/

(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module unless amdModuleId is set
define(["jquery"], function (a0) {
return (factory(a0));
});
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require("jquery"));
} else {
factory(jQuery);
}
}(this, function (jQuery) {

(function ($) {
$.fn.selectpicker.defaults = {
noneSelectedText: 'No selection',
noneResultsText: 'No results {0}',
countSelectedText: function (numSelected, numTotal) {
return (numSelected == 1) ? "{0} selected item" : "{0} selected items";
},
maxOptionsText: function (numAll, numGroup) {
return [
(numAll == 1) ? 'Límit reached ({n} max item)' : 'Límit reached ({n} max items)',
(numGroup == 1) ? 'Group limit reached ({n} max item)' : 'Group limit reached ({n} max items)'
];
},
selectAllText: 'Select All',
deselectAllText: 'Deselect All',
multipleSeparator: ', '
};
})(jQuery);