示例#1
0
 public static function crm_new_event($timestamp, $timeless, $id, $object, $cal_obj)
 {
     $x = ModuleManager::get_instance('/Base_Box|0');
     if (!$x) {
         trigger_error('There is no base box module instance', E_USER_ERROR);
     }
     $me = CRM_ContactsCommon::get_my_record();
     $defaults = array('employees' => $me['id'], 'priority' => CRM_CommonCommon::get_default_priority(), 'permission' => 0, 'status' => 0);
     $defaults['deadline'] = date('Y-m-d', $timestamp);
     if ($object) {
         $defaults['employees'] = $object;
     }
     $x->push_main('Utils_RecordBrowser', 'view_entry', array('add', null, $defaults), 'task');
 }
示例#2
0
 public function addon($r, $rb_parent)
 {
     $rb = $this->init_module('Utils/RecordBrowser', 'phonecall');
     $params = array(array('related' => $rb_parent->tab . '/' . $r['id']), array('related' => false), array('date_and_time' => 'DESC'));
     //look for customers
     $customers = array();
     if (isset($r['customers'])) {
         $customers = $r['customers'];
     } elseif (isset($r['customer'])) {
         $customers = $r['customer'];
     }
     if (!is_array($customers)) {
         $customers = array($customers);
     }
     foreach ($customers as $i => &$customer) {
         if (preg_match('/^(C\\:|company\\/)([0-9]+)$/', $customer, $req)) {
             $customer = $req[2];
         } elseif (is_numeric($customer)) {
             $customer = $customer;
         } else {
             unset($customers[$i]);
         }
     }
     $me = CRM_ContactsCommon::get_my_record();
     $rb->set_defaults(array('related' => $rb_parent->tab . '/' . $r['id'], 'employees' => array($me['id']), 'status' => 0, 'permission' => 0, 'priority' => CRM_CommonCommon::get_default_priority(), 'date_and_time' => date('Y-m-d H:i:s'), 'customer' => array_shift($customers)));
     $this->display_module($rb, $params, 'show_data');
 }
示例#3
0
 public static function display_phone($r, $nolink, $desc)
 {
     if ($nolink) {
         return $r[$desc['id']];
     }
     if (MOBILE_DEVICE && IPHONE && preg_match('/^([0-9\\t\\+-]+)/', $r[$desc['id']], $args)) {
         return '<a href="tel:' . $args[1] . '">' . $r[$desc['id']] . '</a>';
     }
     $num = $r[$desc['id']];
     if ($num && strpos($num, '+') === false) {
         if (isset($r['country']) && $r['country']) {
             $calling_code = Utils_CommonDataCommon::get_value('Calling_Codes/' . $r['country']);
             if ($calling_code) {
                 $num = $calling_code . $num;
             }
         }
     }
     return CRM_CommonCommon::get_dial_code($num);
 }
示例#4
0
 public static function mobile_meetings()
 {
     $me = CRM_ContactsCommon::get_my_record();
     $defaults = array('employees' => array($me['id']), 'status' => 0, 'permission' => 0, 'priority' => CRM_CommonCommon::get_default_priority());
     Utils_RecordBrowserCommon::mobile_rb('crm_meeting', array('employees' => array($me['id'])), array('date' => 'ASC', 'time' => 'ASC', 'priority' => 'DESC', 'title' => 'ASC'), array('date' => 1, 'time' => 1, 'priority' => 1, 'longterm' => 1), $defaults);
 }
示例#5
0
 public static function mobile_phone_calls()
 {
     $me = CRM_ContactsCommon::get_my_record();
     $defaults = array('date_and_time' => date('Y-m-d H:i:s'), 'employees' => array($me['id']), 'permission' => '0', 'status' => '0', 'priority' => CRM_CommonCommon::get_default_priority());
     Utils_RecordBrowserCommon::mobile_rb('phonecall', array('employees' => array($me['id'])), array('status' => 'ASC', 'date_and_time' => 'ASC', 'subject' => 'ASC'), array(), $defaults);
 }