*
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
// NOTE: This entire file needs to be rewritten. There is a great deal of code not being used
// anymore. This should also be converted to templates while where at it (jengo)
$abc = array("FN" => "full name", //'firstname lastname'
"SOUND" => "",
"ORG_Name" => "company name", //company
"ORG_Unit" => "department", //division
"TITLE" => "title",
"N_Given" => "first name", //firstname
"N_Family" => "last name", //lastname
"N_Middle" => "middle",
"N_Prefix" => "prefix",
"N_Suffix" => "suffix",
"LABEL" => "label",
"ADR_Street" => "street",
"ADR_Locality" => "city", //city
"ADR_Region" => "state", //state
"ADR_PostalCode" => "zip", //zip
"ADR_CountryName" => "country",
"ADR_Work" => "", //yn
"ADR_Home" => "", //yn
"ADR_Parcel" => "", //yn
"ADR_Postal" => "", //yn
"TZ" => "timezone",
"GEO" => "geo",
"A_TEL" => "home 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" => "work 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
"bday" => "birthday",
"url" => "URL",
"access" => "access"
);
function display_name($column) {
global $abc;
while($name = each($abc) ) {
if ($column == $name[0]) { return $name[1]; }
}
}
function form($format,$action,$title,$fields) { // used for add/edit
global $phpgw, $phpgw_info;
$t = new Template($phpgw_info["server"]["app_tpl"]);
$t->set_file(array( "form" => "form.tpl"));
$email = $fields["D_EMAIL"];
$emailtype = $fields["D_EMAILTYPE"];
$firstname = $fields["N_Given"];
$middle = $fields["N_Middle"];
$prefix = $fields["N_Prefix"];
$suffix = $fields["N_Suffix"];
$lastname = $fields["N_Family"];
$title = $fields["TITLE"];
$hphone = $fields["A_TEL"];
$wphone = $fields["B_TEL"];
$fax = $fields["C_TEL"];
$pager = $fields["pager"];
$mphone = $fields["mphone"];
$ophone = $fields["ophone"];
$street = $fields["ADR_Street"];
$address2 = $fields["address2"];
$city = $fields["ADR_Locality"];
$state = $fields["ADR_Region"];
$zip = $fields["ADR_PostalCode"];
$country = $fields["ADR_CountryName"];
$timezone = $fields["TZ"];
$bday = $fields["bday"];
$notes = $fields["notes"];
$company = $fields["ORG_Name"];
$department = $fields["ORG_Unit"];
$url = $fields["url"];
if ($format != "view") {
$email = "";
$firstname = "";
$lastname = "";
$middle = "";
$prefix = "";
$suffix = "";
$title = "";
$hphone = "";
$wphone = "";
$fax = "";
$pager = "";
$mphone = "";
$ophone = "";
$street = "";
$address2 = "";
$city = "";
$state = "";
$zip = "";
$country = "";
/*
if($phpgw_info["apps"]["timetrack"]["enabled"]) {
$company = '";
} else { */
$company = "";
$department = "";
/* } */
if (strlen($bday) > 2) {
list( $month, $day, $year ) = split( '/', $bday );
$temp_month[$month] = "SELECTED";
$bday_month = "";
$bday_day = '';
$bday_year = '';
} else {
$bday_month = "";
$bday_day = '';
$bday_year = '';
}
$time_zone = "";
$notes = '';
} else {
$notes = "
";
if ($bday == "//")
$bday = "";
/*
if($phpgw_info["apps"]["timetrack"]["enabled"]) {
$company = $company_name;
} else { */
$company = $company;
/* } */
}
if ($action) {
echo "