Przeglądaj źródła

Contacts: Added Prefix, Middle and Suffix name fields.

Nate Jones 10 lat temu
rodzic
commit
194ab6ebfa
3 zmienionych plików z 93 dodań i 0 usunięć
  1. 12 0
      app_config.php
  2. 30 0
      app_languages.php
  3. 51 0
      contact_edit.php

+ 12 - 0
app_config.php

@@ -169,14 +169,26 @@
 		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
 		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the organization.";
 		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "contact_name_prefix";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the name prefix.";
+		$z++;
 		$apps[$x]['db'][$y]['fields'][$z]['name'] = "contact_name_given";
 		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
 		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the given name.";
 		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "contact_name_middle";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the middle name.";
+		$z++;
 		$apps[$x]['db'][$y]['fields'][$z]['name'] = "contact_name_family";
 		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
 		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the family name.";
 		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "contact_name_suffix";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the name suffix.";
+		$z++;
 		$apps[$x]['db'][$y]['fields'][$z]['name'] = "contact_nickname";
 		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
 		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the nickname.";

+ 30 - 0
app_languages.php

@@ -82,6 +82,16 @@
 		$text['label-contact_name']['pt-pt'] = "Nome";
 		$text['label-contact_name']['fr-fr'] = "Nom";
 
+		$text['label-contact_name_prefix']['en-us'] = "Prefix";
+		$text['label-contact_name_prefix']['es-cl'] = "Prefijo";
+		$text['label-contact_name_prefix']['pt-pt'] = "Prefixo";
+		$text['label-contact_name_prefix']['fr-fr'] = "Préfixe";
+
+		$text['description-contact_name_prefix']['en-us'] = "Enter the name prefix.";
+		$text['description-contact_name_prefix']['es-cl'] = "Introduzca el prefijo del nombre.";
+		$text['description-contact_name_prefix']['pt-pt'] = "Digite o prefixo do nome.";
+		$text['description-contact_name_prefix']['fr-fr'] = "Entrez le préfixe de nom.";
+
 		$text['label-contact_name_given']['en-us'] = "First Name";
 		$text['label-contact_name_given']['es-cl'] = "Primer Nombre";
 		$text['label-contact_name_given']['pt-pt'] = "Primeiro Nome";
@@ -92,6 +102,16 @@
 		$text['description-contact_name_given']['pt-pt'] = "Introduzir o nome";
 		$text['description-contact_name_given']['fr-fr'] = "";
 
+		$text['label-contact_name_middle']['en-us'] = "Middle";
+		$text['label-contact_name_middle']['es-cl'] = "Segundo Nombre";
+		$text['label-contact_name_middle']['pt-pt'] = "Nome Do Meio";
+		$text['label-contact_name_middle']['fr-fr'] = "Deuxième Nom";
+
+		$text['description-contact_name_middle']['en-us'] = "Enter the middle name.";
+		$text['description-contact_name_middle']['es-cl'] = "Introduzca el segundo nombre.";
+		$text['description-contact_name_middle']['pt-pt'] = "Digite o nome do meio.";
+		$text['description-contact_name_middle']['fr-fr'] = "Entrez le nom du milieu.";
+
 		$text['label-contact_name_family']['en-us'] = "Last Name";
 		$text['label-contact_name_family']['es-cl'] = "Segundo Nombre";
 		$text['label-contact_name_family']['pt-pt'] = "Último nome";
@@ -102,6 +122,16 @@
 		$text['description-contact_name_family']['pt-pt'] = "Introduzir o nome de família";
 		$text['description-contact_name_family']['fr-fr'] = "";
 
+		$text['label-contact_name_suffix']['en-us'] = "Suffix";
+		$text['label-contact_name_suffix']['es-cl'] = "Sufijo";
+		$text['label-contact_name_suffix']['pt-pt'] = "Sufixo";
+		$text['label-contact_name_suffix']['fr-fr'] = "Suffixe";
+
+		$text['description-contact_name_suffix']['en-us'] = "Enter the name suffix.";
+		$text['description-contact_name_suffix']['es-cl'] = "";
+		$text['description-contact_name_suffix']['pt-pt'] = "";
+		$text['description-contact_name_suffix']['fr-fr'] = "";
+
 		$text['label-contact_nickname']['en-us'] = "Nickname";
 		$text['label-contact_nickname']['es-cl'] = "Apodo";
 		$text['label-contact_nickname']['pt-pt'] = "Nickname";

+ 51 - 0
contact_edit.php

