本文整理汇总了PHP中Utils_RecordBrowserCommon::add_default_access方法的典型用法代码示例。如果您正苦于以下问题:PHP Utils_RecordBrowserCommon::add_default_access方法的具体用法?PHP Utils_RecordBrowserCommon::add_default_access怎么用?PHP Utils_RecordBrowserCommon::add_default_access使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utils_RecordBrowserCommon
的用法示例。
在下文中一共展示了Utils_RecordBrowserCommon::add_default_access方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: install
public function install()
{
Utils_CommonDataCommon::new_array('crm_assets_category', array(_M('Desktop'), _M('Server'), _M('Notebook'), _M('Monitor'), _M('Printer'), _M('Other')), true, true);
Utils_CommonDataCommon::new_id('crm_assets_monitor_type', true);
Utils_CommonDataCommon::new_array('crm_assets_monitor_type', array(_M('CRT'), _M('LCD'), _M('Other')));
Utils_CommonDataCommon::new_id('crm_assets_printer_type', true);
Utils_CommonDataCommon::new_array('crm_assets_printer_type', array(_M('Ink'), _M('Laser'), _M('Other')));
$fields = array(array('name' => _M('Asset ID'), 'type' => 'calculated', 'param' => Utils_RecordBrowserCommon::actual_db_type('text', 16), 'extra' => false, 'visible' => true, 'display_callback' => array('CRM_AssetsCommon', 'display_asset_id')), array('name' => _M('Active'), 'type' => 'checkbox', 'extra' => false, 'visible' => true, 'filter' => true), array('name' => _M('Category'), 'type' => 'commondata', 'param' => array('crm_assets_category'), 'extra' => false, 'visible' => true, 'filter' => true, 'required' => true, 'QFfield_callback' => array('CRM_AssetsCommon', 'QFfield_category')), array('name' => _M('Asset Name'), 'type' => 'text', 'param' => '128', 'extra' => false, 'visible' => true, 'required' => true), array('name' => _M('Asset Tag'), 'type' => 'text', 'param' => '128', 'extra' => false), array('name' => _M('Company'), 'type' => 'crm_company', 'extra' => false, 'visible' => true, 'param' => array('field_type' => 'select', 'crits' => array('CRM_AssetsCommon', 'company_crits')), 'filter' => true), array('name' => _M('Date Purchased'), 'type' => 'date', 'extra' => false), array('name' => _M('Serial Number'), 'type' => 'text', 'param' => '128', 'extra' => false), array('name' => _M('IP Address'), 'type' => 'text', 'param' => '128', 'extra' => false), array('name' => _M('General Info'), 'type' => 'calculated', 'extra' => false, 'visible' => true, 'display_callback' => array('CRM_AssetsCommon', 'display_info'), 'QFfield_callback' => array('CRM_AssetsCommon', 'QFfield_info')), array('name' => _M('Host Name'), 'type' => 'text', 'param' => '128', 'extra' => false), array('name' => _M('Operating System'), 'type' => 'text', 'param' => '128', 'extra' => false), array('name' => _M('Processor'), 'type' => 'text', 'param' => '128', 'extra' => false), array('name' => _M('RAM'), 'type' => 'text', 'param' => '128', 'extra' => false), array('name' => _M('HDD'), 'type' => 'text', 'param' => '128', 'extra' => false), array('name' => _M('Optical Devices'), 'type' => 'text', 'param' => '128', 'extra' => false), array('name' => _M('Audio'), 'type' => 'text', 'param' => '128', 'extra' => false), array('name' => _M('Software'), 'type' => 'long text', 'extra' => false), array('name' => _M('Display Type'), 'type' => 'commondata', 'extra' => false, 'param' => array('crm_assets_monitor_type')), array('name' => _M('Screen Size'), 'type' => 'text', 'param' => '128', 'extra' => false), array('name' => _M('Printer Type'), 'type' => 'commondata', 'extra' => false, 'param' => array('order_by_key' => true, 'crm_assets_printer_type')), array('name' => _M('Color Printing'), 'type' => 'checkbox', 'extra' => false));
Utils_RecordBrowserCommon::install_new_recordset('crm_assets', $fields);
Utils_RecordBrowserCommon::set_recent('crm_assets', 10);
Utils_RecordBrowserCommon::set_favorites('crm_assets', true);
Utils_RecordBrowserCommon::set_caption('crm_assets', _M('Assets'));
Utils_RecordBrowserCommon::set_quickjump('crm_assets', 'Asset Name');
Utils_RecordBrowserCommon::set_icon('crm_assets', Base_ThemeCommon::get_template_filename('CRM/Assets', 'icon.png'));
Utils_RecordBrowserCommon::register_processing_callback('crm_assets', array('CRM_AssetsCommon', 'process_request'));
Utils_RecordBrowserCommon::enable_watchdog('crm_assets', array('CRM_AssetsCommon', 'watchdog_label'));
Utils_RecordBrowserCommon::add_default_access('crm_assets');
Utils_RecordBrowserCommon::set_search('crm_assets', 2, 0);
Utils_RecordBrowserCommon::new_addon('company', 'CRM/Assets', 'assets_addon', _M('Assets'));
Utils_AttachmentCommon::new_addon('crm_assets');
Base_ThemeCommon::install_default_theme($this->get_type());
return true;
}
示例2: add_default_access
/**
* Add default permissions to recordset.
*/
public function add_default_access()
{
Utils_RecordBrowserCommon::add_default_access($this->tab);
}
示例3: edit_rset
public function edit_rset($id = null)
{
if ($this->is_back()) {
return false;
}
$form = $this->init_module(Libs_QuickForm::module_name());
$menu_deep = 3;
$form->addElement('header', null, $id ? __('Edit RecordSet properties') : __('Create new RecordSet'));
$form->addElement('text', 'tab', __('Table name'));
$form->addElement('text', 'caption', __('Caption'));
$m = array();
for ($i = 0; $i < $menu_deep; $i++) {
$m[] = $form->createElement('text', 'menu_' . $i, __('Menu'), array('placeholder' => __('Enter Menu or Submenu label')));
}
$form->addGroup($m, 'menu', __('Menu'));
$form->addElement('checkbox', 'recent', __('Enable Recent'));
$form->addElement('checkbox', 'favs', __('Enable Favorites'));
$form->addRule('tab', __('Field required'), 'required');
$form->addRule('caption', __('Field required'), 'required');
$form->addFormRule(array($this, 'check_form'));
if ($id !== null) {
$tab = DB::GetOne('SELECT tab FROM recordbrowser_custom_recordsets WHERE id=%d', array($id));
$menu = DB::GetOne('SELECT menu FROM recordbrowser_custom_recordsets WHERE id=%d', array($id));
$p = DB::getRow('SELECT * FROM recordbrowser_table_properties WHERE tab=%s', array($tab));
$form->setDefaults(array('tab' => $tab, 'caption' => $p['caption'], 'recent' => $p['recent'], 'favs' => $p['favorites']));
$menu = explode(Utils_RecordBrowser_CustomRecordsetsCommon::$sep, $menu);
foreach ($menu as $k => $v) {
$form->setDefaults(array('menu[menu_' . $k . ']' => $v));
}
$form->freeze('tab');
}
if ($form->validate()) {
$vals = $form->exportValues();
$menu = array();
for ($i = 0; $i < $menu_deep; $i++) {
if ($vals['menu']['menu_' . $i]) {
$menu[] = $vals['menu']['menu_' . $i];
}
}
if ($id === null) {
$vals['tab'] = strtolower($vals['tab']);
Utils_RecordBrowserCommon::install_new_recordset($vals['tab']);
Utils_RecordBrowserCommon::add_default_access($vals['tab']);
DB::Execute('INSERT INTO recordbrowser_custom_recordsets (active, tab, menu) VALUES (1, %s, %s)', array($vals['tab'], implode(Utils_RecordBrowser_CustomRecordsetsCommon::$sep, $menu)));
$tab = $vals['tab'];
} else {
DB::Execute('UPDATE recordbrowser_custom_recordsets SET menu=%s WHERE id=%d', array(implode(Utils_RecordBrowser_CustomRecordsetsCommon::$sep, $menu), $id));
}
Utils_RecordBrowserCommon::set_caption($tab, $vals['caption']);
Utils_RecordBrowserCommon::set_recent($tab, isset($vals['recent']) ? 15 : 0);
Utils_RecordBrowserCommon::set_favorites($tab, isset($vals['favs']) ? true : false);
return false;
}
$form->display_as_column();
Base_ActionBarCommon::add('back', __('Cancel'), $this->create_back_href());
Base_ActionBarCommon::add('save', __('Save'), $form->get_submit_form_href());
return true;
}
示例4: array
Custom_CADES_AccessRestrictionsCommon::add_default_cades_permissions('cades_vitalsigns');
Utils_RecordBrowserCommon::add_access('cades_incidents', 'view', array('ACCESS:employee', 'ACCESS:mrm'));
Utils_RecordBrowserCommon::add_access('cades_incidents', 'edit', array('ACCESS:employee', 'ACCESS:mrm'));
Utils_RecordBrowserCommon::add_access('cades_incidents', 'add', array('ACCESS:employee', 'ACCESS:mrm'));
Utils_RecordBrowserCommon::add_access('cades_incidents', 'delete', array('ACCESS:employee', 'ACCESS:mrm'));
$field = 'person';
Utils_RecordBrowserCommon::add_access('cades_incidents', 'view', 'ALL', array($field . '[view]' => 'USER', '(employees' => 'USER', '|employees' => ''));
Utils_RecordBrowserCommon::add_access('cades_incidents', 'view', 'ALL', array($field . '[view]' => 'USER'), array('employees', 'notes', 'description', 'witness', 'notified_party', 'action_taken'));
Utils_RecordBrowserCommon::add_access('cades_incidents', 'edit', 'ALL', array($field . '[edit]' => 'USER'), array($field));
Utils_RecordBrowserCommon::add_access('cades_incidents', 'add', 'ALL', array('(' . $field => '', '|' . $field . '[add]' => 'USER'));
Utils_RecordBrowserCommon::add_access('cades_incidents', 'delete', 'ALL', array($field . '[delete]' => 'USER'));
Utils_RecordBrowserCommon::add_default_access('cades_billing_authorization');
Utils_RecordBrowserCommon::add_default_access('cades_billing_auth_used');
Utils_RecordBrowserCommon::add_default_access('premium_schoolregister_att_except');
Utils_RecordBrowserCommon::add_default_access('cades_billing_auth_rejected');
Utils_RecordBrowserCommon::add_default_access('cades_billing_auth_bill');
DB::CreateIndex('prem_school_reg__idx_1', 'premium_schoolregister_lesson_data_1', 'f_date');
DB::CreateIndex('prem_school_reg__idx_2', 'premium_schoolregister_lesson_data_1', 'f_course');
DB::CreateIndex('prem_school_reg__idx_3', 'premium_schoolregister_lesson_data_1', 'f_custom_course');
DB::Execute('UPDATE contact_data_1 SET f_company_name=1, f_related_companies=NULL WHERE f_related_companies=%s AND f_company_name IS NULL', array('__1__'));
}
if (ModuleManager::is_installed('Premium_Warehouse_eCommerce') >= 0) {
DB::Execute('UPDATE premium_ecommerce_products_field SET type=%s WHERE field=%s OR field=%s', array(Variable::get('ecommerce_item_descriptions') ? 'calculated' : 'hidden', 'Product Name', 'Description'));
foreach (array('premium_ecommerce_products', 'premium_ecommerce_parameters', 'premium_ecommerce_parameter_groups', 'premium_ecommerce_pages', 'premium_ecommerce_polls', 'premium_ecommerce_boxes', 'premium_ecommerce_3rdp_info') as $t) {
DB::Execute('UPDATE ' . $t . '_field SET type=%s WHERE field=%s', array('hidden', 'Position'));
}
}
if (ModuleManager::is_installed('Premium_Warehouse_Items') >= 0) {
DB::Execute('UPDATE premium_warehouse_items_categories_field SET type=%s WHERE field=%s', array('hidden', 'Position'));
}
if (ModuleManager::is_installed('Premium_Warehouse_Items_Orders') >= 0) {