本文整理汇总了PHP中Utils_RecordBrowserCommon::get_record方法的典型用法代码示例。如果您正苦于以下问题:PHP Utils_RecordBrowserCommon::get_record方法的具体用法?PHP Utils_RecordBrowserCommon::get_record怎么用?PHP Utils_RecordBrowserCommon::get_record使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utils_RecordBrowserCommon
的用法示例。
在下文中一共展示了Utils_RecordBrowserCommon::get_record方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mobile_rb_edit
public static function mobile_rb_edit($tab, $id)
{
if ($id === false) {
$rec = array();
} else {
$rec = self::get_record($tab, $id);
}
$cols = Utils_RecordBrowserCommon::init($tab);
$defaults = array();
if ($id === false) {
$mode = 'add';
$access = array();
$defaults = self::record_processing($tab, $defaults, 'adding');
} else {
$mode = 'edit';
$access = Utils_RecordBrowserCommon::get_access($tab, 'view', $rec);
if (is_array($access)) {
foreach ($access as $k => $v) {
if (!$v) {
unset($rec[$k]);
}
}
}
$defaults = $rec = self::record_processing($tab, $rec, 'editing');
}
$QFfield_callback_table = array();
$ret = DB::Execute('SELECT * FROM ' . $tab . '_callback WHERE freezed=0');
while ($row = $ret->FetchRow()) {
$QFfield_callback_table[$row['field']] = $row['callback'];
}
$defaults = array_merge($defaults, $_SESSION['rb_' . $tab . '_defaults']);
$qf = new HTML_QuickForm('rb_edit', 'post', 'mobile.php?' . http_build_query($_GET));
foreach ($cols as $field => $args) {
if (isset($access[$args['id']]) && !$access[$args['id']]) {
continue;
}
if (isset($rec[$args['id']])) {
$val = $rec[$args['id']];
} elseif (isset($defaults[$args['id']])) {
$val = $defaults[$args['id']];
} else {
$val = null;
}
$label = _V($args['name']);
// TRSL
if (isset($QFfield_callback_table[$field])) {
$mobile_rb = new Utils_RecordBrowserMobile($tab, $rec);
self::call_QFfield_callback($QFfield_callback_table[$field], $qf, $args['id'], $label, $mode, $val, $args, $mobile_rb, null);
if ($mode == 'edit') {
unset($defaults[$args['id']]);
}
continue;
}
switch ($args['type']) {
case 'calculated':
$qf->addElement('static', $args['id'], $label);
if (!is_array($rec)) {
$values = $defaults;
} else {
$values = $rec;
if (is_array($defaults)) {
$values = $values + $defaults;
}
}
if (!isset($values[$args['id']])) {
$values[$args['id']] = '';
}
$val = Utils_RecordBrowserCommon::get_val($tab, $field, $values, true, $args);
if ($val !== null) {
$qf->setDefaults(array($args['id'] => $val));
}
break;
case 'integer':
case 'float':
$qf->addElement('text', $args['id'], $label);
if ($args['type'] == 'integer') {
$qf->addRule($args['id'], __('Only integer numbers are allowed.'), 'regex', '/^[0-9]*$/');
} else {
$qf->addRule($args['id'], __('Only numbers are allowed.'), 'numeric');
}
if ($val !== null) {
$qf->setDefaults(array($args['id'] => $val));
}
break;
case 'checkbox':
$qf->addElement('checkbox', $args['id'], $label, '');
if ($val !== null) {
$qf->setDefaults(array($args['id'] => $val));
}
break;
case 'currency':
$qf->addElement('currency', $args['id'], $label);
if ($val !== null) {
$qf->setDefaults(array($args['id'] => $val));
}
break;
case 'text':
$qf->addElement('text', $args['id'], $label, array('maxlength' => $args['param']));
$qf->addRule($args['id'], __('Maximum length for this field is %s characters.', array($args['param'])), 'maxlength', $args['param']);
if ($val !== null) {
//.........这里部分代码省略.........
示例2: die
<?php
if (!isset($_POST['acc_id']) || !is_numeric($_POST['acc_id'])) {
die('Invalid request');
}
define('CID', false);
define('READ_ONLY_SESSION', true);
require_once '../../../include.php';
ModuleManager::load_modules();
if (!Acl::is_user()) {
die('not logged');
}
@set_time_limit(0);
$rec = Utils_RecordBrowserCommon::get_record('rc_accounts', $_POST['acc_id']);
if ($rec['epesi_user'] !== Acl::get_user()) {
die('invalid account id');
}
$port = $rec['security'] == 'ssl' ? 993 : 143;
$server_str = '{' . $rec['server'] . '/imap/readonly/novalidate-cert' . ($rec['security'] ? '/' . $rec['security'] : '') . ':' . $port . '}';
$mailbox = @imap_open(imap_utf7_encode($server_str), imap_utf7_encode($rec['login']), imap_utf7_encode($rec['password']), OP_READONLY || OP_SILENT);
$err = imap_errors();
if (!$mailbox || $err) {
die(Utils_TooltipCommon::create(__('Connection error'), $err, false));
}
$uns = @imap_search($mailbox, 'UNSEEN ALL');
$unseen = array();
if ($uns) {
$l = @imap_fetch_overview($mailbox, implode(',', $uns), 0);
$err = imap_errors();
if (!$l || $err) {
die('error reading messages overview');
示例3: search_by_id_form
public function search_by_id_form($label) {
$message = '';
$form = $this->init_module('Libs/QuickForm');
$theme = $this->init_module('Base/Theme');
$form->addElement('text', 'record_id', $label);
$form->addRule('record_id', __('Must be a number'), 'numeric');
$form->addRule('record_id', __('Field required'), 'required');
$ret = false;
if ($form->isSubmitted())
$ret = true;
if ($form->validate()) {
$id = $form->exportValue('record_id');
if (!is_numeric($id)) trigger_error('Invalid id',E_USER_ERROR);
$r = Utils_RecordBrowserCommon::get_record($this->tab,$id);
if (!$r || empty($r)) $message = __('There is no such record').'<br>';
else if (!$r[':active']) $message = __('This record was deleted from the system').'<br>';
else {
$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','view_entry',array('view', $id),array($this->tab));
return;
}
}
$form->assign_theme('form', $theme);
$theme->assign('message', $message);
$theme->display('search_by_id');
return $ret;
}
示例4: get_record
/**
* Get single record from recordset by id
* @param int $id
* @param bool $htmlspecialchars quote values using htmlspecialchars
* @return RBO_Record
*/
public function get_record($id, $htmlspecialchars = true)
{
$record = Utils_RecordBrowserCommon::get_record($this->tab, $id, $htmlspecialchars);
return $this->record_to_object($record);
}
示例5: header
<?php
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// date in the past
if (!isset($_GET['mail_id']) || !is_numeric($_GET['mail_id']) || !isset($_GET['mime_id']) || !is_numeric($_GET['mime_id']) && strlen($_GET['mime_id']) != 32) {
die('Invalid request');
}
define('CID', false);
define('READ_ONLY_SESSION', true);
require_once '../../../include.php';
ModuleManager::load_modules();
if (!Acl::is_user()) {
die('Not logged in');
}
$rec = Utils_RecordBrowserCommon::get_record('rc_mails', $_GET['mail_id']);
if (!$rec) {
die('Invalid e-mail id.');
}
$access_fields = Utils_RecordBrowserCommon::get_access('rc_mails', 'view', $rec);
if (!isset($access_fields['body']) || !$access_fields['body']) {
die('Access forbidden');
}
list($mimetype, $name, $attachment) = DB::GetRow('SELECT type,name,attachment FROM rc_mails_attachments WHERE mail_id=%d AND mime_id=%s', array($_GET['mail_id'], $_GET['mime_id']));
$disposition = $attachment ? 'attachment' : 'inline';
$filename = DATA_DIR . '/CRM_Roundcube/attachments/' . $_GET['mail_id'] . '/' . $_GET['mime_id'];
if (headers_sent()) {
die('Some data has already been output to browser, can\'t send file');
}
if (!file_exists($filename)) {
die('File doesn\'t exists');
示例6: die
* @version 1.0
* @package epesi-utils
* @subpackage RecordBrowser-RecordPicker
*/
if (!isset($_POST['select']) || !isset($_POST['row']) || !is_numeric($_POST['row']) || !isset($_POST['path']) || !isset($_POST['cid'])) {
die('alert(\'Invalid request\')');
}
define('JS_OUTPUT', 1);
define('CID', $_POST['cid']);
require_once '../../../../include.php';
foreach ($_POST as $k => $v) {
$_POST[$k] = trim($v, '"');
}
$path = $_POST['path'];
$tab = Module::static_get_module_variable($path, 'tab', null);
$crits = Module::static_get_module_variable($path, 'crits_stuff', null);
$rp_path = Module::static_get_module_variable($path, 'rp_fs_path', null);
$selected =& Module::static_get_module_variable($rp_path, 'selected', array());
ModuleManager::load_modules();
if ($tab === null || $crits === null || $rp_path === null) {
die('alert(\'Invalid usage - variables not set (path - ' . $path . ', module vars - ' . epesi::escapeJS(print_r($_SESSION['client']['__module_vars__'][$path], true)) . ')\');');
}
$record = Utils_RecordBrowserCommon::get_record($tab, $_POST['row']);
if (is_array($record)) {
if ($_POST['select'] && $_POST['select'] != 'false') {
$selected[$_POST['row']] = 1;
} else {
unset($selected[$_POST['row']]);
}
}
session_commit();
示例7: die
*/
if (!isset($_REQUEST['cid']) || !isset($_REQUEST['id'])) {
die('Invalid usage');
}
$cid = $_REQUEST['cid'];
$id = $_REQUEST['id'];
$disposition = isset($_REQUEST['view']) && $_REQUEST['view'] ? 'inline' : 'attachment';
define('CID', $cid);
define('READ_ONLY_SESSION', true);
require_once '../../../include.php';
ModuleManager::load_modules();
if (!Acl::is_user()) {
die('Permission denied');
}
$file = DB::GetRow('SELECT uaf.attach_id, uaf.original, uaf.filestorage_id FROM utils_attachment_file uaf WHERE uaf.id=%d', array($id));
$rec = Utils_RecordBrowserCommon::get_record('utils_attachment', $file['attach_id']);
if (!$rec) {
die('Invalid attachment.');
}
$access_fields = Utils_RecordBrowserCommon::get_access('utils_attachment', 'view', $rec);
if (!isset($access_fields['note']) || !$access_fields['note']) {
die('Access forbidden');
}
$original = $file['original'];
$local = $rec['id'];
$fsid = $file['filestorage_id'];
$crypted = $rec['crypted'];
$meta = Utils_FileStorageCommon::meta($fsid);
require_once 'mime.php';
if (headers_sent()) {
die('Some data has already been output to browser, can\'t send file');
示例8: die
<?php
if (!isset($_REQUEST['cid']) || !isset($_REQUEST['id']) || !isset($_REQUEST['pass'])) {
die('Invalid usage');
}
$cid = $_REQUEST['cid'];
$id = $_REQUEST['id'];
$pass = $_REQUEST['pass'];
define('CID', $cid);
define('READ_ONLY_SESSION', false);
require_once '../../../include.php';
ModuleManager::load_modules();
$row = Utils_RecordBrowserCommon::get_record('utils_attachment', $id);
if (!Utils_RecordBrowserCommon::get_access('utils_attachment', 'view', $row)) {
die(json_encode(array('error' => __('Access denied'))));
}
$decoded = Utils_AttachmentCommon::decrypt($row['note'], $pass);
if ($decoded !== false) {
$_SESSION['client']['cp' . $row['id']] = $pass;
ob_start();
$note = Utils_AttachmentCommon::display_note($row, false, null, 'utils_attachment', true);
$note = ob_get_clean() . $note;
die(json_encode(array('note' => $note, 'js' => Epesi::get_output())));
}
die(json_encode(array('error' => __('Invalid password'))));
示例9: search
public static function search($word, $types) {
if(!$types) return;
$r = null;
$limit = Base_SearchCommon::get_recordset_limit_records();
$ret = array();
foreach($types as $type) {
if($type=='files') {
$r = DB::SelectLimit('SELECT ua.id,uaf.original,ual.func,ual.args,ual.local,ua.f_title FROM utils_attachment_data_1 ua INNER JOIN utils_attachment_local AS ual ON ual.attachment=ua.id INNER JOIN utils_attachment_file AS uaf ON uaf.attach_id=ua.id WHERE ua.active=1 AND '.
' uaf.original '.DB::like().' '.DB::Concat(DB::qstr('%'),'%s',DB::qstr('%')).' AND uaf.deleted=0', $limit, -1, array($word));
} elseif($type=='downloads') {
if(strlen($word)==32) {
$query = 'SELECT ua.id,uaf.original,ual.func,ual.args,ual.local,ua.f_title FROM utils_attachment_file uaf INNER JOIN utils_attachment_download uad ON uad.attach_file_id=uaf.id INNER JOIN utils_attachment_data_1 ua ON uaf.attach_id=ua.id INNER JOIN utils_attachment_local AS ual ON ual.attachment=ua.id WHERE uad.token='.DB::qstr($word);
$r = DB::Execute($query);
} else {
$query = parse_url($word,PHP_URL_QUERY);
if($query) {
$vars = array();
parse_str($query,$vars);
if($vars && isset($vars['id']) && isset($vars['token'])) {
$query = 'SELECT ua.id,uaf.original,ual.func,ual.args,ual.local,ua.f_title FROM utils_attachment_file uaf INNER JOIN utils_attachment_download uad ON uad.attach_file_id=uaf.id INNER JOIN utils_attachment_data_1 ua ON uaf.attach_id=ua.id INNER JOIN utils_attachment_local AS ual ON ual.attachment=ua.id WHERE uad.id='.DB::qstr($vars['id']).' AND uad.token='.DB::qstr($vars['token']);
$r = DB::Execute($query);
}
}
}
}
if($r) {
while($row = $r->FetchRow()) {
if(!self::get_access($row['id'])) continue;
$func = unserialize($row['func']);
$record = $func ? call_user_func_array($func, unserialize($row['args'])) : '';
if(!$record) continue;
$title = $row['original'].' - '.self::description_callback(Utils_RecordBrowserCommon::get_record('utils_attachment',$row['id']));
$title = Utils_RecordBrowserCommon::record_link_open_tag('utils_attachment', $row['id'])
. __('Files').': ' . $title
. Utils_RecordBrowserCommon::record_link_close_tag();
$ret[$row['id'].'#'.$row['local']] = $title . " ($record)";
}
}
}
return $ret;
}
示例10: trigger_error
if ($mode == 'submit') {
// && $form->validate()) {
$form->validate();
$vals = $form->exportValues();
if (!isset($vals['__grid_' . $element])) {
trigger_error(print_r($vals, true));
}
$value = $vals['__grid_' . $element];
Utils_RecordBrowserCommon::update_record($tab, $id, array($element => $value));
$record[$element] = $value;
$form = ModuleManager::new_instance('Libs_QuickForm', null, 'grid_form');
$rb = ModuleManager::new_instance('Utils_RecordBrowser', null, 'grid_rb');
$form->construct();
$rb->construct($tab);
$rb->init();
$record = Utils_RecordBrowserCommon::get_record($tab, $id);
$record[$element] = $value;
$rb->record = $record;
$rb->view_fields_permission = $rb->get_access('view', $record);
$rb->prepare_view_entry_details($record, 'view', $id, $form, array($element => true));
$renderer = new HTML_QuickForm_Renderer_TCMSArraySmarty();
$form->accept($renderer);
$data = $renderer->toArray();
$html = $data[$element]['html'];
if ($form_name == '') {
$html = '<form ' . $data['attributes'] . '>' . $html . '</form>';
}
print '$("grid_value_field_' . $element . '_' . $id . '").innerHTML = \'' . Epesi::escapeJS($html) . '\';';
return;
}
ob_start();
示例11: get_unread_messages
/**
* @param int $account_id
* @param bool $only_cached If true then only cached response will be retrieved
* @param int $cache_validity_in_minutes Provide 0 or false to force request
*
* @return array|null
* @throws Exception
*/
public static function get_unread_messages($account_id, $only_cached = false, $cache_validity_in_minutes = 3)
{
$return = null;
$rec = Utils_RecordBrowserCommon::get_record('rc_accounts', $account_id);
if ($rec['epesi_user'] !== Acl::get_user()) {
throw new Exception('Invalid account id');
}
$port = $rec['security'] == 'ssl' ? 993 : 143;
$server_str = '{' . $rec['server'] . '/imap/readonly/novalidate-cert' . ($rec['security'] ? '/' . $rec['security'] : '') . ':' . $port . '}';
$cache_key = md5($server_str . ' # ' . $rec['login'] . ' # ' . $rec['password']);
$cache = new FileCache(DATA_DIR . '/cache/roundcube_unread.php');
if ($cache_validity_in_minutes) {
$unread_messages = $cache->get($cache_key);
if ($unread_messages && ($only_cached || $unread_messages['t'] > time() - $cache_validity_in_minutes * 60)) {
$return = $unread_messages['val'];
}
}
if ($return === null && $only_cached === false) {
@set_time_limit(0);
$mailbox = @imap_open(imap_utf7_encode($server_str), imap_utf7_encode($rec['login']), imap_utf7_encode($rec['password']), OP_READONLY || OP_SILENT);
$err = imap_errors();
$unseen = array();
if (!$mailbox || $err) {
$err = __('Connection error') . ": " . implode(', ', $err);
} else {
$uns = @imap_search($mailbox, 'UNSEEN ALL');
if ($uns) {
$l = @imap_fetch_overview($mailbox, implode(',', $uns), 0);
$err = imap_errors();
if (!$l || $err) {
$error_info = $err ? ": " . implode(', ', $err) : "";
$err = __('Error reading messages overview') . $error_info;
} else {
foreach ($l as $msg) {
$from = isset($msg->from) ? imap_utf8($msg->from) : '<unknown>';
$subject = isset($msg->subject) ? imap_utf8($msg->subject) : '<no subject>';
$date = isset($msg->date) ? $msg->date : '';
$unseen[] = array('from' => $from, 'subject' => $subject, 'id' => $msg->uid, 'date' => $date, 'unix_timestamp' => $msg->udate);
}
}
}
}
if (!is_bool($mailbox)) {
imap_close($mailbox);
}
imap_errors();
// called just to clean up errors.
if ($err) {
throw new Exception($err);
} else {
$return = $unseen;
$cache->set($cache_key, array('val' => $return, 't' => time()));
}
}
return $return;
}
示例12: array
Utils_RecordBrowserCommon::new_record('rc_related', array('recordset' => $r['recordset']));
unset($old[$i]);
$old_checkpoint->set('old', $old);
}
$old_checkpoint->done();
}
Patch::set_message('Processing related');
$related_checkpoint = Patch::checkpoint('related');
if (!$related_checkpoint->is_done()) {
while (1) {
$related = $related_checkpoint->get('related', array());
if (empty($related)) {
$related = Utils_RecordBrowserCommon::get_records('rc_mails_assoc', array(), array(), array(), 10);
if (empty($related)) {
break;
}
}
foreach ($related as $i => $r) {
$related_checkpoint->require_time(5);
$mail = Utils_RecordBrowserCommon::get_record('rc_mails', $r['mail']);
$mail['related'][] = $r['recordset'] . '/' . $r['record_id'];
Utils_RecordBrowserCommon::update_record('rc_mails', $r['mail'], array('related' => $mail['related']));
Utils_RecordBrowserCommon::delete_record('rc_mails_assoc', $r['id']);
unset($related[$i]);
$related_checkpoint->set('related', $related);
}
}
$related_checkpoint->done();
}
Utils_RecordBrowserCommon::uninstall_recordset('rc_mails_assoc');
Utils_RecordBrowserCommon::delete_addon('rc_mails', CRM_Roundcube::module_name(), 'assoc_addon');
示例13: body
//.........这里部分代码省略.........
}
if (isset($filters['edit'])) {
if (!isset($filters['delete_restore'])) {
$e_where[] = ' ehd.field!=' . DB::qstr('id');
}
} else {
if (isset($filters['delete_restore'])) {
$e_where[] = ' ehd.field=' . DB::qstr('id');
}
}
if ($filters['start_date']) {
$date = DB::qstr(date('Y-m-d', strtotime($filters['start_date'])));
$af_where .= ' AND uaf.created_on >= ' . $date;
$c_where .= ($c_where ? ' AND' : '') . ' created_on >= ' . $date;
$e_where[] = ' edited_on >= ' . $date;
}
if ($filters['end_date']) {
$date = DB::qstr(date('Y-m-d 23:59:59', strtotime($filters['end_date'])));
$af_where .= ' AND uaf.created_on <= ' . $date;
$c_where .= ($c_where ? ' AND' : '') . ' created_on <= ' . $date;
$e_where[] = ' edited_on <= ' . $date;
}
if (!empty($e_where)) {
$e_where = ' WHERE' . implode(' AND', $e_where);
} else {
$e_where = '';
}
if ($c_where) {
$c_where = ' WHERE' . $c_where;
}
$postgre_cast_type = DB::is_postgresql() ? '::varchar' : '';
// **** files ****
if (isset($filters['file'])) {
$tables[] = 'SELECT uaf.id AS id,uaf.created_on AS edited_on,uaf.created_by AS edited_by, ual.local AS r_id, ' . DB::qstr('') . ' AS tab, ' . DB::qstr('file') . ' AS action FROM utils_attachment_file uaf INNER JOIN utils_attachment_data_1 ua ON uaf.attach_id=ua.id INNER JOIN utils_attachment_local ual ON ua.id=ual.attachment WHERE original!=' . DB::qstr('') . ' AND ' . $af_where;
}
// **** edit ****
if (isset($filters['edit']) || isset($filters['delete_restore'])) {
foreach ($rb_tabs as $k => $t) {
$tables[] = 'SELECT id, edited_on, edited_by, ' . $k . '_id' . $postgre_cast_type . ' as r_id, ' . DB::qstr($k) . ' as tab, ' . DB::qstr('edit') . ' as action FROM ' . $k . '_edit_history eh LEFT JOIN ' . $k . '_edit_history_data ehd ON ehd.edit_id=eh.id' . $e_where;
}
}
// **** create ****
if (isset($filters['new'])) {
foreach ($rb_tabs as $k => $t) {
$tables[] = 'SELECT 0 AS id, created_on AS edited_on, created_by AS edited_by, id' . $postgre_cast_type . ' as r_id, ' . DB::qstr($k) . ' as tab, ' . DB::qstr('create') . ' as action FROM ' . $k . '_data_1' . $c_where;
}
}
if (!empty($tables)) {
$tables = implode(' UNION ', $tables);
$limit = DB::GetOne('SELECT COUNT(*) FROM (' . $tables . ') AS tmp');
$limit = $gb->get_limit($limit);
$ret = DB::SelectLimit('SELECT * FROM (' . $tables . ') AS tmp ORDER BY edited_on DESC', $limit['numrows'], $limit['offset']);
while ($row = $ret->FetchRow()) {
$user = Base_UserCommon::get_user_label($row['edited_by']);
$action = '';
$link = '';
switch ($row['action']) {
case 'edit':
$details = DB::GetAssoc('SELECT field, old_value FROM ' . $row['tab'] . '_edit_history_data WHERE edit_id=%d', array($row['id']));
if (isset($details['id'])) {
$action = $details['id'] == 'DELETED' ? __('Deleted') : __('Restored');
} else {
$action = __('Edited');
$action = '<a ' . Utils_TooltipCommon::tooltip_leightbox_mode() . ' ' . Utils_TooltipCommon::ajax_open_tag_attrs(array('Utils_RecordBrowserCommon', 'get_edit_details_label'), array($row['tab'], $row['r_id'], $row['id']), 500) . '>' . $action . '</a>';
}
$r_id = $row['r_id'];
break;
case 'create':
$action = __('Created');
$r_id = $row['r_id'];
break;
case 'file':
$action = __('Attachment') . ': ';
$action .= $row['id'] == 0 ? __('New') : __('Updated');
$id = explode('/', $row['r_id']);
$row['tab'] = $id[0];
$r_id = $id[1];
break;
case 'note':
$action = __('Note') . ': ';
$action .= $row['id'] == 0 ? __('New') : __('Updated');
$id = explode('/', $row['r_id']);
$row['tab'] = $id[0];
$r_id = $id[1];
break;
}
if (!Utils_RecordBrowserCommon::get_access($row['tab'], 'view', Utils_RecordBrowserCommon::get_record($row['tab'], $r_id))) {
$link = __('Access restricted');
$action = strip_tags($action);
} else {
$link = Utils_TooltipCommon::create('<img src="' . Base_ThemeCommon::get_template_file('Utils_RecordBrowser', 'info.png') . '">', Utils_RecordBrowserCommon::get_html_record_info($row['tab'], $r_id), false);
$link .= ' ';
$link .= Utils_RecordBrowserCommon::create_default_linked_label($row['tab'], $r_id, false, false);
}
$gb->add_row(Base_RegionalSettingsCommon::time2reg($row['edited_on']), $user, $rb_tabs[$row['tab']], $link, $action);
}
}
Base_ThemeCommon::load_css('Utils_RecordBrowser', 'changes_list');
$this->display_module($gb);
}
示例14: die
*/
if (!isset($_POST['tab']) || !isset($_POST['id']) || !isset($_POST['cid'])) {
die('alert(\'Invalid request\')');
}
define('JS_OUTPUT', 1);
define('CID', $_POST['cid']);
define('READ_ONLY_SESSION', true);
require_once '../../../include.php';
ModuleManager::load_modules();
if (!Base_AclCommon::is_user()) {
die;
}
$id = $_POST['id'];
$tab = $_POST['tab'];
$now = $_POST['date'];
$created = Utils_RecordBrowserCommon::get_record($tab, $id, true);
$access = Utils_RecordBrowserCommon::get_access($tab, 'view', $created);
$created['created_by_login'] = Base_UserCommon::get_user_login($created['created_by']);
$field_hash = array();
$edited = DB::GetRow('SELECT ul.login, c.edited_on FROM ' . $tab . '_edit_history AS c LEFT JOIN user_login AS ul ON ul.id=c.edited_by WHERE c.' . $tab . '_id=%d ORDER BY edited_on DESC', array($id));
Utils_RecordBrowserCommon::init($tab);
$table_rows = Utils_RecordBrowserCommon::$table_rows;
foreach ($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 ' . $tab . '_edit_history AS c LEFT JOIN user_login AS ul ON ul.id=c.edited_by WHERE c.' . $tab . '_id=%d AND edited_on>%T ORDER BY edited_on DESC, id DESC', array($id, $now));
while ($row = $ret->FetchRow()) {
$changed = array();
$ret2 = DB::Execute('SELECT * FROM ' . $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']])) {
示例15: processing_related
public static function processing_related($values, $mode)
{
switch ($mode) {
case 'edit':
$rec = Utils_RecordBrowserCommon::get_record('task_related', $values['id']);
$rs = $rec['recordset'];
self::delete_addon($rs);
case 'add':
$rs = $values['recordset'];
self::new_addon($rs);
break;
case 'delete':
$rs = $values['recordset'];
self::delete_addon($rs);
break;
}
return $values;
}