Contacts: Fix redirect after Add and Edit, remove redundant [+] buttons and auto-scroll Notes.

This commit is contained in:
Nate Jones
2015-03-26 19:47:57 +00:00
parent 72c5ecbbb1
commit 6fd4a638e3
8 changed files with 18 additions and 138 deletions

View File

@@ -92,7 +92,7 @@ require_once "resources/paging.php";
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<table class='tr_hover' style='margin-bottom: 20px;' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo "<th>".$text['label-address_label']."</th>\n";
@@ -129,20 +129,6 @@ require_once "resources/paging.php";
unset($sql, $result, $row_count);
} //end if results
echo "<tr>\n";
echo "<td colspan='7' align='left'>\n";
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
echo " <tr>\n";
// 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'>";
echo "<a href='contact_address_edit.php?contact_uuid=".$_GET['id']."' alt='".$text['button-add']."'>$v_link_label_add</a>";
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>";
?>

View File

@@ -157,7 +157,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
unset($sql);
$_SESSION["message"] = $text['message-add'];
$location = "contacts.php";
$location = "contact_edit.php?id=".$contact_uuid;
} //if ($action == "add")
//if contact is shared, remove contact group record containing user's uuid
@@ -223,7 +223,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
unset($sql);
$_SESSION["message"] = $text['message-update'];
$location = "contacts.php";
$location = "contact_edit.php?id=".$contact_uuid;
} //if ($action == "update")
//handle redirect

View File

@@ -91,7 +91,7 @@ require_once "resources/paging.php";
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<table class='tr_hover' style='margin-bottom: 20px;' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo "<th>".$text['label-email_label']."</th>\n";
@@ -119,20 +119,6 @@ require_once "resources/paging.php";
unset($sql, $result, $row_count);
} //end if results
echo "<tr>\n";
echo "<td colspan='11' align='left'>\n";
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
echo " <tr>\n";
// 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'>";
echo "<a href='contact_email_edit.php?contact_uuid=".$_GET['id']."' alt='".$text['button-add']."'>$v_link_label_add</a>";
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>";
?>

View File

@@ -114,7 +114,7 @@ require_once "resources/paging.php";
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<table class='tr_hover' style='margin-bottom: 20px;' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo "<th>".$text['label-extension']."</th>\n";
echo "<th>".$text['label-enabled']."</th>\n";
@@ -153,21 +153,6 @@ require_once "resources/paging.php";
unset($sql, $result, $row_count);
} //end if results
echo "<tr>\n";
echo "<td colspan='5' align='left'>\n";
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
echo " <tr>\n";
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('extension_add')) {
echo " <a href='/app/extensions/extension_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
}
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>";
?>

View File

