本文整理汇总了PHP中Utils_RecordBrowserCommon::check_table_name方法的典型用法代码示例。如果您正苦于以下问题:PHP Utils_RecordBrowserCommon::check_table_name方法的具体用法?PHP Utils_RecordBrowserCommon::check_table_name怎么用?PHP Utils_RecordBrowserCommon::check_table_name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utils_RecordBrowserCommon
的用法示例。
在下文中一共展示了Utils_RecordBrowserCommon::check_table_name方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check_for_jump
public static function check_for_jump()
{
if (isset($_REQUEST['__jump_to_RB_table']) && isset($_REQUEST['__jump_to_RB_record'])) {
$tab = $_REQUEST['__jump_to_RB_table'];
$id = $_REQUEST['__jump_to_RB_record'];
$action = $_REQUEST['__jump_to_RB_action'];
if (!is_numeric($id)) {
return false;
}
Utils_RecordBrowserCommon::check_table_name($tab);
if (!self::get_access($tab, 'browse')) {
return false;
}
if (!DB::GetOne('SELECT id FROM ' . $tab . '_data_1 WHERE id=%d', $id)) {
return false;
}
unset($_REQUEST['__jump_to_RB_record']);
unset($_REQUEST['__jump_to_RB_table']);
unset($_REQUEST['__jump_to_RB_action']);
$x = ModuleManager::get_instance('/Base_Box|0');
if (!$x) {
trigger_error('There is no base box module instance', E_USER_ERROR);
}
$x->push_main(Utils_RecordBrowser::module_name(), 'view_entry_with_REQUEST', array($action, $id, array(), true, $_REQUEST), array($tab));
return true;
}
return false;
}
示例2: permissions_get_field_values
private function permissions_get_field_values($field, $in_depth=true) {
static $all_fields = array();
if (!isset($all_fields[$this->tab]))
foreach ($this->table_rows as $k=>$v)
$all_fields[$this->tab][$v['id']] = $k;
$args = $this->table_rows[$all_fields[$this->tab][$field]];
$arr = array(''=>'['.__('Empty').']');
switch (true) {
case $args['type']=='text' && $args['filter']:
$arr_add = @DB::GetAssoc('SELECT f_'.$args['id'].', f_'.$args['id'].' FROM '.$this->tab.'_data_1 GROUP BY f_'.$args['id'].' ORDER BY count(*) DESC LIMIT 20');
if($arr_add) $arr += $arr_add;
break;
case $args['commondata']:
$array_id = is_array($args['param']) ? $args['param']['array_id'] : $args['ref_table'];
if (strpos($array_id, '::')===false)
$arr = $arr + Utils_CommonDataCommon::get_translated_array($array_id, is_array($args['param'])?$args['param']['order_by_key']:false);
break;
case $this->tab=='contact' && $field=='login' ||
$this->tab=='rc_accounts' && $field=='epesi_user': // just a quickfix, better solution will be needed
$arr = $arr + array('USER_ID'=>__('User Login'));
break;
case $args['type']=='date' || $args['type']=='timestamp':
$arr = $arr + Utils_RecordBrowserCommon::$date_values;
break;
case ($args['type']=='multiselect' || $args['type']=='select') && (!isset($args['ref_table']) || !$args['ref_table']):
$arr = $arr + array('USER'=>__('User Contact'));
$arr = $arr + array('USER_COMPANY'=>__('User Company'));
break;
case $args['type']=='checkbox':
$arr = array('1'=>__('Yes'),'0'=>__('No'));
break;
case ($args['type']=='select' || $args['type']=='multiselect') && isset($args['ref_table']):
if ($args['ref_table']=='contact') $arr = $arr + array('USER'=>__('User Contact'));
if ($args['ref_table']=='company') $arr = $arr + array('USER_COMPANY'=>__('User Company'));
if (!$in_depth) continue;
$last_tab = $this->tab;
$tabs = explode(',', $args['ref_table']);
if (count($tabs) != 1) break;
$one_tab = reset($tabs);
if ($one_tab != '__RECORDSETS__'
&& Utils_RecordBrowserCommon::check_table_name($one_tab, false, false)) {
$this->tab = $one_tab;
$this->init();
if (!isset($all_fields[$this->tab]))
foreach ($this->table_rows as $k=>$v)
$all_fields[$this->tab][$v['id']] = $k;
foreach ($all_fields[$this->tab] as $k=>$v) {
if ($this->table_rows[$v]['type']=='calculated' || $this->table_rows[$v]['type']=='hidden') unset($all_fields[$this->tab][$k]);
else {
$arr2 = $this->permissions_get_field_values($k, false, $this->tab);
foreach ($arr2 as $k2=>$v2)
$arr2[$k2] = '"'.$k2.'":"'.$v2.'"';
eval_js('utils_recordbrowser__field_sub_values["'.$field.'__'.$k.'"] = {'.implode(',',$arr2).'};');
}
}
foreach ($all_fields[$this->tab] as $k=>$v) {
$arr[$k] = __(' records with %s set to ', array(_V($v)));
}
}
$this->tab = $last_tab;
$this->init();
break;
}
return $arr;
}
示例3: detranslate_field_names
public function detranslate_field_names($rset, &$fs)
{
Utils_RecordBrowserCommon::check_table_name($rset);
$fields = DB::GetAssoc('SELECT field, field FROM ' . $rset . '_field WHERE type!=%s AND field!=%s AND type!=%s ORDER BY position', array('page_split', 'id', 'hidden'));
foreach ($fields as $k => $f) {
$fields[_V($f)] = $f;
}
// ****** RecordBrowser - field name
$ret = array();
foreach ($fs as $k => $f) {
$f = trim($f);
$fs[$k] = $f;
if (isset($fields[$f]) && $f == $fields[$f]) {
continue;
}
if (isset($fields[$f])) {
$fs[$k] = $fields[$f];
continue;
}
$ret['label_field'] = __('Field not found: %s', array($f));
}
return $ret;
}
示例4: get_access
public static function get_access($id) {
$locals = DB::GetCol('SELECT local FROM utils_attachment_local WHERE attachment=%d',array($id));
$ret = false;
foreach($locals as $local) {
list($recordset,$key) = explode('/',$local,2);
if(!Utils_RecordBrowserCommon::check_table_name($recordset, false, false)
|| !is_numeric($key)
|| Utils_RecordBrowserCommon::get_access($recordset,'view',$key)) {
$ret = true;
break;
}
}
return $ret;
}
示例5: array
if (!$r['f_access']) {
$gr = '__mrm__';
} else {
$gr = $r['f_access'] . 'mrm__';
}
DB::Execute('UPDATE contact_data_1 SET f_access=%s WHERE id=%d', array($gr, $r['id']));
}
}
}
Acl::del_group('Medical Record Manager');
Utils_RecordBrowserCommon::new_record_field('contact', array('name' => _M('View'), 'type' => 'crm_contact', 'param' => array('field_type' => 'multiselect', 'crits' => array('Custom_CADES_AccessRestrictionsCommon', 'employee_crits'), 'format' => array('CRM_ContactsCommon', 'contact_format_no_company')), 'required' => false, 'extra' => true, 'filter' => false, 'visible' => false));
Utils_RecordBrowserCommon::new_record_field('contact', array('name' => _M('Edit'), 'type' => 'crm_contact', 'param' => array('field_type' => 'multiselect', 'crits' => array('Custom_CADES_AccessRestrictionsCommon', 'employee_crits'), 'format' => array('CRM_ContactsCommon', 'contact_format_no_company')), 'required' => false, 'extra' => true, 'filter' => false, 'visible' => false));
Utils_RecordBrowserCommon::new_record_field('contact', array('name' => _M('Add'), 'type' => 'crm_contact', 'param' => array('field_type' => 'multiselect', 'crits' => array('Custom_CADES_AccessRestrictionsCommon', 'employee_crits'), 'format' => array('CRM_ContactsCommon', 'contact_format_no_company')), 'required' => false, 'extra' => true, 'filter' => false, 'visible' => false));
Utils_RecordBrowserCommon::new_record_field('contact', array('name' => _M('Delete'), 'type' => 'crm_contact', 'param' => array('field_type' => 'multiselect', 'crits' => array('Custom_CADES_AccessRestrictionsCommon', 'employee_crits'), 'format' => array('CRM_ContactsCommon', 'contact_format_no_company')), 'required' => false, 'extra' => true, 'filter' => false, 'visible' => false));
// migrate data
if (Utils_RecordBrowserCommon::check_table_name('cades_access_control', false, false)) {
$recs = DB::Execute('SELECT * FROM cades_access_control_data_1 WHERE active=1');
$perms = array();
$rm_acl = array();
$count = 0;
$done = 0;
while ($r = $recs->FetchRow()) {
if (!isset($rm_acl[$r['f_patient']])) {
$rm_acl[$r['f_patient']] = array();
}
$rm_acl[$r['f_patient']][] = $r['id'];
$field = Utils_RecordBrowserCommon::get_field_id(Utils_CommonDataCommon::get_value('CADES/AccessLevel/' . $r['f_permission_level']));
$fields = explode('_', $field);
foreach ($fields as $field) {
if (!isset($perms[$r['f_patient']][$field])) {
$perms[$r['f_patient']][$field] = array();
示例6: map_rb_field_to_query_builder_filters
public static function map_rb_field_to_query_builder_filters($tab, $f, $in_depth = true, $prefix = '', $sufix = '', $label_prefix = '')
{
$filters = array();
$type = null;
$values = null;
$input = null;
$opts = array();
$opts['id'] = $prefix . $f['id'] . $sufix;
$opts['field'] = $opts['id'];
$opts['label'] = $label_prefix . _V($f['name']);
if ($tab == 'contact' && $f['id'] == 'login' || $tab == 'rc_accounts' && $f['id'] == 'epesi_user') {
$type = 'boolean';
// just for valid operators
$input = 'select';
$values = array('' => '[' . __('Empty') . ']', 'USER_ID' => __('User Login'));
} else {
switch ($f['type']) {
case 'text':
$type = 'string';
break;
case 'multiselect':
case 'select':
$param = explode(';', $f['param']);
$ref = explode('::', $param[0]);
$tabs = $ref[0];
if ($tabs == '__RECORDSETS__') {
$single_tab = false;
} else {
$tabs = explode(',', $tabs);
$single_tab = count($tabs) == 1;
}
$type = 'boolean';
$input = 'select';
$values = self::permissions_get_field_values($tab, $f, $in_depth);
if ($in_depth && $single_tab) {
$one_tab = reset($tabs);
if (Utils_RecordBrowserCommon::check_table_name($one_tab, false, false)) {
$fields = Utils_RecordBrowserCommon::init($one_tab);
foreach ($fields as $k => $v) {
if ($v['type'] == 'calculated' || $v['type'] == 'hidden') {
} else {
$new_label_prefix = _V($f['name']) . ' ' . __('is set to record where') . ' ';
$sub_filter = self::map_rb_field_to_query_builder_filters($tab, $v, false, $f['id'] . '[', ']', $new_label_prefix);
if ($sub_filter) {
$sub_filter = reset($sub_filter);
$sub_filter['optgroup'] = $new_label_prefix;
$filters[] = $sub_filter;
}
}
}
}
}
break;
case 'commondata':
$type = 'boolean';
$input = 'select';
$array_id = is_array($f['param']) ? $f['param']['array_id'] : $f['ref_table'];
$values = array('' => '[' . __('Empty') . ']');
if (strpos($array_id, '::') === false) {
$values = $values + Utils_CommonDataCommon::get_translated_array($array_id, is_array($f['param']) ? $f['param']['order_by_key'] : false);
}
break;
case 'integer':
$type = 'integer';
break;
case 'float':
$type = 'double';
break;
case 'timestamp':
$type = 'datetime';
case 'date':
if (!$type) {
$type = 'date';
}
// absolute value filter
$opts['plugin'] = 'datepicker';
$opts['plugin_config'] = array('dateFormat' => 'yy-mm-dd');
// relative value filter
$filt2 = $opts;
$filt2['id'] .= '_relative';
$filt2['label'] .= ' (' . __('relative') . ')';
$filt2['type'] = 'date';
$filt2['input'] = 'select';
$filt2['values'] = self::permissions_get_field_values($tab, $f);
$filters[] = $filt2;
break;
case 'time':
$type = 'time';
break;
case 'long text':
$type = 'string';
$input = 'textarea';
break;
case 'hidden':
break;
case 'calculated':
break;
case 'checkbox':
$type = 'boolean';
break;
//.........这里部分代码省略.........