示例#1
0
 public function uninstall()
 {
     CRM_CalendarCommon::delete_event_handler('Tasks');
     CRM_RoundcubeCommon::delete_addon('task');
     Utils_AttachmentCommon::delete_addon('task');
     Base_ThemeCommon::uninstall_default_theme(CRM_TasksInstall::module_name());
     Utils_RecordBrowserCommon::unregister_processing_callback('task', array('CRM_TasksCommon', 'submit_task'));
     Utils_RecordBrowserCommon::uninstall_recordset('task');
     return true;
 }
示例#2
0
 public function uninstall()
 {
     CRM_CalendarCommon::delete_event_handler('Phonecalls');
     CRM_RoundcubeCommon::delete_addon('phonecall');
     Base_ThemeCommon::uninstall_default_theme(CRM_PhoneCallInstall::module_name());
     Utils_AttachmentCommon::delete_addon('phonecall');
     Utils_AttachmentCommon::persistent_mass_delete('phonecall/');
     Utils_RecordBrowserCommon::unregister_processing_callback('phonecall', array('CRM_PhoneCallCommon', 'submit_phonecall'));
     Utils_RecordBrowserCommon::uninstall_recordset('phonecall');
     return true;
 }
示例#3
0
 public function uninstall()
 {
     Utils_AttachmentCommon::delete_addon('crm_meeting');
     Utils_RecordBrowserCommon::delete_addon('crm_meeting', CRM_MeetingInstall::module_name(), 'messanger_addon');
     CRM_RoundcubeCommon::delete_addon('crm_meeting');
     CRM_CalendarCommon::delete_event_handler('Meetings');
     Base_ThemeCommon::uninstall_default_theme(CRM_MeetingInstall::module_name());
     Utils_RecordBrowserCommon::uninstall_recordset('crm_meeting');
     Utils_RecordBrowserCommon::unregister_processing_callback('crm_meeting', array('CRM_MeetingCommon', 'submit_meeting'));
     return true;
 }
<?php

defined("_VALID_ACCESS") || die('Direct access forbidden');
Utils_RecordBrowserCommon::register_processing_callback('rc_mails', array('CRM_RoundcubeCommon', 'submit_mail'));
$mails = Utils_RecordBrowserCommon::get_records('rc_mails', array('thread' => null));
foreach ($mails as $m) {
    if (preg_match('/\\nreferences:(.*)\\n/i', $m['headers_data'], $match)) {
        $ref = trim($match[1]);
        Utils_RecordBrowserCommon::update_record('rc_mails', $m['id'], array('references' => $ref));
    }
    if (preg_match('/\\nmessageid:(.*)\\n/i', $m['headers_data'], $match)) {
        $mid = str_replace(array('<', '>'), '', trim($match[1]));
        Utils_RecordBrowserCommon::update_record('rc_mails', $m['id'], array('message_id' => $mid));
    }
}
foreach ($mails as $m) {
    CRM_RoundcubeCommon::create_thread($m['id']);
}
示例#5
0
 public function account_manager($pushed_on_top = false)
 {
     if ($pushed_on_top) {
         if ($this->is_back()) {
             Base_BoxCommon::pop_main();
             return;
         }
         Base_ActionBarCommon::add('back', __('Back'), $this->create_back_href());
     } else {
         Base_ActionBarCommon::add('back', __('Back'), $this->create_main_href('Base_User_Settings'));
     }
     $this->rb = $this->init_module('Utils/RecordBrowser', 'rc_accounts', 'rc_accounts');
     $this->rb->set_defaults(array('epesi_user' => Acl::get_user()));
     $order = array(array('login' => 'DESC'), array('epesi_user' => Acl::get_user()), array('epesi_user' => false));
     $this->display_module($this->rb, $order);
     // other settings
     $qf = $this->init_module('Libs/QuickForm');
     $qf->addElement('advcheckbox', 'standard_mailto', __("Use standard mailto links"), null, array('onchange' => $qf->get_submit_form_js()));
     $use_standard_mailto = CRM_RoundcubeCommon::use_standard_mailto();
     $qf->setDefaults(array('standard_mailto' => $use_standard_mailto));
     if ($qf->validate()) {
         CRM_RoundcubeCommon::set_standard_mailto($qf->exportValue('standard_mailto'));
     }
     $qf->display_as_row();
 }
