[ Index ] |
|
Code source de eGroupWare 1.2.106-2 |
1 /**************************************************************************\ 2 * eGroupWare API - Contacts class documentation * 3 * This file written by Miles Lott <milosch@groupwhare.org> * 4 * -------------------------------------------------------------------------* 5 * This library is free software; you can redistribute it and/or modify it * 6 * under the terms of the GNU Lesser General Public License as published by * 7 * the Free Software Foundation; either version 2.1 of the License, * 8 * or any later version. * 9 * This library is distributed in the hope that it will be useful, but * 10 * WITHOUT ANY WARRANTY; without even the implied warranty of * 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * 12 * See the GNU Lesser General Public License for more details. * 13 * You should have received a copy of the GNU Lesser General Public License * 14 * along with this library; if not, write to the Free Software Foundation, * 15 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 16 \**************************************************************************/ 17 18 /* $Id: contacts.readme.txt 15132 2004-05-05 09:59:18Z reinerj $ */ 19 20 21 Starting with the most cumbersome function: 22 23 function read($start,$offset,$fields,$query="",$filter="",$sort="",$order="") 24 25 Purpose: 26 Returns a list of contacts based on limits, query, and filter, 27 in an array of name/values, e.g.: 28 29 $fields[0]["id"] => "354", 30 $fields[0]["email"] => "name@domain.com", ... 31 32 $fields[1]["id"] => "355", 33 $fields[1]["email"] => "othername@otherdomain.com", ... 34 35 Inputs: 36 37 $start = start of list, e.g. 1,16,31 38 $offset = numrows, e.g. 15,30,etc. from nextmatchs, usually 39 $fields = simple array of fields to return: 40 41 $qfields = array( 42 'id' => 'id', 43 'n_given' => 'n_given 44 ); 45 46 $query = simple string to search for, e.g. "milosch" or "555" 47 48 $filter = for 'accounting' fields other than id (use read_single_entry for 49 that): 50 51 owner = account_id of record owner 52 access = public/private 53 cat_id = category id for the record 54 lid = account_lid for account records stored here, if any 55 tid = type id: 56 n = normal contact - almost always use this 57 p = profiles for hr, tied to account records 58 u = user account, if stored in contacts class 59 g = group account, "" 60 61 Filters should be in the format: 62 63 example 1: 'tid=n' filter for normal contacts 64 example 2: 'tid=u,lid=milosch' filter user accounts for lid 65 'milosch' 66 etc... 67 68 $sort = ASC, DESC, or "" (defaults to ASC) 69 70 $order = sort on this field, e.g. n_given 71 72 73 function read_single_entry($id,$fields) 74 75 Purpose: 76 returns a single array of name/value based on id 77 and field selection, e.g.: 78 79 $fields[0]["email"] => "name@domain.com" 80 $fields[0]["n_given"] => "Bob" 81 82 Inputs: 83 84 $id = id of entry you want to return 85 86 $fields = simple array of fields to return 87 88 $qfields = array( 89 'id' => 'id', 90 'n_given' => 'n_given 91 ); 92 93 94 function add($owner,$fields,$access='',$cat_id='',$tid='n') 95 96 Purpose: 97 98 Add a new contact record of the type, category and access sent 99 with a field list. 100 101 Inputs: 102 103 $owner = id of user adding this data 104 105 $fields = simple array of fields to write into the new record 106 107 $access = public/private 108 109 $cat_id = category id for the record, if desired 110 111 $tid = type id ( see read() above ), defaults to 'n' 112 113 114 function update($id,$owner,$fields,$access='',$cat_id='',$tid='') 115 116 Purpose: 117 118 Update an entry already in the contacts list 119 120 Inputs: 121 122 $id = id of entry you want to update 123 124 $owner = id of user modifying this data 125 126 $fields = simple array of fields to update in the record 127 (see examples above) 128 129 $access = public/private 130 131 $cat_id = category id for the record, if desired 132 133 134 $tid = type id ( see read() above ), defaults to 'n' 135 136 137 function delete_($id) 138 139 Purpose: 140 141 Delete an entry already in the contacts list 142 143 Inputs: 144 145 $id = id of entry you want to delete 146 147 148 Stock contact fields, other than accounting fields mentioned above: 149 150 $this->stock_contact_fields = array( 151 "fn" => "fn", // 'prefix given middle family suffix' 152 "n_given" => "n_given", // firstname 153 "n_family" => "n_family", // lastname 154 "n_middle" => "n_middle", 155 "n_prefix" => "n_prefix", 156 "n_suffix" => "n_suffix", 157 "sound" => "sound", 158 "bday" => "bday", // Birthday (12/31/1969) 159 "note" => "note", // Note, description, etc. 160 "tz" => "tz", // Hours offset from phpgw install 161 "geo" => "geo", // Not used 162 "url" => "url", 163 "pubkey" => "pubkey", // Similar to note, but for public encryption key 164 165 "org_name" => "org_name", // company 166 "org_unit" => "org_unit", // division 167 "title" => "title", 168 169 "adr_one_street" => "adr_one_street", // Business address entry 170 "adr_one_locality" => "adr_one_locality", 171 "adr_one_region" => "adr_one_region", 172 "adr_one_postalcode" => "adr_one_postalcode", 173 "adr_one_countryname" => "adr_one_countryname", 174 "adr_one_type" => "adr_one_type", // address is domestic/intl/postal/parcel/work/home 175 "label" => "label", // address label 176 177 "adr_two_street" => "adr_two_street", // Home address entry 178 "adr_two_locality" => "adr_two_locality", 179 "adr_two_region" => "adr_two_region", 180 "adr_two_postalcode" => "adr_two_postalcode", 181 "adr_two_countryname" => "adr_two_countryname", 182 "adr_two_type" => "adr_two_type", // address is domestic/intl/postal/parcel/work/home 183 184 "tel_work" => "tel_work", 185 "tel_home" => "tel_home", 186 "tel_voice" => "tel_voice", 187 "tel_fax" => "tel_fax", 188 "tel_msg" => "tel_msg", 189 "tel_cell" => "tel_cell", 190 "tel_pager" => "tel_pager", 191 "tel_bbs" => "tel_bbs", 192 "tel_modem" => "tel_modem", 193 "tel_car" => "tel_car", 194 "tel_isdn" => "tel_isdn", 195 "tel_video" => "tel_video", 196 "tel_prefer" => "tel_prefer", // home;work;voice 197 "email" => "email", 198 "email_type" => "email_type", //'INTERNET','CompuServe',etc... 199 "email_home" => "email_home", 200 "email_home_type" => "email_home_type" //'INTERNET','CompuServe',etc... 201 ); 202 203 Other useful arrays for setting option dialogs, etc. 204 205 // Used to set adr_one_type/adr_two_type, e.g. 'intl;work' 206 $this->adr_types = array( 207 "dom" => lang("Domestic"), 208 "intl" => lang("International"), 209 "parcel" => lang("Parcel"), 210 "postal" => lang("Postal") 211 ); 212 213 // Used to set preferred number field, e.g. 'cell' or 'work' 214 $this->tel_types = array( 215 "work" => "work", 216 "home" => "home", 217 "voice" => "voice", 218 "fax" => "fax", 219 "msg" => "msg", 220 "cell" => "cell", 221 "pager" => "pager", 222 "bbs" => "bbs", 223 "modem" => "modem", 224 "car" => "car", 225 "isdn" => "isdn", 226 "video" => "video" 227 ); 228 229 $this->email_types = array( 230 "INTERNET" => "INTERNET", 231 "CompuServe" => "CompuServe", 232 "AOL" => "AOL", 233 "Prodigy" => "Prodigy", 234 "eWorld" => "eWorld", 235 "AppleLink" => "AppleLink", 236 "AppleTalk" => "AppleTalk", 237 "PowerShare" => "PowerShare", 238 "IBMMail" => "IBMMail", 239 "ATTMail" => "ATTMail", 240 "MCIMail" => "MCIMail", 241 "X.400" => "X.400", 242 "TLX" => "TLX" 243 ); 244
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 17:20:01 2007 | par Balluche grâce à PHPXref 0.7 |