當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Utils_RecordBrowserCommon::delete_record_field方法代碼示例

本文整理匯總了PHP中Utils_RecordBrowserCommon::delete_record_field方法的典型用法代碼示例。如果您正苦於以下問題:PHP Utils_RecordBrowserCommon::delete_record_field方法的具體用法?PHP Utils_RecordBrowserCommon::delete_record_field怎麽用?PHP Utils_RecordBrowserCommon::delete_record_field使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Utils_RecordBrowserCommon的用法示例。


在下文中一共展示了Utils_RecordBrowserCommon::delete_record_field方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: 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;
 }
開發者ID:62BRAINS,項目名稱:EPESI,代碼行數:7,代碼來源:CountyInstall.php

示例2: defined

<?php

defined("_VALID_ACCESS") || die('Direct access forbidden');
if (DB::GetOne('SELECT 1 FROM utils_attachment_field WHERE field=%s', array('Date'))) {
    Utils_RecordBrowserCommon::new_record_field('utils_attachment', array('name' => _M('Edited on'), 'type' => 'timestamp', 'extra' => false, 'visible' => true, 'required' => false, 'display_callback' => array('Utils_AttachmentCommon', 'display_date'), 'QFfield_callback' => array('Utils_AttachmentCommon', 'QFfield_date'), 'position' => 'Date'));
    DB::Execute('UPDATE utils_attachment_data_1 SET f_edited_on=f_date');
    Utils_RecordBrowserCommon::delete_record_field('utils_attachment', 'Date');
    Utils_RecordBrowserCommon::wipe_access('utils_attachment');
    Utils_RecordBrowserCommon::add_access('utils_attachment', 'view', 'ACCESS:employee', array('(!permission' => 2, '|:Created_by' => 'USER_ID'));
    Utils_RecordBrowserCommon::add_access('utils_attachment', 'delete', 'ACCESS:employee', array(':Created_by' => 'USER_ID'));
    Utils_RecordBrowserCommon::add_access('utils_attachment', 'delete', array('ACCESS:employee', 'ACCESS:manager'));
    Utils_RecordBrowserCommon::add_access('utils_attachment', 'add', 'ACCESS:employee', array(), array('edited_on'));
    Utils_RecordBrowserCommon::add_access('utils_attachment', 'edit', 'ACCESS:employee', array('(permission' => 0, '|:Created_by' => 'USER_ID'), array('edited_on'));
}
開發者ID:cretzu89,項目名稱:EPESI,代碼行數:14,代碼來源:20140621_date_to_timestamp.php

示例3: view_field


