Default Settings: Button & minor updates.

This commit is contained in:
Nate 2020-02-10 08:07:06 -07:00
parent 9a2ab8a426
commit 41b17c2717
2 changed files with 39 additions and 34 deletions

View File

@ -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) 2008-2016
Portions created by the Initial Developer are Copyright (C) 2008-2020
the Initial Developer. All Rights Reserved.
Contributor(s):
@ -198,47 +198,49 @@
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
//show the header
require_once "resources/header.php";
//include the header
if ($action == "update") {
$document['title'] = $text['title-default_setting-edit'];
}
elseif ($action == "add") {
$document['title'] = $text['title-default_setting-add'];
}
require_once "resources/header.php";
//show the content
echo "<form name='frm' id='frm' method='post' action=''>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo "<form name='frm' id='frm' method='post'>\n";
echo "<div class='action_bar' id='action_bar'>\n";
echo " <div class='heading'>";
if ($action == "add") {
echo "<td align='left' width='30%' nowrap='nowrap'><b>".$text['header-default_setting-add']."</b></td>\n";
echo "<b>".$text['header-default_setting-add']."</b>";
}
if ($action == "update") {
echo "<td align='left' width='30%' nowrap='nowrap'><b>".$text['header-default_setting-edit']."</b></td>\n";
echo "<b>".$text['header-default_setting-edit']."</b>";
}
echo "<td width='70%' align='right'>";
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='default_settings.php".(($search != '') ? "?search=".$search : null)."'\" value='".$text['button-back']."'>";
echo " <input type='button' class='btn' value='".$text['button-save']."' onclick='submit_form();'>\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align='left' colspan='2'>\n";
echo " </div>\n";
echo " <div class='actions'>\n";
echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'style'=>'margin-right: 15px;','link'=>'default_settings.php'.($search != '' ? "?search=".$search : null)]);
echo button::create(['type'=>'button','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'onclick'=>'submit_form();']);
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";
if ($action == "add") {
echo $text['description-default_setting-add'];
echo $text['description-default_setting-add']."\n";
}
if ($action == "update") {
echo $text['description-default_setting-edit'];
echo $text['description-default_setting-edit']."\n";
}
echo "<br /><br />\n";
echo "</td>\n";
echo "</tr>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo "<td width='30%' class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-category']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo "<td width='70%' class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='default_setting_category' maxlength='255' value=\"$default_setting_category\">\n";
echo "<br />\n";
echo $text['description-category']."\n";
@ -676,19 +678,15 @@
echo "</td>\n";
echo "</tr>\n";
echo " <tr>\n";
echo " <td colspan='2' align='right'>\n";
if ($action == "update") {
echo " <input type='hidden' name='default_setting_uuid' value='".$default_setting_uuid."'>\n";
echo " <input type='hidden' name='search' value='".$search."'>\n";
}
echo " <input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo " <br>";
echo " <input type='button' class='btn' value='".$text['button-save']."' onclick='submit_form();'>\n";
echo " </td>\n";
echo " </tr>";
echo "</table>";
echo "<br><br>";
if ($action == "update") {
echo "<input type='hidden' name='default_setting_uuid' value='".escape($default_setting_uuid)."'>\n";
echo "<input type='hidden' name='search' value='".escape($search)."'>\n";
}
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo "</form>";
if ($_REQUEST["id"] == '' && $_REQUEST["default_setting_category"] != '') {

View File

@ -278,7 +278,14 @@
if ($_GET['show'] == 'all' && permission_exists('default_setting_all')) {
echo " <td>".escape($_SESSION['domains'][$row['domain_uuid']]['domain_name'])."</td>\n";
}
echo " <td class='overflow no-wrap'>".escape($row['default_setting_subcategory'])."</td>\n";
echo " <td class='overflow no-wrap'>";
if (permission_exists('default_setting_edit')) {
echo "<a href='".$list_row_url."'>".escape($row['default_setting_subcategory'])."</a>";
}
else {
echo escape($row['default_setting_subcategory']);
}
echo " </td>\n";
echo " <td class='hide-sm-dn'>".escape($row['default_setting_name'])."</td>\n";
echo " <td class='overflow no-wrap'>\n";
$category = $row['default_setting_category'];