当前位置: 首页>>代码示例>>PHP>>正文


PHP Utils_RecordBrowserCommon::decode_multi方法代码示例

本文整理汇总了PHP中Utils_RecordBrowserCommon::decode_multi方法的典型用法代码示例。如果您正苦于以下问题:PHP Utils_RecordBrowserCommon::decode_multi方法的具体用法?PHP Utils_RecordBrowserCommon::decode_multi怎么用?PHP Utils_RecordBrowserCommon::decode_multi使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Utils_RecordBrowserCommon的用法示例。


在下文中一共展示了Utils_RecordBrowserCommon::decode_multi方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: defined

<?php

defined("_VALID_ACCESS") || die('Direct access forbidden');
Utils_CommonDataCommon::extend_array('Contacts/Access', array('employee' => _M('Employee')));
$cmp = Variable::get('main_company', null);
if ($cmp) {
    set_time_limit(0);
    $conts = DB::GetAll('SELECT * FROM contact_data_1 WHERE f_company_name=%d OR f_related_companies ' . DB::like() . ' ' . DB::Concat(DB::qstr('\\_\\_'), DB::qstr($cmp), DB::qstr('\\_\\_')), array($cmp));
    foreach ($conts as $k => $v) {
        $v['access'] = Utils_RecordBrowserCommon::decode_multi($v['f_access']);
        $v['access'][] = 'employee';
        Utils_RecordBrowserCommon::update_record('contact', $v['id'], array('access' => $v['access']));
    }
    Variable::delete('main_company', false);
}
$tab = DB::GetAssoc('SELECT tab, tab FROM recordbrowser_table_properties');
foreach ($tab as $t) {
    DB::Execute('UPDATE ' . $t . '_access_clearance SET clearance=%s WHERE clearance=%s', array('ACCESS:employee', 'EMPLOYEE'));
}
开发者ID:cretzu89,项目名称:EPESI,代码行数:19,代码来源:20120626_employees_clearance_change.php

