Skip to content

Commit

Permalink
Added content card div to devices (fusionpbx#7122)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdcrane authored Sep 6, 2024
1 parent 2182ebd commit c01403c
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 29 deletions.
17 changes: 10 additions & 7 deletions app/devices/device_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <[email protected]>
Portions created by the Initial Developer are Copyright (C) 2008-2023
Portions created by the Initial Developer are Copyright (C) 2008-2024
the Initial Developer. All Rights Reserved.
*/
Expand Down Expand Up @@ -509,7 +509,7 @@
$sql = "select * from v_devices ";
$sql .= "where device_uuid = :device_uuid ";
$parameters['device_uuid'] = $device_uuid;

$row = $database->select($sql, $parameters, 'row');
if (is_array($row) && @sizeof($row) != 0) {
$device_address = $row["device_address"];
Expand Down Expand Up @@ -540,7 +540,7 @@
if (empty($device_vendor)) {
//get the device vendor using the device address
$device_vendor = device::get_vendor($device_address ?? null);

//if the vendor was not found using the device address use an alternative method
if (empty($device_vendor)) {
$template_array = explode("/", $device_template ?? '');
Expand All @@ -567,7 +567,7 @@
$sql .= "where device_uuid = :device_uuid ";
$sql .= "order by cast(line_number as int) asc ";
$parameters['device_uuid'] = $device_uuid ?? null;

$device_lines = $database->select($sql, $parameters, 'all');
unset($sql, $parameters);

Expand Down Expand Up @@ -638,7 +638,7 @@
$sql .= "from v_device_vendors ";
$sql .= "where enabled = 'true' ";
$sql .= "order by name asc ";

$device_vendors = $database->select($sql, null, 'all');
unset($sql);

Expand Down Expand Up @@ -885,7 +885,7 @@
//get the provision settings
$provision = new settings(["category" => "provision"]);
$acrobits_code = $provision->get('provision', 'acrobits_code');

if (!empty($template) && isset($acrobits_code)) {
$template = str_replace('{$server_address}', $row['server_address'], $template);
$template = str_replace('{$user_id}', urlencode($row['user_id']), $template);
Expand Down Expand Up @@ -1101,6 +1101,7 @@
echo $text['description-device']."\n";
echo "<br /><br />\n";

echo "<div class='card'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";

echo "<tr>\n";
Expand Down Expand Up @@ -2029,6 +2030,7 @@
echo " </td>\n";
echo " </tr>";
echo "</table>";
echo "</div>\n";
echo "<br><br>";
echo "</form>";

Expand All @@ -2051,4 +2053,5 @@
//show the footer
require_once "resources/footer.php";

?>
?>

14 changes: 9 additions & 5 deletions app/devices/device_imports.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <[email protected]>
Portions created by the Initial Developer are Copyright (C) 2018-2023
Portions created by the Initial Developer are Copyright (C) 2018-2024
the Initial Developer. All Rights Reserved.
Contributor(s):
Expand Down Expand Up @@ -105,7 +105,7 @@ function str_getcsv($input, $delimiter = ",", $enclosure = '"', $escape = "\\")
}

//filter for specific tables and build the schema array
if ($table_name == "devices" || $table_name == "device_lines" ||
if ($table_name == "devices" || $table_name == "device_lines" ||
$table_name == "device_keys" || $table_name == "device_settings") {
$schema[$i]['table'] = $table_name;
$schema[$i]['parent'] = $parent_name;
Expand Down Expand Up @@ -164,6 +164,7 @@ function str_getcsv($input, $delimiter = ",", $enclosure = '"', $escape = "\\")
echo $text['description-import']."\n";
echo "<br /><br />\n";

echo "<div class='card'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";

//loop through user columns
Expand Down Expand Up @@ -200,6 +201,7 @@ function str_getcsv($input, $delimiter = ",", $enclosure = '"', $escape = "\\")
}

echo "</table>\n";
echo "</div>\n";
echo "<br /><br />\n";

echo "<input name='action' type='hidden' value='import'>\n";
Expand Down Expand Up @@ -247,7 +249,7 @@ function get_parent($schema,$table_name) {

//user selected fields
$fields = $_POST['fields'];

//set the domain_uuid
$domain_uuid = $_SESSION['domain_uuid'];

Expand Down Expand Up @@ -285,7 +287,7 @@ function get_parent($schema,$table_name) {
//echo "value: $value<br />\n";
//echo "table_name: $table_name<br />\n";
//echo "field_name: $field_name<br />\n";

//get the parent table name
$parent = get_parent($schema, $table_name);

Expand Down Expand Up @@ -445,7 +447,7 @@ function get_parent($schema,$table_name) {
//$message = $database->message;
//view_array($message);
}

if (!empty($_SESSION['provision']['path']['text'])) {
$prov = new provision;
$prov->domain_uuid = $domain_uuid;
Expand Down Expand Up @@ -481,6 +483,7 @@ function get_parent($schema,$table_name) {
echo $text['description-import']."\n";
echo "<br /><br />\n";

echo "<div class='card'>\n";
echo "<table border='0' cellpadding='0' cellspacing='0' width='100%'>\n";

echo "<tr>\n";
Expand Down Expand Up @@ -552,6 +555,7 @@ function get_parent($schema,$table_name) {
echo "</tr>\n";

echo "</table>\n";
echo "</div>\n";
echo "<br><br>";

echo "<input name='type' type='hidden' value='csv'>\n";
Expand Down
2 changes: 1 addition & 1 deletion app/devices/device_profile_copy.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <[email protected]>
Portions created by the Initial Developer are Copyright (C) 2008-2023
Portions created by the Initial Developer are Copyright (C) 2008-2024
the Initial Developer. All Rights Reserved.
Contributor(s):
Expand Down
10 changes: 6 additions & 4 deletions app/devices/device_profile_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <[email protected]>
Copyright (C) 2020-2023 All Rights Reserved.
Copyright (C) 2020-2024 All Rights Reserved.
Contributor(s):
Mark J Crane <[email protected]>
Expand Down Expand Up @@ -427,6 +427,7 @@
echo $text['description-device_profiles']."\n";
echo "<br /><br />\n";

echo "<div class='card'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";

echo "<tr>\n";
Expand Down Expand Up @@ -499,7 +500,7 @@
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) {
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";
Expand Down Expand Up @@ -531,11 +532,11 @@
echo " <td class='formfld'>\n";
echo " <select class='formfld' name='device_profile_keys[$x][profile_key_category]'>\n";
echo " <option value='line' ".($row['profile_key_category'] == "line" ? "selected='selected'" : null).">".$text['label-line']."</option>\n";
if ($row['profile_key_vendor'] !== "polycom") {
if ($row['profile_key_vendor'] !== "polycom") {
echo " <option value='memory' ".($row['profile_key_category'] == "memory" ? "selected='selected'" : null).">".$text['label-memory']."</option>\n";
}
echo " <option value='programmable' ".($row['profile_key_category'] == "programmable" ? "selected='selected'" : null).">".$text['label-programmable']."</option>\n";
if ($row['profile_key_vendor'] !== "polycom") {
if ($row['profile_key_vendor'] !== "polycom") {
if (empty($row['profile_key_vendor'])) {
echo " <option value='expansion' ".($row['profile_key_category'] == "expansion" ? "selected='selected'" : null).">".$text['label-expansion']."</option>\n";
echo " <option value='expansion-1' ".($row['profile_key_category'] == "expansion-1" ? "selected='selected'" : null).">".$text['label-expansion']." 1</option>\n";
Expand Down Expand Up @@ -791,6 +792,7 @@
echo "</tr>\n";

echo "</table>";
echo "</div>\n";
echo "<br /><br />";

echo "<input type='hidden' name='device_profile_uuid' value='".escape($device_profile_uuid)."'>\n";
Expand Down
4 changes: 3 additions & 1 deletion app/devices/device_profiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <[email protected]>
Copyright (C) 2019-2023 All Rights Reserved.
Copyright (C) 2019-2024 All Rights Reserved.
Contributor(s):
Mark J Crane <[email protected]>
Expand Down Expand Up @@ -215,6 +215,7 @@
echo "<input type='hidden' name='search' value=\"".escape($search)."\">\n";
echo "<input type='hidden' name='fields' value=\"".escape($fields)."\">\n";

echo "<div class='card'>\n";
echo "<table class='list'>\n";
echo "<tr class='list-header'>\n";
if (permission_exists('device_profile_add') || permission_exists('device_profile_edit') || permission_exists('device_profile_delete')) {
Expand Down Expand Up @@ -285,6 +286,7 @@
}

echo "</table>\n";
echo "</div>\n";
echo "<br />\n";
echo "<div align='center'>".$paging_controls."</div>\n";

Expand Down
7 changes: 5 additions & 2 deletions app/devices/device_vendor_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <[email protected]>
Portions created by the Initial Developer are Copyright (C) 2016-2023
Portions created by the Initial Developer are Copyright (C) 2016-2024
the Initial Developer. All Rights Reserved.
Contributor(s):
Expand Down Expand Up @@ -159,6 +159,7 @@
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";

echo "<div class='card'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";

echo "<tr>\n";
Expand Down Expand Up @@ -206,6 +207,7 @@
echo "</tr>\n";

echo "</table>";
echo "</div>\n";
echo "<br /><br />";

if ($action == "update") {
Expand All @@ -223,4 +225,5 @@
//include the footer
require_once "resources/footer.php";

?>
?>

5 changes: 4 additions & 1 deletion app/devices/device_vendor_function_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <[email protected]>
Portions created by the Initial Developer are Copyright (C) 2016-2023
Portions created by the Initial Developer are Copyright (C) 2016-2024
the Initial Developer. All Rights Reserved.
Contributor(s):
Expand Down Expand Up @@ -287,6 +287,7 @@
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";

echo "<div class='card'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";

echo "<tr>\n";
Expand Down Expand Up @@ -394,10 +395,12 @@
echo " </td>\n";
echo " </tr>";
echo "</table>";
echo "</div>\n";
echo "</form>";
echo "<br /><br />";

//include the footer
require_once "resources/footer.php";

?>

7 changes: 5 additions & 2 deletions app/devices/device_vendor_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <[email protected]>
Portions created by the Initial Developer are Copyright (C) 2016-2023
Portions created by the Initial Developer are Copyright (C) 2016-2024
the Initial Developer. All Rights Reserved.
Contributor(s):
Expand Down Expand Up @@ -162,6 +162,7 @@
echo modal::create(['id'=>'modal-delete','type'=>'delete','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_delete','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('delete'); list_form_submit('form_list');"])]);
}

echo "<div class='card'>\n";
echo "<table class='list'>\n";
echo "<tr class='list-header'>\n";
if (permission_exists('device_vendor_function_add') || permission_exists('device_vendor_function_edit') || permission_exists('device_vendor_function_delete')) {
Expand Down Expand Up @@ -263,6 +264,7 @@
}

echo "</table>\n";
echo "</div>\n";
echo "<br />\n";
echo "<div align='center'>".($paging_controls ?? '')."</div>\n";

Expand All @@ -286,4 +288,5 @@

echo "</script>\n";

?>
?>

5 changes: 3 additions & 2 deletions app/devices/device_vendor_restore.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <[email protected]>
Portions created by the Initial Developer are Copyright (C) 2016-2023
Portions created by the Initial Developer are Copyright (C) 2016-2024
the Initial Developer. All Rights Reserved.
Contributor(s):
Expand Down Expand Up @@ -156,4 +156,5 @@
header('Location: device_vendors.php');
exit;

?>
?>

8 changes: 5 additions & 3 deletions app/devices/device_vendors.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <[email protected]>
Portions created by the Initial Developer are Copyright (C) 2016-2023
Portions created by the Initial Developer are Copyright (C) 2016-2024
the Initial Developer. All Rights Reserved.
Contributor(s):
Expand Down Expand Up @@ -159,7 +159,7 @@
echo "<input type='hidden' id='action' name='action' value=''>\n";
echo "<input type='hidden' name='search' value=\"".escape($search)."\">\n";


echo "<div class='card'>\n";
echo "<table class='list'>\n";
echo "<tr class='list-header'>\n";
if (permission_exists('device_vendor_edit') || permission_exists('device_vendor_delete')) {
Expand Down Expand Up @@ -210,6 +210,7 @@
unset($result);

echo "</table>\n";
echo "</div>\n";
echo "<br />\n";
echo "<div align='center'>".$paging_controls."</div>\n";

Expand All @@ -220,4 +221,5 @@
//include the footer
require_once "resources/footer.php";

?>
?>

Loading

0 comments on commit c01403c

Please sign in to comment.