From c0bb5b61530d7d4d13b87fbfabb43b66fa62bdb7 Mon Sep 17 00:00:00 2001 From: Nate Jones Date: Fri, 10 May 2013 00:40:24 +0000 Subject: [PATCH] Multilinquified Contacts app (sans \n"; + echo ""; + if ($action == "update") { + echo $text['header-contact_addresses-edit']; + } + else if ($action == "add") { + echo $text['header-contact_addresses-add']; + } + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo "Contact address information.

\n"; + if ($action == "update") { + echo $text['description-contact_addresses-edit']; + } + else if ($action == "add") { + echo $text['description-contact_addresses-add']; + } + echo "

\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " Type:\n"; + echo " ".$text['label-address_type'].":\n"; echo "\n"; echo "\n"; if (is_array($_SESSION["contact"]["address_type"])) { @@ -232,7 +256,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; echo " \n"; - if (strtolower($address_type) == "home") { + if (strtolower($address_type) == "home") { echo " \n"; } else { echo " \n"; } - if (strtolower($address_type) == "work") { + if (strtolower($address_type) == "work") { echo " \n"; } else { @@ -259,106 +283,106 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; } echo "
\n"; - echo "Enter the address type.\n"; + echo $text['description-address_type']."\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " Street Address:\n"; + echo " ".$text['label-address_street'].":\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the street address.\n"; + echo $text['description-address_street']."\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " Extended Address:\n"; + echo " ".$text['label-address_extended'].":\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the extended address.\n"; + echo $text['description-address_extended']."\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " City:\n"; + echo " ".$text['label-address_locality'].":\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the city.\n"; + echo $text['description-address_locality']."\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " Region:\n"; + echo " ".$text['label-address_region'].":\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the state or province.\n"; + echo $text['description-address_region']."\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " Postal Code:\n"; + echo " ".$text['label-address_postal_code'].":\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the postal code.\n"; + echo $text['description-address_postal_code']."\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " Country:\n"; + echo " ".$text['label-address_country'].":\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the country.\n"; + echo $text['description-address_country']."\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " Latitude:\n"; + echo " ".$text['label-address_latitude'].":\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the latitude\n"; + echo $text['description-address_latitude']."\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " Longitude:\n"; + echo " ".$text['label-address_longitude'].":\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the longitude\n"; + echo $text['description-address_longitude']."\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " Description:\n"; + echo " ".$text['label-address_description'].":\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the description.\n"; + echo $text['description-address_description']."\n"; echo "\n"; echo "\n"; @@ -368,7 +392,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if ($action == "update") { echo " \n"; } - echo " \n"; + echo " \n"; echo " \n"; echo " "; echo ""; diff --git a/app/contacts/contact_import.php b/app/contacts/contact_import.php index a7a5c75227..0ff4030058 100644 --- a/app/contacts/contact_import.php +++ b/app/contacts/contact_import.php @@ -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 "
\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Import Contacts".$text['header-contacts_import']."\n"; - echo " \n"; + echo " \n"; echo "
\n"; - echo " These contacts were added from the csv file.

\n"; + echo " ".$text['message-results']."

\n"; echo "
\n"; @@ -311,10 +317,10 @@ else { //show the results echo "\n"; echo "\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; echo "\n"; foreach($results as $row) { echo "\n"; @@ -354,11 +360,11 @@ else { echo "
NameOrganizationEmailURL".$text['label-contact_name']."".$text['label-contact_organization']."".$text['label-contact_email']."".$text['label-contact_url']."
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; - echo " Import Contacts
\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 " ".$text['header-contacts_import']."
\n"; + echo " ".$text['description-contacts_import']."\n"; echo "
\n"; - echo " \n"; + echo " \n"; echo "
"; @@ -370,7 +376,7 @@ else { echo "\n"; echo "\n"; - echo " Delimiter:\n"; + echo " ".$text['label-import_delimiter'].":\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Select the delimiter.\n"; + echo $text['description-import_delimiter']."\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " Enclosure:\n"; + echo " ".$text['label-import_enclosure'].":\n"; echo "\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Select the enclosure.\n"; + echo $text['description-import_enclosure']."\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo " File to upload:\n"; + echo " ".$text['label-import_file_upload'].":\n"; echo "\n"; echo "\n"; echo " \n"; @@ -413,7 +419,7 @@ else { echo " \n"; echo " \n"; echo " \n"; - echo " \n"; + echo " \n"; echo " \n"; echo " \n"; echo " \n"; diff --git a/app/contacts/contact_notes.php b/app/contacts/contact_notes.php index 2ff8da16f3..fccc9c5118 100644 --- a/app/contacts/contact_notes.php +++ b/app/contacts/contact_notes.php @@ -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 "
"; - //echo "\n"; - //echo "\n"; - //echo " \n"; echo "\n"; } @@ -134,7 +125,7 @@ require_once "includes/paging.php"; //echo "\n"; //echo "\n"; echo "\n"; echo "\n"; @@ -143,8 +134,8 @@ require_once "includes/paging.php"; //echo " \n"; //echo " \n"; echo " \n"; echo "\n"; @@ -164,7 +155,7 @@ require_once "includes/paging.php"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; - //echo "
"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; - //echo "\n"; - //echo "\n"; - //echo "\n"; echo "
Notes".$text['label-contact_notes']." 
\n"; - //echo " List of notes for the contact.

\n"; - //echo "
\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 "   \n"; echo "\n"; echo "
\n"; - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; echo "
Modified Date ".$row['last_mod_date']."Modified By ".$row['last_mod_user']."\n"; - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; echo "
".$row['last_mod_date']." ".$row['last_mod_user']." \n"; - echo " $v_link_label_edit\n"; - echo " $v_link_label_delete\n"; + echo " $v_link_label_edit\n"; + echo " $v_link_label_delete\n"; echo "
 $paging_controls\n"; - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; echo "
\n"; @@ -174,12 +165,4 @@ require_once "includes/paging.php"; echo ""; echo "
"; - //echo ""; - //echo ""; - //echo ""; - //echo "
"; - //echo "

"; - -//include the footer - //require_once "includes/footer.php"; ?> \ No newline at end of file diff --git a/app/contacts/contact_notes_delete.php b/app/contacts/contact_notes_delete.php index 308731e642..b07ceaeb56 100644 --- a/app/contacts/contact_notes_delete.php +++ b/app/contacts/contact_notes_delete.php @@ -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 "\n"; echo "
\n"; -echo "Delete Complete\n"; +echo $text['message-delete']."\n"; echo "
\n"; require_once "includes/footer.php"; return; diff --git a/app/contacts/contact_notes_edit.php b/app/contacts/contact_notes_edit.php index f155db0ac0..cdbaa7600a 100644 --- a/app/contacts/contact_notes_edit.php +++ b/app/contacts/contact_notes_edit.php @@ -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
\n"; } - //if (strlen($domain_uuid) == 0) { $msg .= "Please provide: domain_uuid
\n"; } - //if (strlen($last_mod_date) == 0) { $msg .= "Please provide: Last Modified Date
\n"; } - //if (strlen($last_mod_user) == 0) { $msg .= "Please provide: Last Modified By
\n"; } + //if (strlen($contact_note) == 0) { $msg .= $text['message-required'].$text['label-contact_note']."
\n"; } + //if (strlen($domain_uuid) == 0) { $msg .= $text['message-required']."domain_uuid
\n"; } + //if (strlen($last_mod_date) == 0) { $msg .= $text['message-required']."Last Modified Date
\n"; } + //if (strlen($last_mod_user) == 0) { $msg .= $text['message-required']."Last Modified By
\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 "\n"; echo "
\n"; - echo "Add Complete\n"; + echo $text['message-add']."\n"; echo "
\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 "\n"; echo "
\n"; - echo "Update Complete\n"; + echo $text['message-update']."\n"; echo "
\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 "
"; @@ -170,17 +182,16 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo "\n"; if ($action == "add") { - echo "\n"; + echo "\n"; } if ($action == "update") { - echo "\n"; + echo "\n"; } - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; echo "\n"; echo "\n"; echo " "; echo "
Add Notes".$text['header-contact_notes-add']."Edit Notes".$text['header-contact_notes-edit']."
\n"; - echo " Notes:\n"; + echo " ".$text['label-contact_note'].":\n"; echo "\n"; echo " \n"; @@ -194,7 +205,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if ($action == "update") { echo " \n"; } - echo " \n"; + echo " \n"; echo "
"; diff --git a/app/contacts/contact_phones.php b/app/contacts/contact_phones.php index 0f6c5c16d8..e07c65f98a 100644 --- a/app/contacts/contact_phones.php +++ b/app/contacts/contact_phones.php @@ -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 "\n"; //show the content - //echo "
"; - //echo "\n"; - //echo "\n"; - //echo "
\n"; - //echo "
"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; - //echo "\n"; - //echo "\n"; - //echo "\n"; echo "
Phone Numbers".$text['label-phone_numbers']." 
\n"; - //echo " List of phone numbers for the contact.

\n"; - //echo "
\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 "
\n"; echo "\n"; echo "\n"; - echo th_order_by('phone_type', 'Type', $order_by, $order); - echo th_order_by('phone_number', 'Numbers', $order_by, $order); - echo "\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 "\n"; + echo th_order_by('phone_description', $text['label-phone_description'], $order_by, $order); echo "\n"; echo "\n"; if ($result_count > 0) { @@ -135,15 +126,15 @@ require_once "includes/paging.php"; echo " ".format_phone($row['phone_number'])." \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "\n"; if ($c==0) { $c=1; } else { $c=0; } @@ -158,7 +149,7 @@ require_once "includes/paging.php"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
Tools".$text['label-phone_tools']."\n"; - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; echo "
\n"; - echo " Call\n"; + echo " ".$text['label-phone_call']."\n"; echo "  \n"; echo " CDR\n"; echo "  \n"; echo " ".$row['phone_description']." \n"; - echo " $v_link_label_edit\n"; - echo " $v_link_label_delete\n"; + echo " $v_link_label_edit\n"; + echo " $v_link_label_delete\n"; echo "
 $paging_controls\n"; - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; echo "
\n"; @@ -168,12 +159,4 @@ require_once "includes/paging.php"; echo "
"; echo "
"; - //echo ""; - //echo ""; - //echo ""; - //echo "
"; - //echo "

"; - -//include the footer - //require_once "includes/footer.php"; ?> \ No newline at end of file diff --git a/app/contacts/contact_phones_delete.php b/app/contacts/contact_phones_delete.php index fe8dadf675..57b5474f13 100644 --- a/app/contacts/contact_phones_delete.php +++ b/app/contacts/contact_phones_delete.php @@ -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 "\n"; echo "
\n"; -echo "Delete Complete\n"; +echo $text['message-delete']."\n"; echo "
\n"; require_once "includes/footer.php"; diff --git a/app/contacts/contact_phones_edit.php b/app/contacts/contact_phones_edit.php index bcf6540aa4..aaf956f598 100644 --- a/app/contacts/contact_phones_edit.php +++ b/app/contacts/contact_phones_edit.php @@ -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
\n"; } - //if (strlen($phone_type) == 0) { $msg .= "Please provide: Telephone Type.
\n"; } - //if (strlen($phone_number) == 0) { $msg .= "Please provide: Telephone Number
\n"; } + //if (strlen($phone_type) == 0) { $msg .= $text['message-required'].$text['label-phone_type']."
\n"; } + //if (strlen($phone_number) == 0) { $msg .= $text['message-required'].$text['label-phone_number']."
\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 "\n"; echo "
\n"; - echo "Add Complete\n"; + echo $text['message-add']."\n"; echo "
\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 "\n"; echo "
\n"; - echo "Update Complete\n"; + echo $text['message-update']."\n"; echo "
\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 "
"; @@ -173,18 +184,24 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "
\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -346,7 +363,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if ($action == "update") { echo " \n"; } - echo " \n"; + echo " \n"; echo " \n"; echo " "; echo "
Contact Phone"; + if ($action == "update") { + echo $text['header-contact_phones-edit']; + } + else if ($action == "add") { + echo $text['header-contact_phones-add']; + } + echo "
\n"; - //echo "Phone Numbers

\n"; echo "
\n"; - echo " Type:\n"; + echo " ".$text['label-phone_type'].":\n"; echo "\n"; if (is_array($_SESSION["contact"]["phone_type"])) { @@ -192,7 +209,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; echo " \n"; - if ($phone_type == "home") { + if ($phone_type == "home") { echo " \n"; } else { echo " \n"; } - if ($phone_type == "work") { + if ($phone_type == "work") { echo " \n"; } else { echo " \n"; } - if ($phone_type == "pref") { + if ($phone_type == "pref") { echo " \n"; } else { echo " \n"; } - if ($phone_type == "voice") { + if ($phone_type == "voice") { echo " \n"; } else { echo " \n"; } - if ($phone_type == "fax") { + if ($phone_type == "fax") { echo " \n"; } else { echo " \n"; } - if ($phone_type == "msg") { + if ($phone_type == "msg") { echo " \n"; } else { echo " \n"; } - if ($phone_type == "cell") { + if ($phone_type == "cell") { echo " \n"; } else { echo " \n"; } - if ($phone_type == "pager") { + if ($phone_type == "pager") { echo " \n"; } else { echo " \n"; } - if ($phone_type == "bbs") { + if ($phone_type == "bbs") { echo " \n"; } else { echo " \n"; } - if ($phone_type == "modem") { + if ($phone_type == "modem") { echo " \n"; } else { echo " \n"; } - if ($phone_type == "car") { + if ($phone_type == "car") { echo " \n"; } else { echo " \n"; } - if ($phone_type == "isdn") { + if ($phone_type == "isdn") { echo " \n"; } else { echo " \n"; } - if ($phone_type == "video") { + if ($phone_type == "video") { echo " \n"; } else { echo " \n"; } - if ($phone_type == "pcs") { + if ($phone_type == "pcs") { echo " \n"; } else { echo " \n"; } - if ($phone_type == "iana-token") { + if ($phone_type == "iana-token") { echo " \n"; } else { echo " \n"; } - if ($phone_type == "x-name") { + if ($phone_type == "x-name") { echo " \n"; } else { @@ -303,40 +320,40 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; } echo "
\n"; - echo "Enter the phone type.\n"; + echo $text['description-phone_type']."\n"; echo "
\n"; - echo " Phone Number:\n"; + echo " ".$text['label-phone_number'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the phone number.\n"; + echo $text['description-phone_number']."\n"; echo "
\n"; - echo " Extension:\n"; + echo " ".$text['label-phone_extension'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the extension.\n"; + echo $text['description-phone_extension']."\n"; echo "
\n"; - echo " Description:\n"; + echo " ".$text['label-phone_description'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the description.\n"; + echo $text['description-phone_description']."\n"; echo "
"; diff --git a/app/contacts/contacts.php b/app/contacts/contacts.php index 209167f407..4b3318eb14 100644 --- a/app/contacts/contacts.php +++ b/app/contacts/contacts.php @@ -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 "\n"; echo " \n"; - echo " \n"; echo " \n"; if (permission_exists('contacts_add')) { echo " \n"; } echo " \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 "
\n"; echo "
Contacts
\n"; - echo " The contact is a list of individuals and organizations.\n"; + echo "
".$text['header-contacts']."
\n"; + echo " ".$text['description-contacts']."\n"; echo "
\n"; echo "
\n"; echo " \n"; - echo " \n"; + echo " \n"; echo "
\n"; echo "
\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo "\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 "\n"; echo "\n"; @@ -210,8 +219,8 @@ require_once "includes/paging.php"; //echo " \n"; //echo " \n"; echo " \n"; echo "\n"; if ($c==0) { $c=1; } else { $c=0; } @@ -226,7 +235,7 @@ require_once "includes/paging.php"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; echo "
".$row['contact_time_zone']." ".$row['contact_note']." \n"; - echo " $v_link_label_edit\n"; - echo " $v_link_label_delete\n"; + echo " $v_link_label_edit\n"; + echo " $v_link_label_delete\n"; echo "
 $paging_controls\n"; - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; echo "
\n"; diff --git a/app/contacts/contacts_delete.php b/app/contacts/contacts_delete.php index 560abdd98a..2807677dc6 100644 --- a/app/contacts/contacts_delete.php +++ b/app/contacts/contacts_delete.php @@ -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 "\n"; echo "
\n"; - echo "Delete Complete\n"; + echo $text['message-delete']."\n"; echo "
\n"; require_once "includes/footer.php"; return; diff --git a/app/contacts/contacts_edit.php b/app/contacts/contacts_edit.php index 2668bbc09b..f139c89eb4 100644 --- a/app/contacts/contacts_edit.php +++ b/app/contacts/contacts_edit.php @@ -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
\n"; } - //if (strlen($contact_type) == 0) { $msg .= "Please provide: Type
\n"; } - //if (strlen($contact_organization) == 0) { $msg .= "Please provide: Organization
\n"; } - //if (strlen($contact_name_given) == 0) { $msg .= "Please provide: First Name
\n"; } - //if (strlen($contact_name_family) == 0) { $msg .= "Please provide: Last Name
\n"; } - //if (strlen($contact_nickname) == 0) { $msg .= "Please provide: Nickname
\n"; } - //if (strlen($contact_title) == 0) { $msg .= "Please provide: Title
\n"; } - //if (strlen($contact_role) == 0) { $msg .= "Please provide: Role
\n"; } - //if (strlen($contact_email) == 0) { $msg .= "Please provide: Email
\n"; } - //if (strlen($contact_url) == 0) { $msg .= "Please provide: URL
\n"; } - //if (strlen($contact_time_zone) == 0) { $msg .= "Please provide: Time Zone
\n"; } - //if (strlen($contact_note) == 0) { $msg .= "Please provide: Notes
\n"; } + //if (strlen($contact_type) == 0) { $msg .= $text['message-required'].$text['label-contact_type']."
\n"; } + //if (strlen($contact_organization) == 0) { $msg .= $text['message-required'].$text['label-contact_organization']."
\n"; } + //if (strlen($contact_name_given) == 0) { $msg .= $text['message-required'].$text['label-contact_name_given']."
\n"; } + //if (strlen($contact_name_family) == 0) { $msg .= $text['message-required'].$text['label-contact_name_family']."
\n"; } + //if (strlen($contact_nickname) == 0) { $msg .= $text['message-required'].$text['label-contact_nickname']."
\n"; } + //if (strlen($contact_title) == 0) { $msg .= $text['message-required'].$text['label-contact_title']."
\n"; } + //if (strlen($contact_role) == 0) { $msg .= $text['message-required'].$text['label-contact_role']."
\n"; } + //if (strlen($contact_email) == 0) { $msg .= $text['message-required'].$text['label-contact_email']."
\n"; } + //if (strlen($contact_url) == 0) { $msg .= $text['message-required'].$text['label-contact_url']."
\n"; } + //if (strlen($contact_time_zone) == 0) { $msg .= $text['message-required'].$text['label-contact_time_zone']."
\n"; } + //if (strlen($contact_note) == 0) { $msg .= $text['message-required'].$text['label-contact_note']."
\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 "\n"; echo "
\n"; - echo "Add Complete\n"; + echo $text['message-add']."\n"; echo "
\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 "\n"; echo "
\n"; - echo "Update Complete\n"; + echo $text['message-update']."\n"; echo "
\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 "
"; @@ -212,19 +224,30 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "
\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Contact\n"; - echo " \n"; - echo " \n"; - if ($action == "update" && is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/invoices')) { - echo " \n"; + echo ""; + switch ($action) { + case "add" : echo $text['header-contact-add']; break; + case "update" : echo $text['header-contact-edit']; break; } - echo " \n"; + echo "\n"; + if ($action == "update") { + echo " \n"; + echo " \n"; + } + if ($action == "update" && is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/invoices')) { + echo " \n"; + } + echo " \n"; echo "
\n"; - echo "The contact is a list of individuals and organizations.

\n"; + switch ($action) { + case "add" : echo $text['description-contact-add']; break; + case "update" : echo $text['description-contact-edit']; break; + } + echo "

\n"; echo "
\n"; @@ -235,23 +258,18 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "
\n"; echo "\n"; - echo "\n"; - echo " \n"; - echo " \n"; - echo "\n"; - echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - //echo "\n"; - //echo "\n"; - //echo "\n"; - //echo "\n"; - echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -495,23 +509,23 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo " \n"; @@ -519,7 +533,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if ($action == "update") { echo " \n"; } - echo " \n"; + echo " \n"; echo " \n"; echo " "; echo "
User Information 
\n"; - echo " Type:\n"; + echo " ".$text['label-contact_type'].":\n"; echo "\n"; - + if (is_array($_SESSION["contact"]["role"])) { sort($_SESSION["contact"]["role"]); echo " \n"; echo " \n"; - if ($contact_type == "customer") { + + if ($contact_type == "customer") { echo " \n"; } else { echo " \n"; } - if ($contact_type == "contractor") { + if ($contact_type == "contractor") { echo " \n"; } else { echo " \n"; } - if ($contact_type == "friend") { + if ($contact_type == "friend") { echo " \n"; } else { echo " \n"; } - if ($contact_type == "lead") { + if ($contact_type == "lead") { echo " \n"; } else { echo " \n"; } - if ($contact_type == "member") { + if ($contact_type == "member") { echo " \n"; } else { echo " \n"; } - if ($contact_type == "family") { + if ($contact_type == "family") { echo " \n"; } else { echo " \n"; } - if ($contact_type == "subscriber") { + if ($contact_type == "subscriber") { echo " \n"; } else { echo " \n"; } - if ($contact_type == "supplier") { + if ($contact_type == "supplier") { echo " \n"; } else { echo " \n"; } - if ($contact_type == "provider") { + if ($contact_type == "provider") { echo " \n"; } else { echo " \n"; } - if ($contact_type == "user") { + if ($contact_type == "user") { echo " \n"; } else { echo " \n"; } - if ($contact_type == "volunteer") { + if ($contact_type == "volunteer") { echo " \n"; } else { @@ -332,57 +351,57 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; } echo "
\n"; - echo "Select the contact type.\n"; + echo $text['description-contact_type']."\n"; echo "
\n"; - echo " Organization:\n"; + echo " ".$text['label-contact_organization'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the organization.\n"; + echo $text['description-contact_organization']."\n"; echo "
\n"; - echo " First Name:\n"; + echo " ".$text['label-contact_name_given'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the given name.\n"; + echo $text['description-contact_name_given']."\n"; echo "
\n"; - echo " Last Name:\n"; + echo " ".$text['label-contact_name_family'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the family name.\n"; + echo $text['description-contact_name_family']."\n"; echo "
\n"; - echo " Nickname:\n"; + echo " ".$text['label-contact_nickname'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the nickname.\n"; + echo $text['description-contact_nickname']."\n"; echo "
\n"; - echo " Title:\n"; + echo " ".$text['label-contact_title'].":\n"; echo "\n"; if (is_array($_SESSION["contact"]["title"])) { @@ -390,7 +409,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; } echo "
\n"; - echo "Enter the title.\n"; + echo $text['description-contact_title']."\n"; echo "
\n"; - echo " Category:\n"; + echo " ".$text['label-contact_category'].":\n"; echo "\n"; if (is_array($_SESSION["contact"]["category"])) { @@ -417,7 +436,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; } echo "
\n"; - echo "Enter the category.\n"; + echo $text['description-contact_category']."\n"; echo "
\n"; - echo " Role:\n"; + echo " ".$text['label-contact_role'].":\n"; echo "\n"; if (is_array($_SESSION["contact"]["role"])) { @@ -444,7 +463,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; } echo "
\n"; - echo "Enter the role.\n"; + echo $text['description-contact_role']."\n"; echo "
Contact Information 
\n"; - echo " Email:\n"; + echo " ".$text['label-contact_email'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the email address.\n"; + echo $text['description-contact_email']."\n"; echo "
\n"; - echo " URL:\n"; + echo " ".$text['label-contact_url'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the website address.\n"; + echo $text['description-contact_url']."\n"; echo "
\n"; - echo " Time Zone:\n"; + echo " ".$text['label-contact_time_zone'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the time zone.\n"; + echo $text['description-contact_time_zone']."\n"; echo "
\n"; - echo " Notes:\n"; + echo " ".$text['label-contact_note'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the notes.\n"; + echo $text['description-contact_note']."\n"; echo "
"; @@ -540,7 +554,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if ($action == "update") { echo "
\n"; - + } echo " ";