Order contacts by last modified date by default.
This commit is contained in:
parent
8e2dcddbaf
commit
7a776fadb8
|
|
@ -48,6 +48,7 @@ else {
|
|||
$action = "add";
|
||||
}
|
||||
|
||||
//get the contact uuid
|
||||
if (strlen($_GET["contact_uuid"]) > 0) {
|
||||
$contact_uuid = check_str($_GET["contact_uuid"]);
|
||||
}
|
||||
|
|
@ -73,14 +74,16 @@ if (strlen($_GET["contact_uuid"]) > 0) {
|
|||
$address_label = ($address_label_custom != '') ? $address_label_custom : $address_label;
|
||||
}
|
||||
|
||||
//process the form data
|
||||
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
$msg = '';
|
||||
//set the uuid
|
||||
if ($action == "update") {
|
||||
$contact_address_uuid = check_str($_POST["contact_address_uuid"]);
|
||||
}
|
||||
|
||||
//check for all required data
|
||||
$msg = '';
|
||||
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
require_once "resources/header.php";
|
||||
require_once "resources/persist_form_var.php";
|
||||
|
|
@ -97,6 +100,15 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
//add or update the database
|
||||
if ($_POST["persistformvar"] != "true") {
|
||||
|
||||
//update last modified
|
||||
$sql = "update v_contacts set ";
|
||||
$sql .= "last_mod_date = now(), ";
|
||||
$sql .= "last_mod_user = '".$_SESSION['username']."' ";
|
||||
$sql .= "where domain_uuid = '".$domain_uuid."' ";
|
||||
$sql .= "and contact_uuid = '".$contact_uuid."' ";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
//if primary, unmark other primary numbers
|
||||
if ($address_primary) {
|
||||
$sql = "update v_contact_addresses set address_primary = 0 ";
|
||||
|
|
|
|||
|
|
@ -79,14 +79,16 @@ else {
|
|||
$contact_note = check_str($_POST["contact_note"]);
|
||||
}
|
||||
|
||||
//process the form data
|
||||
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
$msg = '';
|
||||
//set the uuid
|
||||
if ($action == "update") {
|
||||
$contact_uuid = check_str($_POST["contact_uuid"]);
|
||||
}
|
||||
|
||||
//check for all required data
|
||||
$msg = '';
|
||||
//if (strlen($contact_type) == 0) { $msg .= $text['message-required'].$text['label-contact_type']."<br>\n"; }
|
||||
//if (strlen($contact_organization) == 0) { $msg .= $text['message-required'].$text['label-contact_organization']."<br>\n"; }
|
||||
//if (strlen($contact_name_prefix) == 0) { $msg .= $text['message-required'].$text['label-contact_name_prefix']."<br>\n"; }
|
||||
|
|
@ -115,6 +117,15 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
//add or update the database
|
||||
if ($_POST["persistformvar"] != "true") {
|
||||
|
||||
//update last modified
|
||||
$sql = "update v_contacts set ";
|
||||
$sql .= "last_mod_date = now(), ";
|
||||
$sql .= "last_mod_user = '".$_SESSION['username']."' ";
|
||||
$sql .= "where domain_uuid = '".$domain_uuid."' ";
|
||||
$sql .= "and contact_uuid = '".$contact_uuid."' ";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
if ($action == "add") {
|
||||
$contact_uuid = uuid();
|
||||
$sql = "insert into v_contacts ";
|
||||
|
|
|
|||
|
|
@ -64,14 +64,16 @@ if (strlen($_GET["contact_uuid"]) > 0) {
|
|||
$email_label = ($email_label_custom != '') ? $email_label_custom : $email_label;
|
||||
}
|
||||
|
||||
//process the form data
|
||||
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
$msg = '';
|
||||
//set the uuid
|
||||
if ($action == "update") {
|
||||
$contact_email_uuid = check_str($_POST["contact_email_uuid"]);
|
||||
}
|
||||
|
||||
//check for all required data
|
||||
$msg = '';
|
||||
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
require_once "resources/header.php";
|
||||
require_once "resources/persist_form_var.php";
|
||||
|
|
@ -88,6 +90,15 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
//add or update the database
|
||||
if ($_POST["persistformvar"] != "true") {
|
||||
|
||||
//update last modified
|
||||
$sql = "update v_contacts set ";
|
||||
$sql .= "last_mod_date = now(), ";
|
||||
$sql .= "last_mod_user = '".$_SESSION['username']."' ";
|
||||
$sql .= "where domain_uuid = '".$domain_uuid."' ";
|
||||
$sql .= "and contact_uuid = '".$contact_uuid."' ";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
//if primary, unmark other primary numbers
|
||||
if ($email_primary) {
|
||||
$sql = "update v_contact_emails set email_primary = 0 ";
|
||||
|
|
|
|||
|
|
@ -59,15 +59,16 @@ else {
|
|||
$last_mod_user = check_str($_POST["last_mod_user"]);
|
||||
}
|
||||
|
||||
//process the form data
|
||||
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
//get the primary id for the contact note
|
||||
$msg = '';
|
||||
if ($action == "update") {
|
||||
$contact_note_uuid = check_str($_POST["contact_note_uuid"]);
|
||||
}
|
||||
|
||||
//check for all required data
|
||||
$msg = '';
|
||||
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
require_once "resources/header.php";
|
||||
require_once "resources/persist_form_var.php";
|
||||
|
|
@ -83,6 +84,16 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
|
||||
//add or update the database
|
||||
if ($_POST["persistformvar"] != "true") {
|
||||
//update last modified
|
||||
$sql = "update v_contacts set ";
|
||||
$sql .= "last_mod_date = now(), ";
|
||||
$sql .= "last_mod_user = '".$_SESSION['username']."' ";
|
||||
$sql .= "where domain_uuid = '".$domain_uuid."' ";
|
||||
$sql .= "and contact_uuid = '".$contact_uuid."' ";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
//add the note
|
||||
if ($action == "add") {
|
||||
$contact_note_uuid = uuid();
|
||||
$sql = "insert into v_contact_notes ";
|
||||
|
|
@ -111,6 +122,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
return;
|
||||
} //if ($action == "add")
|
||||
|
||||
//update the note
|
||||
if ($action == "update") {
|
||||
$sql = "update v_contact_notes set ";
|
||||
$sql .= "contact_uuid = '$contact_uuid', ";
|
||||
|
|
|
|||
|
|
@ -72,14 +72,16 @@ if (strlen($_GET["contact_uuid"]) > 0) {
|
|||
$phone_label = ($phone_label_custom != '') ? $phone_label_custom : $phone_label;
|
||||
}
|
||||
|
||||
//process the form data
|
||||
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
$msg = '';
|
||||
//set thge uuid
|
||||
if ($action == "update") {
|
||||
$contact_phone_uuid = check_str($_POST["contact_phone_uuid"]);
|
||||
}
|
||||
|
||||
//check for all required data
|
||||
$msg = '';
|
||||
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
require_once "resources/header.php";
|
||||
require_once "resources/persist_form_var.php";
|
||||
|
|
@ -96,6 +98,15 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
//add or update the database
|
||||
if ($_POST["persistformvar"] != "true") {
|
||||
|
||||
//update last modified
|
||||
$sql = "update v_contacts set ";
|
||||
$sql .= "last_mod_date = now(), ";
|
||||
$sql .= "last_mod_user = '".$_SESSION['username']."' ";
|
||||
$sql .= "where domain_uuid = '".$domain_uuid."' ";
|
||||
$sql .= "and contact_uuid = '".$contact_uuid."' ";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
//if primary, unmark other primary numbers
|
||||
if ($phone_primary) {
|
||||
$sql = "update v_contact_phones set phone_primary = 0 ";
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ else {
|
|||
$action = "add";
|
||||
}
|
||||
|
||||
//get the contact uuid
|
||||
if (strlen($_GET["contact_uuid"]) > 0) {
|
||||
$contact_uuid = check_str($_GET["contact_uuid"]);
|
||||
}
|
||||
|
|
@ -66,14 +67,16 @@ if (strlen($_GET["contact_uuid"]) > 0) {
|
|||
$relation_reciprocal_label = ($relation_reciprocal_label_custom != '') ? $relation_reciprocal_label_custom : $relation_reciprocal_label;
|
||||
}
|
||||
|
||||
//process the form data
|
||||
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
$msg = '';
|
||||
//set the uuid
|
||||
if ($action == "update") {
|
||||
$contact_relation_uuid = check_str($_POST["contact_relation_uuid"]);
|
||||
}
|
||||
|
||||
//check for all required data
|
||||
$msg = '';
|
||||
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
require_once "resources/header.php";
|
||||
require_once "resources/persist_form_var.php";
|
||||
|
|
@ -90,6 +93,15 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
//add or update the database
|
||||
if ($_POST["persistformvar"] != "true") {
|
||||
|
||||
//update last modified
|
||||
$sql = "update v_contacts set ";
|
||||
$sql .= "last_mod_date = now(), ";
|
||||
$sql .= "last_mod_user = '".$_SESSION['username']."' ";
|
||||
$sql .= "where domain_uuid = '".$domain_uuid."' ";
|
||||
$sql .= "and contact_uuid = '".$contact_uuid."' ";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
if ($action == "add") {
|
||||
$contact_relation_uuid = uuid();
|
||||
$sql = "insert into v_contact_relations ";
|
||||
|
|
|
|||
|
|
@ -48,9 +48,12 @@ else {
|
|||
$action = "add";
|
||||
}
|
||||
|
||||
//get the contact uuid
|
||||
if (strlen($_GET["contact_uuid"]) > 0) {
|
||||
$contact_uuid = check_str($_GET["contact_uuid"]);
|
||||
}
|
||||
|
||||
//set the session domain uuid as a variable
|
||||
$domain_uuid = $_SESSION['domain_uuid'];
|
||||
|
||||
//get http post variables and set them to php variables
|
||||
|
|
@ -64,14 +67,16 @@ $domain_uuid = $_SESSION['domain_uuid'];
|
|||
$contact_setting_description = check_str($_POST["contact_setting_description"]);
|
||||
}
|
||||
|
||||
//process the form data
|
||||
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
$msg = '';
|
||||
//set the uuid
|
||||
if ($action == "update") {
|
||||
$contact_setting_uuid = check_str($_POST["contact_setting_uuid"]);
|
||||
}
|
||||
|
||||
//check for all required data
|
||||
$msg = '';
|
||||
//if (strlen($domain_setting_category) == 0) { $msg .= $text['message-required'].$text['label-category']."<br>\n"; }
|
||||
//if (strlen($domain_setting_subcategory) == 0) { $msg .= $text['message-required'].$text['label-subcategory']."<br>\n"; }
|
||||
//if (strlen($domain_setting_name) == 0) { $msg .= $text['message-required'].$text['label-type']."<br>\n"; }
|
||||
|
|
@ -94,8 +99,19 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
|
||||
//add or update the database
|
||||
if ($_POST["persistformvar"] != "true") {
|
||||
|
||||
//set the order
|
||||
$contact_setting_order = ($contact_setting_order != '') ? $contact_setting_order : 'null';
|
||||
|
||||
//update last modified
|
||||
$sql = "update v_contacts set ";
|
||||
$sql .= "last_mod_date = now(), ";
|
||||
$sql .= "last_mod_user = '".$_SESSION['username']."' ";
|
||||
$sql .= "where domain_uuid = '".$domain_uuid."' ";
|
||||
$sql .= "and contact_uuid = '".$contact_uuid."' ";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
//add the domain
|
||||
if ($action == "add" && permission_exists('domain_setting_add')) {
|
||||
$sql = "insert into v_contact_settings ";
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ else {
|
|||
$action = "add";
|
||||
}
|
||||
|
||||
//get the contact uuid
|
||||
if (strlen($_GET["contact_uuid"]) > 0) {
|
||||
$contact_uuid = check_str($_GET["contact_uuid"]);
|
||||
}
|
||||
|
|
@ -58,14 +59,16 @@ if (strlen($_GET["contact_uuid"]) > 0) {
|
|||
$time_description = check_str($_POST["time_description"]);
|
||||
}
|
||||
|
||||
//process the form data
|
||||
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
$msg = '';
|
||||
//set the uuid
|
||||
if ($action == "update") {
|
||||
$contact_time_uuid = check_str($_POST["contact_time_uuid"]);
|
||||
}
|
||||
|
||||
//check for all required data
|
||||
$msg = '';
|
||||
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
require_once "resources/header.php";
|
||||
require_once "resources/persist_form_var.php";
|
||||
|
|
@ -82,6 +85,14 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
//add or update the database
|
||||
if ($_POST["persistformvar"] != "true") {
|
||||
|
||||
//update last modified
|
||||
$sql = "update v_contacts set ";
|
||||
$sql .= "last_mod_date = now(), ";
|
||||
$sql .= "last_mod_user = '".$_SESSION['username']."' ";
|
||||
$sql .= "where domain_uuid = '".$domain_uuid."' ";
|
||||
$sql .= "and contact_uuid = '".$contact_uuid."' ";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
if ($action == "add") {
|
||||
$contact_time_uuid = uuid();
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ else {
|
|||
$action = "add";
|
||||
}
|
||||
|
||||
//get the contact uuid
|
||||
if (strlen($_GET["contact_uuid"]) > 0) {
|
||||
$contact_uuid = check_str($_GET["contact_uuid"]);
|
||||
}
|
||||
|
|
@ -64,14 +65,16 @@ if (strlen($_GET["contact_uuid"]) > 0) {
|
|||
$url_label = ($url_label_custom != '') ? $url_label_custom : $url_label;
|
||||
}
|
||||
|
||||
//process the form data
|
||||
if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
$msg = '';
|
||||
//set the uuid
|
||||
if ($action == "update") {
|
||||
$contact_url_uuid = check_str($_POST["contact_url_uuid"]);
|
||||
}
|
||||
|
||||
//check for all required data
|
||||
$msg = '';
|
||||
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
require_once "resources/header.php";
|
||||
require_once "resources/persist_form_var.php";
|
||||
|
|
@ -88,6 +91,15 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
//add or update the database
|
||||
if ($_POST["persistformvar"] != "true") {
|
||||
|
||||
//update last modified
|
||||
$sql = "update v_contacts set ";
|
||||
$sql .= "last_mod_date = now(), ";
|
||||
$sql .= "last_mod_user = '".$_SESSION['username']."' ";
|
||||
$sql .= "where domain_uuid = '".$domain_uuid."' ";
|
||||
$sql .= "and contact_uuid = '".$contact_uuid."' ";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
//if primary, unmark other primary numbers
|
||||
if ($url_primary) {
|
||||
$sql = "update v_contact_urls set url_primary = 0 ";
|
||||
|
|
|
|||
|
|
@ -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-2013
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2015
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
|
@ -55,6 +55,7 @@ else {
|
|||
foreach ($_SESSION['groups'] as $group_data) {
|
||||
$user_group_uuids[] = $group_data['group_uuid'];
|
||||
}
|
||||
|
||||
//add user's uuid to group uuid list to include private (non-shared) contacts
|
||||
$user_group_uuids[] = $_SESSION["user_uuid"];
|
||||
|
||||
|
|
@ -177,7 +178,7 @@ else {
|
|||
$sql .= "order by ".$order_by." ".$order." ";
|
||||
}
|
||||
else {
|
||||
$sql .= "order by contact_organization desc, contact_name_given asc, contact_name_family asc ";
|
||||
$sql .= "order by last_mod_date desc ";
|
||||
}
|
||||
$sql .= "limit ".$rows_per_page." offset ".$offset." ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
|
|
|
|||
Loading…
Reference in New Issue