//.........這裏部分代碼省略.........
			$form->freeze('rset');
		}
		
		if ($action=='edit') {
			$display_callbacback = DB::GetOne('SELECT callback FROM '.$this->tab.'_callback WHERE freezed=1 AND field=%s', array($field));
			$QFfield_callbacback = DB::GetOne('SELECT callback FROM '.$this->tab.'_callback WHERE freezed=0 AND field=%s', array($field));
			$form->setDefaults(array('display_callback'=>$display_callbacback));
			$form->setDefaults(array('QFfield_callback'=>$QFfield_callbacback));
		}

        if ($form->validate()) {
            $data = $form->exportValues();
            $data['caption'] = trim($data['caption']);
            $data['field'] = trim($data['field']);
			$type = DB::GetOne('SELECT type FROM '.$this->tab.'_field WHERE field=%s', array($field));
			if (!isset($data['select_data_type'])) $data['select_data_type'] = $type;
            if ($action=='add')
                $field = $data['field'];
            $id = preg_replace('/[^a-z0-9]/','_',strtolower($field));
            $new_id = preg_replace('/[^a-z0-9]/','_',strtolower($data['field']));
            if (preg_match('/^[a-z0-9_]*$/',$id)==0) trigger_error('Invalid column name: '.$field);
            if (preg_match('/^[a-z0-9_]*$/',$new_id)==0) trigger_error('Invalid new column name: '.$data['field']);
			$param = '';
			switch ($data['select_data_type']) {
                case 'autonumber':
                    $data['required'] = false;
                    $data['filter'] = false;
                    $param = Utils_RecordBrowserCommon::encode_autonumber_param(
                            $data['autonumber_prefix'],
                            $data['autonumber_pad_length'],
                            $data['autonumber_pad_mask']);
                    // delete field and add again later to generate values
                    if ($action != 'add') {
                        Utils_RecordBrowserCommon::delete_record_field($this->tab, $field);
                        $action = 'add';
                        $field = $data['field'];
                    }
                    break;
				case 'checkbox': 
							$data['required'] = false;
							break;
				case 'text': if ($action=='add') $param = $data['text_length'];
							else {
								if ($data['text_length']<$row['param']) trigger_error('Invalid field length', E_USER_ERROR);
								$param = $data['text_length'];
								if ($data['text_length']!=$row['param']) {
									if(DB::is_postgresql())
										DB::Execute('ALTER TABLE '.$this->tab.'_data_1 ALTER COLUMN f_'.$id.' TYPE VARCHAR('.$param.')');
									else
										DB::Execute('ALTER TABLE '.$this->tab.'_data_1 MODIFY f_'.$id.' VARCHAR('.$param.')');
								}
							}
							break;
				case 'select':
							if ($data['data_source']=='commondata') {
								if ($data['select_type']=='select') {
									$param = Utils_RecordBrowserCommon::encode_commondata_param(array('order_by_key'=>$data['order_by']=='key', 'array_id'=>$data['commondata_table']));
									$data['select_data_type'] = 'commondata';
								} else {
									$param = '__COMMON__::'.$data['commondata_table'].'::'.$data['order_by'];
									$data['select_data_type'] = 'multiselect';
								}
							} else {
								$data['select_data_type'] = $data['select_type'];
								if (!isset($row) || !isset($row['param'])) $row['param'] = ';::';
								$props = explode(';', $row['param']);
開發者ID:62BRAINS,項目名稱:EPESI,代碼行數:67,代碼來源:RecordBrowser_0.php

示例4: uninstall

 public function uninstall()
 {
     Utils_RecordBrowserCommon::delete_addon('company', 'CRM_Contacts_ParentCompany', 'parent_company_addon');
     Utils_RecordBrowserCommon::delete_record_field('company', 'Parent Company');
     return true;
 }
開發者ID:cretzu89,項目名稱:EPESI,代碼行數:6,代碼來源:ParentCompanyInstall.php

示例5: delete_record_field

 public function delete_record_field($field_name)
 {
     Utils_RecordBrowserCommon::delete_record_field($this->tab, $field_name);
 }
開發者ID:cretzu89,項目名稱:EPESI,代碼行數:4,代碼來源:Recordset.php

示例6: uninstall

 public function uninstall()
 {
     Utils_RecordBrowserCommon::delete_record_field('company', 'Account Manager');
     Utils_RecordBrowserCommon::delete_browse_mode_details_callback('company', 'CRM/Contacts/AccountManager', 'browse_mode_details');
     return true;
 }
開發者ID:62BRAINS,項目名稱:EPESI,代碼行數:6,代碼來源:AccountManagerInstall.php

示例7: defined

defined("_VALID_ACCESS") || die('Direct access forbidden');
$deadline_field_is_not_timestamp = !DB::GetOne('SELECT 1 FROM task_field WHERE field=%s AND type=%s', array('Deadline', 'timestamp'));
if ($deadline_field_is_not_timestamp) {
    PatchUtil::db_alter_column('task_data_1', 'f_deadline', 'T');
    DB::Execute('UPDATE task_field SET type=%s WHERE field=%s', array('timestamp', 'Deadline'));
}
$tab = 'task';
$field = array('name' => _M('Timeless'), 'type' => 'checkbox', 'required' => false, 'extra' => false, 'position' => 'Deadline', 'QFfield_callback' => 'CRM_TasksCommon::QFfield_timeless');
Utils_RecordBrowserCommon::new_record_field($tab, $field);
$deadline_time_field_exists = DB::GetOne('SELECT 1 FROM task_field WHERE field=%s', array('Deadline Time'));
$sql = false;
if ($deadline_time_field_exists) {
    if (DB::is_mysql()) {
        $sql = 'UPDATE task_data_1 SET f_deadline = TIMESTAMP(f_deadline, TIME(f_deadline_time)), f_timeless = (f_deadline_time IS NULL)';
    } else {
        $sql = 'UPDATE task_data_1 SET f_deadline = f_deadline + CAST(f_deadline_time as time), f_timeless = (f_deadline_time IS NULL)::int';
    }
} elseif ($deadline_field_is_not_timestamp) {
    if (DB::is_mysql()) {
        $sql = 'UPDATE task_data_1 SET f_deadline = TIMESTAMP(f_deadline, \'12:00:00\'), f_timeless = 1';
    } else {
        $sql = 'UPDATE task_data_1 SET f_deadline = f_deadline + CAST(\'12:00:00\' as time), f_timeless = 1';
    }
}
if ($sql) {
    DB::Execute($sql);
}
if ($deadline_time_field_exists) {
    Utils_RecordBrowserCommon::delete_record_field('task', 'Deadline Time');
}
開發者ID:cretzu89,項目名稱:EPESI,代碼行數:30,代碼來源:20151109_timeless_task.php

示例8: defined

<?php

defined("_VALID_ACCESS") || die('Direct access forbidden');
//addons table
$fields = array(array('name' => _M('Recordset'), 'type' => 'text', 'param' => 64, 'display_callback' => array('CRM_PhoneCallCommon', 'display_recordset'), 'QFfield_callback' => array('CRM_PhoneCallCommon', 'QFfield_recordset'), 'required' => true, 'extra' => false, 'visible' => true));
Utils_RecordBrowserCommon::install_new_recordset('phonecall_related', $fields);
Utils_RecordBrowserCommon::set_caption('phonecall_related', _M('Meeting Related Recordsets'));
Utils_RecordBrowserCommon::register_processing_callback('phonecall_related', array('CRM_PhoneCallCommon', 'processing_related'));
Utils_RecordBrowserCommon::add_access('phonecall_related', 'view', 'ACCESS:employee');
Utils_RecordBrowserCommon::add_access('phonecall_related', 'add', 'ADMIN');
Utils_RecordBrowserCommon::add_access('phonecall_related', 'edit', 'SUPERADMIN');
Utils_RecordBrowserCommon::add_access('phonecall_related', 'delete', 'SUPERADMIN');
Utils_RecordBrowserCommon::new_record_field('phonecall', array('name' => _M('Related'), 'type' => 'multiselect', 'param' => '__RECORDSETS__::;CRM_PhoneCallCommon::related_crits', 'QFfield_callback' => array('CRM_PhoneCallCommon', 'QFfield_related'), 'extra' => false, 'required' => false, 'visible' => true));
$rel = Utils_RecordBrowserCommon::get_records('phonecall', array('!related_to' => ''));
foreach ($rel as $r) {
    $rr = array();
    foreach ($r['related_to'] as $id) {
        $rr[] = 'contact/' . $id;
    }
    Utils_RecordBrowserCommon::update_record('phonecall', $r['id'], array('related' => $rr), false, null, true);
}
Utils_RecordBrowserCommon::delete_record_field('phonecall', 'Related to');
開發者ID:cretzu89,項目名稱:EPESI,代碼行數:22,代碼來源:20141218_related.php

示例9: defined

<?php

defined("_VALID_ACCESS") || die('Direct access forbidden');
if (ModuleManager::is_installed('CRM_Roundcube') >= 0) {
    Utils_RecordBrowserCommon::delete_record_field('rc_mails', 'Direction');
}
開發者ID:cretzu89,項目名稱:EPESI,代碼行數:6,代碼來源:crm_roundcube_remove_direction.php


注:本文中的Utils_RecordBrowserCommon::delete_record_field方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。