示例#6
0
<?php

if (!isset($_POST['acc_id']) || !is_numeric($_POST['acc_id'])) {
    die('Invalid request');
}
define('CID', false);
define('READ_ONLY_SESSION', true);
require_once '../../../include.php';
ModuleManager::load_modules();
if (!Acl::is_user()) {
    die('not logged');
}
try {
    $unseen_data = CRM_RoundcubeCommon::get_unread_messages($_POST['acc_id']);
    $unseen = array();
    foreach ($unseen_data as $u) {
        $unseen[] = htmlspecialchars($u['from']) . ': <i>' . htmlspecialchars($u['subject']) . '</i>';
    }
    $ret = Utils_TooltipCommon::create(count($unseen), implode('<br />', $unseen));
    print $ret;
} catch (Exception $ex) {
    $message = $ex->getMessage();
    print $message;
}
示例#7
0
 public static function display_email($record, $nolink, $desc)
 {
     $v = $record[$desc['id']];
     if ($nolink) {
         return $v;
     }
     if (ModuleManager::is_installed('CRM_Roundcube') >= 0) {
         return CRM_RoundcubeCommon::get_mailto_link($v);
     }
     return '<a href="mailto:' . $v . '">' . $v . '</a>';
 }
示例#8
0
 public static function get_support_email()
 {
     $email = '*****@*****.**';
     if (ModuleManager::is_installed('CRM_Roundcube') >= 0) {
         $email = CRM_RoundcubeCommon::get_mailto_link($email);
     } else {
         $email = '<a href="mailto:' . $email . '">' . $email . '</a>';
     }
     return $email;
 }
示例#9
0
 public static function reload_mails($rs, $id, $email_addresses = null)
 {
     $prefix = ($rs == 'contact' ? 'P' : 'C') . ':';
     if (!$email_addresses) {
         $email_addresses = self::get_email_addresses($rs, $id);
     }
     foreach ($email_addresses as $email) {
         $cc = Utils_RecordBrowserCommon::get_records('rc_mails', array('(~from' => '%' . $email . '%', '|~to' => '%' . $email . '%'));
         foreach ($cc as $mail) {
             if ($rs == 'contact' && $mail['employee'] == $id || in_array($prefix . $id, $mail['contacts'])) {
                 continue;
             }
             if (!preg_match('/(^|[\\s,\\<\\;])' . preg_quote($email, '/') . '($|[\\s,\\>\\&])/i', $mail['from'] . ',' . $mail['to'])) {
                 continue;
             }
             $mail['contacts'][] = $prefix . $id;
             Utils_RecordBrowserCommon::update_record('rc_mails', $mail['id'], array('contacts' => $mail['contacts']));
             CRM_RoundcubeCommon::create_thread($mail['id']);
         }
     }
 }
示例#10
0
 public static function get_mailto_link($v)
 {
     if (isset($_REQUEST['rc_mailto'])) {
         $x = ModuleManager::get_instance('/Base_Box|0');
         $x->push_main('CRM_Roundcube', 'new_mail', array($_REQUEST['rc_mailto']));
         unset($_REQUEST['rc_mailto']);
     }
     if (!CRM_RoundcubeCommon::use_standard_mailto()) {
         $ret = Utils_RecordBrowserCommon::get_records_count('rc_accounts', array('epesi_user' => Acl::get_user()));
         if ($ret) {
             return '<a ' . Module::create_href(array('rc_mailto' => $v)) . '>' . $v . '</a>';
         }
     }
     return '<a href="mailto:' . $v . '">' . $v . '</a>';
 }