本文整理汇总了PHP中Utils_RecordBrowserCommon::list_installed_recordsets方法的典型用法代码示例。如果您正苦于以下问题:PHP Utils_RecordBrowserCommon::list_installed_recordsets方法的具体用法?PHP Utils_RecordBrowserCommon::list_installed_recordsets怎么用?PHP Utils_RecordBrowserCommon::list_installed_recordsets使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utils_RecordBrowserCommon
的用法示例。
在下文中一共展示了Utils_RecordBrowserCommon::list_installed_recordsets方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: admin
public function admin() {
if($this->is_back()) {
if($this->parent->get_type()=='Base_Admin')
$this->parent->reset();
else
location(array());
return;
}
Base_ActionBarCommon::add('back',__('Back'),$this->create_back_href());
$form = $this->init_module('Libs/QuickForm');
$opts = Utils_RecordBrowserCommon::list_installed_recordsets('%caption (%tab)');
asort($opts);
$first = array_keys($opts);
$first = reset($first);
$form->addElement('select', 'recordset', __('Recordset'), $opts, array('onchange'=>$form->get_submit_form_js()));
if ($form->validate()) {
$tab = $form->exportValue('recordset');
$this->set_module_variable('admin_browse_recordset', $tab);
}
$tab = $this->get_module_variable('admin_browse_recordset', $first);
$form->setDefaults(array('recordset'=>$tab));
$form->display_as_column();
if ($tab) {
$this->record_management($tab);
}
$custom_recordsets_module = 'Utils/RecordBrowser/CustomRecordsets';
if (ModuleManager::is_installed($custom_recordsets_module) >= 0) {
$href = $this->create_callback_href(array('Base_BoxCommon', 'push_module'), array($custom_recordsets_module, 'admin'));
Base_ActionBarCommon::add('settings', __('Custom Recordsets'), $href);
}
}
示例2: array
Patch::require_time(20);
if (DB::is_postgresql()) {
DB::Execute('ALTER TABLE recordbrowser_table_properties DROP CONSTRAINT recordbrowser_table_properties_pkey');
DB::Execute('ALTER TABLE recordbrowser_table_properties ADD COLUMN id SERIAL PRIMARY KEY');
} else {
DB::Execute('ALTER TABLE recordbrowser_table_properties DROP PRIMARY KEY');
DB::Execute('ALTER TABLE recordbrowser_table_properties ADD id SMALLINT NOT NULL AUTO_INCREMENT PRIMARY KEY');
}
DB::CreateIndex('recordbrowser_table_properties_tab', 'recordbrowser_table_properties', 'tab', array('UNIQUE' => 1));
$tab_ids_checkpoint->done();
}
}
$field_ids_checkpoint = Patch::checkpoint('field_ids');
if (!$field_ids_checkpoint->is_done()) {
Patch::require_time(20);
$recordsets = Utils_RecordBrowserCommon::list_installed_recordsets();
foreach ($recordsets as $tab => $caption) {
$tab_f = $tab . "_field";
$columns = DB::MetaColumnNames($tab_f);
if (!isset($columns['ID'])) {
if (DB::is_postgresql()) {
@DB::Execute('ALTER TABLE ' . $tab_f . ' DROP CONSTRAINT ' . $tab_f . '_pkey');
DB::Execute('ALTER TABLE ' . $tab_f . ' ADD COLUMN id SERIAL PRIMARY KEY');
} else {
@DB::Execute('ALTER TABLE ' . $tab_f . ' DROP PRIMARY KEY');
DB::Execute('ALTER TABLE ' . $tab_f . ' ADD id SMALLINT NOT NULL AUTO_INCREMENT PRIMARY KEY');
}
DB::CreateIndex($tab_f . '_field', $tab_f, 'field', array('UNIQUE' => 1));
}
}
$field_ids_checkpoint->done();
示例3: body
public function body($contact = null)
{
if (!Apps_ActivityReportCommon::has_access_to_report($contact)) {
return;
}
$fixed_user_id = $contact['login'];
$rb_tabs = Utils_RecordBrowserCommon::list_installed_recordsets();
asort($rb_tabs);
$form = $this->init_module(Libs_QuickForm::module_name());
if ($fixed_user_id == null) {
$users_count = DB::GetOne('SELECT COUNT(id) FROM user_login') > Base_User_SettingsCommon::get('Utils_RecordBrowser', 'enable_autocomplete');
if ($users_count) {
$crits = array('!login' => '');
$fcallback = array('CRM_ContactsCommon', 'contact_format_no_company');
$form->addElement('autoselect', 'user', __('User'), array(), array(array('CRM_ContactsCommon', 'autoselect_contact_suggestbox'), array($crits, $fcallback)), $fcallback);
} else {
$users = DB::GetAssoc('SELECT id, id FROM user_login');
foreach ($users as $k => $u) {
$users[$k] = Base_UserCommon::get_user_label($u, true);
}
asort($users);
$users = array('' => '[' . __('All') . ']') + $users;
$form->addElement('select', 'user', __('User'), $users);
}
}
$form->addElement('multiselect', 'recordsets', __('Record Type'), $rb_tabs);
$form->addElement('checkbox', 'new', __('New record'));
$form->addElement('checkbox', 'edit', __('Record edit'));
$form->addElement('checkbox', 'delete_restore', __('Record Delete/restore'));
$form->addElement('checkbox', 'file', __('Files'));
$form->addElement('datepicker', 'start_date', __('Start Date'));
$form->addElement('datepicker', 'end_date', __('End Date'));
if ($contact) {
$form->addElement('submit', 'submit', __('Show'));
} else {
Base_ActionBarCommon::add('search', __('Show'), $form->get_submit_form_href());
}
$filters = $this->get_module_variable('filters', array('user' => '', 'new' => 1, 'edit' => 1, 'delete_restore' => 1, 'recordsets' => array_keys($rb_tabs), 'start_date' => date('Y-m-01'), 'end_date' => date('Y-m-d')));
if ($form->validate()) {
$filters = $form->exportValues();
$this->set_module_variable('filters', $filters);
}
if ($fixed_user_id) {
$filters['user'] = $fixed_user_id;
}
$form->setDefaults($filters);
$theme = $this->init_module(Base_Theme::module_name());
$form->assign_theme('form', $theme);
$theme->display();
if ($fixed_user_id == null && $users_count) {
$filters['user'] = CRM_ContactsCommon::get_contact($filters['user']);
$filters['user'] = $filters['user']['login'];
}
$tables = array();
$recordsets = $filters['recordsets'];
$gb = $this->init_module(Utils_GenericBrowser::module_name(), null, 'activity_report');
$columns = array();
$columns[] = array('name' => __('Date'), 'width' => 40);
if (!$fixed_user_id) {
$columns[] = array('name' => __('User'), 'width' => 40);
}
$columns[] = array('name' => __('Type'), 'width' => 40);
$columns[] = array('name' => __('Label'));
$columns[] = array('name' => __('Actions taken'), 'width' => 40);
$gb->set_table_columns($columns);
$af_where = array();
foreach ($recordsets as $k) {
$af_where[] = 'ual.local ' . DB::like() . ' ' . DB::Concat(DB::qstr($k . '/'), DB::qstr('%'));
}
$af_where = count($af_where) ? ' (' . implode(' OR ', $af_where) . ')' : 'TRUE ';
$e_where = array();
$c_where = '';
if ($filters['user']) {
$e_where[] = ' edited_by = ' . $filters['user'];
$c_where = ' created_by = ' . $filters['user'];
$af_where .= ' AND uaf.created_by = ' . $filters['user'];
}
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);
//.........这里部分代码省略.........