Multilinquified Contacts app (sans <select> options). Hid QR Code and vCard buttons on Contact Add page.

This commit is contained in:
Nate Jones
2013-05-10 00:40:24 +00:00
parent d02dbddf8b
commit c0bb5b6153
14 changed files with 733 additions and 308 deletions

View File

@@ -0,0 +1,372 @@
<?php
// Contacts
$text['title-contacts']['en-us'] = 'Contacts';
$text['title-contacts']['pt-pt'] = '';
$text['header-contacts']['en-us'] = 'Contacts';
$text['header-contacts']['pt-pt'] = '';
$text['description-contacts']['en-us'] = 'The contact is a list of individuals and organizations.';
$text['description-contacts']['pt-pt'] = '';
$text['button-import']['en-us'] = 'Import';
$text['button-import']['pt-pt'] = '';
$text['button-search']['en-us'] = 'Search';
$text['button-search']['pt-pt'] = '';
// contact
$text['title-contact-add']['en-us'] = 'Contact Add';
$text['title-contact-add']['pt-pt'] = '';
$text['header-contact-add']['en-us'] = 'Contact Add';
$text['header-contact-add']['pt-pt'] = '';
$text['description-contact-add']['en-us'] = 'The contact is a list of individuals and organizations.';
$text['description-contact-add']['pt-pt'] = '';
$text['title-contact-edit']['en-us'] = 'Contact Edit';
$text['title-contact-edit']['pt-pt'] = '';
$text['header-contact-edit']['en-us'] = 'Contact Edit';
$text['header-contact-edit']['pt-pt'] = '';
$text['description-contact-edit']['en-us'] = 'The contact is a list of individuals and organizations.';
$text['description-contact-edit']['pt-pt'] = '';
$text['label-contact_type']['en-us'] = 'Type';
$text['label-contact_type']['pt-pt'] = '';
$text['description-contact_type']['en-us'] = 'Select the contact type.';
$text['description-contact_type']['pt-pt'] = '';
$text['label-contact_organization']['en-us'] = 'Organization';
$text['label-contact_organization']['pt-pt'] = '';
$text['description-contact_organization']['en-us'] = 'Enter the organization.';
$text['description-contact_organization']['pt-pt'] = '';
$text['label-contact_name']['en-us'] = 'Name';
$text['label-contact_name']['pt-pt'] = '';
$text['label-contact_name_given']['en-us'] = 'First Name';
$text['label-contact_name_given']['pt-pt'] = '';
$text['description-contact_name_given']['en-us'] = 'Enter the given name.';
$text['description-contact_name_given']['pt-pt'] = '';
$text['label-contact_name_family']['en-us'] = 'Last Name';
$text['label-contact_name_family']['pt-pt'] = '';
$text['description-contact_name_family']['en-us'] = 'Enter the family name.';
$text['description-contact_name_family']['pt-pt'] = '';
$text['label-contact_nickname']['en-us'] = 'Nickname';
$text['label-contact_nickname']['pt-pt'] = '';
$text['description-contact_nickname']['en-us'] = 'Enter the nickname.';
$text['description-contact_nickname']['pt-pt'] = '';
$text['label-contact_title']['en-us'] = 'Title';
$text['label-contact_title']['pt-pt'] = '';
$text['description-contact_title']['en-us'] = 'Enter the title.';
$text['description-contact_title']['pt-pt'] = '';
$text['label-contact_category']['en-us'] = 'Category';
$text['label-contact_category']['pt-pt'] = '';
$text['description-contact_category']['en-us'] = 'Enter the category.';
$text['description-contact_category']['pt-pt'] = '';
$text['label-contact_role']['en-us'] = 'Role';
$text['label-contact_role']['pt-pt'] = '';
$text['description-contact_role']['en-us'] = 'Enter the role.';
$text['description-contact_role']['pt-pt'] = '';
$text['label-contact_email']['en-us'] = 'Email';
$text['label-contact_email']['pt-pt'] = '';
$text['description-contact_email']['en-us'] = 'Enter the email address.';
$text['description-contact_email']['pt-pt'] = '';
$text['label-contact_url']['en-us'] = 'URL';
$text['label-contact_url']['pt-pt'] = '';
$text['description-contact_url']['en-us'] = 'Enter the website address.';
$text['description-contact_url']['pt-pt'] = '';
$text['label-contact_time_zone']['en-us'] = 'Time Zone';
$text['label-contact_time_zone']['pt-pt'] = '';
$text['description-contact_time_zone']['en-us'] = 'Enter the time zone.';
$text['description-contact_time_zone']['pt-pt'] = '';
$text['label-contact_note']['en-us'] = 'Note';
$text['label-contact_note']['pt-pt'] = '';
$text['description-contact_note']['en-us'] = 'Enter a note.';
$text['description-contact_note']['pt-pt'] = '';
$text['button-qr_code']['en-us'] = 'QR Code';
$text['button-qr_code']['pt-pt'] = '';
$text['button-vcard']['en-us'] = 'vCard';
$text['button-vcard']['pt-pt'] = '';
$text['button-invoices']['en-us'] = 'Invoices';
$text['button-invoices']['pt-pt'] = '';
// contact phones
$text['title-contact_phones-add']['en-us'] = 'Contact Phone Add';
$text['title-contact_phones-add']['pt-pt'] = '';
$text['header-contact_phones-add']['en-us'] = 'Contact Phone Add';
$text['header-contact_phones-add']['pt-pt'] = '';
$text['title-contact_phones-edit']['en-us'] = 'Contact Phone Edit';
$text['title-contact_phones-edit']['pt-pt'] = '';
$text['header-contact_phones-edit']['en-us'] = 'Contact Phone Edit';
$text['header-contact_phones-edit']['pt-pt'] = '';
$text['label-phone_numbers']['en-us'] = 'Phone Numbers';
$text['label-phone_numbers']['pt-pt'] = '';
$text['label-phone_type']['en-us'] = 'Type';
$text['label-phone_type']['pt-pt'] = '';
$text['description-phone_type']['en-us'] = 'Select the phone type.';
$text['description-phone_type']['pt-pt'] = '';
$text['label-phone_number']['en-us'] = 'Number';
$text['label-phone_number']['pt-pt'] = '';
$text['description-phone_number']['en-us'] = 'Enter the phone number.';
$text['description-phone_number']['pt-pt'] = '';
$text['label-phone_extension']['en-us'] = 'Extension';
$text['label-phone_extension']['pt-pt'] = '';
$text['description-phone_extension']['en-us'] = 'Enter the extension.';
$text['description-phone_extension']['pt-pt'] = '';
$text['label-phone_description']['en-us'] = 'Description';
$text['label-phone_description']['pt-pt'] = '';
$text['description-phone_description']['en-us'] = 'Enter the description.';
$text['description-phone_description']['pt-pt'] = '';
$text['label-phone_tools']['en-us'] = 'Tools';
$text['label-phone_tools']['pt-pt'] = '';
$text['label-phone_call']['en-us'] = 'Call';
$text['label-phone_call']['pt-pt'] = '';
// contact addresses
$text['title-contact_addresses-add']['en-us'] = 'Contact Address Add';
$text['title-contact_addresses-add']['pt-pt'] = '';
$text['header-contact_addresses-add']['en-us'] = 'Contact Address Add';
$text['header-contact_addresses-add']['pt-pt'] = '';
$text['description-contact_addresses-add']['en-us'] = 'Contact address information.';
$text['description-contact_addresses-add']['pt-pt'] = '';
$text['title-contact_addresses-edit']['en-us'] = 'Contact Address Edit';
$text['title-contact_addresses-edit']['pt-pt'] = '';
$text['header-contact_addresses-edit']['en-us'] = 'Contact Address Edit';
$text['header-contact_addresses-edit']['pt-pt'] = '';
$text['description-contact_addresses-edit']['en-us'] = 'Contact address information.';
$text['description-contact_addresses-edit']['pt-pt'] = '';
$text['label-addresses']['en-us'] = 'Addresses';
$text['label-addresses']['pt-pt'] = '';
$text['label-address_type']['en-us'] = 'Type';
$text['label-address_type']['pt-pt'] = '';
$text['description-address_type']['en-us'] = 'Enter the address type.';
$text['description-address_type']['pt-pt'] = '';
$text['label-address_street']['en-us'] = 'Street Address';
$text['label-address_street']['pt-pt'] = '';
$text['description-address_street']['en-us'] = 'Enter the street address.';
$text['description-address_street']['pt-pt'] = '';
$text['label-address_extended']['en-us'] = 'Extended Address';
$text['label-address_extended']['pt-pt'] = '';
$text['description-address_extended']['en-us'] = 'Enter the extended address.';
$text['description-address_extended']['pt-pt'] = '';
$text['label-address_locality']['en-us'] = 'City';
$text['label-address_locality']['pt-pt'] = '';
$text['description-address_locality']['en-us'] = 'Enter the city.';
$text['description-address_locality']['pt-pt'] = '';
$text['label-address_region']['en-us'] = 'Region';
$text['label-address_region']['pt-pt'] = '';
$text['description-address_region']['en-us'] = 'Enter the state or province.';
$text['description-address_region']['pt-pt'] = '';
$text['label-address_postal_code']['en-us'] = 'Postal Code';
$text['label-address_postal_code']['pt-pt'] = '';
$text['description-address_postal_code']['en-us'] = 'Enter the postal code.';
$text['description-address_postal_code']['pt-pt'] = '';
$text['label-address_country']['en-us'] = 'Country';
$text['label-address_country']['pt-pt'] = '';
$text['description-address_country']['en-us'] = 'Enter the country.';
$text['description-address_country']['pt-pt'] = '';
$text['label-address_latitude']['en-us'] = 'Latitude';
$text['label-address_latitude']['pt-pt'] = '';
$text['description-address_latitude']['en-us'] = 'Enter the latitude.';
$text['description-address_latitude']['pt-pt'] = '';
$text['label-address_longitude']['en-us'] = 'Longitude';
$text['label-address_longitude']['pt-pt'] = '';
$text['description-address_longitude']['en-us'] = 'Enter the longitude.';
$text['description-address_longitude']['pt-pt'] = '';
$text['label-address_description']['en-us'] = 'Description';
$text['label-address_description']['pt-pt'] = '';
$text['description-address_description']['en-us'] = 'Enter a description.';
$text['description-address_description']['pt-pt'] = '';
$text['label-address_tools']['en-us'] = 'Tools';
$text['label-address_tools']['pt-pt'] = '';
// contact notes
$text['title-contact_notes-add']['en-us'] = 'Contact Note Add';
$text['title-contact_notes-add']['pt-pt'] = '';
$text['header-contact_notes-add']['en-us'] = 'Contact Note Add';
$text['header-contact_notes-add']['pt-pt'] = '';
$text['description-contact_notes-add']['en-us'] = '';
$text['description-contact_notes-add']['pt-pt'] = '';
$text['title-contact_notes-edit']['en-us'] = 'Contact Note Edit';
$text['title-contact_notes-edit']['pt-pt'] = '';
$text['header-contact_notes-edit']['en-us'] = 'Contact Note Edit';
$text['header-contact_notes-edit']['pt-pt'] = '';
$text['description-contact_notes-edit']['en-us'] = '.';
$text['description-contact_notes-edit']['pt-pt'] = '';
$text['label-contact_notes']['en-us'] = 'Notes';
$text['label-contact_notes']['pt-pt'] = '';
$text['label-contact_note']['en-us'] = 'Note';
$text['label-contact_note']['pt-pt'] = '';
$text['description-contact_note']['en-us'] = '';
$text['description-contact_note']['pt-pt'] = '';
// contact import
$text['title-contacts_import']['en-us'] = 'Import Contacts';
$text['title-contacts_import']['pt-pt'] = '';
$text['header-contacts_import']['en-us'] = 'Import Contacts';
$text['header-contacts_import']['pt-pt'] = '';
$text['description-contacts_import']['en-us'] = 'Export your contacts from outlook to a comma delimitted csv file. Then use this tool to upload and add the contacts from that file.';
$text['description-contacts_import']['pt-pt'] = '';
$text['label-import_delimiter']['en-us'] = 'Delimiter';
$text['label-import_delimiter']['pt-pt'] = '';
$text['description-import_delimiter']['en-us'] = 'Select the delimiter (comma or pipe).';
$text['description-import_delimiter']['pt-pt'] = '';
$text['label-import_enclosure']['en-us'] = 'Enclosure';
$text['label-import_enclosure']['pt-pt'] = '';
$text['description-import_enclosure']['en-us'] = 'Select the enclosure of text (double-quotes or nothing).';
$text['description-import_enclosure']['pt-pt'] = '';
$text['label-import_file_upload']['en-us'] = 'File to Upload';
$text['label-import_file_upload']['pt-pt'] = '';
$text['button-upload']['en-us'] = 'Upload';
$text['button-upload']['pt-pt'] = '';
$text['message-results']['en-us'] = 'The following contacts were successfully imported from the uploaded CSV file:';
$text['message-results']['pt-pt'] = '';
// general labels
$text['button-add']['en-us'] = 'Add';
$text['button-add']['pt-pt'] = '';
$text['button-edit']['en-us'] = 'Edit';
$text['button-edit']['pt-pt'] = '';
$text['button-delete']['en-us'] = 'Delete';
$text['button-delete']['pt-pt'] = '';
$text['button-save']['en-us'] = 'Save';
$text['button-save']['pt-pt'] = 'Guardar';
$text['button-back']['en-us'] = 'Back';
$text['button-back']['pt-pt'] = 'Voltar';
$text['confirm-delete']['en-us'] = 'Do you really want to delete this?';
$text['confirm-delete']['pt-pt'] = '';
$text['message-add']['en-us'] = 'Add Completed';
$text['message-add']['pt-pt'] = '';
$text['message-update']['en-us'] = 'Update Completed';
$text['message-update']['pt-pt'] = '';
$text['message-delete']['en-us'] = 'Delete Completed';
$text['message-delete']['pt-pt'] = '';
$text['message-required']['en-us'] = 'Please provide: ';
$text['message-required']['pt-pt'] = '';
?>

