本文整理汇总了PHP中Utils_RecordBrowserCommon类的典型用法代码示例。如果您正苦于以下问题:PHP Utils_RecordBrowserCommon类的具体用法?PHP Utils_RecordBrowserCommon怎么用?PHP Utils_RecordBrowserCommon使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Utils_RecordBrowserCommon类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: applet
public function applet($conf, &$opts)
{
$opts['go'] = true;
$rb = $this->init_module('Utils/RecordBrowser', 'phonecall', 'phonecall');
$me = CRM_ContactsCommon::get_my_record();
if ($me['id'] == -1) {
CRM_ContactsCommon::no_contact_message();
return;
}
$crits = array('employees' => array($me['id']), '!status' => array(2, 3));
if (!isset($conf['past']) || !$conf['past']) {
$crits['>=date_and_time'] = date('Y-m-d 00:00:00');
}
if (!isset($conf['today']) || !$conf['today']) {
$crits['(>=date_and_time'] = date('Y-m-d 00:00:00', strtotime('+1 day'));
$crits['|<date_and_time'] = date('Y-m-d 00:00:00');
}
if ($conf['future'] != -1) {
$crits['<=date_and_time'] = date('Y-m-d 23:59:59', strtotime('+' . $conf['future'] . ' day'));
}
$conds = array(array(array('field' => 'contact_name', 'width' => 14), array('field' => 'phone_number', 'width' => 20), array('field' => 'status', 'width' => 8)), $crits, array('status' => 'ASC', 'date_and_time' => 'ASC', 'priority' => 'DESC'), array('CRM_PhoneCallCommon', 'applet_info_format'), 15, $conf, &$opts);
$date = $this->get_module_variable('applet_date', date('Y-m-d H:i:s'));
$opts['actions'][] = Utils_RecordBrowserCommon::applet_new_record_button('phonecall', array('date_and_time' => $date, 'employees' => array($me['id']), 'permission' => '0', 'status' => '0', 'priority' => CRM_CommonCommon::get_default_priority()));
$this->display_module($rb, $conds, 'mini_view');
}
示例2: install
public function install()
{
Base_AclCommon::add_permission(_M('View Activity Report'), array('ACCESS:employee', 'ACCESS:manager'));
Base_ThemeCommon::install_default_theme($this->get_type());
Utils_RecordBrowserCommon::new_addon('contact', 'Apps/ActivityReport', 'contact_addon', array('Apps_ActivityReportCommon', 'contact_addon_label'));
return true;
}
示例3: uninstall
public function uninstall()
{
$ret = true;
Utils_RecordBrowserCommon::uninstall_recordset('quick_search');
Utils_RecordBrowserCommon::unregister_processing_callback('quick_search', array('Applets_QuickSearchCommon', 'parse_values'));
return $ret;
}
示例4: create_contact
public function create_contact($r)
{
global $OUTPUT;
$mail = $r['record']['email'];
require_once dirname(__FILE__) . '/epesi_contacts_addressbook_backend.php';
$contacts = new epesi_contacts_addressbook_backend('CRM Contacts');
$ret = $contacts->search('email', $mail, true, false);
if (count($ret->records)) {
$OUTPUT->show_message('contactexists', 'warning');
} else {
require_once dirname(__FILE__) . '/epesi_companies_addressbook_backend.php';
$companies = new epesi_companies_addressbook_backend('CRM Companies');
$ret = $companies->search('email', $mail, true, false);
if (count($ret->records)) {
$OUTPUT->show_message('contactexists', 'warning');
} else {
if (isset($r['record']['firstname']) && $r['record']['firstname'] !== "" && isset($r['record']['surname']) && $r['record']['surname'] !== "") {
$name = array($r['record']['firstname'], $r['record']['surname']);
} else {
$name = explode(' ', $r['record']['name'], 2);
}
if (count($name) < 2) {
$OUTPUT->show_message('errorsavingcontact', 'warning');
} else {
$loc = Base_RegionalSettingsCommon::get_default_location();
Utils_RecordBrowserCommon::new_record('contact', array('first_name' => $name[0], 'last_name' => $name[1], 'email' => $mail, 'permission' => 0, 'country' => $loc['country']));
$OUTPUT->show_message('addedsuccessfully', 'confirmation');
}
}
}
$OUTPUT->send();
// return array('abort'=>true);
}
示例5: uninstall
public function uninstall()
{
Utils_RecordBrowserCommon::delete_record_field('company', 'County');
Utils_RecordBrowserCommon::delete_record_field('contact', 'County');
Utils_RecordBrowserCommon::delete_record_field('contact', 'Home County');
return true;
}
示例6: format_values
protected function format_values($tab, $record_id)
{
$rb_obj = new RBO_RecordsetAccessor($tab);
$record = $rb_obj->get_record($record_id);
if (!$record) {
return array();
}
$access = Utils_RecordBrowserCommon::get_access($tab, 'view', $record);
if (!$access) {
return array();
}
// use RB object instance for better display callback compatibility
// some of them uses Utils_RecordBrowser::$rb_obj instance
$rb = ModuleManager::new_instance('Utils_RecordBrowser', null, 'rb');
$rb->construct($tab);
$rb->init($tab);
$fields = Utils_RecordBrowserCommon::init($tab);
$printable_data = array();
foreach ($fields as $f) {
if ($access[$f['id']]) {
$printable_data[] = array('label' => _V($f['name']), 'value' => $record->get_val($f['id'], true));
}
}
// fill rows - it's easier here than in template
if ($this->fill_empty_rows()) {
while (count($printable_data) % $this->cols() != 0) {
$printable_data[] = array('label' => '', 'value' => '');
}
}
return $printable_data;
}
示例7: uninstall
public function uninstall() {
Utils_RecordBrowserCommon::delete_addon('company', 'Tests/Bugtrack', 'company_bugtrack_addon');
Utils_AttachmentCommon::delete_addon('bugtrack');
Utils_RecordBrowserCommon::uninstall_recordset('bugtrack');
Utils_CommonDataCommon::remove('Bugtrack_Status');
return true;
}
示例8: uninstall
public function uninstall()
{
Base_ThemeCommon::uninstall_default_theme('CRM/Contacts/Activities');
Utils_RecordBrowserCommon::delete_addon('company', 'CRM/Contacts/Activities', 'company_activities');
Utils_RecordBrowserCommon::delete_addon('contact', 'CRM/Contacts/Actitivies', 'contact_activities');
return true;
}
示例9: applet
public function applet($conf, &$opts)
{
$opts['go'] = true;
$opts['title'] = __('Meetings');
$me = CRM_ContactsCommon::get_my_record();
if ($me['id'] == -1) {
CRM_ContactsCommon::no_contact_message();
return;
}
$closed = isset($conf['closed']) && $conf['closed'];
$related = $conf['related'];
$rb = $this->init_module('Utils/RecordBrowser', 'crm_meeting', 'crm_meeting');
$crits = array();
if (!$closed) {
$crits['!status'] = array(2, 3);
}
if ($related == 0) {
$crits['employees'] = array($me['id']);
}
if ($related == 1) {
$crits['customers'] = array($me['id']);
}
if ($related == 2) {
$crits['(employees'] = array($me['id']);
$crits['|customers'] = array($me['id']);
}
$conds = array(array(array('field' => 'title', 'width' => 14, 'callback' => array('CRM_MeetingCommon', 'display_title_with_mark')), array('field' => 'status', 'width' => 4)), $crits, array('date' => 'ASC', 'time' => 'ASC', 'status' => 'ASC', 'priority' => 'DESC'), array('CRM_MeetingCommon', 'applet_info_format'), 15, $conf, &$opts);
$opts['actions'][] = Utils_RecordBrowserCommon::applet_new_record_button('crm_meeting', array('employees' => array($me['id']), 'status' => 0, 'permission' => 0, 'priority' => CRM_CommonCommon::get_default_priority(), 'date' => $this->get_module_variable('date', date('Y-m-d')), 'time' => $this->get_module_variable('time', date('H:i:s')), 'duration' => 3600));
$this->display_module($rb, $conds, 'mini_view');
}
示例10: display_company
public static function display_company($record, $nolink = false)
{
$def = Utils_RecordBrowserCommon::create_linked_label_r('company', 'Company Name', $record, $nolink);
if (!$def) {
return '---';
}
return $def;
}
示例11: uninstall
public function uninstall()
{
Base_ThemeCommon::uninstall_default_theme($this->get_type());
Utils_RecordBrowserCommon::delete_addon('contact', 'CRM/Contacts/NotesAggregate', 'contact_addon');
Utils_RecordBrowserCommon::delete_addon('company', 'CRM/Contacts/NotesAggregate', 'company_addon');
Utils_RecordBrowserCommon::delete_addon('premium_salesopportunity', 'CRM/Contacts/NotesAggregate', 'salesopportunity_addon');
return true;
}
示例12: search_format
public static function search_format($id)
{
$row = Utils_RecordBrowserCommon::get_records('bugtrack', array('id' => $id));
if (!$row) {
return false;
}
$row = array_pop($row);
return Utils_RecordBrowserCommon::record_link_open_tag('bugtrack', $row['id']) . __('Bug (attachment) #%d, %s', array($row['id'], $row['project_name'])) . Utils_RecordBrowserCommon::record_link_close_tag();
}
示例13: uninstall
public function uninstall()
{
Base_ThemeCommon::uninstall_default_theme('CRM/Contacts/Activities');
Utils_RecordBrowserCommon::set_tpl('contact', Base_ThemeCommon::get_template_filename('CRM/Contacts', 'Contact'));
Utils_RecordBrowserCommon::unregister_processing_callback('contact', array('CRM_Contacts_PhotoCommon', 'submit_contact'));
$this->remove_data_dir();
DB::DropTable(CRM_Contacts_PhotoCommon::table_name);
return true;
}
示例14: user_label
public static function user_label($id)
{
$label = Base_UserCommon::get_user_login($id);
$c = Utils_RecordBrowserCommon::get_id('contact', 'login', $id);
if ($c) {
$label = CRM_ContactsCommon::contact_format_no_company($c, true) . ' [' . $label . ']';
}
return $label;
}
示例15: uninstall
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;
}