@@ -48,7 +48,6 @@ require_once "resources/paging.php";
}
//show the content
echo "<table width='100%' border='0'>\n";
echo "<tr>\n";
echo "<td width='50%' align='left' nowrap='nowrap'><b>".$text['label-contact_notes']."</b></td>\n";
@@ -56,37 +55,11 @@ require_once "resources/paging.php";
echo "</tr>\n";
echo "</table>\n";
//prepare to page the results
// $sql = "select count(*) as num_rows from v_contact_notes ";
// $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
// $sql .= "and contact_uuid = '$contact_uuid' ";
// if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
// $prep_statement = $db->prepare($sql);
// if ($prep_statement) {
// $prep_statement->execute();
// $row = $prep_statement->fetch(PDO::FETCH_ASSOC);
// if ($row['num_rows'] > 0) {
// $num_rows = $row['num_rows'];
// }
// else {
// $num_rows = '0';
// }
// }
//prepare to page the results
// $rows_per_page = 10;
// $param = "";
// $page = $_GET['page'];
// if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
// list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page);
// $offset = $rows_per_page * $page;
//get the contact list
$sql = "select * from v_contact_notes ";
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
$sql .= "and contact_uuid = '$contact_uuid' ";
if (strlen($order_by)> 0) { $sql .= "order by ".$order_by." ".$order." "; }
// $sql .= " limit ".$rows_per_page." offset ".$offset." ";
$prep_statement = $db->prepare(check_sql($sql));
if ($prep_statement) {
$prep_statement->execute();
@@ -99,7 +72,7 @@ require_once "resources/paging.php";
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo "<th>".$text['label-note_content']."</th>\n";
@@ -108,6 +81,10 @@ require_once "resources/paging.php";
echo "<a href='contact_note_edit.php?contact_uuid=".$_GET['id']."' alt='".$text['button-add']."'>$v_link_label_add</a>";
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "<div id='contact_notes' style='width: 100%; overflow: auto; direction: rtl; text-align: right; margin-bottom: 23px;'>";
echo "<table class='tr_hover' style='width: 100%; direction: ltr; padding-left: 1px' border='0' cellpadding='0' cellspacing='0'>\n";
if ($result_count != 0) {
foreach($result as $row) {
$contact_note = $row['contact_note'];
@@ -123,26 +100,13 @@ require_once "resources/paging.php";
echo "<a href='contact_note_delete.php?contact_uuid=".$row['contact_uuid']."&id=".$row['contact_note_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
echo " </td>\n";
echo "</tr>\n";
if ($c==0) { $c=1; } else { $c=0; }
$c = ($c) ? 0 : 1;
} //end foreach
unset($sql, $result, $row_count);
} //end if results
echo "<tr>\n";
echo "<td colspan='3' align='left'>\n";
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
echo " <tr>\n";
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'>";
echo "<a href='contact_note_edit.php?contact_uuid=".$_GET['id']."' alt='".$text['button-add']."'>$v_link_label_add</a>";
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>";
echo "</div>\n";
echo "<script>if (document.getElementById('contact_notes').offsetHeight > 200) { document.getElementById('contact_notes').style.height = 200; }</script>\n";
?>

View File

@@ -107,7 +107,7 @@ require_once "resources/paging.php";
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<table class='tr_hover' style='margin-bottom: 20px;' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo "<th>".$text['label-phone_label']."</th>\n";
echo "<th>".$text['label-phone_number']."</th>\n";
@@ -155,20 +155,6 @@ require_once "resources/paging.php";
unset($sql, $result, $row_count);
} //end if results
echo "<tr>\n";
echo "<td colspan='6' align='left'>\n";
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
echo " <tr>\n";
// 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'>";
echo "<a href='contact_phone_edit.php?contact_uuid=".$_GET['id']."' alt='".$text['button-add']."'>$v_link_label_add</a>";
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>";
?>

View File

@@ -89,7 +89,7 @@ require_once "resources/paging.php";
echo "</tr>\n";
echo "</table>\n";
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<table class='tr_hover' style='margin-bottom: 20px;' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>";
echo " <td colspan='6' align='left'>\n";
echo " <b>".ucfirst($row['contact_setting_category'])."</b>\n";
@@ -142,19 +142,6 @@ require_once "resources/paging.php";
unset($sql, $result, $row_count);
} //end if results
echo "<tr>\n";
echo "<td colspan='7' align='left'>\n";
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
echo " <tr>\n";
// 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'>";
echo "<a href='contact_setting_edit.php?contact_uuid=".$contact_uuid."' alt='".$text['button-add']."'>$v_link_label_add</a>";
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>";
//include the footer

View File

@@ -91,7 +91,7 @@ require_once "resources/paging.php";
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<table class='tr_hover' style='margin-bottom: 20px;' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo "<th>".$text['label-url_label']."</th>\n";
@@ -119,20 +119,6 @@ require_once "resources/paging.php";
unset($sql, $result, $row_count);
} //end if results
echo "<tr>\n";
echo "<td colspan='11' align='left'>\n";
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
echo " <tr>\n";
// 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'>";
echo "<a href='contact_url_edit.php?contact_uuid=".$_GET['id']."' alt='".$text['button-add']."'>$v_link_label_add</a>";
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>";
echo "</table>\n";
?>