mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-16 18:31:26 +01:00
Table upgrade and changes to implement better vcard std and more useful fields
This commit is contained in:
parent
c71a3684c7
commit
0eedd1ffc3
@ -47,40 +47,63 @@
|
||||
$url = "";
|
||||
}
|
||||
|
||||
$fields["org_name"] = $company;
|
||||
$fields["org_unit"] = $department;
|
||||
$fields["n_given"] = $firstname;
|
||||
$fields["n_family"] = $lastname;
|
||||
$fields["n_middle"] = $middle;
|
||||
$fields["n_prefix"] = $prefix;
|
||||
$fields["n_suffix"] = $suffix;
|
||||
$fields["org_name"] = $company;
|
||||
$fields["org_unit"] = $department;
|
||||
$fields["n_given"] = $firstname;
|
||||
$fields["n_family"] = $lastname;
|
||||
$fields["n_middle"] = $middle;
|
||||
$fields["n_prefix"] = $prefix;
|
||||
$fields["n_suffix"] = $suffix;
|
||||
if ($prefix) { $pspc = " "; }
|
||||
if ($middle) { $mspc = " "; } else { $nspc = " "; }
|
||||
if ($suffix) { $sspc = " "; }
|
||||
$fields["fn"] = $prefix.$pspc.$firstname.$nspc.$mspc.$middle.$mspc.$lastname.$sspc.$suffix;
|
||||
$fields["d_email"] = $email;
|
||||
$fields["d_emailtype"] = $email_type;
|
||||
$fields["title"] = $title;
|
||||
$fields["a_tel"] = $wphone;
|
||||
$fields["a_tel_work"] = "y";
|
||||
$fields["b_tel"] = $hphone;
|
||||
$fields["b_tel_home"] = "y";
|
||||
$fields["c_tel"] = $fax;
|
||||
$fields["c_tel_fax"] = "y";
|
||||
$fields["pager"] = $pager;
|
||||
$fields["mphone"] = $mphone;
|
||||
$fields["ophone"] = $ophone;
|
||||
$fields["adr_street"] = $street;
|
||||
$fields["address2"] = $address2;
|
||||
$fields["adr_locality"] = $city;
|
||||
$fields["adr_region"] = $state;
|
||||
$fields["adr_postalcode"] = $zip;
|
||||
$fields["adr_countryname"] = $country;
|
||||
$fields["tz"] = $timezone;
|
||||
$fields["bday"] = $bday;
|
||||
$fields["url"] = $url;
|
||||
$fields["note"] = $notes;
|
||||
|
||||
$fields["fn"] = $prefix.$pspc.$firstname.$nspc.$mspc.$middle.$mspc.$lastname.$sspc.$suffix;
|
||||
$fields["email"] = $email;
|
||||
$fields["email_type"] = $email_type;
|
||||
$fields["title"] = $title;
|
||||
$fields["tel_work"] = $wphone;
|
||||
$fields["tel_home"] = $hphone;
|
||||
$fields["tel_fax"] = $fax;
|
||||
$fields["tel_pager"] = $pager;
|
||||
$fields["tel_cel"] = $mphone;
|
||||
$fields["tel_msg"] = $ophone;
|
||||
$fields["adr_one_street"] = $bstreet;
|
||||
$fields["adr_one_locality"] = $bcity;
|
||||
$fields["adr_one_region"] = $bstate;
|
||||
$fields["adr_one_postalcode"] = $bzip;
|
||||
$fields["adr_one_countryname"] = $bcountry;
|
||||
|
||||
reset($this->adr_types);
|
||||
$typed = '';
|
||||
while (list($type,$val) = each($this->adr_types)) {
|
||||
$ftype = 'one_'.$type;
|
||||
eval("if (\$\$ftype=='on'\) { \$typed \.= \$type\.';'; }");
|
||||
}
|
||||
$fields["adr_one_type"] = substr($typed,0,-1);
|
||||
|
||||
$fields["address2"] = $address2;
|
||||
$fields["address3"] = $address3;
|
||||
|
||||
$fields["adr_two_street"] = $hstreet;
|
||||
$fields["adr_two_locality"] = $hcity;
|
||||
$fields["adr_two_region"] = $hstate;
|
||||
$fields["adr_two_postalcode"] = $hzip;
|
||||
$fields["adr_two_countryname"] = $hcountry;
|
||||
|
||||
reset($this->adr_types);
|
||||
$typed = '';
|
||||
while (list($type,$val) = each($this->adr_types)) {
|
||||
$ftype = 'two_'.$type;
|
||||
eval("if \(\$\$ftype=='on'\) { \$typed \.= \$type\.';'; }");
|
||||
}
|
||||
$fields["adr_two_type"] = substr($typed,0,-1);
|
||||
|
||||
$fields["tz"] = $timezone;
|
||||
$fields["bday"] = $bday;
|
||||
$fields["url"] = $url;
|
||||
$fields["pubkey"] = $pubkey;
|
||||
$fields["note"] = $notes;
|
||||
|
||||
addressbook_add_entry($phpgw_info["user"]["account_id"],$fields);
|
||||
$ab_id = addressbook_get_lastid();
|
||||
|
||||
|
@ -22,25 +22,25 @@
|
||||
var $type = 'ldif';
|
||||
|
||||
var $import = array(
|
||||
"title" => "title",
|
||||
"givenname" => "n_given",
|
||||
"sn" => "n_family",
|
||||
"cn" => "fn",
|
||||
"o" => "org_name",
|
||||
"ou" => "org_unit",
|
||||
"streetaddress" => "adr_street",
|
||||
"locality" => "adr_locality",
|
||||
"st" => "adr_region",
|
||||
"postalcode" => "adr_postalcode",
|
||||
"countryname" => "adr_countryname",
|
||||
"telephonenumber" => "a_tel",
|
||||
"homephone" => "b_tel",
|
||||
"facsimiletelephonenumber" => "c_tel",
|
||||
"title" => "title",
|
||||
"givenname" => "n_given",
|
||||
"sn" => "n_family",
|
||||
"cn" => "fn",
|
||||
"o" => "org_name",
|
||||
"ou" => "org_unit",
|
||||
"streetaddress" => "adr_one_street",
|
||||
"locality" => "adr_one_locality",
|
||||
"st" => "adr_one_region",
|
||||
"postalcode" => "adr_one_postalcode",
|
||||
"countryname" => "adr_one_countryname",
|
||||
"telephonenumber" => "tel_work",
|
||||
"homephone" => "tel_home",
|
||||
"facsimiletelephonenumber" => "tel_fax",
|
||||
"xmozillaanyphone" => "ophone",
|
||||
"cellphone" => "mphone",
|
||||
"cellphone" => "tel_cell",
|
||||
"description" => "note",
|
||||
"pagerphone" => "pager",
|
||||
"mail" => "d_email",
|
||||
"pagerphone" => "tel_pager",
|
||||
"mail" => "email",
|
||||
"homeurl" => "url",
|
||||
"xmozillauseconferenceserver" => "",
|
||||
"xmozillanickname" => "",
|
||||
@ -63,7 +63,10 @@
|
||||
//echo '<br>'.$i.': '.$name.' => '.$value;
|
||||
$entry[$i][$name] = $value;
|
||||
}
|
||||
$entry[$i]['d_emailtype'] = 'INTERNET';
|
||||
$entry[$i]['email_type'] = 'INTERNET';
|
||||
$entry[$i]['email_home_type'] = 'INTERNET';
|
||||
$entry[$i]['adr_one_type'] = 'intl';
|
||||
$entry[$i]['adr_two_type'] = 'intl';
|
||||
//echo '<br>';
|
||||
$contacts->add($phpgw_info["user"]["account_id"],$entry[$i]);
|
||||
}
|
||||
@ -89,7 +92,6 @@
|
||||
}
|
||||
|
||||
function import_new_attrib($buffer,$name,$value) {
|
||||
//$value = str_replace("\n","<BR>",$value);
|
||||
// chop leading space from value
|
||||
$value = trim($value);
|
||||
$value = str_replace("\r","",$value);
|
||||
|
@ -38,18 +38,18 @@
|
||||
"Company" => "org_name", //objectclass: organization
|
||||
"Department" => "org_unit", //objectclass: organizationalPerson
|
||||
"Job Title" => "title", //objectclass: organizationalPerson
|
||||
"Business Street" => "address2",
|
||||
"Business Street 2" => "",
|
||||
"Business Street 3" => "",
|
||||
"Business City" => "",
|
||||
"Business State" => "",
|
||||
"Business Postal Code" => "",
|
||||
"Business Country" => "",
|
||||
"Home Street" => "adr_street",
|
||||
"Home City" => "adr_locality",
|
||||
"Home State" => "adr_region",
|
||||
"Home Postal Code" => "adr_postalcode",
|
||||
"Home Country" => "adr_countryname",
|
||||
"Business Street" => "adr_one_street",
|
||||
"Business Street 2" => "address2",
|
||||
"Business Street 3" => "address3",
|
||||
"Business City" => "adr_one_locality",
|
||||
"Business State" => "adr_one_region",
|
||||
"Business Postal Code" => "adr_one_postalcode",
|
||||
"Business Country" => "adr_one_countryname",
|
||||
"Home Street" => "adr_two_street",
|
||||
"Home City" => "adr_two_locality",
|
||||
"Home State" => "adr_two_region",
|
||||
"Home Postal Code" => "adr_two_postalcode",
|
||||
"Home Country" => "adr_two_countryname",
|
||||
"Home Street 2" => "",
|
||||
"Home Street 3" => "",
|
||||
"Other Street" => "",
|
||||
@ -57,21 +57,21 @@
|
||||
"Other State" => "",
|
||||
"Other Postal Code" => "",
|
||||
"Other Country" => "",
|
||||
"Assistant's Phone" => "",
|
||||
"Business Fax" => "c_tel",
|
||||
"Business Phone" => "a_tel",
|
||||
"Assistant's Phone" => "tel_msg",
|
||||
"Business Fax" => "tel_fax",
|
||||
"Business Phone" => "tel_work",
|
||||
"Business Phone 2" => "ophone",
|
||||
"Callback" => "",
|
||||
"Car Phone" => "",
|
||||
"Car Phone" => "tel_car",
|
||||
"Company Main Phone" => "",
|
||||
"Home Fax" => "",
|
||||
"Home Phone" => "b_tel",
|
||||
"Home Phone" => "tel_home",
|
||||
"Home Phone 2" => "", //This will make another homePhone entry
|
||||
"ISDN" => "",
|
||||
"Mobile Phone" => "mphone", //newPilotPerson
|
||||
"ISDN" => "tel_isdn",
|
||||
"Mobile Phone" => "tel_cell", //newPilotPerson
|
||||
"Other Fax" => "",
|
||||
"Other Phone" => "",
|
||||
"Pager" => "pager",
|
||||
"Pager" => "tel_pager",
|
||||
"Primary Phone" => "",
|
||||
"Radio Phone" => "",
|
||||
"TTY/TDD Phone" => "",
|
||||
@ -84,9 +84,9 @@
|
||||
"Categories" => "",
|
||||
"Children" => "",
|
||||
"Directory Server" => "",
|
||||
"E-mail Address" => "d_email",
|
||||
"E-mail Address" => "email",
|
||||
"E-mail Display Name" => "",
|
||||
"E-mail 2 Address" => "",
|
||||
"E-mail 2 Address" => "email_home",
|
||||
"E-mail 2 Display Name" => "",
|
||||
"E-mail 3 Address" => "", //add another...
|
||||
"E-mail 3 Display Name" => "",
|
||||
@ -130,7 +130,10 @@
|
||||
//echo '<br>'.$i.': '.$name.' => '.$value;
|
||||
$entry[$i][$name] = $value;
|
||||
}
|
||||
$entry[$i]['d_emailtype'] = 'INTERNET';
|
||||
$entry[$i]['email_type'] = 'INTERNET';
|
||||
$entry[$i]['email_home_type'] = 'INTERNET';
|
||||
$entry[$i]['adr_one_type'] = 'intl';
|
||||
$entry[$i]['adr_two_type'] = 'intl';
|
||||
//echo '<br>';
|
||||
$contacts->add($phpgw_info["user"]["account_id"],$entry[$i]);
|
||||
}
|
||||
|
@ -37,10 +37,9 @@
|
||||
// not checking acl here, only on submit - that ok?
|
||||
// merge in extra fields
|
||||
$extrafields = array(
|
||||
"pager" => "pager",
|
||||
"mphone" => "mphone",
|
||||
"ophone" => "ophone",
|
||||
"address2" => "address2",
|
||||
"address3" => "address3"
|
||||
);
|
||||
$qfields = $this->stock_contact_fields + $extrafields;
|
||||
$fields = addressbook_read_entry($ab_id,$qfields);
|
||||
@ -55,41 +54,70 @@
|
||||
$bday = "$bday_month/$bday_day/$bday_year";
|
||||
}
|
||||
|
||||
$fields["org_name"] = $company;
|
||||
$fields["org_unit"] = $department;
|
||||
$fields["n_given"] = $firstname;
|
||||
$fields["n_family"] = $lastname;
|
||||
$fields["n_middle"] = $middle;
|
||||
$fields["n_prefix"] = $prefix;
|
||||
$fields["n_suffix"] = $suffix;
|
||||
$fields["org_name"] = $company;
|
||||
$fields["org_unit"] = $department;
|
||||
$fields["n_given"] = $firstname;
|
||||
$fields["n_family"] = $lastname;
|
||||
$fields["n_middle"] = $middle;
|
||||
$fields["n_prefix"] = $prefix;
|
||||
$fields["n_suffix"] = $suffix;
|
||||
if ($prefix) { $pspc = " "; }
|
||||
if ($middle) { $mspc = " "; } else { $nspc = " "; }
|
||||
if ($suffix) { $sspc = " "; }
|
||||
$fields["fn"] = $prefix.$pspc.$firstname.$nspc.$mspc.$middle.$mspc.$lastname.$sspc.$suffix;
|
||||
$fields["d_email"] = $email;
|
||||
$fields["d_emailtype"] = $email_type;
|
||||
$fields["title"] = $title;
|
||||
$fields["a_tel"] = $wphone;
|
||||
$fields["b_tel"] = $hphone;
|
||||
$fields["c_tel"] = $fax;
|
||||
$fields["pager"] = $pager;
|
||||
$fields["mphone"] = $mphone;
|
||||
$fields["ophone"] = $ophone;
|
||||
$fields["adr_street"] = $street;
|
||||
$fields["address2"] = $address2;
|
||||
$fields["adr_locality"] = $city;
|
||||
$fields["adr_region"] = $state;
|
||||
$fields["adr_postalcode"] = $zip;
|
||||
$fields["adr_countryname"] = $country;
|
||||
$fields["tz"] = $timezone;
|
||||
$fields["bday"] = $bday;
|
||||
$fields["url"] = $url;
|
||||
$fields["note"] = $notes;
|
||||
$fields["fn"] = $prefix.$pspc.$firstname.$nspc.$mspc.$middle.$mspc.$lastname.$sspc.$suffix;
|
||||
$fields["email"] = $email;
|
||||
$fields["email_type"] = $email_type;
|
||||
$fields["email_home"] = $hemail;
|
||||
$fields["email_home_type"] = $hemail_type;
|
||||
|
||||
$fields["title"] = $title;
|
||||
$fields["tel_work"] = $wphone;
|
||||
$fields["tel_home"] = $hphone;
|
||||
$fields["tel_fax"] = $fax;
|
||||
$fields["tel_pager"] = $pager;
|
||||
$fields["tel_cel"] = $mphone;
|
||||
$fields["tel_msg"] = $ophone;
|
||||
$fields["tel_prefer"] = $tel_prefer;
|
||||
|
||||
$fields["adr_one_street"] = $bstreet;
|
||||
$fields["adr_one_locality"] = $bcity;
|
||||
$fields["adr_one_region"] = $bstate;
|
||||
$fields["adr_one_postalcode"] = $bzip;
|
||||
$fields["adr_one_countryname"] = $bcountry;
|
||||
|
||||
reset($this->adr_types);
|
||||
$typed = '';
|
||||
while (list($type,$val) = each($this->adr_types)) {
|
||||
$ftype = 'one_'.$type;
|
||||
eval("if (\$\$ftype=='on'\) { \$typed \.= \$type\.';'; }");
|
||||
}
|
||||
$fields["adr_one_type"] = substr($typed,0,-1);
|
||||
|
||||
$fields["address2"] = $address2;
|
||||
$fields["address3"] = $address3;
|
||||
|
||||
$fields["adr_two_street"] = $hstreet;
|
||||
$fields["adr_two_locality"] = $hcity;
|
||||
$fields["adr_two_region"] = $hstate;
|
||||
$fields["adr_two_postalcode"] = $hzip;
|
||||
$fields["adr_two_countryname"] = $hcountry;
|
||||
|
||||
reset($this->adr_types);
|
||||
$typed = '';
|
||||
while (list($type,$val) = each($this->adr_types)) {
|
||||
$ftype = 'two_'.$type;
|
||||
eval("if \(\$\$ftype=='on'\) { \$typed \.= \$type\.';'; }");
|
||||
}
|
||||
$fields["adr_two_type"] = substr($typed,0,-1);
|
||||
|
||||
$fields["tz"] = $timezone;
|
||||
$fields["bday"] = $bday;
|
||||
$fields["url"] = $url;
|
||||
$fields["pubkey"] = $pubkey;
|
||||
$fields["note"] = $notes;
|
||||
|
||||
$userid = $phpgw_info["user"]["account_id"];
|
||||
|
||||
// this is now in functions.inc.php and will handle acl soon
|
||||
//if (!$userid) {
|
||||
$userid = $phpgw_info["user"]["account_id"];
|
||||
//}
|
||||
addressbook_update_entry($ab_id,$userid,$fields);
|
||||
|
||||
Header("Location: " . $phpgw->link("/addressbook/view.php","ab_id=$ab_id&order=$order&sort=$sort&filter=$filter&start=$start"));
|
||||
|
@ -383,13 +383,13 @@
|
||||
while(list($name,$value)=each($stock_fields)) {
|
||||
$std .= "a.".$name.",";
|
||||
}
|
||||
//$std = substr($std,0,-1);
|
||||
$std = substr($std,0,-1);
|
||||
if ($extra_fields) {
|
||||
while(list($name,$value)=each($extra_fields)) {
|
||||
$ext .= "b.".$name.",";
|
||||
}
|
||||
}
|
||||
//$ext = substr($ext,0,-1);
|
||||
$ext = substr($ext,0,-1);
|
||||
if (!empty($fieldlist2)) {
|
||||
$filtertemp = " AND " . $filterlist2 . " ";
|
||||
}
|
||||
@ -398,21 +398,30 @@
|
||||
echo "<br>DEBUG - Final SELECT - Filtering with: #" . $filtertemp . "#";
|
||||
}
|
||||
|
||||
$qfields = $std . $ext;
|
||||
$qfields = substr($qfields,0,-1);
|
||||
//$qfields = $std . $ext;
|
||||
//$qfields = substr($qfields,0,-1);
|
||||
|
||||
if ($query) {
|
||||
$squery = " AND (n_family like '%$query%' OR n_middle like '"
|
||||
. "%$query%' OR n_given like '%$query%' OR d_email like '%$query%' OR "
|
||||
. "adr_street like '%$query%' OR adr_locality like '%$query%' OR adr_region "
|
||||
. "like '%$query%' OR adr_postalcode like '%$query%' OR org_unit like "
|
||||
. "'%$query%' OR adr_countryname like '%$query%' OR "
|
||||
. "%$query%' OR n_given like '%$query%' OR email like '%$query%' OR "
|
||||
. "adr_one_street like '%$query%' OR adr_one_locality like '%$query%' OR adr_one_region "
|
||||
. "like '%$query%' OR adr_one_postalcode like '%$query%' OR org_unit like "
|
||||
. "'%$query%' OR adr_one_countryname like '%$query%' OR "
|
||||
. "org_name like '%$query%')";
|
||||
}
|
||||
|
||||
$sql = 'SELECT a.id,a.tid,a.lid,a.owner,b.contact_id,'
|
||||
. $qfields . $extra_fields.' FROM '.$this->std_table.' AS a '. $join . ' '
|
||||
. $this->ext_table .' AS b ON a.id=b.contact_id ' . $squery;
|
||||
if ($ext) {
|
||||
$equery = " AND (";
|
||||
$extf = split(',',$ext);
|
||||
for ($i=0;$i<count($extf);$i++) {
|
||||
$extf[$i]=ereg_replace('b.','',$extf[$i]);
|
||||
$equery .= "contact_name='".$extf[$i]."' OR ";
|
||||
}
|
||||
$equery = substr($equery,0,-3);
|
||||
$equery .= ") ";
|
||||
}
|
||||
$sql = 'SELECT a.id,a.tid,a.lid,a.owner,b.contact_id,b.contact_value,'
|
||||
. $std . ' FROM '.$this->std_table.' AS a '. $join . ' '
|
||||
. $this->ext_table .' AS b ON a.id=b.contact_id ' . $squery . $equery;
|
||||
|
||||
$this->db3->query($sql,__LINE__,__FILE__);
|
||||
$this->total_records = $this->db3->num_rows();
|
||||
@ -431,13 +440,23 @@
|
||||
|
||||
if (gettype($stock_fieldnames) == "array") {
|
||||
while (list($f_name) = each($fields)) {
|
||||
$return_fields[$i][$f_name] = $this->db->f($f_name);
|
||||
if ($DEBUG) { echo "<br>FNAME is '".$f_name."'"; }
|
||||
reset($extra_fields);
|
||||
while(list($stock)=each($extra_fields)) {
|
||||
if ($stock == $f_name) {
|
||||
if ($DEBUG) { echo " and is an extra field"; }
|
||||
$f_value = $this->db->f('contact_value');
|
||||
} else {
|
||||
$f_value = $this->db->f($f_name);
|
||||
}
|
||||
}
|
||||
if ($DEBUG) { echo " equal to '".$f_value."'"; }
|
||||
$return_fields[$i][$f_name] = $f_value;
|
||||
}
|
||||
reset($fields);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
// $this->db->query("DROP TABLE $tmp_table");
|
||||
return $return_fields;
|
||||
}
|
||||
|
||||
|
@ -43,49 +43,42 @@
|
||||
"n_middle" => "middle name",
|
||||
"n_family" => "last name", //lastname
|
||||
"n_suffix" => "suffix",
|
||||
"label" => "label",
|
||||
"adr_street" => "street",
|
||||
"adr_locality" => "city", //city
|
||||
"adr_region" => "state", //state
|
||||
"adr_postalcode" => "zip code", //zip
|
||||
"adr_countryname" => "country",
|
||||
"adr_work" => "", //yn
|
||||
"adr_home" => "", //yn
|
||||
"adr_parcel" => "", //yn
|
||||
"adr_postal" => "", //yn
|
||||
"label" => "label",
|
||||
"adr_one_street" => "business street",
|
||||
"adr_one_locality" => "business city", //city
|
||||
"adr_one_region" => "business state", //state
|
||||
"adr_one_postalcode" => "business zip code", //zip
|
||||
"adr_one_countryname" => "business country",
|
||||
"adr_two_street" => "home street",
|
||||
"adr_two_locality" => "home city", //city
|
||||
"adr_two_region" => "home state", //state
|
||||
"adr_two_postalcode" => "home zip code", //zip
|
||||
"adr_two_countryname" => "home country",
|
||||
"tz" => "time zone",
|
||||
"geo" => "geo",
|
||||
"a_tel" => "work phone",
|
||||
"a_tel_work" => "", //yn
|
||||
"a_tel_home" => "", //yn
|
||||
"a_tel_voice" => "", //yn
|
||||
"a_tel_msg" => "", //yn
|
||||
"a_tel_fax" => "", //yn
|
||||
"a_tel_prefer" => "", //yn
|
||||
"b_tel" => "home phone",
|
||||
"b_tel_work" => "", //yn
|
||||
"b_tel_home" => "", //yn
|
||||
"b_tel_voice" => "", //yn
|
||||
"b_tel_msg" => "", //yn
|
||||
"b_tel_fax" => "", //yn
|
||||
"b_tel_prefer" => "", //yn
|
||||
"c_tel" => "fax",
|
||||
"c_tel_work" => "", //yn
|
||||
"c_tel_home" => "", //yn
|
||||
"c_tel_voice" => "", //yn
|
||||
"c_tel_msg" => "", //yn
|
||||
"c_tel_fax" => "", //yn
|
||||
"c_tel_prefer" => "", //yn
|
||||
"d_email" => "email",
|
||||
"d_emailtype" => "email type", //'INTERNET','CompuServe',etc...
|
||||
"d_email_work" => "", //yn
|
||||
"d_email_home" => "", //yn
|
||||
"pager" => "Pager",
|
||||
"mphone" => "mobile phone",
|
||||
"ophone" => "other phone",
|
||||
"address2" => "address2",
|
||||
"tel_work" => "work phone", //yn
|
||||
"tel_home" => "home phone", //yn
|
||||
"tel_voice" => "voice phone", //yn
|
||||
"tel_msg" => "msg phone", //yn
|
||||
"tel_fax" => "fax", //yn
|
||||
"tel_pager" => "pager",
|
||||
"tel_cell" => "mobile phone",
|
||||
"tel_bbs" => "bbs phone",
|
||||
"tel_modem" => "modem phone",
|
||||
"tel_isdn" => "isdn phone",
|
||||
"tel_car" => "car phone",
|
||||
"tel_video" => "video phone",
|
||||
|
||||
"tel_prefer" => "prefer", //yn
|
||||
"email" => "work email",
|
||||
"email_type" => "work email type", //'INTERNET','CompuServe',etc...
|
||||
"email_home" => "home email", //yn
|
||||
"email_home_type" => "home email type",
|
||||
"address2" => "address line 2",
|
||||
"address3" => "address line 3",
|
||||
"bday" => "birthday",
|
||||
"url" => "url",
|
||||
"pubkey" => "public key",
|
||||
"note" => "notes"
|
||||
);
|
||||
|
||||
@ -141,77 +134,104 @@
|
||||
$t = new Template($phpgw->common->get_tpl_dir("addressbook"));
|
||||
$t->set_file(array( "form" => "form.tpl"));
|
||||
|
||||
$email = $fields["d_email"];
|
||||
$emailtype = $fields["d_emailtype"];
|
||||
$email = $fields["email"];
|
||||
$emailtype = $fields["email_type"];
|
||||
$hemail = $fields["email_home"];
|
||||
$hemailtype = $fields["email_home_type"];
|
||||
$firstname = $fields["n_given"];
|
||||
$middle = $fields["n_middle"];
|
||||
$prefix = $fields["n_prefix"];
|
||||
$suffix = $fields["n_suffix"];
|
||||
$lastname = $fields["n_family"];
|
||||
$title = $fields["title"];
|
||||
$wphone = $fields["a_tel"];
|
||||
$hphone = $fields["b_tel"];
|
||||
$fax = $fields["c_tel"];
|
||||
$pager = $fields["pager"];
|
||||
$mphone = $fields["mphone"];
|
||||
$wphone = $fields["tel_work"];
|
||||
$hphone = $fields["tel_home"];
|
||||
$fax = $fields["tel_fax"];
|
||||
$pager = $fields["tel_pager"];
|
||||
$mphone = $fields["tel_cell"];
|
||||
$ophone = $fields["ophone"];
|
||||
$street = $fields["adr_street"];
|
||||
$msgphone = $fields["tel_msg"];
|
||||
$isdnphone = $fields["tel_isdn"];
|
||||
$carphone = $fields["tel_car"];
|
||||
$vidphone = $fields["tel_video"];
|
||||
$preferred = $fields["tel_prefer"];
|
||||
|
||||
$bstreet = $fields["adr_one_street"];
|
||||
$address2 = $fields["address2"];
|
||||
$city = $fields["adr_locality"];
|
||||
$state = $fields["adr_region"];
|
||||
$zip = $fields["adr_postalcode"];
|
||||
$country = $fields["adr_countryname"];
|
||||
$address3 = $fields["address3"];
|
||||
$bcity = $fields["adr_one_locality"];
|
||||
$bstate = $fields["adr_one_region"];
|
||||
$bzip = $fields["adr_one_postalcode"];
|
||||
$bcountry = $fields["adr_one_countryname"];
|
||||
$one_dom = $fields["one_dom"];
|
||||
$one_intl = $fields["one_intl"];
|
||||
$one_parcel = $fields["one_parcel"];
|
||||
$one_postal = $fields["one_postal"];
|
||||
|
||||
$hstreet = $fields["adr_two_street"];
|
||||
$hcity = $fields["adr_two_locality"];
|
||||
$hstate = $fields["adr_two_region"];
|
||||
$hzip = $fields["adr_two_postalcode"];
|
||||
$hcountry = $fields["adr_two_countryname"];
|
||||
$btype = $fields["adr_two_type"];
|
||||
$two_dom = $fields["two_dom"];
|
||||
$two_intl = $fields["two_intl"];
|
||||
$two_parcel = $fields["two_parcel"];
|
||||
$two_postal = $fields["two_postal"];
|
||||
|
||||
$timezone = $fields["tz"];
|
||||
$bday = $fields["bday"];
|
||||
$notes = stripslashes($fields["note"]);
|
||||
$company = $fields["org_name"];
|
||||
$department = $fields["org_unit"];
|
||||
$url = $fields["url"];
|
||||
//$access = $fields["access"];
|
||||
$pubkey = $fields["pubkey"];
|
||||
|
||||
$this = CreateObject("phpgwapi.contacts");
|
||||
|
||||
if ($format != "view") {
|
||||
$email = "<input name=\"email\" value=\"$email\">";
|
||||
$firstname = "<input name=\"firstname\" value=\"$firstname\">";
|
||||
$lastname = "<input name=\"lastname\" value=\"$lastname\">";
|
||||
$middle = "<input name=\"middle\" value=\"$middle\">";
|
||||
$prefix = "<input name=\"prefix\" value=\"$prefix\" size=\"10\">";
|
||||
$suffix = "<input name=\"suffix\" value=\"$suffix\" size=\"10\">";
|
||||
$title = "<input name=\"title\" value=\"$title\">";
|
||||
$hphone = "<input name=\"hphone\" value=\"$hphone\">";
|
||||
$wphone = "<input name=\"wphone\" value=\"$wphone\">";
|
||||
$fax = "<input name=\"fax\" value=\"$fax\">";
|
||||
$pager = "<input name=\"pager\" value=\"$pager\">";
|
||||
$mphone = "<input name=\"mphone\" value=\"$mphone\">";
|
||||
$ophone = "<input name=\"ophone\" value=\"$ophone\">";
|
||||
$street = "<input name=\"street\" value=\"$street\">";
|
||||
$address2 = "<input name=\"address2\" value=\"$address2\">";
|
||||
$city = "<input name=\"city\" value=\"$city\">";
|
||||
$state = "<input name=\"state\" value=\"$state\">";
|
||||
$zip = "<input name=\"zip\" value=\"$zip\">";
|
||||
$country = "<input name=\"country\" value=\"$country\">";
|
||||
$email = "<input name=\"email\" value=\"$email\">";
|
||||
$firstname = "<input name=\"firstname\" value=\"$firstname\">";
|
||||
$lastname = "<input name=\"lastname\" value=\"$lastname\">";
|
||||
$middle = "<input name=\"middle\" value=\"$middle\">";
|
||||
$prefix = "<input name=\"prefix\" value=\"$prefix\" size=\"10\">";
|
||||
$suffix = "<input name=\"suffix\" value=\"$suffix\" size=\"10\">";
|
||||
$title = "<input name=\"title\" value=\"$title\">";
|
||||
|
||||
/*
|
||||
if($phpgw_info["apps"]["timetrack"]["enabled"]) {
|
||||
$company = '<select name="company">';
|
||||
if (!$company) {
|
||||
$company .= '<option value="0" SELECTED>'. lang("none").'</option>';
|
||||
} else {
|
||||
$company .= '<option value="0">'. lang("none").'</option>';
|
||||
}
|
||||
$phpgw->db->query("select company_id,company_name from customers order by company_name");
|
||||
while ($phpgw->db->next_record()) {
|
||||
$ncust = $phpgw->db->f("company_id");
|
||||
$company .= '<option value="' . $ncust . '"';
|
||||
if ( $company_id == $ncust ) {
|
||||
$company .= " selected";
|
||||
}
|
||||
$company .= ">" . $phpgw->db->f("company_name") . "</option>";
|
||||
}
|
||||
$company .= "</select>";
|
||||
} else { */
|
||||
$company = "<input name=\"company\" value=\"$company\">";
|
||||
while (list($name,$val) = each($this->tel_types)) {
|
||||
$str[$name] = "\n".'<INPUT type="radio" name="tel_prefer" value="'.$name.'"';
|
||||
if ($name == $preferred) {
|
||||
$str[$name] .= ' checked';
|
||||
}
|
||||
$str[$name] .= '>';
|
||||
}
|
||||
$hphone = "<input name=\"hphone\" value=\"$hphone\"> ".$str['home'];
|
||||
$wphone = "<input name=\"wphone\" value=\"$wphone\"> ".$str['work'];
|
||||
$msgphone = "<input name=\"msgphone\" value=\"$msgphone\"> ".$str['msg'];
|
||||
$isdnphone = "<input name=\"isdnphone\" value=\"$isdnphone\"> ".$str['isdn'];
|
||||
$carphone = "<input name=\"carphone\" value=\"$carphone\"> ".$str['car'];
|
||||
$vidphone = "<input name=\"vidphone\" value=\"$vidphone\"> ".$str['video'];
|
||||
$fax = "<input name=\"fax\" value=\"$fax\"> ".$str['fax'];
|
||||
$pager = "<input name=\"pager\" value=\"$pager\"> ".$str['pager'];
|
||||
$mphone = "<input name=\"mphone\" value=\"$mphone\"> ".$str['cell'];
|
||||
|
||||
$ophone = "<input name=\"ophone\" value=\"$ophone\">";
|
||||
$bstreet = "<input name=\"bstreet\" value=\"$bstreet\">";
|
||||
$address2 = "<input name=\"address2\" value=\"$address2\">";
|
||||
$address3 = "<input name=\"address3\" value=\"$address3\">";
|
||||
$bcity = "<input name=\"bcity\" value=\"$bcity\">";
|
||||
$bstate = "<input name=\"bstate\" value=\"$bstate\">";
|
||||
$bzip = "<input name=\"bzip\" value=\"$bzip\">";
|
||||
$bcountry = "<input name=\"bcountry\" value=\"$bcountry\">";
|
||||
$company = "<input name=\"company\" value=\"$company\">";
|
||||
$department = "<input name=\"department\" value=\"$department\">";
|
||||
/* } */
|
||||
|
||||
$hemail = "<input name=\"hemail\" value=\"$hemail\">";
|
||||
$hstreet = "<input name=\"hstreet\" value=\"$hstreet\">";
|
||||
$hcity = "<input name=\"hcity\" value=\"$hcity\">";
|
||||
$hstate = "<input name=\"hstate\" value=\"$hstate\">";
|
||||
$hzip = "<input name=\"hzip\" value=\"$hzip\">";
|
||||
$hcountry = "<input name=\"hcountry\" value=\"$hcountry\">";
|
||||
|
||||
if (strlen($bday) > 2) {
|
||||
list( $month, $day, $year ) = split( '/', $bday );
|
||||
@ -265,7 +285,6 @@
|
||||
}
|
||||
$time_zone .= "</select>\n";
|
||||
|
||||
$this = CreateObject("phpgwapi.contacts");
|
||||
$email_type = '<select name=email_type>';
|
||||
while ($type = each($this->email_types)) {
|
||||
$email_type .= '<option value="'.$type[0].'"';
|
||||
@ -273,96 +292,60 @@
|
||||
$email_type .= '>'.$type[1].'</option>';
|
||||
}
|
||||
$email_type .= "</select>";
|
||||
|
||||
|
||||
reset($this->email_types);
|
||||
$hemail_type = '<select name=hemail_type>';
|
||||
while ($type = each($this->email_types)) {
|
||||
$hemail_type .= '<option value="'.$type[0].'"';
|
||||
if ($type[0] == $hemailtype) { $hemail_type .= ' selected'; }
|
||||
$hemail_type .= '>'.$type[1].'</option>';
|
||||
}
|
||||
$hemail_type .= "</select>";
|
||||
|
||||
reset($this->adr_types);
|
||||
while (list($type,$val) = each($this->adr_types)) {
|
||||
$badrtype .= "\n".'<INPUT type="checkbox" name="one_'.$type.'"';
|
||||
$ot = 'one_'.$type;
|
||||
eval("
|
||||
if (\$$ot=='on') {
|
||||
\$badrtype \.= ' value=\"on\" checked';
|
||||
}
|
||||
");
|
||||
$badrtype .= '>'.$val;
|
||||
}
|
||||
|
||||
reset($this->adr_types);
|
||||
while (list($type,$val) = each($this->adr_types)) {
|
||||
$hadrtype .= "\n".'<INPUT type="checkbox" name="two_'.$type.'"';
|
||||
$tt = 'two_'.$type;
|
||||
eval("
|
||||
if (\$$tt=='on') {
|
||||
\$hadrtype \.= ' value=\"on\" checked';
|
||||
}
|
||||
");
|
||||
$hadrtype .= '>'.$val;
|
||||
}
|
||||
|
||||
$notes = '<TEXTAREA cols="60" name="notes" rows="4">' . $notes . '</TEXTAREA>';
|
||||
$pubkey = '<TEXTAREA cols="60" name="notes" rows="6">' . $pubkey . '</TEXTAREA>';
|
||||
} else {
|
||||
$notes = "<form><TEXTAREA cols=\"60\" name=\"notes\" rows=\"4\">"
|
||||
. $notes . "</TEXTAREA></form>";
|
||||
if ($bday == "//")
|
||||
$bday = "";
|
||||
|
||||
/*
|
||||
if($phpgw_info["apps"]["timetrack"]["enabled"]) {
|
||||
$company = $company_name;
|
||||
} else { */
|
||||
$company = $company;
|
||||
/* } */
|
||||
}
|
||||
|
||||
if ($action) {
|
||||
echo "<FORM action=\"".$phpgw->link('/addressbook/' . $action)."\" method=\"post\">\n";
|
||||
}
|
||||
|
||||
// test:
|
||||
//echo "Time track app status = " . $phpgw_info["apps"]["timetrack"]["enabled"];
|
||||
|
||||
if (! ereg("^http://",$url)) {
|
||||
$url = "http://". $url;
|
||||
}
|
||||
|
||||
$birthday = $phpgw->common->dateformatorder($bday_year,$bday_month,$bday_day)
|
||||
. '<font face="'.$theme["font"].'" size="-2">(e.g. 1969)</font>';
|
||||
/*
|
||||
// This is now handled by acl code, and should go away
|
||||
if ($format == "Edit") {
|
||||
if ($access != "private" && $access != "public") {
|
||||
$access_link .= '<td><font size="-1">'.lang("Group access").':</font></td>'
|
||||
. '<td colspan="3"><font size="-1">'
|
||||
. $phpgw->accounts->convert_string_to_names($access);
|
||||
} else {
|
||||
$access_link .= '<td><font size="-1">'.lang("Access").':</font></td>'
|
||||
. '<td colspan="3"><font size="-1">' . $access;
|
||||
}
|
||||
} else {
|
||||
$access_link .= '<td><font size="-1">'.lang("Access").':</font></td>
|
||||
<td colspan="3">
|
||||
<font size="-1">
|
||||
<select name="access">
|
||||
<option value="private"';
|
||||
|
||||
if ($access == "private") $access_link .= ' selected>'.lang("private").'</option>';
|
||||
else $access_link .= '>'.lang("private").'</option>';
|
||||
|
||||
$access_link .= '<option value="public"
|
||||
';
|
||||
|
||||
if ($access == "public")
|
||||
$access_link .= ' selected>'.lang("Global Public").'</option>';
|
||||
else $access_link .= '>'.lang("Global Public").'</option>';
|
||||
|
||||
$access_link .= '<option value="group"
|
||||
';
|
||||
|
||||
if ($access != "public" && $access != "private" && $access != "")
|
||||
$access_link .= ' selected>'.lang("Group Public").'</option></select>';
|
||||
else
|
||||
$access_link .= '>'.lang("Group Public").'</option></select>';
|
||||
|
||||
$access_link .= '</tr>
|
||||
';
|
||||
}
|
||||
|
||||
if ($format != "view") {
|
||||
$access_link .= '<tr><td><font size="-1">' . lang("Which groups")
|
||||
. ':</font></td><td colspan="3"><select name="n_groups[]" '
|
||||
. 'multiple size="5">';
|
||||
|
||||
$user_groups = $phpgw->accounts->read_group_names($fields["owner"]);
|
||||
for ($i=0;$i<count($user_groups);$i++) {
|
||||
$access_link .= '<option value="'.$user_groups[$i][0].'"';
|
||||
if (ereg(",".$user_groups[$i][0].",",$access))
|
||||
$access_link .= ' selected';
|
||||
|
||||
$access_link .= '>'.$user_groups[$i][1].'</option>
|
||||
';
|
||||
}
|
||||
$access_link .= '</select></font></td></tr>';
|
||||
$t->set_var("lang_access",lang("access"));
|
||||
} else {
|
||||
$access_link = '';
|
||||
$t->set_var("lang_access",'');
|
||||
}
|
||||
*/
|
||||
if ($format == "view")
|
||||
$create .= '<tr><td><font size="-1">'.lang("Created by").':</font></td>'
|
||||
. '<td colspan="3"><font size="-1">'
|
||||
@ -370,6 +353,10 @@
|
||||
else
|
||||
$create = '';
|
||||
|
||||
$t->set_var("lang_home",lang("Home"));
|
||||
$t->set_var("lang_business",lang("Business"));
|
||||
$t->set_var("lang_personal",lang("Personal"));
|
||||
|
||||
$t->set_var("lang_lastname",lang("Last Name"));
|
||||
$t->set_var("lastname",$lastname);
|
||||
$t->set_var("lang_firstname",lang("First Name"));
|
||||
@ -380,50 +367,83 @@
|
||||
$t->set_var("prefix",$prefix);
|
||||
$t->set_var("lang_suffix",lang("Suffix"));
|
||||
$t->set_var("suffix",$suffix);
|
||||
$t->set_var("lang_birthday",lang("Birthday"));
|
||||
$t->set_var("birthday",$birthday);
|
||||
|
||||
$t->set_var("lang_company",lang("Company Name"));
|
||||
$t->set_var("company",$company);
|
||||
$t->set_var("lang_department",lang("Department"));
|
||||
$t->set_var("department",$department);
|
||||
$t->set_var("lang_title",lang("Title"));
|
||||
$t->set_var("title",$title);
|
||||
$t->set_var("lang_email",lang("Email"));
|
||||
$t->set_var("lang_email",lang("Business Email"));
|
||||
$t->set_var("email",$email);
|
||||
$t->set_var("lang_email_type",lang("EMail Type"));
|
||||
$t->set_var("lang_email_type",lang("Business EMail Type"));
|
||||
$t->set_var("email_type",$email_type);
|
||||
$t->set_var("lang_url",lang("URL"));
|
||||
$t->set_var("url",$url);
|
||||
$t->set_var("lang_timezone",lang("time zone offset"));
|
||||
$t->set_var("timezone",$time_zone);
|
||||
$t->set_var("lang_hphone",lang("Home Phone"));
|
||||
$t->set_var("hphone",$hphone);
|
||||
$t->set_var("lang_fax",lang("fax"));
|
||||
$t->set_var("lang_fax",lang("Business Fax"));
|
||||
$t->set_var("fax",$fax);
|
||||
$t->set_var("lang_wphone",lang("Work Phone"));
|
||||
$t->set_var("lang_wphone",lang("Business Phone"));
|
||||
$t->set_var("wphone",$wphone);
|
||||
$t->set_var("lang_pager",lang("Pager"));
|
||||
$t->set_var("pager",$pager);
|
||||
$t->set_var("lang_mphone",lang("Mobile"));
|
||||
$t->set_var("lang_mphone",lang("Cell Phone"));
|
||||
$t->set_var("mphone",$mphone);
|
||||
$t->set_var("lang_msgphone",lang("Message Phone"));
|
||||
$t->set_var("msgphone",$msgphone);
|
||||
$t->set_var("lang_isdnphone",lang("ISDN Phone"));
|
||||
$t->set_var("isdnphone",$isdnphone);
|
||||
$t->set_var("lang_carphone",lang("Car Phone"));
|
||||
$t->set_var("carphone",$carphone);
|
||||
$t->set_var("lang_vidphone",lang("Video Phone"));
|
||||
$t->set_var("vidphone",$vidphone);
|
||||
|
||||
$t->set_var("lang_ophone",lang("Other Number"));
|
||||
$t->set_var("ophone",$ophone);
|
||||
$t->set_var("lang_street",lang("Street"));
|
||||
$t->set_var("street",$street);
|
||||
$t->set_var("lang_birthday",lang("Birthday"));
|
||||
$t->set_var("birthday",$birthday);
|
||||
$t->set_var("lang_address2",lang("Line 2"));
|
||||
$t->set_var("lang_bstreet",lang("Business Street"));
|
||||
$t->set_var("bstreet",$bstreet);
|
||||
$t->set_var("lang_address2",lang("Address Line 2"));
|
||||
$t->set_var("address2",$address2);
|
||||
$t->set_var("lang_city",lang("city"));
|
||||
$t->set_var("city",$city);
|
||||
$t->set_var("lang_state",lang("state"));
|
||||
$t->set_var("state",$state);
|
||||
$t->set_var("lang_zip",lang("Zip Code"));
|
||||
$t->set_var("zip",$zip);
|
||||
$t->set_var("lang_country",lang("Country"));
|
||||
$t->set_var("country",$country);
|
||||
$t->set_var("access_link",$access_link);
|
||||
$t->set_var("lang_address3",lang("Address Line 3"));
|
||||
$t->set_var("address3",$address3);
|
||||
$t->set_var("lang_bcity",lang("Business City"));
|
||||
$t->set_var("bcity",$bcity);
|
||||
$t->set_var("lang_bstate",lang("Business State"));
|
||||
$t->set_var("bstate",$bstate);
|
||||
$t->set_var("lang_bzip",lang("Business Zip Code"));
|
||||
$t->set_var("bzip",$bzip);
|
||||
$t->set_var("lang_bcountry",lang("Business Country"));
|
||||
$t->set_var("bcountry",$bcountry);
|
||||
$t->set_var("lang_badrtype",lang("Address Type"));
|
||||
$t->set_var("badrtype",$badrtype);
|
||||
|
||||
$t->set_var("lang_hphone",lang("Home Phone"));
|
||||
$t->set_var("hphone",$hphone);
|
||||
$t->set_var("lang_hemail",lang("Home Email"));
|
||||
$t->set_var("hemail",$hemail);
|
||||
$t->set_var("lang_hemail_type",lang("Home EMail Type"));
|
||||
$t->set_var("hemail_type",$hemail_type);
|
||||
$t->set_var("lang_hstreet",lang("Home Street"));
|
||||
$t->set_var("hstreet",$hstreet);
|
||||
$t->set_var("lang_hcity",lang("Home City"));
|
||||
$t->set_var("hcity",$hcity);
|
||||
$t->set_var("lang_hstate",lang("Home State"));
|
||||
$t->set_var("hstate",$hstate);
|
||||
$t->set_var("lang_hzip",lang("Home Zip Code"));
|
||||
$t->set_var("hzip",$hzip);
|
||||
$t->set_var("lang_hcountry",lang("Home Country"));
|
||||
$t->set_var("hcountry",$hcountry);
|
||||
$t->set_var("lang_hadrtype",lang("Address Type"));
|
||||
$t->set_var("hadrtype",$hadrtype);
|
||||
|
||||
$t->set_var("create",$create);
|
||||
$t->set_var("lang_notes",lang("notes"));
|
||||
$t->set_var("notes",$notes);
|
||||
$t->set_var("lang_pubkey",lang("Public Key"));
|
||||
$t->set_var("pubkey",$pubkey);
|
||||
|
||||
$t->parse("out","form");
|
||||
$t->pparse("out","form");
|
||||
@ -611,55 +631,28 @@
|
||||
$i++;
|
||||
} // All of the values that are getting filled are.
|
||||
|
||||
/* if($phpgw_info["apps"]["timetrack"]["enabled"]) {
|
||||
$sql = "insert into addressbook (ab_owner,ab_access,ab_firstname,ab_lastname,ab_title,ab_email,"
|
||||
. "ab_hphone,ab_wphone,ab_fax,ab_pager,ab_mphone,ab_ophone,ab_street,ab_address2,ab_city,"
|
||||
. "ab_state,ab_zip,ab_bday,"
|
||||
. "ab_notes,ab_company_id) values ('" . $phpgw_info["user"]["account_id"] . "','$access','"
|
||||
. addslashes($firstname). "','"
|
||||
. addslashes($lastname) . "','"
|
||||
. addslashes($title) . "','"
|
||||
. addslashes($email) . "','"
|
||||
. addslashes($hphone) . "','"
|
||||
. addslashes($wphone) . "','"
|
||||
. addslashes($fax) . "','"
|
||||
. addslashes($pager) . "','"
|
||||
. addslashes($mphone) . "','"
|
||||
. addslashes($ophone) . "','"
|
||||
. addslashes($street) . "','"
|
||||
. addslashes($address2) . "','"
|
||||
. addslashes($city) . "','"
|
||||
. addslashes($state) . "','"
|
||||
. addslashes($zip) . "','"
|
||||
. addslashes($bday) . "','"
|
||||
. addslashes($notes) . "','"
|
||||
. addslashes($company). "')";
|
||||
} else {
|
||||
*/
|
||||
$fields["owner"] = $phpgw_info["user"]["account_id"];
|
||||
$fields["n_given"] = addslashes($firstname);
|
||||
$fields["n_family"] = addslashes($lastname);
|
||||
$fields["fn"] = addslashes($firstname . " " . $lastname);
|
||||
$fields["title"] = addslashes($title);
|
||||
$fields["d_email"] = addslashes($email);
|
||||
$fields["tel_work"] = addslashes($wphone);
|
||||
$fields["tel_home"] = addslashes($hphone);
|
||||
$fields["tel_fax"] = addslashes($fax);
|
||||
$fields["tel_pager"] = addslashes($pager);
|
||||
$fields["tel_cell"] = addslashes($mphone);
|
||||
$fields["tel_msg"] = addslashes($ophone);
|
||||
$fields["adr_one_street"] = addslashes($street);
|
||||
$fields["address2"] = addslashes($address2);
|
||||
$fields["adr_one_locality"] = addslashes($city);
|
||||
$fields["adr_one_region"] = addslashes($state);
|
||||
$fields["adr_one_postalcode"] = addslashes($zip);
|
||||
$fields["bday"] = addslashes($bday);
|
||||
$fields["url"] = $url;
|
||||
$fields["note"] = addslashes($notes);
|
||||
$fields["org_name"] = addslashes($company);
|
||||
|
||||
$fields["owner"] = $phpgw_info["user"]["account_id"];
|
||||
//$fields["access"] = $access;
|
||||
$fields["n_given"] = addslashes($firstname);
|
||||
$fields["n_family"] = addslashes($lastname);
|
||||
$fields["fn"] = addslashes($firstname . " " . $lastname);
|
||||
$fields["title"] = addslashes($title);
|
||||
$fields["d_email"] = addslashes($email);
|
||||
$fields["a_tel"] = addslashes($wphone);
|
||||
$fields["b_tel"] = addslashes($hphone);
|
||||
$fields["c_tel"] = addslashes($fax);
|
||||
$fields["pager"] = addslashes($pager);
|
||||
$fields["mphone"] = addslashes($mphone);
|
||||
$fields["ophone"] = addslashes($ophone);
|
||||
$fields["adr_street"] = addslashes($street);
|
||||
$fields["address2"] = addslashes($address2);
|
||||
$fields["adr_locality"] = addslashes($city);
|
||||
$fields["adr_region"] = addslashes($state);
|
||||
$fields["adr_postalcode"] = addslashes($zip);
|
||||
$fields["bday"] = addslashes($bday);
|
||||
$fields["url"] = $url;
|
||||
$fields["note"] = addslashes($notes);
|
||||
$fields["org_name"] = addslashes($company);
|
||||
|
||||
$this = CreateObject("phpgwapi.contacts");
|
||||
$this->add($phpgw_info["user"]["account_id"],$fields);
|
||||
}
|
||||
|
@ -29,10 +29,9 @@
|
||||
|
||||
$this = CreateObject("phpgwapi.contacts");
|
||||
$extrafields = array(
|
||||
"pager" => "pager",
|
||||
"mphone" => "mphone",
|
||||
"ophone" => "ophone",
|
||||
"address2" => "address2",
|
||||
"address3" => "address3"
|
||||
);
|
||||
$qfields = $this->stock_contact_fields + $extrafields;
|
||||
|
||||
@ -159,7 +158,7 @@
|
||||
if ( !empty($coldata) && (substr($coldata,0,7) != 'http://') ) { $coldata = 'http://' . $coldata; }
|
||||
$ref='<a href="'.$coldata.'" target="_new">';
|
||||
$data=$coldata.'</a>';
|
||||
} elseif ($column[0] == "d_email") {
|
||||
} elseif ( ($column[0] == "email") || ($column[0] == "email_home") ) {
|
||||
if ($phpgw_info["user"]["apps"]["email"]) {
|
||||
$ref='<a href="'.$phpgw->link("/email/compose.php","to=" . urlencode($coldata)).'" target="_new">';
|
||||
} else {
|
||||
|
@ -22,12 +22,13 @@
|
||||
include("../header.inc.php");
|
||||
|
||||
$this = CreateObject("phpgwapi.contacts");
|
||||
|
||||
$extrafields = array(
|
||||
"pager" => "pager",
|
||||
"mphone" => "mphone",
|
||||
"ophone" => "ophone",
|
||||
"address2" => "address2",
|
||||
"address3" => "address3"
|
||||
);
|
||||
|
||||
$qfields = $this->stock_contact_fields + $extrafields;
|
||||
|
||||
if ($submit) {
|
||||
|
@ -2,6 +2,12 @@
|
||||
<!-- BEGIN addressbook entry form -->
|
||||
<table width="75%" border="0" align="center">
|
||||
<tr>
|
||||
<td><font color="#000000" face="">{lang_personal}:</font></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><font color="#000000" face="" size="-1">{lang_prefix}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
@ -9,6 +15,7 @@
|
||||
</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><font color="#000000" face="" size="-1">{lang_firstname}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
@ -21,6 +28,7 @@
|
||||
</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><font color="#000000" face="" size="-1">{lang_lastname}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
@ -28,37 +36,35 @@
|
||||
</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><font color="#000000" face="" size="-1">{lang_suffix}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{suffix}
|
||||
</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<font color="#000000" face="" size="-1">{lang_email}:</font>
|
||||
</td>
|
||||
<td><font face="" size="-1">{lang_birthday}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{email}
|
||||
</font></td>
|
||||
{birthday}
|
||||
</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><font color="#000000" face="">{lang_business}:</font></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<font color="#000000" face="" size="-1">{lang_title}:
|
||||
<font color="#000000" face="" size="-1">{lang_title}:</font>
|
||||
</td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{title}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<font color="#000000" face="" size="-1">{lang_email_type}:</font>
|
||||
</td>
|
||||
<td>
|
||||
<font size="-1">{email_type}</font>
|
||||
</td>
|
||||
</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<font color="#000000" face="" size="-1">{lang_company}:</font>
|
||||
</td>
|
||||
@ -74,6 +80,23 @@
|
||||
<td><font size="-1"></font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<font color="#000000" face="" size="-1">{lang_email}:
|
||||
</td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{email}
|
||||
</td>
|
||||
<td>
|
||||
<font color="#000000" face="" size="-1">{lang_email_type}:</font>
|
||||
</td>
|
||||
<td>
|
||||
<font size="-1">{email_type}</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<font color="#000000" face="" size="-1">{lang_department}:</font>
|
||||
</td>
|
||||
@ -83,93 +106,62 @@
|
||||
<td><font size="-1"></font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><font color="#000000" face="" size="-1">{lang_hphone}:</font></td>
|
||||
<td></td>
|
||||
<td><font face="" size="-1">{lang_bstreet}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{hphone}
|
||||
</font></td>
|
||||
<td><font color="#000000" face="" size="-1">{lang_fax}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{fax}
|
||||
</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><font color="#000000" face="" size="-1">{lang_wphone}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{wphone}
|
||||
</font></td>
|
||||
<td><font color="#000000" face="" size="-1">{lang_pager}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{pager}
|
||||
</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><font color="#000000" face="" size="-1">{lang_mphone}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{mphone}
|
||||
</font></td>
|
||||
<td><font face="" size="-1" color="#000000">{lang_ophone}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{ophone}
|
||||
</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><font face="" size="-1">{lang_street}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{street}
|
||||
</font></td>
|
||||
<td><font face="" size="-1">{lang_birthday}:</font></td>
|
||||
<td>
|
||||
{birthday}
|
||||
</td>
|
||||
{bstreet}
|
||||
</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><font face="" size="-1">{lang_address2}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{address2}
|
||||
</font></td>
|
||||
<td><font size="-1"></font></td>
|
||||
<td><font size="-1"></font></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><font face="" size="-1">{lang_city}:</font></td>
|
||||
<td></td>
|
||||
<td><font face="" size="-1">{lang_address3}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{city}
|
||||
{address3}
|
||||
</font></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><font face="" size="-1">{lang_bcity}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{bcity}
|
||||
</font></td>
|
||||
<td><font color="#000000" face="" size="-1">{lang_bstate}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{bstate}
|
||||
</font></td>
|
||||
<td><font size="-1"></font></td>
|
||||
<td><font size="-1"></font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><font color="#000000" face="" size="-1">{lang_state}:</font></td>
|
||||
<td></td>
|
||||
<td><font face="" size="-1">{lang_bzip}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{state}
|
||||
</font></td>
|
||||
<td><font size="-1"></font></td>
|
||||
<td><font size="-1"></font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><font face="" size="-1">{lang_zip}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{zip}
|
||||
{bzip}
|
||||
</font></td>
|
||||
<td><font size="-1"></font></td>
|
||||
<td><font size="-1"></font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><font color="#000000" face="" size="-1">{lang_country}:</font></td>
|
||||
<td></td>
|
||||
<td><font color="#000000" face="" size="-1">{lang_bcountry}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{country}
|
||||
{bcountry}
|
||||
</font></td>
|
||||
<td><font color="#000000" face="" size="-1">{lang_timezone}:</font></td>
|
||||
<td>
|
||||
@ -179,14 +171,157 @@
|
||||
<td><font size="-1"></font></td>
|
||||
<td><font size="-1"></font></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><font color="#000000" face="" size="-1">{lang_badrtype}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{badrtype}
|
||||
</font></td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><font color="#000000" face="" size="-1">{lang_wphone}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{wphone}
|
||||
</font></td>
|
||||
<td><font color="#000000" face="" size="-1">{lang_fax}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{fax}
|
||||
</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><font color="#000000" face="" size="-1">{lang_pager}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{pager}
|
||||
</font></td>
|
||||
<td><font color="#000000" face="" size="-1">{lang_mphone}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{mphone}
|
||||
</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><font color="#000000" face="" size="-1">{lang_msgphone}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{msgphone}
|
||||
</font></td>
|
||||
<td><font color="#000000" face="" size="-1">{lang_isdnphone}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{isdnphone}
|
||||
</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><font color="#000000" face="" size="-1">{lang_carphone}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{carphone}
|
||||
</font></td>
|
||||
<td><font color="#000000" face="" size="-1">{lang_vidphone}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{vidphone}
|
||||
</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><font size="-1">{lang_pubkey}:</font></td>
|
||||
<td colspan="3">
|
||||
<font size="-1">
|
||||
{pubkey}
|
||||
</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><font color="#000000" face="">{lang_home}:</font></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<font color="#000000" face="" size="-1">{lang_hemail}:
|
||||
</td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{hemail}
|
||||
</td>
|
||||
<td>
|
||||
<font color="#000000" face="" size="-1">{lang_hemail_type}:</font>
|
||||
</td>
|
||||
<td>
|
||||
<font size="-1">{hemail_type}</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><font face="" size="-1">{lang_hstreet}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{hstreet}
|
||||
</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><font face="" size="-1">{lang_hcity}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{hcity}
|
||||
</font></td>
|
||||
<td><font color="#000000" face="" size="-1">{lang_hstate}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{hstate}
|
||||
</font></td>
|
||||
<td><font size="-1"></font></td>
|
||||
<td><font size="-1"></font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><font face="" size="-1">{lang_hzip}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{hzip}
|
||||
</font></td>
|
||||
<td><font size="-1"></font></td>
|
||||
<td><font size="-1"></font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><font color="#000000" face="" size="-1">{lang_hcountry}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{hcountry}
|
||||
</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><font color="#000000" face="" size="-1">{lang_hadrtype}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{hadrtype}
|
||||
</font></td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><font color="#000000" face="" size="-1">{lang_hphone}:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
{hphone}
|
||||
</font></td>
|
||||
<td></td>
|
||||
<td colspan="4"><font size="-1"></font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<!-- BEGIN Access -->
|
||||
{access_link}
|
||||
<!-- END Access -->
|
||||
<!-- BEGIN creator -->
|
||||
{create}
|
||||
<!-- END creator -->
|
||||
|
@ -30,8 +30,6 @@
|
||||
|
||||
// Some of the methods where borrowed from
|
||||
// Squirrelmail <Luke Ehresman> http://www.squirrelmail.org
|
||||
|
||||
//$sep = $phpgw->common->filesystem_separator();
|
||||
$sep = SEP;
|
||||
|
||||
$uploaddir = $phpgw_info["server"]["temp_dir"] . $sep . $phpgw_info["user"]["sessionid"] . $sep;
|
||||
@ -52,11 +50,6 @@
|
||||
|
||||
// This has to be non-interactive in case of a multi-entry vcard.
|
||||
$filename = $uploaddir . $newfilename;
|
||||
//$n_groups = $phpgw->accounts->array_to_string($access,$n_groups);
|
||||
|
||||
//if($access == "group")
|
||||
// $access = $n_groups;
|
||||
//echo $access . "<BR>";
|
||||
|
||||
parsevcard($filename,$access);
|
||||
// Delete the temp file.
|
||||
@ -73,47 +66,19 @@
|
||||
echo "<B><CENTER>You must select a vcard. (*.vcf)</B></CENTER><BR><BR>";
|
||||
}
|
||||
|
||||
|
||||
$t = new Template($phpgw->common->get_tpl_dir("addressbook"));
|
||||
$t->set_file(array("vcardin" => "vcardin.tpl"));
|
||||
|
||||
|
||||
$vcard_header = "<p> <b>" . lang("Address book - VCard in") . "</b><hr><p>";
|
||||
|
||||
$t->set_var(vcard_header,$vcard_header);
|
||||
$t->set_var(action_url,$phpgw->link("/addressbook/vcardin.php"));
|
||||
$t->set_var(lang_access,lang("Access"));
|
||||
$t->set_var(lang_groups,lang("Which groups"));
|
||||
/*
|
||||
$access_option = "<option value=\"private\"";
|
||||
if($access == "private")
|
||||
$access_option .= "selected";
|
||||
$access_option .= ">" . lang("private");
|
||||
$access_option .= "</option>\n";
|
||||
$access_option .= "<option value=\"public\"\n";
|
||||
if($access == "public")
|
||||
$access_option .= "selected";
|
||||
$access_option .= ">" . lang("Global Public");
|
||||
$access_option .= "</option>\n";
|
||||
$access_option .= "<option value=\"group\"";
|
||||
if($access != "private" && $access != "public" && $access != "")
|
||||
$access_option .= "selected";
|
||||
$access_option .= ">" . lang("Group Public");
|
||||
$access_option .= "</option>\n";
|
||||
*/
|
||||
$t->set_var(access_option,$access_option);
|
||||
/*
|
||||
//$user_groups = $phpgw->accounts->read_group_names($fields["ab_owner"]);
|
||||
for ($i=0;$i<count($user_groups);$i++) {
|
||||
$group_option = "<option value=\"" . $user_groups[$i][0] . "\"";
|
||||
if (ereg(",".$user_groups[$i][0].",",$access)) {
|
||||
$group_option .= " selected";
|
||||
$group_option .= ">" . $user_groups[$i][1];
|
||||
$group_option .= "</option>\n";
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
$t->set_var(group_option,$group_option);
|
||||
|
||||
|
||||
$t->pparse("out","vcardin");
|
||||
|
||||
if ($action != "Load Vcard")
|
||||
|
@ -27,7 +27,7 @@
|
||||
$phpgw_info["flags"]["enable_addressbook_class"] = True;
|
||||
$phpgw_info["flags"]["currentapp"] = "addressbook";
|
||||
include("../header.inc.php");
|
||||
|
||||
|
||||
if (! $ab_id) {
|
||||
Header("Location: " . $phpgw->link("/addressbook/index.php"));
|
||||
$phpgw->common->phpgw_exit();
|
||||
@ -35,13 +35,20 @@
|
||||
|
||||
$this = CreateObject("phpgwapi.contacts");
|
||||
|
||||
//if ($filter != "private")
|
||||
//$filtermethod = " or ab_access='public' " . $phpgw->accounts->sql_search("ab_access");
|
||||
|
||||
$fieldlist = addressbook_read_entry($ab_id,$this->stock_contact_fields);
|
||||
$extrafields = array(
|
||||
"ophone" => "ophone",
|
||||
"address2" => "address2",
|
||||
"address3" => "address3"
|
||||
);
|
||||
$qfields = $this->stock_contact_fields + $extrafields;
|
||||
|
||||
$fieldlist = addressbook_read_entry($ab_id,$qfields);
|
||||
$fields = $fieldlist[0];
|
||||
|
||||
$email = $fields["d_email"];
|
||||
$email = $fields["email"];
|
||||
$emailtype = $fields["email_type"]; if (!$emailtype) { $emailtype = 'INTERNET'; }
|
||||
$hemail = $fields["email_home"]; if (!$hemail) { $hemail = 'none'; }
|
||||
$hemailtype = $fields["email_home_type"]; if (!$hemailtype) { $hemailtype = 'INTERNET'; }
|
||||
$fullname = $fields["fn"];
|
||||
$prefix = $fields["n_prefix"];
|
||||
$firstname = $fields["n_given"];
|
||||
@ -49,18 +56,44 @@
|
||||
$lastname = $fields["n_family"];
|
||||
$suffix = $fields["n_suffix"];
|
||||
$title = $fields["title"];
|
||||
$wphone = $fields["a_tel"];
|
||||
$hphone = $fields["b_tel"];
|
||||
$fax = $fields["c_tel"];
|
||||
$pager = $fields["pager"];
|
||||
$mphone = $fields["mphone"];
|
||||
$ophone = $fields["ophone"];
|
||||
$street = $fields["adr_street"];
|
||||
$aphone = $fields["tel_work"];
|
||||
$bphone = $fields["tel_home"];
|
||||
$afax = $fields["tel_fax"];
|
||||
$apager = $fields["tel_pager"];
|
||||
$amphone = $fields["tel_cell"];
|
||||
$aisdnphone = $fields["tel_isdn"];
|
||||
$acarphone = $fields["tel_car"];
|
||||
$avidphone = $fields["tel_video"];
|
||||
$amsgphone = $fields["tel_msg"];
|
||||
$abbsphone = $fields["tel_bbs"];
|
||||
$amodem = $fields["tel_modem"];
|
||||
$preferred = $fields["tel_prefer"];
|
||||
$aophone = $fields["ophone"];
|
||||
|
||||
// Setup array for display of preferred phone number below
|
||||
while (list($name,$val) = each($this->tel_types)) {
|
||||
if ($name == $preferred) {
|
||||
$pref[$name] .= ';PREF';
|
||||
}
|
||||
}
|
||||
|
||||
$aophone = $fields["ophone"];
|
||||
$astreet = $fields["adr_one_street"];
|
||||
$address2 = $fields["address2"];
|
||||
$city = $fields["adr_locality"];
|
||||
$state = $fields["adr_region"];
|
||||
$zip = $fields["adr_postalcode"];
|
||||
$country = $fields["adr_countryname"];
|
||||
$acity = $fields["adr_one_locality"];
|
||||
$astate = $fields["adr_one_region"];
|
||||
$azip = $fields["adr_one_postalcode"];
|
||||
$acountry = $fields["adr_one_countryname"];
|
||||
$atype = $fields["adr_one_type"]; if (!empty($atype)) { $atype = ';'.$atype; }
|
||||
$label = $fields["label"];
|
||||
|
||||
$bstreet = $fields["adr_two_street"];
|
||||
$bcity = $fields["adr_two_locality"];
|
||||
$bstate = $fields["adr_two_region"];
|
||||
$bzip = $fields["adr_two_postalcode"];
|
||||
$bcountry = $fields["adr_two_countryname"];
|
||||
$btype = $fields["adr_two_type"]; if (!empty($btype)) { $btype = ';'.$btype; }
|
||||
|
||||
$company = $fields["org_name"];
|
||||
$dept = $fields["org_unit"];
|
||||
$bday = $fields["bday"];
|
||||
@ -78,7 +111,7 @@
|
||||
Header("Location: " . $phpgw->link("/addressbook/vcardout.php","nofname=1&ab_id=$ab_id&start=$start&order=$order&filter=" . "$filter&query=$query&sort=$sort"));
|
||||
}
|
||||
|
||||
header("Content-type: text/X-VCARD");
|
||||
header("Content-type: text/x-vcard");
|
||||
$fn = explode("@",$email);
|
||||
$filename = sprintf("%s.vcf", $fn[0]);
|
||||
|
||||
@ -89,31 +122,58 @@
|
||||
if (!$fullname) { printf("FN:%s %s\r\n", $firstname, $lastname); }
|
||||
else { printf("FN:%s\r\n", $fullname); }
|
||||
|
||||
/* This stuff is optional. */
|
||||
|
||||
if($title != "") /* Title */
|
||||
printf("TITLE:%s\r\n",$title);
|
||||
|
||||
// 'A' grouping - work stuff
|
||||
if($email != "") /* E-mail */
|
||||
printf("EMAIL;INTERNET:%s\r\n", $email);
|
||||
if($hphone != "") /* Home Phone */
|
||||
printf("TEL;HOME:%s\r\n", $hphone);
|
||||
if($wphone != "") /* Work Phone */
|
||||
printf("TEL;WORK:%s\r\n", $wphone);
|
||||
if($mphone != "") /* Mobile Phone */
|
||||
printf("TEL;CELL:%s\r\n", $mphone);
|
||||
if($fax != "") /* Fax Number */
|
||||
printf("TEL;FAX:%s\r\n", $fax);
|
||||
if($pager != "") /* Pager Number */
|
||||
printf("TEL;PAGER:%s\r\n", $pager);
|
||||
//if($ophone != "") /* Other Phone */
|
||||
//$NOTES .= "Other Phone: " . $ophone;
|
||||
/* The address one is pretty icky. Send it if ANY of the fields are present. */
|
||||
if($address2 != "" || /* Street Line 1 */
|
||||
$street != "" || /* Street Line 2 */
|
||||
$city != "" || /* City */
|
||||
$state != "" || /* State */
|
||||
$zip != "") /* Zip */
|
||||
printf("ADR:;;%s;%s;%s;%s;%s;%s\r\n", $street,
|
||||
$address2,$city,$state,$zip,$country);
|
||||
printf("A.EMAIL;%s:%s\r\n", $emailtype,$email);
|
||||
|
||||
if($aphone != "") printf("A.TEL%s;WORK:%s\r\n", $pref['work'], $aphone);
|
||||
if($amphone != "") printf("A.TEL%s;CELL:%s\r\n", $pref['cell'], $amphone);
|
||||
if($afax != "") printf("A.TEL%s;FAX:%s\r\n", $pref['fax'], $afax);
|
||||
if($apager != "") printf("A.TEL%s;PAGER:%s\r\n", $pref['pager'], $apager);
|
||||
if($amsgphone != "") printf("A.TEL%s;MSG:%s\r\n", $pref['msg'], $amsgphone);
|
||||
if($acarphone != "") printf("A.TEL%s;CAR:%s\r\n", $pref['car'], $acarphone);
|
||||
if($abbs != "") printf("A.TEL%s;BBS:%s\r\n", $pref['fax'], $afax);
|
||||
if($amodem != "") printf("A.TEL%s;MODEM:%s\r\n", $pref['modem'], $amodem);
|
||||
if($aisdnphone != "") printf("A.TEL%s;ISDN:%s\r\n", $pref['isdn'], $aisdnphone);
|
||||
if($avidphone != "") printf("A.TEL%s;VIDEO:%s\r\n", $pref['video'], $avidphone);
|
||||
|
||||
if($ophone != "") $NOTES .= "Other Phone: " . $ophone . "\r\n";
|
||||
|
||||
if($astreet != "" || /* Business Street Line 1 */
|
||||
$address2 != "" || /* Business Street Line 2 */
|
||||
$acity != "" || /* Business City */
|
||||
$astate != "" || /* Business State */
|
||||
$azip != "") { /* Business Zip */
|
||||
printf("A.ADR%s;WORK:;%s;%s;%s;%s;%s;%s\r\n", $atype,$address2,
|
||||
$astreet,$acity,$astate,$azip,$acountry);
|
||||
}
|
||||
if ($label) {
|
||||
printf("LABEL;ENCODING=QUOTED-PRINTABLE:%s\r\n",$label);
|
||||
} else {
|
||||
if ($address2 && $astreet && $acity && $astate && $azip && $acountry) {
|
||||
printf("LABEL;ENCODING=QUOTED-PRINTABLE:%s=0D=0A %s=0D=0A %s,%s %s=0D=0A %s\r\n",$address2,$astreet,$acity,$astate,$azip,$acountry);
|
||||
}
|
||||
}
|
||||
// end 'A' grouping
|
||||
|
||||
// 'B' Grouping - home stuff
|
||||
if($hemail != "") /* Home E-mail */
|
||||
printf("B.EMAIL;%s:%s\r\n", $hemailtype,$hemail);
|
||||
if($bphone != "") /* Home Phone */
|
||||
printf("B.TEL%s;HOME:%s\r\n", $pref['home'],$bphone);
|
||||
|
||||
if( $bstreet != "" || /* Home Street */
|
||||
$bcity != "" || /* Home City */
|
||||
$bstate != "" || /* Home State */
|
||||
$bzip != "") { /* Home Zip */
|
||||
printf("B.ADR%s;HOME:;;%s;%s;%s;%s;%s\r\n", $btype,$bstreet,
|
||||
$bcity,$bstate,$bzip,$bcountry);
|
||||
}
|
||||
// end 'B' grouping
|
||||
|
||||
if($bday != "" && $bday != "//") /* Birthday */
|
||||
printf("BDAY:%s\r\n", $bday); /* This is not the right format. */
|
||||
|
@ -57,15 +57,15 @@
|
||||
}
|
||||
|
||||
// merge in extra fields
|
||||
$extrafields = array (
|
||||
"pager" => "pager",
|
||||
"mphone" => "mphone",
|
||||
$extrafields = array(
|
||||
"ophone" => "ophone",
|
||||
"address2" => "address2",
|
||||
"address3" => "address3"
|
||||
);
|
||||
$qfields = $this->stock_contact_fields + $extrafields;
|
||||
|
||||
$fields = addressbook_read_entry($ab_id,$qfields);
|
||||
|
||||
|
||||
$record_owner = $fields[0]["owner"];
|
||||
|
||||
$view_header = "<p> <b>" . lang("Address book - view") . $noprefs . "</b><hr><p>";
|
||||
@ -80,7 +80,7 @@
|
||||
if ($column[0] == "url") {
|
||||
$ref='<a href="'.$coldata.'" target="_new">';
|
||||
$data=$coldata.'</a>';
|
||||
} elseif ($column[0] == "email") {
|
||||
} elseif (($column[0] == "email") || ($column[0] == "email_home")) {
|
||||
if ($phpgw_info["user"]["apps"]["email"]) {
|
||||
$ref='<a href="'.$phpgw->link("/email/compose.php","to=" . urlencode($coldata)).'" target="_new">';
|
||||
} else {
|
||||
@ -93,15 +93,6 @@
|
||||
$columns_html .= "<td>" . $ref . $data . "</td>";
|
||||
}
|
||||
|
||||
/*
|
||||
if ($access == "private") {
|
||||
$access_link .= lang("Record Access") . " - " . $access;
|
||||
} elseif ($access != "private" && $access != "public") {
|
||||
$access_link .= lang("Group access") . " - " . $phpgw->accounts->convert_string_to_names_access($access);
|
||||
} else {
|
||||
$access_link ="";
|
||||
}
|
||||
*/
|
||||
$columns_html .= '<tr><td colspan="4"> </td></tr>'
|
||||
. '<tr><td><b>' . lang("Record owner") . '</b></td><td>'
|
||||
. $phpgw->common->grab_owner_name($record_owner) . '</td><td><b>'
|
||||
@ -110,7 +101,7 @@
|
||||
$editlink = $phpgw->common->check_owner($record_owner,"/addressbook/edit.php",lang("edit"),"ab_id=" . $ab_id . "&start=".$start."&sort=".$sort."&order=".$order);
|
||||
$vcardlink = '<form action="'.$phpgw->link("/addressbook/vcardout.php","ab_id=$ab_id&order=$order&start=$start&filter=$filter&query=$query&sort=$sort").'">';
|
||||
$donelink = '<form action="'.$phpgw->link("/addressbook/index.php","order=$order&start=$start&filter=$filter&query=$query&sort=$sort").'">';
|
||||
|
||||
|
||||
$t->set_var("access_link",$access_link);
|
||||
$t->set_var("ab_id",$ab_id);
|
||||
$t->set_var("sort",$sort);
|
||||
@ -130,6 +121,6 @@
|
||||
|
||||
$t->parse("out","view");
|
||||
$t->pparse("out","view");
|
||||
|
||||
|
||||
$phpgw->common->phpgw_footer();
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user