* * -------------------------------------------- * * 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('company' => 'company', // AddressBook Columns and their descriptions 'firstname' => 'first name', 'lastname' => 'last name', 'email' => 'email', 'wphone' => 'work phone', 'hphone' => 'home phone', 'fax' => 'fax', 'pager' => 'pager', 'title' => 'title', 'mphone' => 'mobile phone', 'ophone' => 'other phone', 'street' => 'street', 'city' => 'city', 'state' => 'state', 'zip' => 'zip code', 'bday' => 'birthday', 'url' => 'URL' ); */ 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"]; $firstname = $fields["N_Given"]; $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_Country"]; $bday = $fields["bday"]; $notes = $fields["notes"]; $company = $fields["ORG_Name"]; $url = $fields["url"]; if ($format != "view") { $email = ""; $firstname = ""; $lastname = ""; $title = ""; $hphone = ""; $wphone = ""; $fax = ""; $pager = ""; $mphone = ""; $ophone = ""; $street = ""; $address2 = ""; $city = ""; $state = ""; $zip = ""; $country = ""; /* if($phpgw_info["apps"]["timetrack"]["enabled"]) { $company = '"; } else { */ $company = ""; /* } */ 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 = ''; } $email_type = ""; $notes = ''; } else { $notes = "
"; if ($bday == "//") $bday = ""; /* if($phpgw_info["apps"]["timetrack"]["enabled"]) { $company = $company_name; } else { */ $company = $company; /* } */ } if ($action) { echo "
link($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) . '(e.g. 1969)'; if ($format == "view") { if ($access != "private" && $access != "public") { $access_link .= ''.lang("Group access").':' . '' . $phpgw->accounts->convert_string_to_names($access); } else { $access_link .= ''.lang("Access").':' . '' . $access; } } else { $access_link .= ''.lang("Access").': '; else $access_link .= '>'.lang("Group Public").''; $access_link .= ' '; } if ($format != "view") { $access_link .= '' . lang("Which groups") . ':'; $t->set_var("lang_access",lang("access")); } else { $access_link = ''; $t->set_var("lang_access",''); } if ($format == "view") $create .= ''.lang("Created by").':' . '' . grab_owner_name($fields["owner"]); else $create = ''; $t->set_var("lang_lastname",lang("Last Name")); $t->set_var("lastname",$lastname); $t->set_var("lang_firstname",lang("First Name")); $t->set_var("firstname",$firstname); $t->set_var("lang_company",lang("Company Name")); $t->set_var("company",$company); $t->set_var("lang_title",lang("Title")); $t->set_var("title",$title); $t->set_var("lang_email",lang("Email")); $t->set_var("email",$email); $t->set_var("lang_email_type",lang("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_hphone",lang("Home Phone")); $t->set_var("hphone",$hphone); $t->set_var("lang_fax",lang("fax")); $t->set_var("fax",$fax); $t->set_var("lang_wphone",lang("Work 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("mphone",$mphone); $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("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("create",$create); $t->set_var("lang_notes",lang("notes")); $t->set_var("notes",$notes); $t->parse("out","form"); $t->pparse("out","form"); } //end form function ?>