本文整理汇总了PHP中Utils_RecordBrowserCommon::new_record_history方法的典型用法代码示例。如果您正苦于以下问题:PHP Utils_RecordBrowserCommon::new_record_history方法的具体用法?PHP Utils_RecordBrowserCommon::new_record_history怎么用?PHP Utils_RecordBrowserCommon::new_record_history使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utils_RecordBrowserCommon
的用法示例。
在下文中一共展示了Utils_RecordBrowserCommon::new_record_history方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: new_record_history
public function new_record_history($id, $old_value)
{
return Utils_RecordBrowserCommon::new_record_history($this->tab, $id, $old_value);
}
示例2: clone_record
public function clone_record($id) {
if (self::$clone_result!==null) {
if (is_numeric(self::$clone_result)) {
Utils_RecordBrowserCommon::record_processing($this->tab, self::$clone_result, 'cloned', $id);
Utils_RecordBrowserCommon::new_record_history($this->tab,self::$clone_result,'CLONED '.$id);
$this->navigate('view_entry', 'view', self::$clone_result);
}
self::$clone_result = null;
return false;
}
$record = Utils_RecordBrowserCommon::get_record($this->tab, $id, false);
$access = $this->get_access('view',$record);
if (is_array($access))
foreach ($access as $k=>$v)
if (!$v) unset($record[$k]);
$record = Utils_RecordBrowserCommon::record_processing($this->tab, $record, 'cloning', $id);
unset($record['id']);
$this->navigate('view_entry', 'add', null, $record);
return true;
}
示例3: 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;
}