本文整理汇总了PHP中Utils_RecordBrowserCommon::create_new_record_href方法的典型用法代码示例。如果您正苦于以下问题:PHP Utils_RecordBrowserCommon::create_new_record_href方法的具体用法?PHP Utils_RecordBrowserCommon::create_new_record_href怎么用?PHP Utils_RecordBrowserCommon::create_new_record_href使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utils_RecordBrowserCommon
的用法示例。
在下文中一共展示了Utils_RecordBrowserCommon::create_new_record_href方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: submit_task
public static function submit_task($values, $mode)
{
$me = CRM_ContactsCommon::get_my_record();
switch ($mode) {
case 'display':
$values['title'] = __('Follow-up') . ': ' . $values['title'];
$values['status'] = 0;
$values['deadline'] = date('Y-m-d', strtotime('+1 day'));
$ret = array();
$cus = reset($values['customers']);
if (ModuleManager::is_installed('CRM/Meeting') >= 0) {
$ret['new']['event'] = '<a ' . Utils_TooltipCommon::open_tag_attrs(__('New Meeting')) . ' ' . Utils_RecordBrowserCommon::create_new_record_href('crm_meeting', array('title' => $values['title'], 'permission' => $values['permission'], 'priority' => $values['priority'], 'description' => $values['description'], 'date' => date('Y-m-d'), 'time' => date('H:i:s'), 'duration' => 3600, 'employees' => $values['employees'], 'customers' => $values['customers'], 'status' => 0), 'none', false) . '><img border="0" src="' . Base_ThemeCommon::get_template_file('CRM_Calendar', 'icon-small.png') . '" /></a>';
}
$ret['new']['task'] = '<a ' . Utils_TooltipCommon::open_tag_attrs(__('New Task')) . ' ' . Utils_RecordBrowserCommon::create_new_record_href('task', $values) . '><img border="0" src="' . Base_ThemeCommon::get_template_file('CRM_Tasks', 'icon-small.png') . '" /></a>';
if (ModuleManager::is_installed('CRM/PhoneCall') >= 0) {
$ret['new']['phonecall'] = '<a ' . Utils_TooltipCommon::open_tag_attrs(__('New Phonecall')) . ' ' . Utils_RecordBrowserCommon::create_new_record_href('phonecall', array('subject' => $values['title'], 'permission' => $values['permission'], 'priority' => $values['priority'], 'description' => $values['description'], 'date_and_time' => date('Y-m-d H:i:s'), 'employees' => $values['employees'], 'customer' => $cus, 'status' => 0), 'none', false) . '><img border="0" src="' . Base_ThemeCommon::get_template_file('CRM_PhoneCall', 'icon-small.png') . '" /></a>';
}
$ret['new']['note'] = Utils_RecordBrowser::$rb_obj->add_note_button('task/' . $values['id']);
return $ret;
case 'adding':
$values['deadline_time'] = strtotime(date('Y-m-d') . ' 23:59:59');
$values['permission'] = Base_User_SettingsCommon::get('CRM_Common', 'default_record_permission');
break;
case 'add':
break;
case 'edit':
$old_values = Utils_RecordBrowserCommon::get_record('task', $values['id']);
$old_related = array_merge($old_values['employees'], $old_values['customers']);
case 'added':
if (isset($values['follow_up'])) {
CRM_FollowupCommon::add_tracing_notes($values['follow_up'][0], $values['follow_up'][1], $values['follow_up'][2], 'task', $values['id'], $values['title']);
}
self::subscribed_employees($values);
$related = array_merge($values['employees'], $values['customers']);
foreach ($related as $v) {
if ($mode === 'edit' && in_array($v, $old_related)) {
continue;
}
if (!is_numeric($v)) {
list($t, $id) = explode(':', $v);
} else {
$t = 'P';
$id = $v;
}
if ($t == 'P') {
$t = 'contact';
} else {
$t = 'company';
}
$subs = Utils_WatchdogCommon::get_subscribers($t, $id);
foreach ($subs as $s) {
Utils_WatchdogCommon::user_subscribe($s, 'task', $values['id']);
}
}
break;
}
return $values;
}
示例2: applet_new_record_button
public static function applet_new_record_button($tab, $defaults = array())
{
if (!self::get_access($tab, 'add')) {
return '';
}
return '<a ' . Utils_TooltipCommon::open_tag_attrs(__('New record')) . ' ' . Utils_RecordBrowserCommon::create_new_record_href($tab, $defaults) . '><img src="' . Base_ThemeCommon::get_template_file('Utils_RecordBrowser', 'add.png') . '" border="0"></a>';
}
示例3: submit_meeting
public static function submit_meeting($values, $mode)
{
$me = CRM_ContactsCommon::get_my_record();
switch ($mode) {
case 'delete':
Utils_MessengerCommon::delete_by_id('CRM_Calendar_Event:' . $values['id']);
break;
case 'display':
$pdf = Utils_RecordBrowser::$rb_obj->pack_module('Libs/TCPDF', 'L');
if ($pdf->prepare()) {
$pdf->set_title($values['title']);
$pdf->set_subject('');
$pdf->prepare_header();
$pdf->AddPage();
$v = CRM_Calendar_EventCommon::get(DB::GetOne('SELECT id FROM crm_calendar_custom_events_handlers WHERE group_name=%s', array('Meetings')) . '#' . $values['id']);
$ev_mod = Utils_RecordBrowser::$rb_obj->init_module('CRM/Calendar/Event');
$ev_mod->make_event_PDF($pdf, $v, true, 'view');
}
$pdf->add_actionbar_icon('Print');
if (isset($_REQUEST['day'])) {
$values['date'] = $_REQUEST['day'];
}
$ret = array();
if ($values['time']) {
// normal event
$start = $values['time'];
// time in unix timestamp UTC
$start_disp = strtotime(Base_RegionalSettingsCommon::time2reg($start, true, true, true, false));
} else {
// when event is timeless - all day event
$time = $values['date'] . ' 00:00:01';
$start = Base_RegionalSettingsCommon::reg2time($time);
$start_disp = strtotime($time);
}
$end = strtotime('+' . $values['duration'] . ' seconds', $start);
$ret['day_details'] = array('start' => array('day' => '<a ' . Base_BoxCommon::create_href(null, 'CRM/Calendar', 'body', array(array('default_view' => 'day', 'default_date' => strtotime($values['date']))), array()) . '>' . date('j', $start_disp) . '</a>', 'month' => '<a ' . Base_BoxCommon::create_href(null, 'CRM/Calendar', 'body', array(array('default_view' => 'month', 'default_date' => strtotime($values['date']))), array()) . '>' . __date('F', $start_disp) . '</a>', 'year' => '<a ' . Base_BoxCommon::create_href(null, 'CRM/Calendar', 'body', array(array('default_view' => 'year', 'default_date' => strtotime($values['date']))), array()) . '>' . date('Y', $start_disp) . '</a>', 'weekday' => '<a ' . Base_BoxCommon::create_href(null, 'CRM/Calendar', 'body', array(array('default_view' => 'week', 'default_date' => strtotime($values['date']))), array()) . '>' . __date('l', $start_disp) . '</a>'));
if (!isset($values['timeless']) || !$values['timeless']) {
$ret['event_info'] = array('start_time' => Base_RegionalSettingsCommon::time2reg($start, 2, false), 'end_time' => Base_RegionalSettingsCommon::time2reg($end, 2, false), 'duration' => Base_RegionalSettingsCommon::seconds_to_words($values['duration']), 'start_date' => '-', 'end_date' => '-');
}
$ret['form_data']['timeless'] = array('label' => __('Timeless'), 'html' => 'value');
$ret['toggle_duration'] = 'tog';
$ret['duration_block_id'] = '1';
$ret['event_end_block_id'] = '2';
$values['title'] = __('Follow-up') . ': ' . $values['title'];
$values['status'] = 0;
$cus = reset($values['customers']);
if (ModuleManager::is_installed('CRM/Meeting') >= 0) {
$ret['new']['event'] = '<a ' . Utils_TooltipCommon::open_tag_attrs(__('New Meeting')) . ' ' . Utils_RecordBrowserCommon::create_new_record_href('crm_meeting', array('title' => $values['title'], 'permission' => $values['permission'], 'priority' => $values['priority'], 'description' => $values['description'], 'date' => date('Y-m-d'), 'time' => date('H:i:s'), 'duration' => 3600, 'employees' => $values['employees'], 'customers' => $values['customers'], 'status' => 0), 'none', false) . '><img border="0" src="' . Base_ThemeCommon::get_template_file('CRM_Calendar', 'icon-small.png') . '" /></a>';
}
if (ModuleManager::is_installed('CRM/Tasks') >= 0) {
$ret['new']['task'] = '<a ' . Utils_TooltipCommon::open_tag_attrs(__('New Task')) . ' ' . Utils_RecordBrowserCommon::create_new_record_href('task', array('title' => $values['title'], 'permission' => $values['permission'], 'priority' => $values['priority'], 'description' => $values['description'], 'employees' => $values['employees'], 'customers' => $values['customers'], 'status' => 0, 'deadline' => date('Y-m-d', strtotime('+1 day')))) . '><img border="0" src="' . Base_ThemeCommon::get_template_file('CRM_Tasks', 'icon-small.png') . '"></a>';
}
if (ModuleManager::is_installed('CRM/PhoneCall') >= 0) {
$ret['new']['phonecall'] = '<a ' . Utils_TooltipCommon::open_tag_attrs(__('New Phonecall')) . ' ' . Utils_RecordBrowserCommon::create_new_record_href('phonecall', array('subject' => $values['title'], 'permission' => $values['permission'], 'priority' => $values['priority'], 'description' => $values['description'], 'date_and_time' => date('Y-m-d H:i:s'), 'employees' => $values['employees'], 'customer' => $cus, 'status' => 0), 'none', false) . '><img border="0" src="' . Base_ThemeCommon::get_template_file('CRM_PhoneCall', 'icon-small.png') . '" /></a>';
}
$ret['new']['note'] = Utils_RecordBrowser::$rb_obj->add_note_button('crm_meeting/' . $values['id']);
return $ret;
case 'edit':
self::subscribed_employees($values);
$alarms = Utils_MessengerCommon::get_alarms('CRM_Calendar_Event:' . $values['id']);
$old = Utils_RecordBrowserCommon::get_record('crm_meeting', $values['id']);
$old_time = strtotime($old['date'] . ' ' . date('H:i:s', strtotime($old['time'])));
$new_time = strtotime($values['date'] . ' ' . date('H:i:s', strtotime($values['time'])));
foreach ($alarms as $id => $time) {
$time = strtotime($time);
$diff = $old_time - $time;
Utils_MessengerCommon::update_time($id, $new_time - $diff);
}
case 'add':
if (isset($values['duration_switch']) && !$values['duration_switch']) {
$values['duration'] = strtotime($values['end_time']) - strtotime($values['time']);
if ($values['duration'] < 0) {
$values['duration'] += 60 * 60 * 24;
}
// failsafe
}
if (isset($values['timeless']) && $values['timeless']) {
$values['duration'] = -1;
}
$new = '';
foreach (array(0 => 'Mon', 1 => 'Tue', 2 => 'Wed', 3 => 'Thu', 4 => 'Fri', 5 => 'Sat', 6 => 'Sun') as $k => $v) {
if (isset($values['recurrence_hash_' . $k]) && $values['recurrence_hash_' . $k]) {
$new .= '1';
} else {
$new .= '0';
}
}
if ($new != '0000000') {
$values['recurrence_hash'] = $new;
}
if ($values['duration'] != -1) {
if (isset($values['modded'])) {
$time = Base_RegionalSettingsCommon::time2reg($values['time'], true, true, true, false);
$reg_timestamp = $values['date'] . ' ' . date('H:i:s', strtotime($time));
$timestamp = Base_RegionalSettingsCommon::reg2time($reg_timestamp);
$values['date'] = date('Y-m-d', $timestamp);
$values['time'] = date('Y-m-d H:i:s', $timestamp);
if (isset($values['recurrence_end']) && $values['recurrence_end']) {
$values['recurrence_end'] = date('Y-m-d', Base_RegionalSettingsCommon::reg2time($values['recurrence_end'] . ' ' . date('H:i:s', strtotime($time))));
if ($values['recurrence_end'] < $values['date']) {
//.........这里部分代码省略.........
示例4: show_data
//.........这里部分代码省略.........
$limited_print_records = 200;
$limited_print = ($this->amount_of_records >= $limited_print_records);
$print_limit = $limited_print ? $limit : null;
$key = md5(serialize($this->tab).serialize($crits).serialize($cols).serialize($order).serialize($admin).serialize($print_limit));
$_SESSION['client']['utils_recordbrowser'][$key] = array(
'tab'=>$this->tab,
'crits'=>$crits,
'cols'=>$cols,
'order'=>$order,
'admin'=>$admin,
'more_table_properties'=>$this->more_table_properties,
'limit' => $print_limit,
);
$print_href = 'href="modules/Utils/RecordBrowser/print.php?'.http_build_query(array('key'=>$key, 'cid'=>CID)).'" target="_blank"';
$print_tooltip_text = $limited_print ?
__('Due to more than %d records, you are allowed to print current view', array($limited_print_records)) :
__('Print all records');
$print_tooltip = Utils_TooltipCommon::open_tag_attrs($print_tooltip_text, false);
$this->new_button('print', __('Print'), "$print_href $print_tooltip");
}
$records = Utils_RecordBrowserCommon::get_records($this->tab, $crits, array(), $order, $limit, $admin);
if (($this->get_access('export') || $this->enable_export) && !$this->disabled['export'])
$this->new_button('save',__('Export'), 'href="modules/Utils/RecordBrowser/csv_export.php?'.http_build_query(array('tab'=>$this->tab, 'admin'=>$admin, 'cid'=>CID, 'path'=>$this->get_path())).'"');
$this->set_module_variable('crits_stuff',$crits?$crits:array());
$this->set_module_variable('order_stuff',$order?$order:array());
$custom_label = '';
if (!$pdf && !$special && $this->get_access('add',$this->custom_defaults)!==false) {
if ($this->add_button!==null) $label = $this->add_button;
elseif (!$this->multiple_defaults) $label = $this->create_callback_href(array($this, 'navigate'), array('view_entry', 'add', null, $this->custom_defaults));
else $label = Utils_RecordBrowserCommon::create_new_record_href($this->tab,$this->custom_defaults,'multi',true,true);
if ($label!==false && $label!=='') $custom_label = '<a '.$label.'><span class="record_browser_add_new" '.Utils_TooltipCommon::open_tag_attrs(__('Add new record')).'><img src="'.Base_ThemeCommon::get_template_file('Utils/RecordBrowser/add.png').'" /><div class="add_new">'.__('Add new').'</div></span></a>';
}
if ($this->more_add_button_stuff) {
if ($custom_label) $custom_label = '<table><tr><td>'.$custom_label.'</td><td>'.$this->more_add_button_stuff.'</td></tr></table>';
else $custom_label = $this->more_add_button_stuff;
}
$gb->set_custom_label($custom_label);
if ($admin) $this->browse_mode = 'all';
if ($this->browse_mode == 'recent') {
$ret = DB::Execute('SELECT * FROM '.$this->tab.'_recent WHERE user_id=%d ORDER BY visited_on DESC', array(Acl::get_user()));
while ($row = $ret->FetchRow()) {
if (!isset($records[$row[$this->tab.'_id']])) continue;
$records[$row[$this->tab.'_id']]['visited_on'] = Base_RegionalSettingsCommon::time2reg(strtotime($row['visited_on']));
}
} else {
$this->set_module_variable('set_browsed_records',array('tab'=>$this->tab,'crits'=>$crits, 'order'=>$order, 'records'=>array()));
}
if ($special) $rpicker_ind = array();
if (!$pdf && !$admin && $this->favorites) {
$favs = array();
$ret = DB::Execute('SELECT '.$this->tab.'_id FROM '.$this->tab.'_favorite WHERE user_id=%d', array(Acl::get_user()));
while ($row=$ret->FetchRow()) $favs[$row[$this->tab.'_id']] = true;
}
self::$access_override['tab'] = $this->tab;
if (isset($limit)) $i = $limit['offset'];
$grid_enabled = $this->grid===null?Base_User_SettingsCommon::get('Utils/RecordBrowser','grid'):$this->grid;
if ($grid_enabled) load_js('modules/Utils/RecordBrowser/grid.js');
$this->view_fields_permission = $this->get_access('add', $this->custom_defaults);
示例5: submit_contact
public static function submit_contact($values, $mode)
{
switch ($mode) {
case 'cloning':
$values['login'] = '';
return $values;
case 'display':
// display copy company data button and do update if needed
self::copy_company_data_subroutine($values);
$is_employee = false;
if (isset($values['related_companies']) && is_array($values['related_companies']) && in_array(CRM_ContactsCommon::get_main_company(), $values['related_companies'])) {
$is_employee = true;
}
if (isset($values['company_name']) && $values['company_name'] == CRM_ContactsCommon::get_main_company()) {
$is_employee = true;
}
$me = CRM_ContactsCommon::get_my_record();
$emp = array($me['id']);
$cus = array();
if ($is_employee) {
$emp[] = $values['id'];
} else {
$cus[] = 'P:' . $values['id'];
}
$ret = array();
$ret['new'] = array();
$ret['new']['crm_filter'] = '<a ' . Utils_TooltipCommon::open_tag_attrs(__('Set CRM Filter')) . ' ' . Module::create_href(array('set_crm_filter' => 1)) . '>F</a>';
if (isset($_REQUEST['set_crm_filter'])) {
CRM_FiltersCommon::set_profile('c' . $values['id']);
}
if (ModuleManager::is_installed('CRM/Meeting') !== -1 && Utils_RecordBrowserCommon::get_access('crm_meeting', 'add')) {
$ret['new']['event'] = '<a ' . Utils_TooltipCommon::open_tag_attrs(__('New Meeting')) . ' ' . Utils_RecordBrowserCommon::create_new_record_href('crm_meeting', array('employees' => $emp, 'customers' => $cus, 'status' => 0, 'priority' => 1, 'permission' => 0)) . '><img border="0" src="' . Base_ThemeCommon::get_template_file('CRM_Calendar', 'icon-small.png') . '"></a>';
}
if (ModuleManager::is_installed('CRM/Tasks') !== -1 && Utils_RecordBrowserCommon::get_access('task', 'add')) {
$ret['new']['task'] = '<a ' . Utils_TooltipCommon::open_tag_attrs(__('New Task')) . ' ' . Utils_RecordBrowserCommon::create_new_record_href('task', array('employees' => $emp, 'customers' => $cus, 'status' => 0, 'priority' => 1, 'permission' => 0)) . '><img border="0" src="' . Base_ThemeCommon::get_template_file('CRM_Tasks', 'icon-small.png') . '"></a>';
}
if (ModuleManager::is_installed('CRM/PhoneCall') !== -1 && Utils_RecordBrowserCommon::get_access('phonecall', 'add')) {
$ret['new']['phonecall'] = '<a ' . Utils_TooltipCommon::open_tag_attrs(__('New Phonecall')) . ' ' . Utils_RecordBrowserCommon::create_new_record_href('phonecall', array('date_and_time' => date('Y-m-d H:i:s'), 'customer' => 'P:' . $values['id'], 'employees' => $me['id'], 'status' => 0, 'permission' => 0, 'priority' => 1), 'none', false) . '><img border="0" src="' . Base_ThemeCommon::get_template_file('CRM_PhoneCall', 'icon-small.png') . '"></a>';
}
$ret['new']['note'] = Utils_RecordBrowser::$rb_obj->add_note_button('contact/' . $values['id']);
return $ret;
case 'adding':
$values['permission'] = Base_User_SettingsCommon::get('CRM_Common', 'default_record_permission');
break;
case 'add':
if (isset($values['email']) && $values['email'] == '' && $values['login'] != 0 && $mode == 'add') {
$values['email'] = DB::GetOne('SELECT mail FROM user_password WHERE user_login_id=%d', array($values['login']));
}
case 'edit':
if (isset($values['create_company'])) {
$comp_id = Utils_RecordBrowserCommon::new_record('company', array('company_name' => $values['create_company_name'], 'address_1' => $values['address_1'], 'address_2' => $values['address_2'], 'country' => $values['country'], 'city' => $values['city'], 'zone' => isset($values['zone']) ? $values['zone'] : '', 'postal_code' => $values['postal_code'], 'phone' => $values['work_phone'], 'fax' => $values['fax'], 'web_address' => $values['web_address'], 'permission' => $values['permission']));
if (!isset($values['company_name'])) {
$values['company_name'] = null;
}
if (!isset($values['related_companies'])) {
$values['related_companies'] = array();
}
if (!is_array($values['related_companies'])) {
$values['related_companies'] = array($values['related_companies']);
}
if (!$values['company_name']) {
$values['company_name'] = $comp_id;
} else {
$values['related_companies'][] = $comp_id;
}
}
if (Base_AclCommon::i_am_admin()) {
if ($values['login'] == 'new') {
if (!$values['set_password']) {
$values['set_password'] = null;
}
Base_User_LoginCommon::add_user($values['username'], $values['email'], $values['set_password']);
$values['login'] = Base_UserCommon::get_user_id($values['username']);
} else {
if ($values['login']) {
Base_User_LoginCommon::change_user_preferences($values['login'], isset($values['email']) ? $values['email'] : '', isset($values['set_password']) ? $values['set_password'] : null);
if (isset($values['username']) && $values['username']) {
Base_UserCommon::rename_user($values['login'], $values['username']);
}
}
}
if (Base_AclCommon::i_am_sa() && $values['login'] && isset($values['admin']) && $values['admin'] !== '') {
$old_admin = Base_AclCommon::get_admin_level($values['login']);
if ($old_admin != $values['admin']) {
$admin_arr = array(0 => 'No', 1 => 'Administrator', 2 => 'Super Administrator');
if (Base_UserCommon::change_admin($values['login'], $values['admin']) !== true) {
Utils_RecordBrowserCommon::new_record_history('contact', $values['id'], 'Admin set from "' . $admin_arr[$old_admin] . '" to "' . $admin_arr[$values['admin']]);
}
}
}
}
unset($values['admin']);
unset($values['username']);
unset($values['set_password']);
unset($values['confirm_password']);
}
return $values;
}
示例6: companies_actions
public function companies_actions($r, $gb_row)
{
$me = CRM_ContactsCommon::get_my_record();
$emp = array($me['id']);
$cus = array();
$cus[] = 'C:' . $r['id'];
if (ModuleManager::is_installed('CRM/Meeting') !== -1 && Utils_RecordBrowserCommon::get_access('crm_meeting', 'add')) {
$gb_row->add_action(Utils_RecordBrowserCommon::create_new_record_href('crm_meeting', array('employees' => $emp, 'customers' => $cus, 'status' => 0, 'priority' => 1, 'permission' => 0)), __('New Meeting'), null, Base_ThemeCommon::get_template_file('CRM_Calendar', 'icon-small.png'));
}
if (ModuleManager::is_installed('CRM/Tasks') !== -1 && Utils_RecordBrowserCommon::get_access('task', 'add')) {
$gb_row->add_action(Utils_RecordBrowserCommon::create_new_record_href('task', array('employees' => $emp, 'customers' => $cus, 'status' => 0, 'priority' => 1, 'permission' => 0)), __('New Task'), null, Base_ThemeCommon::get_template_file('CRM_Tasks', 'icon-small.png'));
}
if (ModuleManager::is_installed('CRM/PhoneCall') !== -1 && Utils_RecordBrowserCommon::get_access('phonecall', 'add')) {
$gb_row->add_action(Utils_RecordBrowserCommon::create_new_record_href('phonecall', array('date_and_time' => date('Y-m-d H:i:s'), 'customer' => 'C:' . $r['id'], 'employees' => $me['id'], 'status' => 0, 'permission' => 0, 'priority' => 1), 'none', array('date_and_time')), __('New Phonecall'), null, Base_ThemeCommon::get_template_file('CRM_PhoneCall', 'icon-small.png'));
}
$gb_row->add_action(Utils_RecordBrowser::$rb_obj->add_note_button_href('company/' . $r['id']), __('New Note'), null, Base_ThemeCommon::get_template_file('Utils_Attachment', 'icon_small.png'));
}