View File

@@ -33,7 +33,8 @@ else {
echo "access denied";
exit;
}
require_once "includes/header.php";
//require_once "includes/header.php";
require_once "includes/paging.php";
//get variables used to control the order
@@ -41,22 +42,12 @@ require_once "includes/paging.php";
$order = $_GET["order"];
//show the content
//echo "<div align='center'>";
//echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
//echo "<tr class='border'>\n";
//echo " <td align=\"center\">\n";
//echo " <br>";
echo "<table width='100%' border='0'>\n";
echo "<tr>\n";
echo "<td width='50%' align='left' nowrap='nowrap'><b>Addresses</b></td>\n";
echo "<td width='50%' align='left' nowrap='nowrap'><b>".$text['label-addresses']."</b></td>\n";
echo "<td width='50%' align='right'>&nbsp;</td>\n";
echo "</tr>\n";
//echo "<tr>\n";
//echo "<td align='left' colspan='2'>\n";
//echo "List of addresses for the contact.<br /><br />\n";
//echo "</td>\n";
//echo "</tr>\n";
echo "</table>\n";
//prepare to page the results
@@ -80,9 +71,9 @@ require_once "includes/paging.php";
$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;
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_addresses ";
@@ -104,20 +95,19 @@ require_once "includes/paging.php";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
//echo th_order_by('address_name', 'Name', $order_by, $order);
echo th_order_by('address_type', 'Type', $order_by, $order);
//echo th_order_by('address_street', 'Street Address', $order_by, $order);
//echo th_order_by('address_extended', 'Extended Address', $order_by, $order);
echo th_order_by('address_locality', 'City', $order_by, $order);
echo th_order_by('address_region', 'Region', $order_by, $order);
//echo th_order_by('address_postal_code', 'Postal Code', $order_by, $order);
echo th_order_by('address_country', 'Country', $order_by, $order);
//echo th_order_by('address_latitude', 'Latitude', $order_by, $order);
//echo th_order_by('address_longitude', 'Longitude', $order_by, $order);
echo "<th>Tools</th>\n";
echo th_order_by('address_description', 'Description', $order_by, $order);
echo th_order_by('address_type', $text['label-address_type'], $order_by, $order);
//echo th_order_by('address_street', $text['label-address_street'], $order_by, $order);
//echo th_order_by('address_extended', $text['label-address_extended'], $order_by, $order);
echo th_order_by('address_locality', $text['label-address_locality'], $order_by, $order);
echo th_order_by('address_region', $text['label-address_region'], $order_by, $order);
//echo th_order_by('address_postal_code', $text['label-address_postal_code'], $order_by, $order);
echo th_order_by('address_country', $text['label-address_country'], $order_by, $order);
//echo th_order_by('address_latitude', $text['label-address_latitude'], $order_by, $order);
//echo th_order_by('address_longitude', $text['label-address_longitude'], $order_by, $order);
echo "<th>".$text['label-address_tools']."</th>\n";
echo th_order_by('address_description', $text['label-address_description'], $order_by, $order);
echo "<td align='right' width='42'>\n";
echo " <a href='contact_addresses_edit.php?contact_uuid=".$_GET['id']."' alt='add'>$v_link_label_add</a>\n";
echo " <a href='contact_addresses_edit.php?contact_uuid=".$_GET['id']."' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
echo "</td>\n";
echo "<tr>\n";
@@ -140,8 +130,8 @@ require_once "includes/paging.php";
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['address_description']."&nbsp;</td>\n";
echo " <td valign='top' align='right'>\n";
echo " <a href='contact_addresses_edit.php?contact_uuid=".$row['contact_uuid']."&id=".$row['contact_address_uuid']."' alt='edit'>$v_link_label_edit</a>\n";
echo " <a href='contact_addresses_delete.php?contact_uuid=".$row['contact_uuid']."&id=".$row['contact_address_uuid']."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
echo " <a href='contact_addresses_edit.php?contact_uuid=".$row['contact_uuid']."&id=".$row['contact_address_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>\n";
echo " <a href='contact_addresses_delete.php?contact_uuid=".$row['contact_uuid']."&id=".$row['contact_address_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
echo " </td>\n";
echo "</tr>\n";
if ($c==0) { $c=1; } else { $c=0; }
@@ -156,7 +146,7 @@ require_once "includes/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 width='33.3%' align='right'>\n";
echo " <a href='contact_addresses_edit.php?contact_uuid=".$_GET['id']."' alt='add'>$v_link_label_add</a>\n";
echo " <a href='contact_addresses_edit.php?contact_uuid=".$_GET['id']."' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
@@ -166,12 +156,4 @@ require_once "includes/paging.php";
echo "</table>";
echo "</div>";
//echo "</td>";
//echo "</tr>";
//echo "</table>";
//echo "</div>";
//echo "<br><br>";
//include the footer
//require_once "includes/footer.php";
?>

View File

@@ -34,6 +34,12 @@ else {
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
if (count($_GET)>0) {
$id = check_str($_GET["id"]);
$contact_uuid = check_str($_GET["contact_uuid"]);
@@ -44,7 +50,7 @@ if (strlen($id)>0) {
$sql .= "delete from v_contact_addresses ";
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
$sql .= "and contact_address_uuid = '$id' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
unset($sql);
@@ -53,7 +59,7 @@ if (strlen($id)>0) {
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=contacts_edit.php?id=$contact_uuid\">\n";
echo "<div align='center'>\n";
echo "Delete Complete\n";
echo $text['message-delete']."\n";
echo "</div>\n";
require_once "includes/footer.php";
return;

View File

@@ -34,6 +34,12 @@ else {
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
//action add or update
if (isset($_REQUEST["id"])) {
$action = "update";
@@ -70,16 +76,15 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
}
//check for all required data
//if (strlen($domain_uuid) == 0) { $msg .= "Please provide: domain_uuid<br>\n"; }
//if (strlen($address_type) == 0) { $msg .= "Please provide: Address Type<br>\n"; }
//if (strlen($address_street) == 0) { $msg .= "Please provide: Street Address<br>\n"; }
//if (strlen($address_extended) == 0) { $msg .= "Please provide: Extended Address<br>\n"; }
//if (strlen($address_locality) == 0) { $msg .= "Please provide: City<br>\n"; }
//if (strlen($address_region) == 0) { $msg .= "Please provide: State / Province<br>\n"; }
//if (strlen($address_postal_code) == 0) { $msg .= "Please provide: Postal Code<br>\n"; }
//if (strlen($address_country) == 0) { $msg .= "Please provide: Country<br>\n"; }
//if (strlen($address_latitude) == 0) { $msg .= "Please provide: Latitude<br>\n"; }
//if (strlen($address_longitude) == 0) { $msg .= "Please provide: Longitude<br>\n"; }
//if (strlen($address_type) == 0) { $msg .= $text['message-required'].$text['label-address_type']."<br>\n"; }
//if (strlen($address_street) == 0) { $msg .= $text['message-required'].$text['label-address_street']."<br>\n"; }
//if (strlen($address_extended) == 0) { $msg .= $text['message-required'].$text['label-address_extended']."<br>\n"; }
//if (strlen($address_locality) == 0) { $msg .= $text['message-required'].$text['label-address_locality']."<br>\n"; }
//if (strlen($address_region) == 0) { $msg .= $text['message-required'].$text['label-address_region']."<br>\n"; }
//if (strlen($address_postal_code) == 0) { $msg .= $text['message-required'].$text['label-address_postal_code']."<br>\n"; }
//if (strlen($address_country) == 0) { $msg .= $text['message-required'].$text['label-address_country']."<br>\n"; }
//if (strlen($address_latitude) == 0) { $msg .= $text['message-required'].$text['label-address_latitude']."<br>\n"; }
//if (strlen($address_longitude) == 0) { $msg .= $text['message-required'].$text['label-address_longitude']."<br>\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
require_once "includes/persistformvar.php";
@@ -137,7 +142,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=contacts_edit.php?id=$contact_uuid\">\n";
echo "<div align='center'>\n";
echo "Add Complete\n";
echo $text['message-add']."\n";
echo "</div>\n";
require_once "includes/footer.php";
return;
@@ -165,12 +170,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=contacts_edit.php?id=$contact_uuid\">\n";
echo "<div align='center'>\n";
echo "Update Complete\n";
echo $text['message-update']."\n";
echo "</div>\n";
require_once "includes/footer.php";
return;
} //if ($action == "update")
} //if ($_POST["persistformvar"] != "true")
} //if ($_POST["persistformvar"] != "true")
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
//pre-populate the form
@@ -201,6 +206,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//show the header
require_once "includes/header.php";
if ($action == "update") {
$page["title"] = $text['title-contact_addresses-edit'];
}
else if ($action == "add") {
$page["title"] = $text['title-contact_addresses-add'];
}
//show the content
echo "<div align='center'>";
@@ -213,18 +224,31 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td align='left' width='30%' nowrap='nowrap'><b>Contact Address</b></td>\n";
echo "<td width='70%' align='right'><input type='button' class='btn' name='' alt='back' onclick=\"window.location='contacts_edit.php?id=$contact_uuid'\" value='Back'></td>\n";
echo "<td align='left' width='30%' nowrap='nowrap'><b>";
if ($action == "update") {
echo $text['header-contact_addresses-edit'];
}
else if ($action == "add") {
echo $text['header-contact_addresses-add'];
}
echo "</b></td>\n";
echo "<td width='70%' align='right'><input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='contacts_edit.php?id=$contact_uuid'\" value='".$text['button-back']."'></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align='left' colspan='2'>\n";
echo "Contact address information.<br /><br />\n";
if ($action == "update") {
echo $text['description-contact_addresses-edit'];
}
else if ($action == "add") {
echo $text['description-contact_addresses-add'];
}
echo "<br /><br />\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Type:\n";
echo " ".$text['label-address_type'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
if (is_array($_SESSION["contact"]["address_type"])) {
@@ -232,7 +256,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " <select class='formfld' style='width:85%;' name='address_type'>\n";
echo " <option value=''></option>\n";
foreach($_SESSION["contact"]["address_type"] as $row) {
if ($row == $address_type) {
if ($row == $address_type) {
echo " <option value='".$row."' selected='selected'>".$row."</option>\n";
}
else {
@@ -244,13 +268,13 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
else {
echo " <select class='formfld' name='address_type'>\n";
echo " <option value=''></option>\n";
if (strtolower($address_type) == "home") {
if (strtolower($address_type) == "home") {
echo " <option value='home' selected='selected'>home</option>\n";
}
else {
echo " <option value='home'>home</option>\n";
}
if (strtolower($address_type) == "work") {
if (strtolower($address_type) == "work") {
echo " <option value='work' selected='selected'>work</option>\n";
}
else {
@@ -259,106 +283,106 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " </select>\n";
}
echo "<br />\n";
echo "Enter the address type.\n";
echo $text['description-address_type']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Street Address:\n";
echo " ".$text['label-address_street'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='address_street' maxlength='255' value=\"$address_street\">\n";
echo "<br />\n";
echo "Enter the street address.\n";
echo $text['description-address_street']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Extended Address:\n";
echo " ".$text['label-address_extended'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='address_extended' maxlength='255' value=\"$address_extended\">\n";
echo "<br />\n";
echo "Enter the extended address.\n";
echo $text['description-address_extended']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " City:\n";
echo " ".$text['label-address_locality'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='address_locality' maxlength='255' value=\"$address_locality\">\n";
echo "<br />\n";
echo "Enter the city.\n";
echo $text['description-address_locality']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Region:\n";
echo " ".$text['label-address_region'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='address_region' maxlength='255' value=\"$address_region\">\n";
echo "<br />\n";
echo "Enter the state or province.\n";
echo $text['description-address_region']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Postal Code:\n";
echo " ".$text['label-address_postal_code'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='address_postal_code' maxlength='255' value=\"$address_postal_code\">\n";
echo "<br />\n";
echo "Enter the postal code.\n";
echo $text['description-address_postal_code']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Country:\n";
echo " ".$text['label-address_country'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='address_country' maxlength='255' value=\"$address_country\">\n";
echo "<br />\n";
echo "Enter the country.\n";
echo $text['description-address_country']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Latitude:\n";
echo " ".$text['label-address_latitude'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='address_latitude' maxlength='255' value=\"$address_latitude\">\n";
echo "<br />\n";
echo "Enter the latitude\n";
echo $text['description-address_latitude']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Longitude:\n";
echo " ".$text['label-address_longitude'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='address_longitude' maxlength='255' value=\"$address_longitude\">\n";
echo "<br />\n";
echo "Enter the longitude\n";
echo $text['description-address_longitude']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Description:\n";
echo " ".$text['label-address_description'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='address_description' maxlength='255' value=\"$address_description\">\n";
echo "<br />\n";
echo "Enter the description.\n";
echo $text['description-address_description']."\n";
echo "</td>\n";
echo "</tr>\n";
@@ -368,7 +392,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
if ($action == "update") {
echo " <input type='hidden' name='contact_address_uuid' value='$contact_address_uuid'>\n";
}
echo " <input type='submit' name='submit' class='btn' value='Save'>\n";
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
echo " </td>\n";
echo " </tr>";
echo "</table>";

View File

@@ -34,7 +34,13 @@ else {
exit;
}
//built in str_getcsv requires PHP 5.3 or higher, this function can be used to reproduct the functionality but requirs PHP 5.1.0 or higher
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
//built in str_getcsv requires PHP 5.3 or higher, this function can be used to reproduct the functionality but requirs PHP 5.1.0 or higher
if(!function_exists('str_getcsv')) {
function str_getcsv($input, $delimiter = ",", $enclosure = '"', $escape = "\\") {
$fp = fopen("php://memory", 'r+');
@@ -296,14 +302,14 @@ else {
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td align='left' width='30%' nowrap='nowrap'><b>Import Contacts</b></td>\n";
echo "<td align='left' width='30%' nowrap='nowrap'><b>".$text['header-contacts_import']."</b></td>\n";
echo "<td width='70%' align='right'>\n";
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='contacts.php?".$_GET["query_string"]."'\" value='Back'>\n";
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='contacts.php?".$_GET["query_string"]."'\" value='".$text['button-back']."'>\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align=\"left\" colspan='2'>\n";
echo " These contacts were added from the csv file.<br /><br />\n";
echo " ".$text['message-results']."<br /><br />\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
@@ -311,10 +317,10 @@ else {
//show the results
echo "<table width='100%' border='0' cellpadding='3' cellspacing='0' width='100%'>\n";
echo "<tr>\n";
echo " <th>Name</th>\n";
echo " <th>Organization</th>\n";
echo " <th>Email</th>\n";
echo " <th>URL</th>\n";
echo " <th>".$text['label-contact_name']."</th>\n";
echo " <th>".$text['label-contact_organization']."</th>\n";
echo " <th>".$text['label-contact_email']."</th>\n";
echo " <th>".$text['label-contact_url']."</th>\n";
echo "</tr>\n";
foreach($results as $row) {
echo "<tr>\n";
@@ -354,11 +360,11 @@ else {
echo "<table width=\"100%\" border=\"0\" cellpadding=\"6\" cellspacing=\"0\">\n";
echo " <tr>\n";
echo " <td align='left' width='30%' nowrap='nowrap'>\n";
echo " <b>Import Contacts</b><br />\n";
echo " Export your contacts from outlook to a comma delimitted csv file. Then use this tool to upload and add the contacts from that file.\n";
echo " <b>".$text['header-contacts_import']."</b><br />\n";
echo " ".$text['description-contacts_import']."\n";
echo " </td>\n";
echo " <td width='70%' align='right'>\n";
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='contacts.php?".$_GET["query_string"]."'\" value='Back'>\n";
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='contacts.php?".$_GET["query_string"]."'\" value='".$text['button-back']."'>\n";
echo " </td>\n";
echo " </tr>\n";
echo "</table>";
@@ -370,7 +376,7 @@ else {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Delimiter:\n";
echo " ".$text['label-import_delimiter'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' style='width:40px;' name='data_delimiter'>\n";
@@ -378,13 +384,13 @@ else {
echo " <option value='|'>|</option>\n";
echo " </select>\n";
echo "<br />\n";
echo "Select the delimiter.\n";
echo $text['description-import_delimiter']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Enclosure:\n";
echo " ".$text['label-import_enclosure'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' style='width:40px;' name='data_enclosure'>\n";
@@ -392,13 +398,13 @@ else {
echo " <option value=''></option>\n";
echo " </select>\n";
echo "<br />\n";
echo "Select the enclosure.\n";
echo $text['description-import_enclosure']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " File to upload:\n";
echo " ".$text['label-import_file_upload'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input name=\"ulfile\" type=\"file\" class=\"btn\" id=\"ulfile\">\n";
@@ -413,7 +419,7 @@ else {
echo " </td>\n";
echo " <td valign=\"top\" align='right' class=\"label\" nowrap>\n";
echo " <input name=\"type\" type=\"hidden\" value=\"csv\">\n";
echo " <input name=\"submit\" type=\"submit\" class=\"btn\" id=\"upload\" value=\"Upload\">\n";
echo " <input name=\"submit\" type=\"submit\" class=\"btn\" id=\"upload\" value=\"".$text['button-upload']."\">\n";
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";

View File

@@ -33,7 +33,8 @@ else {
echo "access denied";
exit;
}
require_once "includes/header.php";
//require_once "includes/header.php";
require_once "includes/paging.php";
//get variables used to control the order
@@ -41,28 +42,18 @@ require_once "includes/paging.php";
$order = $_GET["order"];
//set defaults
if (strlen($order_by) == 0) {
if (strlen($order_by) == 0) {
$order_by = 'last_mod_date';
$order = 'desc';
}
//show the content
//echo "<div align='center'>";
//echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
//echo "<tr class='border'>\n";
//echo " <td align=\"center\">\n";
//echo " <br>";
echo "<table width='100%' border='0'>\n";
echo "<tr>\n";
echo "<td width='50%' align='left' nowrap='nowrap'><b>Notes</b></td>\n";
echo "<td width='50%' align='left' nowrap='nowrap'><b>".$text['label-contact_notes']."</b></td>\n";
echo "<td width='50%' align='right'>&nbsp;</td>\n";
echo "</tr>\n";
//echo "<tr>\n";
//echo "<td align='left' colspan='2'>\n";
//echo " List of notes for the contact.<br /><br />\n";
//echo "</td>\n";
//echo "</tr>\n";
echo "</table>\n";
//prepare to page the results
@@ -86,9 +77,9 @@ require_once "includes/paging.php";
$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;
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 ";
@@ -117,7 +108,7 @@ require_once "includes/paging.php";
echo " &nbsp; \n";
echo "</th>\n";
echo "<td align='right' width='42'>\n";
echo " <a href='contact_notes_edit.php?contact_uuid=".$_GET['id']."' alt='add'>$v_link_label_add</a>\n";
echo " <a href='contact_notes_edit.php?contact_uuid=".$_GET['id']."' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
echo "</td>\n";
echo "<tr>\n";
}
@@ -134,7 +125,7 @@ require_once "includes/paging.php";
//echo "<th>Modified Date ".$row['last_mod_date']."</th>\n";
//echo "<th>Modified By ".$row['last_mod_user']."</th>\n";
echo "<td align='right' width='42'>\n";
echo " <a href='contact_notes_edit.php?contact_uuid=".$_GET['id']."' alt='add'>$v_link_label_add</a>\n";
echo " <a href='contact_notes_edit.php?contact_uuid=".$_GET['id']."' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
echo "</td>\n";
echo "<tr>\n";
@@ -143,8 +134,8 @@ require_once "includes/paging.php";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['last_mod_date']."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['last_mod_user']."&nbsp;</td>\n";
echo " <td valign='top' align='right'>\n";
echo " <a href='contact_notes_edit.php?contact_uuid=".$row['contact_uuid']."&id=".$row['contact_note_uuid']."' alt='edit'>$v_link_label_edit</a>\n";
echo " <a href='contact_notes_delete.php?contact_uuid=".$row['contact_uuid']."&id=".$row['contact_note_uuid']."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
echo " <a href='contact_notes_edit.php?contact_uuid=".$row['contact_uuid']."&id=".$row['contact_note_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>\n";
echo " <a href='contact_notes_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>\n";
echo " </td>\n";
echo "</tr>\n";
@@ -164,7 +155,7 @@ require_once "includes/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 width='33.3%' align='right'>\n";
echo " <a href='contact_notes_edit.php?contact_uuid=".$_GET['id']."' alt='add'>$v_link_label_add</a>\n";
echo " <a href='contact_notes_edit.php?contact_uuid=".$_GET['id']."' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
@@ -174,12 +165,4 @@ require_once "includes/paging.php";
echo "</table>";
echo "</div>";
//echo "</td>";
//echo "</tr>";
//echo "</table>";
//echo "</div>";
//echo "<br><br>";
//include the footer
//require_once "includes/footer.php";
?>

View File

@@ -34,6 +34,12 @@ else {
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
if (count($_GET)>0) {
$id = check_str($_GET["id"]);
$contact_uuid = check_str($_GET["contact_uuid"]);
@@ -52,7 +58,7 @@ if (strlen($id)>0) {
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=contacts_edit.php?id=$contact_uuid\">\n";
echo "<div align='center'>\n";
echo "Delete Complete\n";
echo $text['message-delete']."\n";
echo "</div>\n";
require_once "includes/footer.php";
return;

View File

@@ -34,6 +34,12 @@ else {
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
//action add or update
if (isset($_REQUEST["id"])) {
$action = "update";
@@ -62,10 +68,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
}
//check for all required data
//if (strlen($contact_note) == 0) { $msg .= "Please provide: Notes<br>\n"; }
//if (strlen($domain_uuid) == 0) { $msg .= "Please provide: domain_uuid<br>\n"; }
//if (strlen($last_mod_date) == 0) { $msg .= "Please provide: Last Modified Date<br>\n"; }
//if (strlen($last_mod_user) == 0) { $msg .= "Please provide: Last Modified By<br>\n"; }
//if (strlen($contact_note) == 0) { $msg .= $text['message-required'].$text['label-contact_note']."<br>\n"; }
//if (strlen($domain_uuid) == 0) { $msg .= $text['message-required']."domain_uuid<br>\n"; }
//if (strlen($last_mod_date) == 0) { $msg .= $text['message-required']."Last Modified Date<br>\n"; }
//if (strlen($last_mod_user) == 0) { $msg .= $text['message-required']."Last Modified By<br>\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
require_once "includes/persistformvar.php";
@@ -107,7 +113,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=contacts_edit.php?id=$contact_uuid\">\n";
echo "<div align='center'>\n";
echo "Add Complete\n";
echo $text['message-add']."\n";
echo "</div>\n";
require_once "includes/footer.php";
return;
@@ -127,12 +133,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=contacts_edit.php?id=$contact_uuid\">\n";
echo "<div align='center'>\n";
echo "Update Complete\n";
echo $text['message-update']."\n";
echo "</div>\n";
require_once "includes/footer.php";
return;
} //if ($action == "update")
} //if ($_POST["persistformvar"] != "true")
} //if ($_POST["persistformvar"] != "true")
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
//pre-populate the form
@@ -156,6 +162,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//show the header
require_once "includes/header.php";
if ($action == "update") {
$page["title"] = $text['title-contact_notes-edit'];
}
else if ($action == "add") {
$page["title"] = $text['title-contact_notes-add'];
}
//show the content
echo "<div align='center'>";
@@ -170,17 +182,16 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
echo "<tr>\n";
if ($action == "add") {
echo "<td align='left' width='15%' nowrap='nowrap'><b>Add Notes</b></td>\n";
echo "<td align='left' width='15%' nowrap='nowrap'><b>".$text['header-contact_notes-add']."</b></td>\n";
}
if ($action == "update") {
echo "<td align='left' width='15%' nowrap='nowrap'><b>Edit Notes</b></td>\n";
echo "<td align='left' width='15%' nowrap='nowrap'><b>".$text['header-contact_notes-edit']."</b></td>\n";
}
echo "<td width='70%' align='right'><input type='button' class='btn' name='' alt='back' onclick=\"window.location='contacts_edit.php?id=$contact_uuid'\" value='Back'></td>\n";
echo "<td width='70%' align='right'><input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='contacts_edit.php?id=$contact_uuid'\" value='".$text['button-back']."'></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Notes:\n";
echo " ".$text['label-contact_note'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <textarea class='formfld' type='text' rows=\"20\" style=\"width: 100%\" name='contact_note'>$contact_note</textarea>\n";
@@ -194,7 +205,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
if ($action == "update") {
echo " <input type='hidden' name='contact_note_uuid' value='$contact_note_uuid'>\n";
}
echo " <input type='submit' name='submit' class='btn' value='Save'>\n";
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
echo " </td>\n";
echo " </tr>";
echo "</table>";

View File

@@ -33,7 +33,8 @@ else {
echo "access denied";
exit;
}
require_once "includes/header.php";
//require_once "includes/header.php";
require_once "includes/paging.php";
//get variables used to control the order
@@ -56,22 +57,12 @@ require_once "includes/paging.php";
echo "</script>\n";
//show the content
//echo "<div align='center'>";
//echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
//echo "<tr class='border'>\n";
//echo " <td align=\"center\">\n";
//echo " <br>";
echo "<table width='100%' border='0'>\n";
echo "<tr>\n";
echo "<td width='50%' align='left' nowrap='nowrap'><b>Phone Numbers</b></td>\n";
echo "<td width='50%' align='left' nowrap='nowrap'><b>".$text['label-phone_numbers']."</b></td>\n";
echo "<td width='50%' align='right'>&nbsp;</td>\n";
echo "</tr>\n";
//echo "<tr>\n";
//echo "<td colspan='2'>\n";
//echo " List of phone numbers for the contact.<br /><br />\n";
//echo "</td>\n";
//echo "</tr>\n";
echo "</table>\n";
//prepare to page the results
@@ -95,9 +86,9 @@ require_once "includes/paging.php";
$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;
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_phones ";
@@ -118,12 +109,12 @@ require_once "includes/paging.php";
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo th_order_by('phone_type', 'Type', $order_by, $order);
echo th_order_by('phone_number', 'Numbers', $order_by, $order);
echo "<th>Tools</th>\n";
echo th_order_by('phone_description', 'Description', $order_by, $order);
echo th_order_by('phone_type', $text['label-phone_type'], $order_by, $order);
echo th_order_by('phone_number', $text['label-phone_number'], $order_by, $order);
echo "<th>".$text['label-phone_tools']."</th>\n";
echo th_order_by('phone_description', $text['label-phone_description'], $order_by, $order);
echo "<td align='right' width='42'>\n";
echo " <a href='contact_phones_edit.php?contact_uuid=".$_GET['id']."' alt='add'>$v_link_label_add</a>\n";
echo " <a href='contact_phones_edit.php?contact_uuid=".$_GET['id']."' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
echo "</td>\n";
echo "<tr>\n";
if ($result_count > 0) {
@@ -135,15 +126,15 @@ require_once "includes/paging.php";
echo " ".format_phone($row['phone_number'])."</a>&nbsp;\n";
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."' nowrap='nowrap'>\n";
echo " <a href=\"javascript:void(0)\" onclick=\"send_cmd('".PROJECT_PATH."/app/click_to_call/click_to_call.php?src_cid_name=".urlencode($row['phone_number'])."&src_cid_number=".urlencode($row['phone_number'])."&dest_cid_name=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_name'])."&dest_cid_number=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_number'])."&src=".urlencode($_SESSION['user']['extension'][0]['user'])."&dest=".urlencode($row['phone_number'])."&rec=false&ringback=us-ring&auto_answer=true');\">Call</a>\n";
echo " <a href=\"javascript:void(0)\" onclick=\"send_cmd('".PROJECT_PATH."/app/click_to_call/click_to_call.php?src_cid_name=".urlencode($row['phone_number'])."&src_cid_number=".urlencode($row['phone_number'])."&dest_cid_name=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_name'])."&dest_cid_number=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_number'])."&src=".urlencode($_SESSION['user']['extension'][0]['user'])."&dest=".urlencode($row['phone_number'])."&rec=false&ringback=us-ring&auto_answer=true');\">".$text['label-phone_call']."</a>\n";
echo " &nbsp;\n";
echo " <a href=\"".PROJECT_PATH."/app/xml_cdr/xml_cdr.php?caller_id_number=".$row['phone_number']."&destination_number=".$row['phone_number']."\">CDR</a>\n";
echo " &nbsp;\n";
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['phone_description']."&nbsp;</td>\n";
echo " <td valign='top' align='right'>\n";
echo " <a href='contact_phones_edit.php?contact_uuid=".$row['contact_uuid']."&id=".$row['contact_phone_uuid']."' alt='edit'>$v_link_label_edit</a>\n";
echo " <a href='contact_phones_delete.php?contact_uuid=".$row['contact_uuid']."&id=".$row['contact_phone_uuid']."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
echo " <a href='contact_phones_edit.php?contact_uuid=".$row['contact_uuid']."&id=".$row['contact_phone_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>\n";
echo " <a href='contact_phones_delete.php?contact_uuid=".$row['contact_uuid']."&id=".$row['contact_phone_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
echo " </td>\n";
echo "</tr>\n";
if ($c==0) { $c=1; } else { $c=0; }
@@ -158,7 +149,7 @@ require_once "includes/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 width='33.3%' align='right'>\n";
echo " <a href='contact_phones_edit.php?contact_uuid=".$_GET['id']."' alt='add'>$v_link_label_add</a>\n";
echo " <a href='contact_phones_edit.php?contact_uuid=".$_GET['id']."' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
@@ -168,12 +159,4 @@ require_once "includes/paging.php";
echo "</table>";
echo "</div>";
//echo "</td>";
//echo "</tr>";
//echo "</table>";
//echo "</div>";
//echo "<br><br>";
//include the footer
//require_once "includes/footer.php";
?>

View File

@@ -34,6 +34,12 @@ else {
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
if (count($_GET)>0) {
$id = check_str($_GET["id"]);
$contact_uuid = check_str($_GET["contact_uuid"]);
@@ -52,7 +58,7 @@ if (strlen($id)>0) {
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=contacts_edit.php?id=$contact_uuid\">\n";
echo "<div align='center'>\n";
echo "Delete Complete\n";
echo $text['message-delete']."\n";
echo "</div>\n";
require_once "includes/footer.php";

View File

@@ -34,6 +34,12 @@ else {
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
//action add or update
if (isset($_REQUEST["id"])) {
$action = "update";
@@ -66,9 +72,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
}
//check for all required data
//if (strlen($domain_uuid) == 0) { $msg .= "Please provide: domain_uuid<br>\n"; }
//if (strlen($phone_type) == 0) { $msg .= "Please provide: Telephone Type.<br>\n"; }
//if (strlen($phone_number) == 0) { $msg .= "Please provide: Telephone Number<br>\n"; }
//if (strlen($phone_type) == 0) { $msg .= $text['message-required'].$text['label-phone_type']."<br>\n"; }
//if (strlen($phone_number) == 0) { $msg .= $text['message-required'].$text['label-phone_number']."<br>\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
require_once "includes/persistformvar.php";
@@ -112,7 +117,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=contacts_edit.php?id=$contact_uuid\">\n";
echo "<div align='center'>\n";
echo "Add Complete\n";
echo $text['message-add']."\n";
echo "</div>\n";
require_once "includes/footer.php";
return;
@@ -133,12 +138,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=contacts_edit.php?id=$contact_uuid\">\n";
echo "<div align='center'>\n";
echo "Update Complete\n";
echo $text['message-update']."\n";
echo "</div>\n";
require_once "includes/footer.php";
return;
} //if ($action == "update")
} //if ($_POST["persistformvar"] != "true")
} //if ($_POST["persistformvar"] != "true")
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
//pre-populate the form
@@ -161,6 +166,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//show the header
require_once "includes/header.php";
if ($action == "update") {
$page["title"] = $text['title-contact_phones-edit'];
}
else if ($action == "add") {
$page["title"] = $text['title-contact_phones-add'];
}
//show the content
echo "<div align='center'>";
@@ -173,18 +184,24 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "<div align='center'>\n";
echo "<table width='100%' align='left' border='0' cellpadding='6' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td align='left' width='30%' nowrap='nowrap'><b>Contact Phone</b></td>\n";
echo "<td width='70%' align='right'><input type='button' class='btn' name='' alt='back' onclick=\"window.location='contacts_edit.php?id=$contact_uuid'\" value='Back'></td>\n";
echo "<td align='left' width='30%' nowrap='nowrap'><b>";
if ($action == "update") {
echo $text['header-contact_phones-edit'];
}
else if ($action == "add") {
echo $text['header-contact_phones-add'];
}
echo "</b></td>\n";
echo "<td width='70%' align='right'><input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='contacts_edit.php?id=$contact_uuid'\" value='".$text['button-back']."'></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align='left' colspan='2'>\n";
//echo "Phone Numbers<br /><br />\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Type:\n";
echo " ".$text['label-phone_type'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
if (is_array($_SESSION["contact"]["phone_type"])) {
@@ -192,7 +209,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " <select class='formfld' style='width:85%;' name='phone_type'>\n";
echo " <option value=''></option>\n";
foreach($_SESSION["contact"]["phone_type"] as $row) {
if ($row == $phone_type) {
if ($row == $phone_type) {
echo " <option value='".$row."' selected='selected'>".$row."</option>\n";
}
else {
@@ -204,97 +221,97 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
else {
echo " <select class='formfld' name='phone_type'>\n";
echo " <option value=''></option>\n";
if ($phone_type == "home") {
if ($phone_type == "home") {
echo " <option value='home' selected='selected'>Home</option>\n";
}
else {
echo " <option value='home'>Home</option>\n";
}
if ($phone_type == "work") {
if ($phone_type == "work") {
echo " <option value='work' selected='selected'>Work</option>\n";
}
else {
echo " <option value='work'>Work</option>\n";
}
if ($phone_type == "pref") {
if ($phone_type == "pref") {
echo " <option value='pref' selected='selected'>Pref</option>\n";
}
else {
echo " <option value='pref'>Pref</option>\n";
}
if ($phone_type == "voice") {
if ($phone_type == "voice") {
echo " <option value='voice' selected='selected'>Voice</option>\n";
}
else {
echo " <option value='voice'>Voice</option>\n";
}
if ($phone_type == "fax") {
if ($phone_type == "fax") {
echo " <option value='fax' selected='selected'>Fax</option>\n";
}
else {
echo " <option value='fax'>Fax</option>\n";
}
if ($phone_type == "msg") {
if ($phone_type == "msg") {
echo " <option value='msg' selected='selected'>MSG</option>\n";
}
else {
echo " <option value='msg'>MSG</option>\n";
}
if ($phone_type == "cell") {
if ($phone_type == "cell") {
echo " <option value='cell' selected='selected'>Cell</option>\n";
}
else {
echo " <option value='cell'>Cell</option>\n";
}
if ($phone_type == "pager") {
if ($phone_type == "pager") {
echo " <option value='pager' selected='selected'>Pager</option>\n";
}
else {
echo " <option value='pager'>Pager</option>\n";
}
if ($phone_type == "bbs") {
if ($phone_type == "bbs") {
echo " <option value='bbs' selected='selected'>BBS</option>\n";
}
else {
echo " <option value='bbs'>BBS</option>\n";
}
if ($phone_type == "modem") {
if ($phone_type == "modem") {
echo " <option value='modem' selected='selected'>Modem</option>\n";
}
else {
echo " <option value='modem'>Modem</option>\n";
}
if ($phone_type == "car") {
if ($phone_type == "car") {
echo " <option value='car' selected='selected'>Car</option>\n";
}
else {
echo " <option value='car'>Car</option>\n";
}
if ($phone_type == "isdn") {
if ($phone_type == "isdn") {
echo " <option value='isdn' selected='selected'>ISDN</option>\n";
}
else {
echo " <option value='isdn'>ISDN</option>\n";
}
if ($phone_type == "video") {
if ($phone_type == "video") {
echo " <option value='video' selected='selected'>Video</option>\n";
}
else {
echo " <option value='video'>Video</option>\n";
}
if ($phone_type == "pcs") {
if ($phone_type == "pcs") {
echo " <option value='pcs' selected='selected'>PCS</option>\n";
}
else {
echo " <option value='pcs'>PCS</option>\n";
}
if ($phone_type == "iana-token") {
if ($phone_type == "iana-token") {
echo " <option value='iana-token' selected='selected'>iana-token</option>\n";
}
else {
echo " <option value='iana-token'>iana-token</option>\n";
}
if ($phone_type == "x-name") {
if ($phone_type == "x-name") {
echo " <option value='x-name' selected='selected'>x-name</option>\n";
}
else {
@@ -303,40 +320,40 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " </select>\n";
}
echo "<br />\n";
echo "Enter the phone type.\n";
echo $text['description-phone_type']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Phone Number:\n";
echo " ".$text['label-phone_number'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='phone_number' maxlength='255' value=\"$phone_number\">\n";
echo "<br />\n";
echo "Enter the phone number.\n";
echo $text['description-phone_number']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Extension:\n";
echo " ".$text['label-phone_extension'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='phone_extension' maxlength='255' value=\"$phone_extension\">\n";
echo "<br />\n";
echo "Enter the extension.\n";
echo $text['description-phone_extension']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Description:\n";
echo " ".$text['label-phone_description'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='phone_description' maxlength='255' value=\"$phone_description\">\n";
echo "<br />\n";
echo "Enter the description.\n";
echo $text['description-phone_description']."\n";
echo "</td>\n";
echo "</tr>\n";
@@ -346,7 +363,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
if ($action == "update") {
echo " <input type='hidden' name='contact_phone_uuid' value='$contact_phone_uuid'>\n";
}
echo " <input type='submit' name='submit' class='btn' value='Save'>\n";
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
echo " </td>\n";
echo " </tr>";
echo "</table>";

View File

@@ -33,7 +33,16 @@ else {
echo "access denied";
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
require_once "includes/header.php";
$page["title"] = $text['title-contacts'];
require_once "includes/paging.php";
//get the search criteria
@@ -53,18 +62,18 @@ require_once "includes/paging.php";
echo "<table width=\"100%\" border=\"0\" cellpadding=\"5\" cellspacing=\"0\">\n";
echo " <tr>\n";
echo " <td align=\"left\" valign=\"top\"><strong>Contacts</strong><br>\n";
echo " The contact is a list of individuals and organizations.\n";
echo " <td align=\"left\" valign=\"top\"><strong>".$text['header-contacts']."</strong><br>\n";
echo " ".$text['description-contacts']."\n";
echo " </td>\n";
echo " <td align=\"right\" valign=\"top\">\n";
echo " <form method=\"GET\" name=\"frm_search\" action=\"\">\n";
echo " <input class=\"formfld\" type=\"text\" name=\"search_all\" value=\"$search_all\">\n";
echo " <input class=\"btn\" type=\"submit\" name=\"submit\" value=\"Search All\">\n";
echo " <input class=\"btn\" type=\"submit\" name=\"submit\" value=\"".$text['button-search']."\">\n";
echo " </form>\n";
echo " </td>\n";
if (permission_exists('contacts_add')) {
echo " <td align=\"right\" valign=\"top\" width=\"50px\">\n";
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='contact_import.php'\" value='Import'>\n";
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='contact_import.php'\" value='".$text['button-import']."'>\n";
echo " </td>\n";
}
echo " </tr>\n";
@@ -124,9 +133,9 @@ require_once "includes/paging.php";
$rows_per_page = 150;
$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;
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 list
$sql = "select * from v_contacts ";
@@ -177,20 +186,20 @@ require_once "includes/paging.php";
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo th_order_by('contact_type', 'Type', $order_by, $order);
echo th_order_by('contact_organization', 'Organization', $order_by, $order);
echo th_order_by('contact_name_given', 'First Name', $order_by, $order);
echo th_order_by('contact_name_family', 'Last Name', $order_by, $order);
echo th_order_by('contact_nickname', 'Nickname', $order_by, $order);
echo th_order_by('contact_title', 'Title', $order_by, $order);
//echo th_order_by('contact_category', 'Category', $order_by, $order);
echo th_order_by('contact_role', 'Role', $order_by, $order);
//echo th_order_by('contact_email', 'Email', $order_by, $order);
//echo th_order_by('contact_url', 'URL', $order_by, $order);
//echo th_order_by('contact_time_zone', 'Time Zone', $order_by, $order);
//echo th_order_by('contact_note', 'Notes', $order_by, $order);
echo th_order_by('contact_type', $text['label-contact_type'], $order_by, $order);
echo th_order_by('contact_organization', $text['label-contact_organization'], $order_by, $order);
echo th_order_by('contact_name_given', $text['label-contact_name_given'], $order_by, $order);
echo th_order_by('contact_name_family', $text['label-contact_name_family'], $order_by, $order);
echo th_order_by('contact_nickname', $text['label-contact_nickname'], $order_by, $order);
echo th_order_by('contact_title', $text['label-contact_title'], $order_by, $order);
//echo th_order_by('contact_category', $text['label-contact_category'], $order_by, $order);
echo th_order_by('contact_role', $text['label-contact_role'], $order_by, $order);
//echo th_order_by('contact_email', $text['label-contact_email'], $order_by, $order);
//echo th_order_by('contact_url', $text['label-contact_url'], $order_by, $order);
//echo th_order_by('contact_time_zone', $text['label-contact_time_zone'], $order_by, $order);
//echo th_order_by('contact_note', $text['label-contact_note'], $order_by, $order);
echo "<td align='right' width='42'>\n";
echo " <a href='contacts_edit.php' alt='add'>$v_link_label_add</a>\n";
echo " <a href='contacts_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
echo "</td>\n";
echo "<tr>\n";
@@ -210,8 +219,8 @@ require_once "includes/paging.php";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['contact_time_zone']."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['contact_note']."&nbsp;</td>\n";
echo " <td valign='top' align='right'>\n";
echo " <a href='contacts_edit.php?id=".$row['contact_uuid']."&query_string=".urlencode($_SERVER["QUERY_STRING"])."' alt='edit'>$v_link_label_edit</a>\n";
echo " <a href='contacts_delete.php?id=".$row['contact_uuid']."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
echo " <a href='contacts_edit.php?id=".$row['contact_uuid']."&query_string=".urlencode($_SERVER["QUERY_STRING"])."' alt='".$text['button-edit']."'>$v_link_label_edit</a>\n";
echo " <a href='contacts_delete.php?id=".$row['contact_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
echo " </td>\n";
echo "</tr>\n";
if ($c==0) { $c=1; } else { $c=0; }
@@ -226,7 +235,7 @@ require_once "includes/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 width='33.3%' align='right'>\n";
echo " <a href='contacts_edit.php' alt='add'>$v_link_label_add</a>\n";
echo " <a href='contacts_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";

View File

@@ -34,6 +34,12 @@ else {
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
if (count($_GET)>0) {
$id = check_str($_GET["id"]);
}
@@ -78,7 +84,7 @@ if (strlen($id)>0) {
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=contacts.php\">\n";
echo "<div align='center'>\n";
echo "Delete Complete\n";
echo $text['message-delete']."\n";
echo "</div>\n";
require_once "includes/footer.php";
return;

View File

@@ -34,6 +34,12 @@ else {
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
//action add or update
if (isset($_REQUEST["id"])) {
$action = "update";
@@ -67,18 +73,17 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
}
//check for all required data
//if (strlen($domain_uuid) == 0) { $msg .= "Please provide: domain_uuid<br>\n"; }
//if (strlen($contact_type) == 0) { $msg .= "Please provide: Type<br>\n"; }
//if (strlen($contact_organization) == 0) { $msg .= "Please provide: Organization<br>\n"; }
//if (strlen($contact_name_given) == 0) { $msg .= "Please provide: First Name<br>\n"; }
//if (strlen($contact_name_family) == 0) { $msg .= "Please provide: Last Name<br>\n"; }
//if (strlen($contact_nickname) == 0) { $msg .= "Please provide: Nickname<br>\n"; }
//if (strlen($contact_title) == 0) { $msg .= "Please provide: Title<br>\n"; }
//if (strlen($contact_role) == 0) { $msg .= "Please provide: Role<br>\n"; }
//if (strlen($contact_email) == 0) { $msg .= "Please provide: Email<br>\n"; }
//if (strlen($contact_url) == 0) { $msg .= "Please provide: URL<br>\n"; }
//if (strlen($contact_time_zone) == 0) { $msg .= "Please provide: Time Zone<br>\n"; }
//if (strlen($contact_note) == 0) { $msg .= "Please provide: Notes<br>\n"; }
//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_given) == 0) { $msg .= $text['message-required'].$text['label-contact_name_given']."<br>\n"; }
//if (strlen($contact_name_family) == 0) { $msg .= $text['message-required'].$text['label-contact_name_family']."<br>\n"; }
//if (strlen($contact_nickname) == 0) { $msg .= $text['message-required'].$text['label-contact_nickname']."<br>\n"; }
//if (strlen($contact_title) == 0) { $msg .= $text['message-required'].$text['label-contact_title']."<br>\n"; }
//if (strlen($contact_role) == 0) { $msg .= $text['message-required'].$text['label-contact_role']."<br>\n"; }
//if (strlen($contact_email) == 0) { $msg .= $text['message-required'].$text['label-contact_email']."<br>\n"; }
//if (strlen($contact_url) == 0) { $msg .= $text['message-required'].$text['label-contact_url']."<br>\n"; }
//if (strlen($contact_time_zone) == 0) { $msg .= $text['message-required'].$text['label-contact_time_zone']."<br>\n"; }
//if (strlen($contact_note) == 0) { $msg .= $text['message-required'].$text['label-contact_note']."<br>\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
require_once "includes/persistformvar.php";
@@ -136,7 +141,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=contacts.php\">\n";
echo "<div align='center'>\n";
echo "Add Complete\n";
echo $text['message-add']."\n";
echo "</div>\n";
require_once "includes/footer.php";
return;
@@ -164,12 +169,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=contacts.php\">\n";
echo "<div align='center'>\n";
echo "Update Complete\n";
echo $text['message-update']."\n";
echo "</div>\n";
require_once "includes/footer.php";
return;
} //if ($action == "update")
} //if ($_POST["persistformvar"] != "true")
} //if ($_POST["persistformvar"] != "true")
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
//pre-populate the form
@@ -201,6 +206,13 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//show the header
require_once "includes/header.php";
if ($action == "update") {
$page["title"] = $text['title-contact-edit'];
}
else if ($action == "add") {
$page["title"] = $text['title-contact-add'];
}
//show the content
echo "<div align='center'>";
@@ -212,19 +224,30 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td align='left' width='30%' nowrap='nowrap'><b>Contact</b></td>\n";
echo "<td width='70%' align='right'>\n";
echo " <input type='button' class='btn' name='' alt='qr code' onclick=\"window.location='contacts_vcard.php?id=$contact_uuid&type=image'\" value='QR Code'>\n";
echo " <input type='button' class='btn' name='' alt='vcard' onclick=\"window.location='contacts_vcard.php?id=$contact_uuid&type=download'\" value='vCard'>\n";
if ($action == "update" && is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/invoices')) {
echo " <input type='button' class='btn' name='' alt='invoice' onclick=\"window.location='".PROJECT_PATH."/app/invoices/v_invoices.php?id=$contact_uuid'\" value='Invoices'>\n";
echo "<td align='left' width='30%' nowrap='nowrap'><b>";
switch ($action) {
case "add" : echo $text['header-contact-add']; break;
case "update" : echo $text['header-contact-edit']; break;
}
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='contacts.php?".$_GET["query_string"]."'\" value='Back'>\n";
echo "</b></td>\n";
echo "<td width='70%' align='right'>\n";
if ($action == "update") {
echo " <input type='button' class='btn' name='' alt='".$text['button-qr_code']."' onclick=\"window.location='contacts_vcard.php?id=$contact_uuid&type=image'\" value='".$text['button-qr_code']."'>\n";
echo " <input type='button' class='btn' name='' alt='".$text['button-vcard']."' onclick=\"window.location='contacts_vcard.php?id=$contact_uuid&type=download'\" value='".$text['button-vcard']."'>\n";
}
if ($action == "update" && is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/invoices')) {
echo " <input type='button' class='btn' name='' alt='".$text['button-invoices']."' onclick=\"window.location='".PROJECT_PATH."/app/invoices/v_invoices.php?id=$contact_uuid'\" value='".$text['button-invoices']."'>\n";
}
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='contacts.php?".$_GET["query_string"]."'\" value='".$text['button-back']."'>\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align=\"left\" colspan='2'>\n";
echo "The contact is a list of individuals and organizations.<br /><br />\n";
switch ($action) {
case "add" : echo $text['description-contact-add']; break;
case "update" : echo $text['description-contact-edit']; break;
}
echo "<br /><br />\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
@@ -235,23 +258,18 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "<form method='post' name='frm' action=''>\n";
echo "<table border='0' width='100%'>\n";
echo "<tr>\n";
echo " <td><strong>User Information</strong></td>\n";
echo " <td>&nbsp;</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Type:\n";
echo " ".$text['label-contact_type'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
if (is_array($_SESSION["contact"]["role"])) {
sort($_SESSION["contact"]["role"]);
echo " <select class='formfld' style='width:85%;' name='contact_type'>\n";
echo " <option value=''></option>\n";
foreach($_SESSION["contact"]["type"] as $row) {
if ($row == $contact_type) {
if ($row == $contact_type) {
echo " <option value='".$row."' selected='selected'>".$row."</option>\n";
}
else {
@@ -263,67 +281,68 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
else {
echo " <select class='formfld' style='width:85%;' name='contact_type'>\n";
echo " <option value=''></option>\n";
if ($contact_type == "customer") {
if ($contact_type == "customer") {
echo " <option value='customer' selected='selected' >Customer</option>\n";
}
else {
echo " <option value='customer'>Customer</option>\n";
}
if ($contact_type == "contractor") {
if ($contact_type == "contractor") {
echo " <option value='contractor' selected='selected' >Contractor</option>\n";
}
else {
echo " <option value='contractor'>Contractor</option>\n";
}
if ($contact_type == "friend") {
if ($contact_type == "friend") {
echo " <option value='friend' selected='selected' >Friend</option>\n";
}
else {
echo " <option value='friend'>Friend</option>\n";
}
if ($contact_type == "lead") {
if ($contact_type == "lead") {
echo " <option value='lead' selected='selected' >Lead</option>\n";
}
else {
echo " <option value='lead'>Lead</option>\n";
}
if ($contact_type == "member") {
if ($contact_type == "member") {
echo " <option value='member' selected='selected' >Member</option>\n";
}
else {
echo " <option value='member'>Member</option>\n";
}
if ($contact_type == "family") {
if ($contact_type == "family") {
echo " <option value='family' selected='selected' >Family</option>\n";
}
else {
echo " <option value='family'>Family</option>\n";
}
if ($contact_type == "subscriber") {
if ($contact_type == "subscriber") {
echo " <option value='subscriber' selected='selected' >Subscriber</option>\n";
}
else {
echo " <option value='subscriber'>Subscriber</option>\n";
}
if ($contact_type == "supplier") {
if ($contact_type == "supplier") {
echo " <option value='supplier' selected='selected' >Supplier</option>\n";
}
else {
echo " <option value='supplier'>Supplier</option>\n";
}
if ($contact_type == "provider") {
if ($contact_type == "provider") {
echo " <option value='provider' selected='selected' >Provider</option>\n";
}
else {
echo " <option value='provider'>Provider</option>\n";
}
if ($contact_type == "user") {
if ($contact_type == "user") {
echo " <option value='user' selected='selected' >User</option>\n";
}
else {
echo " <option value='user'>User</option>\n";
}
if ($contact_type == "volunteer") {
if ($contact_type == "volunteer") {
echo " <option value='volunteer' selected='selected' >Volunteer</option>\n";
}
else {
@@ -332,57 +351,57 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " </select>\n";
}
echo "<br />\n";
echo "Select the contact type.\n";
echo $text['description-contact_type']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Organization:\n";
echo " ".$text['label-contact_organization'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' style='width:85%;' type='text' name='contact_organization' maxlength='255' value=\"$contact_organization\">\n";
echo "<br />\n";
echo "Enter the organization.\n";
echo $text['description-contact_organization']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " First Name:\n";
echo " ".$text['label-contact_name_given'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' style='width:85%;' type='text' name='contact_name_given' maxlength='255' value=\"$contact_name_given\">\n";
echo "<br />\n";
echo "Enter the given name.\n";
echo $text['description-contact_name_given']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Last Name:\n";
echo " ".$text['label-contact_name_family'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' style='width:85%;' type='text' name='contact_name_family' maxlength='255' value=\"$contact_name_family\">\n";
echo "<br />\n";
echo "Enter the family name.\n";
echo $text['description-contact_name_family']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Nickname:\n";
echo " ".$text['label-contact_nickname'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' style='width:85%;' type='text' name='contact_nickname' maxlength='255' value=\"$contact_nickname\">\n";
echo "<br />\n";
echo "Enter the nickname.\n";
echo $text['description-contact_nickname']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Title:\n";
echo " ".$text['label-contact_title'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
if (is_array($_SESSION["contact"]["title"])) {
@@ -390,7 +409,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " <select class='formfld' style='width:85%;' name='contact_title'>\n";
echo " <option value=''></option>\n";
foreach($_SESSION["contact"]["title"] as $row) {
if ($row == $contact_title) {
if ($row == $contact_title) {
echo " <option value='".$row."' selected='selected'>".$row."</option>\n";
}
else {
@@ -403,13 +422,13 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " <input class='formfld' style='width:85%;' type='text' name='contact_title' maxlength='255' value=\"$contact_title\">\n";
}
echo "<br />\n";
echo "Enter the title.\n";
echo $text['description-contact_title']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Category:\n";
echo " ".$text['label-contact_category'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
if (is_array($_SESSION["contact"]["category"])) {
@@ -417,7 +436,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " <select class='formfld' style='width:85%;' name='contact_category'>\n";
echo " <option value=''></option>\n";
foreach($_SESSION["contact"]["category"] as $row) {
if ($row == $contact_category) {
if ($row == $contact_category) {
echo " <option value='".$row."' selected='selected'>".$row."</option>\n";
}
else {
@@ -430,13 +449,13 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " <input class='formfld' style='width:85%;' type='text' name='contact_category' maxlength='255' value=\"$contact_category\">\n";
}
echo "<br />\n";
echo "Enter the category.\n";
echo $text['description-contact_category']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Role:\n";
echo " ".$text['label-contact_role'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
if (is_array($_SESSION["contact"]["role"])) {
@@ -444,7 +463,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " <select class='formfld' style='width:85%;' name='contact_role'>\n";
echo " <option value=''></option>\n";
foreach($_SESSION["contact"]["role"] as $row) {
if ($row == $contact_role) {
if ($row == $contact_role) {
echo " <option value='".$row."' selected='selected'>".$row."</option>\n";
}
else {
@@ -457,34 +476,29 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " <input class='formfld' style='width:85%;' type='text' name='contact_role' maxlength='255' value=\"$contact_role\">\n";
}
echo "<br />\n";
echo "Enter the role.\n";
echo $text['description-contact_role']."\n";
echo "</td>\n";
echo "</tr>\n";
//echo "<tr>\n";
//echo "<td><strong>Contact Information</strong></td>\n";
//echo "<td>&nbsp;</td>\n";
//echo "<tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Email:\n";
echo " ".$text['label-contact_email'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' style='width:85%;' type='text' name='contact_email' maxlength='255' value=\"$contact_email\">\n";
echo "<br />\n";
echo "Enter the email address.\n";
echo $text['description-contact_email']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " URL:\n";
echo " ".$text['label-contact_url'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' style='width:85%;' type='text' name='contact_url' maxlength='255' value='$contact_url'>\n";
echo "<br />\n";
echo "Enter the website address.\n";
echo $text['description-contact_url']."\n";
echo "</td>\n";
echo "</tr>\n";
@@ -495,23 +509,23 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Time Zone:\n";
echo " ".$text['label-contact_time_zone'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' style='width:85%;' type='text' name='contact_time_zone' maxlength='255' value=\"$contact_time_zone\">\n";
echo "<br />\n";
echo "Enter the time zone.\n";
echo $text['description-contact_time_zone']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Notes:\n";
echo " ".$text['label-contact_note'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' style='width:85%;' type='text' name='contact_note' maxlength='255' value='$contact_note'>\n";
echo "<br />\n";
echo "Enter the notes.\n";
echo $text['description-contact_note']."\n";
echo "</td>\n";
echo "</tr>\n";
echo " <tr>\n";
@@ -519,7 +533,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
if ($action == "update") {
echo " <input type='hidden' name='contact_uuid' value='$contact_uuid'>\n";
}
echo " <input type='submit' name='submit' class='btn' value='Save'>\n";
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
echo " </td>\n";
echo " </tr>";
echo "</table>";
@@ -540,7 +554,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
if ($action == "update") {
echo "<br/>\n";
}
echo " </td>";