Changeset 7633 for trunk/zpush/backend/expresso/providers
- Timestamp:
- 12/10/12 13:38:57 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zpush/backend/expresso/providers/contactProvider.php
r7632 r7633 133 133 $messages = array(); 134 134 $ids = array(); 135 try { 136 if ($result == FALSE) throw new Exception(pg_last_error($this->db)); 137 $result = pg_query($this->db, "select given_names, family_names, last_update, id_contact from phpgw_cc_contact where id_owner = " . $this->_uidnumber . ";"); 138 if ($result == FALSE) throw new Exception(pg_last_error($this->db)); 139 while ($row = pg_fetch_row($result)) { 140 $message = array(); 141 $message["id"] = $row[3]; 142 $message["mod"] = substr($row[2], 0, strlen($row[2])-3); 143 $message["flags"] = 1; // always 'read' 144 $messages[] = $message; 145 } 146 if ($result == FALSE) throw new Exception(pg_last_error($this->db)); 147 } catch (Exception $e) { 148 // debugLog("exception -> " . $e->getMessage() . " - ARQUIVO: " . $e->getFile() . " - LINHA: " . $e->getLine()); 135 136 $result = pg_query($this->db, "select given_names, family_names, last_update, id_contact from phpgw_cc_contact where id_owner = " . $this->_uidnumber . ";"); 137 if ($result == FALSE) throw new Exception(pg_last_error($this->db)); 138 while ($row = pg_fetch_row($result)) { 139 $message = array(); 140 $message["id"] = $row[3]; 141 $message["mod"] = substr($row[2], 0, strlen($row[2])-3); 142 $message["flags"] = 1; // always 'read' 143 $messages[] = $message; 149 144 } 150 151 145 152 146 return $messages; … … 172 166 // Parse the database into object 173 167 $message = new SyncContact(); 174 try { 175 $result_contact = pg_query($this->db, "select id_contact, id_owner, id_status, photo, alias, id_prefix, given_names, family_names, names_ordered, id_suffix, birthdate, sex, pgp_key, notes, is_global, last_status, last_update, category, web_page, corporate_name, job_title, department from phpgw_cc_contact where id_contact = " . $id . ";"); 168 $result_contact = pg_query($this->db, "select id_contact, id_owner, id_status, photo, alias, id_prefix, given_names, family_names, names_ordered, id_suffix, birthdate, sex, pgp_key, notes, is_global, last_status, last_update, category, web_page, corporate_name, job_title, department from phpgw_cc_contact where id_contact = " . $id . ";"); 176 169 if ($result_contact == FALSE) throw new Exception(pg_last_error($this->db)); 177 170 while ($row_contact = pg_fetch_row($result_contact)) { … … 358 351 } 359 352 } 360 } catch (Exception $e) { 361 debugLog("exception -> " . $e->getMessage() . " - ARQUIVO: " . $e->getFile() . " - LINHA: " . $e->getLine()); 362 return; 363 } 353 364 354 return $message; 365 355 } … … 386 376 ZLog::Write(LOGLEVEL_DEBUG, "ExpressoContactProvider->StatMessage()"); 387 377 388 try {389 390 378 $result_contact = pg_query($this->db, "select last_update from phpgw_cc_contact where id_contact = " . $id . ";"); 391 379 if ($result_contact == FALSE) throw new Exception(pg_last_error($this->db)); … … 399 387 } 400 388 } 401 402 } catch (Exception $e) {403 debugLog("exception -> " . $e->getMessage() . " - ARQUIVO: " . $e->getFile() . " - LINHA: " . $e->getLine());404 }405 389 return false; 406 390 }
Note: See TracChangeset
for help on using the changeset viewer.