示例2: view_edit_history

    public function view_edit_history($id){
		load_js('modules/Utils/RecordBrowser/edit_history.js');
        if ($this->is_back())
            return $this->back();
        $this->init();
		$tb = $this->init_module('Utils_TabbedBrowser');		
        $gb_cha = $this->init_module('Utils/GenericBrowser', null, $this->tab.'__changes');
		$form = $this->init_module('Libs_QuickForm');

        $table_columns_changes = array( array('name'=>__('Date'), 'width'=>10, 'wrapmode'=>'nowrap'),
                                        array('name'=>__('Username'), 'width'=>10, 'wrapmode'=>'nowrap'),
                                        array('name'=>__('Field'), 'width'=>10, 'wrapmode'=>'nowrap'),
                                        array('name'=>__('Old value'), 'width'=>10, 'wrapmode'=>'nowrap'),
                                        array('name'=>__('New value'), 'width'=>10, 'wrapmode'=>'nowrap'));

        $gb_cha->set_table_columns( $table_columns_changes );

        $gb_cha->set_inline_display();

        $created = Utils_RecordBrowserCommon::get_record($this->tab, $id, true);
        $access = $this->get_access('view', $created);
        $field_hash = array();
        $edited = DB::GetRow('SELECT ul.login, c.edited_on FROM '.$this->tab.'_edit_history AS c LEFT JOIN user_login AS ul ON ul.id=c.edited_by WHERE c.'.$this->tab.'_id=%d ORDER BY edited_on DESC',array($id));
        foreach($this->table_rows as $field => $args)
            $field_hash[$args['id']] = $field;

        $ret = DB::Execute('SELECT ul.login, c.id, c.edited_on, c.edited_by FROM '.$this->tab.'_edit_history AS c LEFT JOIN user_login AS ul ON ul.id=c.edited_by WHERE c.'.$this->tab.'_id=%d ORDER BY edited_on DESC, id DESC',array($id));
		$dates_select = array();
		$tb_path = escapeJS($tb->get_path());
        while ($row = $ret->FetchRow()) {
			$user = Base_UserCommon::get_user_label($row['edited_by']);
			$date_and_time = Base_RegionalSettingsCommon::time2reg($row['edited_on']);
            $changed = array();
            $ret2 = DB::Execute('SELECT * FROM '.$this->tab.'_edit_history_data WHERE edit_id=%d',array($row['id']));
            while($row2 = $ret2->FetchRow()) {
                if ($row2['field']!='id' && (!isset($access[$row2['field']]) || !$access[$row2['field']])) continue;
                $changed[$row2['field']] = $row2['old_value'];
                $last_row = $row2;
                $dates_select[$row['edited_on']] = $date_and_time;
            }
            foreach($changed as $k=>$v) {
                if ($k=='id') {
					$gb_cha->add_row(
						$date_and_time, 
						$user, 
						array('value'=>_V($last_row['old_value']), 'attrs'=>'colspan="3" style="text-align:center;font-weight:bold;"'),
						array('value'=>'', 'dummy'=>true),
						array('value'=>'', 'dummy'=>true)
					);
                } else {
                    if (!isset($field_hash[$k])) continue;
                    $new = $this->get_val($field_hash[$k], $created, false, $this->table_rows[$field_hash[$k]]);
                    if ($this->table_rows[$field_hash[$k]]['type']=='multiselect') $v = Utils_RecordBrowserCommon::decode_multi($v);
                    $created[$k] = $v;
                    $old = $this->get_val($field_hash[$k], $created, false, $this->table_rows[$field_hash[$k]]);
					$gb_row = $gb_cha->get_new_row();
					$gb_row->add_action('href="javascript:void(0);" onclick="recordbrowser_edit_history_jump(\''.$row['edited_on'].'\',\''.$this->tab.'\','.$created['id'].',\''.$form->get_name().'\');tabbed_browser_switch(1,2,null,\''.$tb_path.'\')"','View');
                    $gb_row->add_data(
                        $date_and_time,
                        $row['edited_by']!==null?$user:'',
                        _V($this->table_rows[$field_hash[$k]]['name']), // TRSL
                        $old,
                        $new
                    );
                }
            }
        }

		$gb_row = $gb_cha->get_new_row();
		$gb_row->add_data(
			Base_RegionalSettingsCommon::time2reg($created['created_on']),
			$created['created_by']!==null?Base_UserCommon::get_user_label($created['created_by']):'',
			array('value'=>__('RECORD CREATED'), 'attrs'=>'colspan="3" style="text-align:center;font-weight:bold;"'),
			array('value'=>'', 'dummy'=>true),
			array('value'=>'', 'dummy'=>true)
		);


//		$tb->set_tab(__('Record historical view'), array($this, 'record_historical_view'), array($created, $access, $form, $dates_select), true);
		$tb->start_tab(__('Changes History'));
		$this->display_module($gb_cha);
		$tb->end_tab();

		$tb->start_tab(__('Record historical view'));
		$dates_select[$created['created_on']] = Base_RegionalSettingsCommon::time2reg($created['created_on']);
        foreach($this->table_rows as $field => $args) {
            if (!$access[$args['id']]) continue;
            $val = $this->get_val($field, $created, false, $args);
        }
		$form->addElement('select', 'historical_view_pick_date', __('View the record as of'), $dates_select, array('onChange'=>'recordbrowser_edit_history("'.$this->tab.'",'.$created['id'].',"'.$form->get_name().'");', 'id'=>'historical_view_pick_date'));
		$form->setDefaults(array('historical_view_pick_date'=>$created['created_on']));
		$form->display();
		$this->view_entry('history', $created);
		$tb->end_tab();

		
		$this->display_module($tb);
        Base_ActionBarCommon::add('back',__('Back'),$this->create_back_href());
        return true;
    }
开发者ID:62BRAINS,项目名称:EPESI,代码行数:100,代码来源:RecordBrowser_0.php

