mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Add subtype to vendor functions and device keys. (#6409)
* Add subtype to vendor functions and device keys. Added to support phones that require a subtype for provisioning the phone. * Add device_key_subtype * Update device_edit.php * Update device_profile_edit.php * Update device_vendor_edit.php * Update device_vendor_function_edit.php * Update device_vendor_functions.php * Update device_vendor_restore.php * Update index.php * Update provision.php * Update app_languages.php * Update app_config.php
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -200,6 +200,7 @@ if ($domains_processed == 1) {
|
||||
$array['device_vendors'][$x]['device_vendor_uuid'] = $device_vendor_uuid;
|
||||
$array['device_vendors'][$x]['name'] = $vendor['name'];
|
||||
$array['device_vendors'][$x]['enabled'] = 'true';
|
||||
$array['device_vendors'][$x]['description'] = $vendor['description'];
|
||||
|
||||
//add the vendor functions
|
||||
if (is_array($vendor['functions']) && @sizeof($vendor['functions'])) {
|
||||
@@ -209,7 +210,8 @@ if ($domains_processed == 1) {
|
||||
$device_vendor_function_uuid = uuid();
|
||||
$array['device_vendor_functions'][$y]['device_vendor_uuid'] = $device_vendor_uuid;
|
||||
$array['device_vendor_functions'][$y]['device_vendor_function_uuid'] = $device_vendor_function_uuid;
|
||||
$array['device_vendor_functions'][$y]['name'] = $function['name'];
|
||||
$array['device_vendor_functions'][$y]['type'] = $function['type'];
|
||||
$array['device_vendor_functions'][$y]['subtype'] = $function['subtype'];
|
||||
$array['device_vendor_functions'][$y]['value'] = $function['value'];
|
||||
$array['device_vendor_functions'][$y]['enabled'] = 'true';
|
||||
$array['device_vendor_functions'][$y]['description'] = $function['description'];
|
||||
|
||||
@@ -2964,6 +2964,27 @@ $text['label-device_key_type']['ru-ru'] = "Тип";
|
||||
$text['label-device_key_type']['sv-se'] = "Typ";
|
||||
$text['label-device_key_type']['uk-ua'] = "";
|
||||
|
||||
$text['label-device_key_subtype']['en-us'] = "Subtype";
|
||||
$text['label-device_key_subtype']['en-gb'] = "Subtype";
|
||||
$text['label-device_key_subtype']['ar-eg'] = "";
|
||||
$text['label-device_key_subtype']['de-at'] = "Typ"; //copied from de-de
|
||||
$text['label-device_key_subtype']['de-ch'] = "Typ"; //copied from de-de
|
||||
$text['label-device_key_subtype']['de-de'] = "Typ";
|
||||
$text['label-device_key_subtype']['es-cl'] = "Tipo";
|
||||
$text['label-device_key_subtype']['es-mx'] = "Tipo"; //copied from es-cl
|
||||
$text['label-device_key_subtype']['fr-ca'] = "Type"; //copied from fr-fr
|
||||
$text['label-device_key_subtype']['fr-fr'] = "Type";
|
||||
$text['label-device_key_subtype']['he-il'] = "סוג";
|
||||
$text['label-device_key_subtype']['it-it'] = "Tipo";
|
||||
$text['label-device_key_subtype']['nl-nl'] = "Type";
|
||||
$text['label-device_key_subtype']['pl-pl'] = "Typ";
|
||||
$text['label-device_key_subtype']['pt-br'] = "Tipo"; //copied from pt-pt
|
||||
$text['label-device_key_subtype']['pt-pt'] = "Tipo";
|
||||
$text['label-device_key_subtype']['ro-ro'] = "";
|
||||
$text['label-device_key_subtype']['ru-ru'] = "Тип";
|
||||
$text['label-device_key_subtype']['sv-se'] = "Typ";
|
||||
$text['label-device_key_subtype']['uk-ua'] = "";
|
||||
|
||||
$text['label-device_key_line']['en-us'] = "Line";
|
||||
$text['label-device_key_line']['en-gb'] = "Line";
|
||||
$text['label-device_key_line']['ar-eg'] = "";
|
||||
|
||||
@@ -145,6 +145,7 @@
|
||||
//$device_key_category = $_POST["device_key_category"];
|
||||
//$device_key_id = $_POST["device_key_id"];
|
||||
//$device_key_type = $_POST["device_key_type"];
|
||||
//$device_key_subtype = $_POST["device_key_subtype"];
|
||||
//$device_key_line = $_POST["device_key_line"];
|
||||
//$device_key_value = $_POST["device_key_value"];
|
||||
//$device_key_extension = $_POST["device_key_extension"];
|
||||
@@ -389,6 +390,9 @@
|
||||
$array['devices'][0]['device_keys'][$y]['device_key_id'] = $row["device_key_id"];
|
||||
}
|
||||
$array['devices'][0]['device_keys'][$y]['device_key_type'] = $row["device_key_type"];
|
||||
if (isset($row["device_key_subtype"])) {
|
||||
$array['devices'][0]['device_keys'][$y]['device_key_subtype'] = $row["device_key_subtype"];
|
||||
}
|
||||
if (permission_exists('device_key_line')) {
|
||||
$array['devices'][0]['device_keys'][$y]['device_key_line'] = $row["device_key_line"];
|
||||
}
|
||||
@@ -609,6 +613,7 @@
|
||||
$device_keys[$x]['device_key_category'] = '';
|
||||
$device_keys[$x]['device_key_id'] = '';
|
||||
$device_keys[$x]['device_key_type'] = '';
|
||||
$device_kesy[$x]['device_key_subtype'] = '';
|
||||
$device_keys[$x]['device_key_line'] = '';
|
||||
$device_keys[$x]['device_key_value'] = '';
|
||||
$device_keys[$x]['device_key_extension'] = '';
|
||||
@@ -625,12 +630,12 @@
|
||||
unset($sql);
|
||||
|
||||
//get the vendor functions
|
||||
$sql = "select v.name as vendor_name, f.name, f.value ";
|
||||
$sql = "select v.name as vendor_name, f.type, f.subtype, f.value ";
|
||||
$sql .= "from v_device_vendors as v, v_device_vendor_functions as f ";
|
||||
$sql .= "where v.device_vendor_uuid = f.device_vendor_uuid ";
|
||||
$sql .= "and v.enabled = 'true' ";
|
||||
$sql .= "and f.enabled = 'true' ";
|
||||
$sql .= "order by v.name asc, f.name asc ";
|
||||
$sql .= "order by v.name asc, f.type asc ";
|
||||
$database = new database;
|
||||
$vendor_functions = $database->select($sql, null, 'all');
|
||||
unset($sql);
|
||||
@@ -1332,6 +1337,14 @@
|
||||
}
|
||||
|
||||
if (permission_exists('device_key_edit')) {
|
||||
|
||||
//determine whether to show the key_subtype
|
||||
$show_key_subtype = false;
|
||||
if ($device_vendor == 'fanvil') {
|
||||
$show_key_subtype = true;
|
||||
}
|
||||
|
||||
//set the previous_vendor and vendor_count
|
||||
$vendor_count = 0;
|
||||
foreach($device_keys as $row) {
|
||||
if ($previous_vendor != $row['device_key_vendor']) {
|
||||
@@ -1340,6 +1353,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
//show the device keys html form
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell' valign='top'>".$text['label-keys']."</td>";
|
||||
echo " <td class='vtable' align='left'>";
|
||||
@@ -1351,6 +1365,9 @@
|
||||
echo " <td class='vtable'>".$text['label-device_key_id']."</td>\n";
|
||||
}
|
||||
echo " <td class='vtable'>".$text['label-device_key_type']."</td>\n";
|
||||
if ($show_key_subtype) {
|
||||
echo " <td class='vtable'>".$text['label-device_key_subtype']."</td>\n";
|
||||
}
|
||||
if (permission_exists('device_key_line')) {
|
||||
echo " <td class='vtable'>".$text['label-device_key_line']."</td>\n";
|
||||
}
|
||||
@@ -1382,8 +1399,15 @@
|
||||
}
|
||||
if ($vendor_count > 1 && strlen($row['device_key_vendor']) > 0) {
|
||||
echo " <td class='vtable'>".ucwords($row['device_key_vendor'])."</td>\n";
|
||||
} else {
|
||||
if ($show_key_subtype) {
|
||||
echo " <td class='vtable'>".$text['label-device_key_subtype']."</td>\n";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo " <td class='vtable'>".$text['label-device_key_type']."</td>\n";
|
||||
if ($show_key_subtype) {
|
||||
echo " <td class='vtable'>".$text['label-device_key_subtype']."</td>\n";
|
||||
}
|
||||
}
|
||||
if (permission_exists('device_key_line')) {
|
||||
echo " <td class='vtable'>".$text['label-device_key_line']."</td>\n";
|
||||
@@ -1570,10 +1594,10 @@
|
||||
$selected = "selected='selected'";
|
||||
}
|
||||
if (strlen($row['device_key_vendor']) == 0) {
|
||||
echo " <option value='".$function['value']."' vendor='".$function['vendor_name']."' $selected >".$text['label-'.$function['name']]."</option>\n";
|
||||
echo " <option value='".$function['value']."' vendor='".$function['vendor_name']."' $selected >".$text['label-'.$function['type']]."</option>\n";
|
||||
}
|
||||
if (strlen($row['device_key_vendor']) > 0 && strtolower($row['device_key_vendor']) == $function['vendor_name']) {
|
||||
echo " <option value='".$function['value']."' vendor='".$function['vendor_name']."' $selected >".$text['label-'.$function['name']]."</option>\n";
|
||||
echo " <option value='".$function['value']."' vendor='".$function['vendor_name']."' $selected >".$text['label-'.$function['type']]."</option>\n";
|
||||
}
|
||||
$previous_vendor = $function['vendor_name'];
|
||||
$i++;
|
||||
@@ -1583,6 +1607,11 @@
|
||||
}
|
||||
echo "</select>\n";
|
||||
echo "</td>\n";
|
||||
|
||||
echo "<td align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='device_keys[".$x."][device_key_subtype]' style='width: 120px;' maxlength='255' value=\"".escape($row['device_key_subtype'])."\"/>\n";
|
||||
echo "</td>\n";
|
||||
|
||||
if (permission_exists('device_key_line')) {
|
||||
echo "<td valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " <select class='formfld' name='device_keys[".$x."][device_key_line]'>\n";
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Copyright (C) 2020 All Rights Reserved.
|
||||
Copyright (C) 2020 - 2022 All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
@@ -154,6 +154,9 @@
|
||||
$array['device_profiles'][0]['device_profile_keys'][$y]["profile_key_id"] = $row["profile_key_id"];
|
||||
$array['device_profiles'][0]['device_profile_keys'][$y]["profile_key_vendor"] = $row["profile_key_vendor"];
|
||||
$array['device_profiles'][0]['device_profile_keys'][$y]["profile_key_type"] = $row["profile_key_type"];
|
||||
if (isset($row["profile_key_subtype"])) {
|
||||
$array['device_profiles'][0]['device_profile_keys'][$y]["profile_key_subtype"] = $row["profile_key_subtype"];
|
||||
}
|
||||
$array['device_profiles'][0]['device_profile_keys'][$y]["profile_key_line"] = $row["profile_key_line"];
|
||||
$array['device_profiles'][0]['device_profile_keys'][$y]["profile_key_value"] = $row["profile_key_value"];
|
||||
$array['device_profiles'][0]['device_profile_keys'][$y]["profile_key_extension"] = $row["profile_key_extension"];
|
||||
@@ -282,6 +285,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
//determine whether to show the key_subtype
|
||||
$show_key_subtype = false;
|
||||
if (is_array($device_profile_keys) && @sizeof($device_profile_keys) != 0) {
|
||||
foreach($device_profile_keys as $row) {
|
||||
if ($row['profile_key_vendor'] == 'fanvil') {
|
||||
$show_key_subtype = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//get the vendors
|
||||
$sql = "select * ";
|
||||
$sql .= "from v_device_vendors as v ";
|
||||
@@ -292,7 +305,7 @@
|
||||
unset($sql);
|
||||
|
||||
//get the vendor functions
|
||||
$sql = "select v.name as vendor_name, f.name, f.value ";
|
||||
$sql = "select v.name as vendor_name, f.type, f.subtype, f.value ";
|
||||
$sql .= "from v_device_vendors as v, v_device_vendor_functions as f ";
|
||||
$sql .= "where v.device_vendor_uuid = f.device_vendor_uuid ";
|
||||
$sql .= "and v.enabled = 'true' ";
|
||||
@@ -324,6 +337,7 @@
|
||||
$device_profile_keys[$id]['profile_key_id'] = '';
|
||||
$device_profile_keys[$id]['profile_key_vendor'] = '';
|
||||
$device_profile_keys[$id]['profile_key_type'] = '';
|
||||
$device_profile_keys[$id]['profile_key_subtype'] = '';
|
||||
$device_profile_keys[$id]['profile_key_line'] = '';
|
||||
$device_profile_keys[$id]['profile_key_value'] = '';
|
||||
$device_profile_keys[$id]['profile_key_extension'] = '';
|
||||
@@ -441,6 +455,9 @@
|
||||
echo " <th class='vtablereq'>".$text['label-device_key_id']."</th>\n";
|
||||
echo " <th class='vtablereq'>".$text['label-device_key_vendor']."</th>\n";
|
||||
echo " <th class='vtablereq'>".$text['label-device_key_type']."</th>\n";
|
||||
if ($show_key_subtype) {
|
||||
echo " <th class='vtablereq'>".$text['label-device_key_subtype']."</th>\n";
|
||||
}
|
||||
echo " <th class='vtablereq'>".$text['label-device_key_line']."</th>\n";
|
||||
echo " <td class='vtable'>".$text['label-device_key_value']."</td>\n";
|
||||
if (permission_exists('device_key_extension')) {
|
||||
@@ -482,6 +499,9 @@
|
||||
echo " <th class='vtablereq'>".$text['label-device_key_id']."</td>\n";
|
||||
echo " <th class='vtablereq'>".$text['label-device_vendor']."</td>\n";
|
||||
echo " <th class='vtablereq'>".$text['label-device_key_type']."</td>\n";
|
||||
if ($show_key_subtype) {
|
||||
echo " <th class='vtable'>".$text['label-device_key_subtype']."</th>\n";
|
||||
}
|
||||
echo " <th class='vtablereq'>".$text['label-device_key_line']."</td>\n";
|
||||
echo " <td class='vtable'>".$text['label-device_key_value']."</td>\n";
|
||||
if (permission_exists('device_key_extension')) {
|
||||
@@ -566,7 +586,6 @@
|
||||
echo " </td>\n";
|
||||
echo " <td class='formfld'>\n";
|
||||
//echo " <input class='formfld' type='text' name='device_profile_keys[$x][profile_key_type]' maxlength='255' value=\"".escape($row["profile_key_type"])."\">\n";
|
||||
|
||||
echo " <select class='formfld' name='device_profile_keys[".$x."][profile_key_type]' id='key_type_".$x."'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
$previous_vendor = '';
|
||||
@@ -581,10 +600,10 @@
|
||||
$selected = "selected='selected'";
|
||||
}
|
||||
if (strlen($row['profile_key_vendor']) == 0) {
|
||||
echo " <option value='".escape($function['value'])."' vendor='".escape($function['vendor_name'])."' $selected >".$text['label-'.$function['name']]."</option>\n";
|
||||
echo " <option value='".escape($function['value'])."' vendor='".escape($function['vendor_name'])."' $selected >".$text['label-'.$function['type']]."</option>\n";
|
||||
}
|
||||
if (strlen($row['profile_key_vendor']) > 0 && $row['profile_key_vendor'] == $function['vendor_name']) {
|
||||
echo " <option value='".escape($function['value'])."' vendor='".escape($function['vendor_name'])."' $selected >".$text['label-'.$function['name']]."</option>\n";
|
||||
echo " <option value='".escape($function['value'])."' vendor='".escape($function['vendor_name'])."' $selected >".$text['label-'.$function['type']]."</option>\n";
|
||||
}
|
||||
$previous_vendor = $function['vendor_name'];
|
||||
$i++;
|
||||
@@ -593,8 +612,14 @@
|
||||
echo " </optgroup>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
|
||||
echo " </td>\n";
|
||||
|
||||
if ($show_key_subtype) {
|
||||
echo " <td align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='device_profile_keys[".$x."][profile_key_subtype]' style='width: 120px;' maxlength='255' value=\"".escape($row['profile_key_subtype'])."\"/>\n";
|
||||
echo " </td>\n";
|
||||
}
|
||||
|
||||
echo " <td class='formfld'>\n";
|
||||
echo " <select class='formfld' name='device_profile_keys[$x][profile_key_line]'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2016-2020
|
||||
Portions created by the Initial Developer are Copyright (C) 2016-2022
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -55,14 +55,14 @@
|
||||
}
|
||||
|
||||
//get http post variables and set them to php variables
|
||||
if (count($_POST)>0) {
|
||||
if (count($_POST) > 0) {
|
||||
$name = $_POST["name"];
|
||||
$enabled = $_POST["enabled"] ?: 'false';
|
||||
$description = $_POST["description"];
|
||||
}
|
||||
|
||||
//process the data
|
||||
if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
//get the uuid
|
||||
if ($action == "update") {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2016-2020
|
||||
Portions created by the Initial Developer are Copyright (C) 2016-2022
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -89,7 +89,8 @@
|
||||
//get http post variables and set them to php variables
|
||||
if (count($_POST)>0) {
|
||||
//$label = $_POST["label"];
|
||||
$name = $_POST["name"];
|
||||
$type = $_POST["type"];
|
||||
$subtype = $_POST["subtype"];
|
||||
$value = $_POST["value"];
|
||||
$enabled = $_POST["enabled"];
|
||||
$description = $_POST["description"];
|
||||
@@ -114,7 +115,7 @@
|
||||
//check for all required data
|
||||
$msg = '';
|
||||
//if (strlen($label) == 0) { $msg .= $text['message-required']." ".$text['label-label']."<br>\n"; }
|
||||
if (strlen($name) == 0) { $msg .= $text['message-required']." ".$text['label-name']."<br>\n"; }
|
||||
if (strlen($type) == 0) { $msg .= $text['message-required']." ".$text['label-type']."<br>\n"; }
|
||||
if (strlen($value) == 0) { $msg .= $text['message-required']." ".$text['label-value']."<br>\n"; }
|
||||
if (strlen($enabled) == 0) { $msg .= $text['message-required']." ".$text['label-enabled']."<br>\n"; }
|
||||
//if (strlen($description) == 0) { $msg .= $text['message-required']." ".$text['label-description']."<br>\n"; }
|
||||
@@ -149,7 +150,8 @@
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
$array['device_vendor_functions'][0]['device_vendor_uuid'] = $device_vendor_uuid;
|
||||
//$array['device_vendor_functions'][0]['label'] = $label;
|
||||
$array['device_vendor_functions'][0]['name'] = $name;
|
||||
$array['device_vendor_functions'][0]['type'] = $type;
|
||||
$array['device_vendor_functions'][0]['subtype'] = $subtype;
|
||||
$array['device_vendor_functions'][0]['value'] = $value;
|
||||
$array['device_vendor_functions'][0]['enabled'] = $enabled;
|
||||
$array['device_vendor_functions'][0]['description'] = $description;
|
||||
@@ -208,7 +210,8 @@
|
||||
$row = $database->select($sql, $parameters, 'row');
|
||||
if (is_array($row) && @sizeof($row) != 0) {
|
||||
//$label = $row["label"];
|
||||
$name = $row["name"];
|
||||
$type = $row["type"];
|
||||
$subtype = $row["subtype"];
|
||||
$value = $row["value"];
|
||||
$enabled = $row["enabled"];
|
||||
$description = $row["description"];
|
||||
@@ -285,12 +288,23 @@
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td width='30%' class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-name']."\n";
|
||||
echo " ".$text['label-type']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td width='70%' class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='name' maxlength='255' value=\"".escape($name)."\">\n";
|
||||
echo " <input class='formfld' type='text' name='type' maxlength='255' value=\"".escape($type)."\">\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-name']."\n";
|
||||
echo $text['description-type']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td width='30%' class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-subtype']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td width='70%' class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='subtype' maxlength='255' value=\"".escape($subtype)."\">\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-subtype']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
@@ -383,4 +397,4 @@
|
||||
//include the footer
|
||||
require_once "resources/footer.php";
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2016-2019
|
||||
Portions created by the Initial Developer are Copyright (C) 2016-2022
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -80,26 +80,23 @@
|
||||
$order_by = $_GET["order_by"];
|
||||
$order = $_GET["order"];
|
||||
|
||||
//add the search term
|
||||
$search = $_GET["search"];
|
||||
if (strlen($search) > 0) {
|
||||
$sql_where = "and (";
|
||||
$sql_where .= "label like :search ";
|
||||
$sql_where .= "or name like :search ";
|
||||
$sql_where .= "or value like :search ";
|
||||
$sql_where .= "or enabled like :search ";
|
||||
$sql_where .= "or description like :search ";
|
||||
$sql_where .= ")";
|
||||
$parameters['search'] = '%'.$search.'%';
|
||||
}
|
||||
|
||||
//prepare to page the results
|
||||
$sql = "select count(*) from v_device_vendor_functions ";
|
||||
$sql .= "where device_vendor_uuid = :device_vendor_uuid ";
|
||||
$sql .= $sql_where;
|
||||
if (isset($_GET["search"])) {
|
||||
$sql .= "and (";
|
||||
$sql .= "label like :search ";
|
||||
$sql .= "or name like :search ";
|
||||
$sql .= "or value like :search ";
|
||||
$sql .= "or enabled like :search ";
|
||||
$sql .= "or description like :search ";
|
||||
$sql .= ")";
|
||||
$parameters['search'] = '%'.$_GET["search"].'%';
|
||||
}
|
||||
$parameters['device_vendor_uuid'] = $device_vendor_uuid;
|
||||
$database = new database;
|
||||
$num_rows = $database->select($sql, $parameters, 'column');
|
||||
unset($sql, $parameters);
|
||||
|
||||
//prepare to page the results
|
||||
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
|
||||
@@ -113,7 +110,19 @@
|
||||
}
|
||||
|
||||
//get the list
|
||||
$sql = str_replace('count(*)', '*', $sql);
|
||||
$sql = "select * from v_device_vendor_functions ";
|
||||
$sql .= "where device_vendor_uuid = :device_vendor_uuid ";
|
||||
if (isset($_GET["search"])) {
|
||||
$sql .= "and (";
|
||||
$sql .= " label like :search ";
|
||||
$sql .= " or name like :search ";
|
||||
$sql .= " or value like :search ";
|
||||
$sql .= " or enabled like :search ";
|
||||
$sql .= " or description like :search ";
|
||||
$sql .= ")";
|
||||
$parameters['search'] = '%'.$_GET["search"].'%';
|
||||
}
|
||||
$parameters['device_vendor_uuid'] = $device_vendor_uuid;
|
||||
$sql .= order_by($order_by, $order, 'name', 'asc');
|
||||
$sql .= limit_offset($rows_per_page, $offset);
|
||||
$database = new database;
|
||||
@@ -163,7 +172,8 @@
|
||||
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle(); checkbox_on_change(this);' ".($vendor_functions ?: "style='visibility: hidden;'").">\n";
|
||||
echo " </th>\n";
|
||||
}
|
||||
echo th_order_by('name', $text['label-name'], $order_by, $order);
|
||||
echo th_order_by('type', $text['label-type'], $order_by, $order);
|
||||
echo th_order_by('subtype', $text['label-subtype'], $order_by, $order);
|
||||
echo th_order_by('value', $text['label-value'], $order_by, $order);
|
||||
echo "<th class='hide-sm-dn'>".$text['label-groups']."</th>\n";
|
||||
echo th_order_by('enabled', $text['label-enabled'], $order_by, $order, null, "class='center'");
|
||||
@@ -176,6 +186,7 @@
|
||||
if (is_array($vendor_functions) && @sizeof($vendor_functions) != 0) {
|
||||
$x = 0;
|
||||
foreach ($vendor_functions as $row) {
|
||||
|
||||
//get the groups that have been assigned to the vendor functions
|
||||
$sql = "select ";
|
||||
$sql .= "fg.*, g.domain_uuid as group_domain_uuid ";
|
||||
@@ -200,6 +211,7 @@
|
||||
}
|
||||
$group_list = isset($group_list) ? implode(', ', $group_list) : '';
|
||||
unset ($vendor_function_groups);
|
||||
|
||||
//show the row of data
|
||||
if (permission_exists('device_vendor_function_edit')) {
|
||||
$list_row_url = "device_vendor_function_edit.php?device_vendor_uuid=".urlencode($row['device_vendor_uuid'])."&id=".urlencode($row['device_vendor_function_uuid']);
|
||||
@@ -211,14 +223,25 @@
|
||||
echo " <input type='hidden' name='vendor_functions[$x][uuid]' value='".escape($row['device_vendor_function_uuid'])."' />\n";
|
||||
echo " </td>\n";
|
||||
}
|
||||
|
||||
echo " <td>\n";
|
||||
if (permission_exists('device_vendor_function_edit')) {
|
||||
echo " <a href='".$list_row_url."' title=\"".$text['button-edit']."\">".escape($row['name'])."</a>\n";
|
||||
echo " <a href='".$list_row_url."' title=\"".$text['button-edit']."\">".escape($row['type'])."</a>\n";
|
||||
}
|
||||
else {
|
||||
echo " ".escape($row['name']);
|
||||
echo " ".escape($row['type']);
|
||||
}
|
||||
echo " </td>\n";
|
||||
|
||||
echo " <td>\n";
|
||||
if (permission_exists('device_vendor_function_edit')) {
|
||||
echo " <a href='".$list_row_url."' title=\"".$text['button-edit']."\">".escape($row['subtype'])."</a>\n";
|
||||
}
|
||||
else {
|
||||
echo " ".escape($row['subtype']);
|
||||
}
|
||||
echo " </td>\n";
|
||||
|
||||
echo " <td>".escape($row['value'])." </td>\n";
|
||||
echo " <td class='hide-sm-dn'>".escape($group_list)." </td>\n";
|
||||
if (permission_exists('device_vendor_function_edit')) {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2016
|
||||
Portions created by the Initial Developer are Copyright (C) 2016 - 2022
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -103,7 +103,8 @@
|
||||
$array['device_vendors'][$x]['device_vendor_functions'][$y]['device_vendor_uuid'] = $device_vendor_uuid;
|
||||
$array['device_vendors'][$x]['device_vendor_functions'][$y]['device_vendor_function_uuid'] = $device_vendor_function_uuid;
|
||||
//$array['device_vendors'][$x]['device_vendor_functions'][$y]['label'] = $function['label'];
|
||||
$array['device_vendors'][$x]['device_vendor_functions'][$y]['name'] = $function['name'];
|
||||
$array['device_vendors'][$x]['device_vendor_functions'][$y]['type'] = $function['type'];
|
||||
$array['device_vendors'][$x]['device_vendor_functions'][$y]['subtype'] = $function['subtype'];
|
||||
$array['device_vendors'][$x]['device_vendor_functions'][$y]['value'] = $function['value'];
|
||||
$array['device_vendors'][$x]['device_vendor_functions'][$y]['enabled'] = 'true';
|
||||
$array['device_vendors'][$x]['device_vendor_functions'][$y]['description'] = $function['description'];
|
||||
|
||||
@@ -470,7 +470,7 @@
|
||||
}
|
||||
else {
|
||||
$result = simplexml_load_string ($file_contents, 'SimpleXmlElement', LIBXML_NOERROR+LIBXML_ERR_FATAL+LIBXML_ERR_NONE);
|
||||
if (false == $result){
|
||||
if (false == $result) {
|
||||
header("Content-Type: text/plain");
|
||||
header("Content-Length: ".strval(strlen($file_contents)));
|
||||
}
|
||||
|
||||
@@ -696,6 +696,7 @@
|
||||
$sql .= "profile_key_category as device_key_category, ";
|
||||
$sql .= "profile_key_vendor as device_key_vendor, ";
|
||||
$sql .= "profile_key_type as device_key_type, ";
|
||||
$sql .= "profile_key_subtype as device_key_subtype, ";
|
||||
$sql .= "profile_key_line as device_key_line, ";
|
||||
$sql .= "profile_key_value as device_key_value, ";
|
||||
$sql .= "profile_key_extension as device_key_extension, ";
|
||||
|
||||
@@ -2731,6 +2731,29 @@ $text['label-type']['sv-se'] = "Typ";
|
||||
$text['label-type']['uk-ua'] = "Тип";
|
||||
$text['label-type']['tr-tr'] = "Tür";
|
||||
|
||||
$text['label-subtype']['en-us'] = "Subtype";
|
||||
$text['label-subtype']['en-gb'] = "Subtype";
|
||||
$text['label-subtype']['ar-eg'] = "";
|
||||
$text['label-subtype']['de-at'] = "Typ"; //copied from de-de
|
||||
$text['label-subtype']['de-ch'] = "Typ"; //copied from de-de
|
||||
$text['label-subtype']['de-de'] = "Typ";
|
||||
$text['label-subtype']['el-gr'] = "Τύπος";
|
||||
$text['label-subtype']['es-cl'] = "Tipo";
|
||||
$text['label-subtype']['es-mx'] = "Tipo"; //copied from es-cl
|
||||
$text['label-subtype']['fr-ca'] = "Type"; //copied from fr-fr
|
||||
$text['label-subtype']['fr-fr'] = "Type";
|
||||
$text['label-subtype']['he-il'] = "";
|
||||
$text['label-subtype']['it-it'] = "Tipo";
|
||||
$text['label-subtype']['nl-nl'] = "";
|
||||
$text['label-subtype']['pl-pl'] = "Typ";
|
||||
$text['label-subtype']['pt-br'] = "Tipo"; //copied from pt-pt
|
||||
$text['label-subtype']['pt-pt'] = "Tipo";
|
||||
$text['label-subtype']['ro-ro'] = "";
|
||||
$text['label-subtype']['ru-ru'] = "Тип";
|
||||
$text['label-subtype']['sv-se'] = "Typ";
|
||||
$text['label-subtype']['uk-ua'] = "Тип";
|
||||
$text['label-subtype']['tr-tr'] = "Tür";
|
||||
|
||||
$text['label-remaining']['en-us'] = "Remaining";
|
||||
$text['label-remaining']['en-gb'] = "Remaining";
|
||||
$text['label-remaining']['ar-eg'] = "Remaining";
|
||||
@@ -5087,4 +5110,4 @@ $text['title-languages']['ru-ru'] = "";
|
||||
$text['title-languages']['sv-se'] = "Språk";
|
||||
$text['title-languages']['uk-ua'] = "";
|
||||
|
||||
?>
|
||||
?>
|
||||
Reference in New Issue
Block a user