@@ -68,8 +68,11 @@ else {
 	if (count($_POST)>0) {
 		$contact_type = check_str($_POST["contact_type"]);
 		$contact_organization = check_str($_POST["contact_organization"]);
+		$contact_name_prefix = check_str($_POST["contact_name_prefix"]);
 		$contact_name_given = check_str($_POST["contact_name_given"]);
+		$contact_name_middle = check_str($_POST["contact_name_middle"]);
 		$contact_name_family = check_str($_POST["contact_name_family"]);
+		$contact_name_suffix = check_str($_POST["contact_name_suffix"]);
 		$contact_nickname = check_str($_POST["contact_nickname"]);
 		$contact_title = check_str($_POST["contact_title"]);
 		$contact_category = check_str($_POST["contact_category"]);
@@ -88,8 +91,11 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
 	//check for all required data
 		//if (strlen($contact_type) == 0) { $msg .= $text['message-required'].$text['label-contact_type']."<br>\n"; }
 		//if (strlen($contact_organization) == 0) { $msg .= $text['message-required'].$text['label-contact_organization']."<br>\n"; }
+		//if (strlen($contact_name_prefix) == 0) { $msg .= $text['message-required'].$text['label-contact_name_prefix']."<br>\n"; }
 		//if (strlen($contact_name_given) == 0) { $msg .= $text['message-required'].$text['label-contact_name_given']."<br>\n"; }
+		//if (strlen($contact_name_middle) == 0) { $msg .= $text['message-required'].$text['label-contact_name_middle']."<br>\n"; }
 		//if (strlen($contact_name_family) == 0) { $msg .= $text['message-required'].$text['label-contact_name_family']."<br>\n"; }
+		//if (strlen($contact_name_suffix) == 0) { $msg .= $text['message-required'].$text['label-contact_name_suffix']."<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"; }
@@ -119,8 +125,11 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
 			$sql .= "contact_uuid, ";
 			$sql .= "contact_type, ";
 			$sql .= "contact_organization, ";
+			$sql .= "contact_name_prefix, ";
 			$sql .= "contact_name_given, ";
+			$sql .= "contact_name_middle, ";
 			$sql .= "contact_name_family, ";
+			$sql .= "contact_name_suffix, ";
 			$sql .= "contact_nickname, ";
 			$sql .= "contact_title, ";
 			$sql .= "contact_category, ";
@@ -134,8 +143,11 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
 			$sql .= "'".$contact_uuid."', ";
 			$sql .= "'".$contact_type."', ";
 			$sql .= "'".$contact_organization."', ";
+			$sql .= "'".$contact_name_prefix."', ";
 			$sql .= "'".$contact_name_given."', ";
+			$sql .= "'".$contact_name_middle."', ";
 			$sql .= "'".$contact_name_family."', ";
+			$sql .= "'".$contact_name_suffix."', ";
 			$sql .= "'".$contact_nickname."', ";
 			$sql .= "'".$contact_title."', ";
 			$sql .= "'".$contact_category."', ";
@@ -196,8 +208,11 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
 			$sql = "update v_contacts set ";
 			$sql .= "contact_type = '".$contact_type."', ";
 			$sql .= "contact_organization = '".$contact_organization."', ";
+			$sql .= "contact_name_prefix = '".$contact_name_prefix."', ";
 			$sql .= "contact_name_given = '".$contact_name_given."', ";
+			$sql .= "contact_name_middle = '".$contact_name_middle."', ";
 			$sql .= "contact_name_family = '".$contact_name_family."', ";
+			$sql .= "contact_name_suffix = '".$contact_name_suffix."', ";
 			$sql .= "contact_nickname = '".$contact_nickname."', ";
 			$sql .= "contact_title = '".$contact_title."', ";
 			$sql .= "contact_category = '".$contact_category."', ";
@@ -238,8 +253,11 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
 		foreach ($result as &$row) {
 			$contact_type = $row["contact_type"];
 			$contact_organization = $row["contact_organization"];
+			$contact_name_prefix = $row["contact_name_prefix"];
 			$contact_name_given = $row["contact_name_given"];
+			$contact_name_middle = $row["contact_name_middle"];
 			$contact_name_family = $row["contact_name_family"];
+			$contact_name_suffix = $row["contact_name_suffix"];
 			$contact_nickname = $row["contact_nickname"];
 			$contact_title = $row["contact_title"];
 			$contact_category = $row["contact_category"];
@@ -457,6 +475,17 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
 		echo "</td>\n";
 		echo "</tr>\n";
 
+		echo "<tr>\n";
+		echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
+		echo "	".$text['label-contact_name_prefix']."\n";
+		echo "</td>\n";
+		echo "<td class='vtable' align='left'>\n";
+		echo "	<input class='formfld' type='text' name='contact_name_prefix' maxlength='255' value=\"$contact_name_prefix\">\n";
+		echo "<br />\n";
+		echo $text['description-contact_name_prefix']."\n";
+		echo "</td>\n";
+		echo "</tr>\n";
+
 		echo "<tr>\n";
 		echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
 		echo "	".$text['label-contact_name_given']."\n";
@@ -468,6 +497,17 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
 		echo "</td>\n";
 		echo "</tr>\n";
 
+		echo "<tr>\n";
+		echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
+		echo "	".$text['label-contact_name_middle']."\n";
+		echo "</td>\n";
+		echo "<td class='vtable' align='left'>\n";
+		echo "	<input class='formfld' type='text' name='contact_name_middle' maxlength='255' value=\"$contact_name_middle\">\n";
+		echo "<br />\n";
+		echo $text['description-contact_name_middle']."\n";
+		echo "</td>\n";
+		echo "</tr>\n";
+
 		echo "<tr>\n";
 		echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
 		echo "	".$text['label-contact_name_family']."\n";
@@ -479,6 +519,17 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
 		echo "</td>\n";
 		echo "</tr>\n";
 
+		echo "<tr>\n";
+		echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
+		echo "	".$text['label-contact_name_suffix']."\n";
+		echo "</td>\n";
+		echo "<td class='vtable' align='left'>\n";
+		echo "	<input class='formfld' type='text' name='contact_name_suffix' maxlength='255' value=\"$contact_name_suffix\">\n";
+		echo "<br />\n";
+		echo $text['description-contact_name_suffix']."\n";
+		echo "</td>\n";
+		echo "</tr>\n";
+
 		echo "<tr>\n";
 		echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
 		echo "	".$text['label-contact_nickname']."\n";