1
0
mirror of https://github.com/nerzhul/ocsms.git synced 2025-06-11 18:06:29 +00:00

prepare contact/phone buffer

This commit is contained in:
Loïc Blot (@U-Exp) 2014-09-30 07:36:49 +02:00
parent edb098fad9
commit addc336d12

View File

@ -77,7 +77,14 @@ class Application extends App {
*/
public function getContacts() {
// Only load contacts if they aren't in the buffer
if(count(self::$contacts) == 0){
if(count(self::$contacts) == 0) {
$cm = $this->c['ContactsManager'];
$result = $cm->search('',array('FN'));
foreach ($result as $r) {
if (isset $r["phone"]) {
self::$contacts[$r["phone"]] = $r["FN"];
}
}
}
}
}