示例3: submit_mail

 public static function submit_mail($param, $mode)
 {
     if ($mode == 'add') {
         $param['message_id'] = ltrim(rtrim($param['message_id'], '>'), '<');
     } else {
         if ($mode == 'added') {
             self::create_thread($param['id']);
             self::subscribe_users_to_record($param);
         } else {
             if ($mode == 'edit') {
                 $old_related = Utils_RecordBrowserCommon::get_value('rc_mails', $param['id'], 'related');
                 $old_related = Utils_RecordBrowserCommon::decode_multi($old_related);
                 $new_related = $param['related'];
                 $new_related = Utils_RecordBrowserCommon::decode_multi($new_related);
                 $subscribers = array();
                 foreach ($new_related as $rel) {
                     if (in_array($rel, $old_related)) {
                         continue;
                     }
                     list($recordset, $record_id) = explode('/', $rel);
                     $subscribers = array_merge($subscribers, Utils_WatchdogCommon::get_subscribers($recordset, $record_id));
                 }
                 foreach (array_unique($subscribers) as $user_id) {
                     Utils_WatchdogCommon::user_subscribe($user_id, 'rc_mails', $param['id']);
                 }
             }
         }
     }
     return $param;
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:30,代码来源:RoundcubeCommon_0.php

示例4: validate_single

 protected function validate_single(Utils_RecordBrowser_CritsSingle $crits, $record)
 {
     $id = isset($record['id']) ? $record['id'] : '';
     list($field, $subfield) = Utils_RecordBrowser_CritsSingle::parse_subfield($crits->get_field());
     $field = ltrim(Utils_RecordBrowserCommon::get_field_id($field), '_');
     $subfield = ltrim(Utils_RecordBrowserCommon::get_field_id($subfield), '_');
     $r_val = isset($record[$field]) ? $record[$field] : '';
     $crit_value = $crits->get_value();
     $field_definition = $this->get_field_definition($field);
     if ($subfield && $field_definition) {
         $sub_tab = isset($field_definition['ref_table']) ? $field_definition['ref_table'] : false;
         if ($sub_tab) {
             if (is_array($r_val)) {
                 foreach ($r_val as $k => $v) {
                     $r_val[$k] = Utils_RecordBrowserCommon::get_value($sub_tab, $v, $subfield);
                 }
             } else {
                 if ($r_val) {
                     $r_val = Utils_RecordBrowserCommon::get_value($sub_tab, $r_val, $subfield);
                 } else {
                     $r_val = '';
                 }
                 if (substr($r_val, 0, 2) == '__') {
                     $r_val = Utils_RecordBrowserCommon::decode_multi($r_val);
                 }
                 // FIXME need better check
             }
         }
     }
     $k = strtolower($field);
     $record[$k] = $r_val;
     $result = false;
     $transform_date = false;
     if ($k == 'created_on') {
         $transform_date = 'timestamp';
     } elseif ($k == 'edited_on') {
         $details = Utils_RecordBrowserCommon::get_record_info($this->tab, $id);
         $record[$k] = $details['edited_on'];
         $transform_date = 'timestamp';
     } elseif ($field_definition) {
         $type = $field_definition['type'];
         if ($type == 'timestamp') {
             $transform_date = 'timestamp';
         } elseif ($type == 'date') {
             $transform_date = 'date';
         }
     }
     if ($transform_date == 'timestamp' && $crit_value) {
         $crit_value = Base_RegionalSettingsCommon::reg2time($crit_value, false);
         $crit_value = date('Y-m-d H:i:s', $crit_value);
     } else {
         if ($transform_date == 'date' && $crit_value) {
             $crit_value = Base_RegionalSettingsCommon::reg2time($crit_value, false);
             $crit_value = date('Y-m-d', $crit_value);
         }
     }
     $vv = explode('::', $crit_value, 2);
     if (isset($vv[1]) && is_callable($vv)) {
         $result = call_user_func_array($vv, array($this->tab, &$record, $k, $crits));
     } else {
         if (is_array($record[$k])) {
             if ($crit_value) {
                 $result = in_array($crit_value, $record[$k]);
             } else {
                 $result = empty($record[$k]);
             }
             if ($crits->get_operator() == '!=') {
                 $result = !$result;
             }
         } else {
             switch ($crits->get_operator()) {
                 case '>':
                     $result = $record[$k] > $crit_value;
                     break;
                 case '>=':
                     $result = $record[$k] >= $crit_value;
                     break;
                 case '<':
                     $result = $record[$k] < $crit_value;
                     break;
                 case '<=':
                     $result = $record[$k] <= $crit_value;
                     break;
                 case '!=':
                     $result = $record[$k] != $crit_value;
                     break;
                 case '=':
                     $result = $record[$k] == $crit_value;
                     break;
                 case 'LIKE':
                     $result = self::check_like_match($record[$k], $crit_value);
                     break;
                 case 'NOT LIKE':
                     $result = !self::check_like_match($record[$k], $crit_value);
                     break;
             }
         }
     }
     if ($crits->get_negation()) {
         $result = !$result;
//.........这里部分代码省略.........
开发者ID:cretzu89,项目名称:EPESI,代码行数:101,代码来源:CritsValidator.php

示例5: foreach

        if ($row2['field'] != 'id' && (!isset($access[$row2['field']]) || !$access[$row2['field']])) {
            continue;
        }
        $changed[$row2['field']] = $row2['old_value'];
        $last_row = $row2;
    }
    foreach ($changed as $k => $v) {
        if ($k != 'id') {
            if (!isset($field_hash[$k])) {
                continue;
            }
            if (!isset($table_rows[$field_hash[$k]])) {
                continue;
            }
            if ($table_rows[$field_hash[$k]]['type'] == 'multiselect') {
                $v = Utils_RecordBrowserCommon::decode_multi($v);
            }
            $created[$k] = $v;
        }
    }
}
foreach ($table_rows as $field => $args) {
    ob_start();
    $val = @Utils_RecordBrowserCommon::get_val($tab, $field, $created, false, $args);
    if (!$val) {
        $val = Utils_RecordBrowserCommon::get_val($tab, $field, $created, true, $args);
    }
    ob_end_clean();
    print 'if($("_' . $args['id'] . '__data"))$("_' . $args['id'] . '__data").innerHTML = "' . Epesi::escapeJS($val) . '";';
    //	if (!$access[$args['id']]) continue;
    //	if ($created[$args['id']] !== '') $created[$args['id']] = $val; // TRSL
开发者ID:cretzu89,项目名称:EPESI,代码行数:31,代码来源:edit_history.php


注:本文中的Utils_RecordBrowserCommon::decode_multi方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。