Add links to certain column text in a list view - integrated click on list rows to Edit items, as well. Misc bug fixes.

This commit is contained in:
Nate Jones
2014-06-21 07:51:31 +00:00
parent 84a134a23d
commit 3c2e32d197
11 changed files with 146 additions and 52 deletions

View File

@@ -183,7 +183,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-name'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
@@ -209,7 +209,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo " ".$text['label-description'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='sip_profile_description' maxlength='255' value=\"$sip_profile_description\">\n";
echo " <textarea class='formfld' style='width: 300px;' name='sip_profile_description' rows='4'>$sip_profile_description</textarea>\n";
echo "<br />\n";
echo $text['description-description']."\n";
echo "</td>\n";

View File

@@ -195,7 +195,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-setting_name'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
@@ -206,7 +206,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-setting_value'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";

View File

@@ -93,30 +93,37 @@ require_once "resources/paging.php";
$row_style["1"] = "row_style1";
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo th_order_by('sip_profile_setting_name', $text['label-setting_name'], $order_by, $order);
echo th_order_by('sip_profile_setting_value', $text['label-setting_value'], $order_by, $order);
echo th_order_by('sip_profile_setting_enabled', $text['label-setting_enabled'], $order_by, $order);
echo th_order_by('sip_profile_setting_description', $text['label-setting_description'], $order_by, $order);
echo "<td class='list_control_icons'>";
if (permission_exists('sip_profile_add')) {
if (permission_exists('sip_profile_setting_add')) {
echo "<a href='sip_profile_setting_edit.php?sip_profile_uuid=".$_GET['id']."' alt='".$text['button-add']."'>$v_link_label_add</a>";
}
echo "</td>\n";
echo "<tr>\n";
if ($num_rows > 0) {
foreach($result as $row) {
echo "<tr >\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['sip_profile_setting_name']."&nbsp;</td>\n";
$tr_link = (permission_exists('sip_profile_setting_edit')) ? " onclick=\"document.location.href='sip_profile_setting_edit.php?sip_profile_uuid=".$row['sip_profile_uuid']."&id=".$row['sip_profile_setting_uuid']."';\"" : null;
echo "<tr ".$tr_link.">\n";
echo " <td valign='top' class='".$row_style[$c]."'>";
if (permission_exists('sip_profile_setting_edit')) {
echo "<a href='sip_profile_setting_edit.php?sip_profile_uuid=".$row['sip_profile_uuid']."&id=".$row['sip_profile_setting_uuid']."'>".$row['sip_profile_setting_name']."</a>";
}
else {
echo $row['sip_profile_setting_name'];
}
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['sip_profile_setting_value']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".(($row['sip_profile_setting_enabled'] == 'true') ? $text['option-true'] : $text['option-false'])."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['sip_profile_setting_description']."&nbsp;</td>\n";
echo " <td valign='top' class='row_stylebg'>".$row['sip_profile_setting_description']."&nbsp;</td>\n";
echo " <td class='list_control_icons'>";
if (permission_exists('sip_profile_edit')) {
if (permission_exists('sip_profile_setting_edit')) {
echo "<a href='sip_profile_setting_edit.php?sip_profile_uuid=".$row['sip_profile_uuid']."&id=".$row['sip_profile_setting_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
}
if (permission_exists('sip_profile_delete')) {
if (permission_exists('sip_profile_setting_delete')) {
echo "<a href='sip_profile_setting_delete.php?sip_profile_uuid=".$row['sip_profile_uuid']."&id=".$row['sip_profile_setting_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
}
echo " </td>\n";
@@ -133,7 +140,7 @@ require_once "resources/paging.php";
echo " <td width='33.3%' nowrap>&nbsp;</td>\n";
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
echo " <td class='list_control_icons'>";
if (permission_exists('sip_profile_add')) {
if (permission_exists('sip_profile_setting_add')) {
echo "<a href='sip_profile_setting_edit.php?sip_profile_uuid=".$_GET['id']."' alt='".$text['button-add']."'>$v_link_label_add</a>";
}
echo " </td>\n";

View File

@@ -110,7 +110,7 @@ require_once "resources/paging.php";
$row_style["1"] = "row_style1";
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo th_order_by('sip_profile_name', $text['label-name'], $order_by, $order);
echo "<th align='left' >".$text['label-hostname']."</th>\n";
@@ -120,12 +120,19 @@ require_once "resources/paging.php";
echo "<a href='sip_profile_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>";
}
echo "</td>\n";
echo "<tr>\n";
if ($result_count > 0) {
foreach($result as $row) {
echo "<tr >\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['sip_profile_name']."&nbsp;</td>\n";
$tr_link = (permission_exists('sip_profile_edit')) ? " onclick=\"document.location.href='sip_profile_edit.php?id=".$row['sip_profile_uuid']."';\"" : null;
echo "<tr ".$tr_link.">\n";
echo " <td valign='top' class='".$row_style[$c]."'>";
if (permission_exists('sip_profile_edit')) {
echo "<a href='sip_profile_edit.php?id=".$row['sip_profile_uuid']."'>".$row['sip_profile_name']."</a>";
}
else {
echo $row['sip_profile_name'];
}
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['sip_profile_hostname']."&nbsp;</td>\n";
echo " <td valign='top' class='row_stylebg'>".$row['sip_profile_description']."&nbsp;</td>\n";
echo " <td class='list_control_icons'>";

View File

@@ -81,30 +81,52 @@ require_once "resources/paging.php";
$row_style["1"] = "row_style1";
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo " <th>".$text['label-name']."</th>\n";
echo " <th>".$text['label-category']."</th>\n";
echo " <th>".$text['label-subcategory']."</th>\n";
echo " <th>".$text['label-version']."</th>\n";
echo " <th>".$text['label-description']."</th>\n";
//echo "<td align='right' width='42'>\n";
//echo " <a href='apps_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
//echo "</td>\n";
/*
echo "<td class='list_control_icons'>\n";
if (permission_exists('app_add')) {
echo " <a href='apps_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
}
echo "</td>\n";
*/
echo "<tr>\n";
foreach($apps as $row) {
if ($row['uuid'] != "d8704214-75a0-e52f-1336-f0780e29fef8") {
echo "<tr >\n";
echo " <td valign='top' class='".$row_style[$c]."' nowrap='nowrap'>".$row['name']."&nbsp;</td>\n";
/*
$tr_link = (permission_exists('app_edit')) ? " onclick=\"document.location.href='apps_edit.php?id=".$row['uuid']."';\"" : null;
*/
echo "<tr ".$tr_link.">\n";
echo " <td valign='top' class='".$row_style[$c]."' nowrap='nowrap'>";
/*
if (permission_exists('app_edit')) {
echo " <a href='apps_edit.php?id=".$row['uuid']."'>".$row['name']."</a>";
}
else {
*/
echo $row['name'];
/*
}
*/
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['category']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['subcategory']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['version']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."' width='35%'>".$row['description']['en-us']."&nbsp;</td>\n";
/* // temporarily disabled
echo " <td valign='top' align='left' nowrap='nowrap' width='42'>\n";
echo " &nbsp;<a href='apps_edit.php?id=".$row['uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>\n";
echo " <a href='apps_delete.php?id=".$row['uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
echo " <td class='list_control_icons'>";
if (permission_exists('app_edit')) {
echo " <a href='apps_edit.php?id=".$row['uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>\n";
}
if (permission_exists('app_delete')) {
echo " <a href='apps_delete.php?id=".$row['uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
}
echo " </td>\n";
*/
echo "</tr>\n";
@@ -113,6 +135,16 @@ require_once "resources/paging.php";
} //end foreach
unset($sql, $result, $row_count);
echo "<tr>\n";
echo " <td colspan='5'>&nbsp;</td>\n";
/*
echo "<td class='list_control_icons'>\n";
if (permission_exists('app_add')) {
echo " <a href='apps_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
}
echo "</td>\n";
*/
echo "</tr>";
echo "</table>";
echo "</div>";
echo "<br /><br />";

View File

@@ -106,7 +106,7 @@ require_once "resources/paging.php";
$row_style["1"] = "row_style1";
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo th_order_by('database_driver', $text['label-driver'], $order_by, $order);
@@ -124,12 +124,13 @@ require_once "resources/paging.php";
if ($result_count > 0) {
foreach($result as $row) {
echo "<tr >\n";
$tr_link = " onclick=\"document.location.href='database_edit.php?id=".$row['database_uuid']."';\"";
echo "<tr ".$tr_link.">\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['database_driver']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['database_type']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['database_host']."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['database_port']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['database_name']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'><a href='database_edit.php?id=".$row['database_uuid']."'>".$row['database_name']."</a>&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['database_username']."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['database_path']."&nbsp;</td>\n";
echo " <td valign='top' class='row_stylebg'>".$row['database_description']."&nbsp;</td>\n";

View File

@@ -213,7 +213,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-subcategory'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";

View File

@@ -111,7 +111,7 @@ require_once "resources/paging.php";
$row_style["1"] = "row_style1";
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
if ($result_count > 0) {
$previous_category = '';
@@ -148,9 +148,16 @@ require_once "resources/paging.php";
echo "</td>\n";
echo "</tr>\n";
}
echo "<tr >\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['default_setting_subcategory']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['default_setting_name']."&nbsp;</td>\n";
$tr_link = (permission_exists('default_setting_edit')) ? " onclick=\"document.location.href='default_setting_edit.php?id=".$row['default_setting_uuid']."';\"" : null;
echo "<tr ".$tr_link.">\n";
echo " <td valign='top' class='".$row_style[$c]."'>";
if (permission_exists('default_setting_edit')) {
echo "<a href='default_setting_edit.php?id=".$row['default_setting_uuid']."'>".$row['default_setting_subcategory']."</a>";
}
else {
echo $row['default_setting_subcategory'];
}
echo " <td valign='top' class='".$row_style[$c]."'>".$row['default_setting_name']."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>\n";
$category = $row['default_setting_category'];
@@ -176,7 +183,7 @@ require_once "resources/paging.php";
}
echo " &nbsp;\n";
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['default_setting_enabled']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".ucwords($row['default_setting_enabled'])."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['default_setting_description']."&nbsp;</td>\n";
echo " <td class='list_control_icons'>";
if (permission_exists('default_setting_edit')) {

View File

@@ -106,16 +106,19 @@ require_once "resources/paging.php";
$row_style["1"] = "row_style1";
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
if ($result_count > 0) {
$previous_category = '';
foreach($result as $row) {
if ($previous_category != $row['domain_setting_category']) {
echo "<tr><td colspan='4' align='left'>\n";
echo " <br />\n";
echo " <br />\n";
echo " <b>".ucfirst($row['domain_setting_category'])."</b>&nbsp;</td></tr>\n";
echo "<tr>";
echo " <td colspan='4' align='left'>\n";
echo " <br />\n";
echo " <br />\n";
echo " <b>".ucfirst($row['domain_setting_category'])."</b>&nbsp;\n";
echo " </td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo th_order_by('domain_setting_subcategory', $text['label-category'], $order_by, $order);
echo th_order_by('domain_setting_name', $text['label-type'], $order_by, $order);
@@ -129,8 +132,16 @@ require_once "resources/paging.php";
echo "</td>\n";
echo "</tr>\n";
}
echo "<tr >\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['domain_setting_subcategory']."&nbsp;</td>\n";
$tr_link = (permission_exists('domain_setting_edit')) ? " onclick=\"document.location.href='domain_setting_edit.php?domain_uuid=".$row['domain_uuid']."&id=".$row['domain_setting_uuid']."';\"" : null;
echo "<tr ".$tr_link.">\n";
echo " <td valign='top' class='".$row_style[$c]."'>";
if (permission_exists('domain_setting_edit')) {
echo "<a href='domain_setting_edit.php?domain_uuid=".$row['domain_uuid']."&id=".$row['domain_setting_uuid']."'>".$row['domain_setting_subcategory']."</a>";
}
else {
echo $row['domain_setting_subcategory'];
}
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['domain_setting_name']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>\n";
@@ -158,14 +169,14 @@ require_once "resources/paging.php";
}
echo " &nbsp;\n";
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['domain_setting_enabled']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".ucwords($row['domain_setting_enabled'])."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['domain_setting_description']."&nbsp;</td>\n";
echo " <td class='list_control_icons'>";
if (permission_exists('domain_setting_edit')) {
echo "<a href='domain_setting_edit.php?domain_uuid=".$row['domain_uuid']."&id=".$row['domain_setting_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
echo "<a href='domain_setting_edit.php?domain_uuid=".$row['domain_uuid']."&id=".$row['domain_setting_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
}
if (permission_exists('domain_setting_delete')) {
echo "<a href='domain_setting_delete.php?domain_uuid=".$row['domain_uuid']."&id=".$row['domain_setting_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
echo "<a href='domain_setting_delete.php?domain_uuid=".$row['domain_uuid']."&id=".$row['domain_setting_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
}
echo " </td>\n";
echo "</tr>\n";

View File

@@ -164,7 +164,7 @@ else {
$row_style["1"] = "row_style1";
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo th_order_by('domain_name', $text['label-domain'], $order_by, $order);
echo th_order_by('domain_description', $text['label-description'], $order_by, $order);
@@ -177,8 +177,16 @@ else {
if ($result_count > 0) {
foreach($result as $row) {
echo "<tr >\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['domain_name']."&nbsp;</td>\n";
$tr_link = (permission_exists('domain_edit')) ? " onclick=\"document.location.href='domain_edit.php?id=".$row['domain_uuid']."';\"" : null;
echo "<tr ".$tr_link.">\n";
echo " <td valign='top' class='".$row_style[$c]."'>";
if (permission_exists('domain_edit')) {
echo "<a href='domain_edit.php?id=".$row['domain_uuid']."'>".$row['domain_name']."</a>";
}
else {
echo $row['domain_name'];
}
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['domain_description']."&nbsp;</td>\n";
echo " <td class='list_control_icons'>";
if (permission_exists('domain_edit')) {

View File

@@ -85,7 +85,7 @@ else {
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
$strlist = "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
$strlist = "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
$strlist .= "<tr class='border'>\n";
$strlist .= " <th nowrap>".$text['label-group_name']."</th>\n";
$strlist .= " <th nowrap>".$text['label-group_description']."</th>\n";
@@ -113,8 +113,22 @@ else {
//hide the superadmin group from non superadmin's
}
else {
$strlist .= "<tr>";
$strlist .= "<td class='".$row_style[$c]."' nowrap>".$group_name."</td>\n";
/*
$tr_link = (permission_exists('group_edit')) ? " onclick=\"document.location.href='groupedit.php?id=".$group_uuid."';\"" : null;
*/
$strlist .= "<tr ".$tr_link.">\n";
$strlist .= "<td class='".$row_style[$c]."' nowrap>";
/*
if (permission_exists('group_edit')) {
$strlist .= "<a href='groupedit.php?id=".$group_uuid."'>".$group_name."</a>";
}
else {
*/
$strlist .= $group_name;
/*
}
*/
$strlist .= "</td>\n";
$strlist .= "<td class='".$row_style[$c]."' nowrap>".$group_description."</td>\n";
$strlist .= "<td class='".$row_style[$c]."' nowrap>\n";
if (permission_exists('group_add') || if_group("superadmin")) {
@@ -133,7 +147,14 @@ else {
}
$strlist .= "</td>\n";
$strlist .= "<td class='list_control_icons' style='width: 25px;'>";
$strlist .= "<a href='groupdelete.php?id=$group_uuid' onclick=\"return confirm('".$text['confirm-delete']."')\" alt='".$text['button-delete']."'>$v_link_label_delete</a>";
/*
if (permission_exists('group_edit')) {
$strlist .= "<a href='groupedit.php?id=$group_uuid' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
}
*/
if (permission_exists('group_delete')) {
$strlist .= "<a href='groupdelete.php?id=$group_uuid' onclick=\"return confirm('".$text['confirm-delete']."')\" alt='".$text['button-delete']."'>$v_link_label_delete</a>";
}
$strlist .= "</td>\n";
$strlist .= "</tr>\n";
}