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


PHP Utils_RecordBrowserCommon::add_access方法代码示例

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


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

示例1: install

	public function install() {
		
		$fields = array(
			array('name' => _M('Project Name'), 'type'=>'text', 'required'=>true, 'param'=>'64', 'extra'=>false, 'visible'=>true,'display_callback'=>array('Tests_BugtrackCommon', 'display_bugtrack')),	
			array('name' => _M('Company Name'), 'type'=>'select', 'required'=>true, 'param'=>array('company'=>'Company Name'), 'extra'=>false, 'visible'=>true),
			array('name' => _M('Due Date'), 'type'=>'date', 'required'=>true, 'param'=>64, 'extra'=>false, 'visible'=>true),
			array('name' => _M('Status'), 'type'=>'commondata', 'required'=>true, 'param'=>'Bugtrack_Status', 'extra'=>false,'visible'=>true),
			array('name' => _M('Description'), 'type'=>'long text', 'required'=>false, 'param'=>'64', 'extra'=>false)
		);
		Utils_RecordBrowserCommon::install_new_recordset('bugtrack', $fields);
		Utils_RecordBrowserCommon::new_filter('bugtrack', 'Company Name');
		Utils_RecordBrowserCommon::set_quickjump('bugtrack', 'Project Name');
		Utils_RecordBrowserCommon::set_favorites('bugtrack', true);
		Utils_RecordBrowserCommon::set_recent('bugtrack', 15);
		Utils_RecordBrowserCommon::set_caption('bugtrack', _M('Bugtrack'));
		Utils_RecordBrowserCommon::set_icon('bugtrack', Base_ThemeCommon::get_template_filename('Tests/Bugtrack', 'icon.png'));
		
// ************ addons ************** //
		Utils_AttachmentCommon::new_addon('bugtrack');
		Utils_RecordBrowserCommon::new_addon('company', 'Tests/Bugtrack', 'company_bugtrack_addon', 'Bugtrack');

// ************ other ************** //	
		Utils_CommonDataCommon::new_array('Bugtrack_Status',array('new'=>_M('New'),'inprog'=>_M('In Progress'),'cl'=>_M('Closed')),true,true);

		Utils_RecordBrowserCommon::add_access('bugtrack', 'view', 'ACCESS:employee');
		Utils_RecordBrowserCommon::add_access('bugtrack', 'add', 'ACCESS:employee');
		Utils_RecordBrowserCommon::add_access('bugtrack', 'edit', 'ACCESS:employee');
		Utils_RecordBrowserCommon::add_access('bugtrack', 'delete', array('ACCESS:employee', 'ACCESS:manager'));

		return true;
	}
开发者ID:62BRAINS,项目名称:EPESI,代码行数:31,代码来源:BugtrackInstall.php

示例2: install

 public function install()
 {
     Base_ThemeCommon::install_default_theme($this->get_type());
     $fields = array(array('name' => _M('Name'), 'type' => 'text', 'required' => true, 'param' => 16, 'extra' => false, 'visible' => true), array('name' => _M('Description'), 'type' => 'long text', 'required' => false, 'extra' => false), array('name' => _M('Percentage'), 'type' => 'float', 'required' => true, 'extra' => false, 'visible' => true));
     Utils_RecordBrowserCommon::install_new_recordset('data_tax_rates', $fields);
     Utils_RecordBrowserCommon::new_record('data_tax_rates', array('name' => 'Non-taxable', 'percentage' => 0));
     Utils_RecordBrowserCommon::set_caption('data_tax_rates', _M('Tax Rates'));
     Utils_RecordBrowserCommon::set_icon('data_tax_rates', Base_ThemeCommon::get_template_filename('Data/TaxRates', 'icon.png'));
     Utils_RecordBrowserCommon::add_access('data_tax_rates', 'view', 'ACCESS:employee');
     Utils_RecordBrowserCommon::add_access('data_tax_rates', 'add', array('ACCESS:employee', 'ACCESS:manager'));
     Utils_RecordBrowserCommon::add_access('data_tax_rates', 'edit', array('ACCESS:employee', 'ACCESS:manager'));
     Utils_RecordBrowserCommon::add_access('data_tax_rates', 'delete', array('ACCESS:employee', 'ACCESS:manager'));
     return true;
 }
开发者ID:62BRAINS,项目名称:EPESI,代码行数:14,代码来源:TaxRatesInstall.php

示例3: install

 public function install()
 {
     //addons table
     $fields = array(array('name' => _M('Recordset'), 'type' => 'text', 'param' => 64, 'display_callback' => array($this->get_type() . 'Common', 'display_recordset'), 'QFfield_callback' => array($this->get_type() . 'Common', 'QFfield_recordset'), 'required' => true, 'extra' => false, 'visible' => true));
     Utils_RecordBrowserCommon::install_new_recordset('phonecall_related', $fields);
     Utils_RecordBrowserCommon::set_caption('phonecall_related', _M('Phonecalls Related Recordsets'));
     Utils_RecordBrowserCommon::register_processing_callback('phonecall_related', array('CRM_PhoneCallCommon', 'processing_related'));
     Utils_RecordBrowserCommon::add_access('phonecall_related', 'view', 'ACCESS:employee');
     Utils_RecordBrowserCommon::add_access('phonecall_related', 'add', 'ADMIN');
     Utils_RecordBrowserCommon::add_access('phonecall_related', 'edit', 'SUPERADMIN');
     Utils_RecordBrowserCommon::add_access('phonecall_related', 'delete', 'SUPERADMIN');
     // ************ phone calls ************** //
     Base_ThemeCommon::install_default_theme(CRM_PhoneCallInstall::module_name());
     $fields = array(array('name' => _M('Subject'), 'type' => 'text', 'required' => true, 'param' => '64', 'extra' => false, 'visible' => true, 'display_callback' => array('CRM_PhoneCallCommon', 'display_subject')), array('name' => _M('Contact Name'), 'type' => 'hidden', 'extra' => false, 'visible' => true, 'display_callback' => array('CRM_PhoneCallCommon', 'display_contact_name')), array('name' => _M('Phone Number'), 'type' => 'hidden', 'extra' => false, 'visible' => true, 'display_callback' => array('CRM_PhoneCallCommon', 'display_phone_number')), array('name' => _M('Customer'), 'type' => 'crm_company_contact', 'param' => array('field_type' => 'select'), 'extra' => false), array('name' => _M('Other Customer'), 'type' => 'checkbox', 'extra' => false, 'QFfield_callback' => array('CRM_PhoneCallCommon', 'QFfield_other_contact')), array('name' => _M('Other Customer Name'), 'type' => 'text', 'param' => '64', 'extra' => false), array('name' => _M('Permission'), 'type' => 'commondata', 'required' => true, 'param' => array('order_by_key' => true, 'CRM/Access'), 'extra' => false), array('name' => _M('Employees'), 'type' => 'crm_contact', 'param' => array('field_type' => 'multiselect', 'crits' => array('CRM_PhoneCallCommon', 'employees_crits'), 'format' => array('CRM_ContactsCommon', 'contact_format_no_company')), 'required' => true, 'extra' => false, 'visible' => true, 'filter' => true), array('name' => _M('Status'), 'type' => 'commondata', 'required' => true, 'filter' => true, 'param' => array('order_by_key' => true, 'CRM/Status'), 'extra' => false, 'visible' => true, 'display_callback' => array('CRM_PhoneCallCommon', 'display_status')), array('name' => _M('Priority'), 'type' => 'commondata', 'required' => true, 'param' => array('order_by_key' => true, 'CRM/Priority'), 'extra' => false), array('name' => _M('Phone'), 'type' => 'integer', 'extra' => false, 'QFfield_callback' => array('CRM_PhoneCallCommon', 'QFfield_phone'), 'display_callback' => array('CRM_PhoneCallCommon', 'display_phone')), array('name' => _M('Other Phone'), 'type' => 'checkbox', 'extra' => false, 'QFfield_callback' => array('CRM_PhoneCallCommon', 'QFfield_other_phone')), array('name' => _M('Other Phone Number'), 'type' => 'text', 'param' => '64', 'extra' => false), array('name' => _M('Date and Time'), 'type' => 'timestamp', 'required' => true, 'extra' => false, 'visible' => true), array('name' => _M('Description'), 'type' => 'long text', 'required' => false, 'param' => '255', 'extra' => false), array('name' => _M('Related'), 'type' => 'multiselect', 'QFfield_callback' => array('CRM_PhoneCallCommon', 'QFfield_related'), 'param' => '__RECORDSETS__::;CRM_PhoneCallCommon::related_crits', 'extra' => false, 'required' => false, 'visible' => true));
     Utils_RecordBrowserCommon::install_new_recordset('phonecall', $fields);
     Utils_RecordBrowserCommon::set_tpl('phonecall', Base_ThemeCommon::get_template_filename(CRM_PhoneCallInstall::module_name(), 'default'));
     Utils_RecordBrowserCommon::register_processing_callback('phonecall', array('CRM_PhoneCallCommon', 'submit_phonecall'));
     Utils_RecordBrowserCommon::set_icon('phonecall', Base_ThemeCommon::get_template_filename(CRM_PhoneCallInstall::module_name(), 'icon.png'));
     Utils_RecordBrowserCommon::set_recent('phonecall', 5);
     Utils_RecordBrowserCommon::set_caption('phonecall', _M('Phonecalls'));
     Utils_RecordBrowserCommon::enable_watchdog('phonecall', array('CRM_PhoneCallCommon', 'watchdog_label'));
     Utils_RecordBrowserCommon::set_search('phonecall', 2, 0);
     // ************ addons ************** //
     Utils_AttachmentCommon::new_addon('phonecall');
     Utils_RecordBrowserCommon::new_addon('phonecall', CRM_PhoneCallInstall::module_name(), 'messanger_addon', _M('Alerts'));
     CRM_RoundcubeCommon::new_addon('phonecall');
     // ************ other ************** //
     CRM_CalendarCommon::new_event_handler(_M('Phonecalls'), array('CRM_PhoneCallCommon', 'crm_calendar_handler'));
     Utils_BBCodeCommon::new_bbcode('phone', 'CRM_PhoneCallCommon', 'phone_bbcode');
     if (ModuleManager::is_installed('Premium_SalesOpportunity') >= 0) {
         Utils_RecordBrowserCommon::new_record_field('phonecall', _M('Opportunity'), 'select', true, false, 'premium_salesopportunity::Opportunity Name;Premium_SalesOpportunityCommon::crm_opportunity_reference_crits', '', false);
     }
     Utils_RecordBrowserCommon::add_access('phonecall', 'view', 'ACCESS:employee', array('(!permission' => 2, '|employees' => 'USER'));
     Utils_RecordBrowserCommon::add_access('phonecall', 'add', 'ACCESS:employee');
     Utils_RecordBrowserCommon::add_access('phonecall', 'edit', 'ACCESS:employee', array('(permission' => 0, '|employees' => 'USER', '|customer' => 'USER'));
     Utils_RecordBrowserCommon::add_access('phonecall', 'delete', 'ACCESS:employee', array(':Created_by' => 'USER_ID'));
     Utils_RecordBrowserCommon::add_access('phonecall', 'delete', array('ACCESS:employee', 'ACCESS:manager'));
     return true;
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:39,代码来源:PhoneCallInstall.php

示例4: install

 public function install()
 {
     $ret = true;
     $recordsetName = "quick_search";
     $fields = array(array('name' => __('Preset name'), 'type' => 'text', 'param' => '255', 'visible' => true, 'required' => true), array('name' => __('Search prompt'), 'type' => 'text', 'param' => '255', 'visible' => true, 'required' => true), array('name' => __('Recordsets'), 'type' => 'long text', 'QFfield_callback' => array('Applets_QuickSearchCommon', 'QFfield_recordsets'), 'display_callback' => array('Applets_QuickSearchCommon', 'display_recordsets'), 'required' => true, 'extra' => false, 'visible' => true), array('name' => __('Select field to search'), 'type' => 'long text', 'QFfield_callback' => array('Applets_QuickSearchCommon', 'QFfield_recordfields'), 'display_callback' => array('Applets_QuickSearchCommon', 'display_recordfields'), 'required' => true, 'extra' => false, 'visible' => true), array('name' => __('Search Format'), 'type' => 'long text', 'param' => '255', 'required' => true, 'visible' => true), array('name' => __('Search field for identifier'), 'type' => 'long text', 'QFfield_callback' => array('Applets_QuickSearchCommon', 'QFfield_identifierfields'), 'display_callback' => array('Applets_QuickSearchCommon', 'display_identifierfields'), 'required' => true, 'extra' => false, 'visible' => true), array('name' => __('Result Format'), 'type' => 'long text', 'param' => '255', 'required' => true, 'visible' => true));
     Utils_RecordBrowserCommon::install_new_recordset($recordsetName, $fields);
     Utils_RecordBrowserCommon::set_caption($recordsetName, __('Quick Search'));
     Utils_RecordBrowserCommon::set_favorites($recordsetName, false);
     Utils_RecordBrowserCommon::register_processing_callback($recordsetName, array('Applets_QuickSearchCommon', 'parse_values'));
     //sets a default value on quick search data
     /* Utils_RecordBrowserCommon::new_record($recordsetName, array("preset_name" => "Test Value", "search_prompt" => "testholder",
     															"recordsets" => array("company[A]", "contact"), 
     															"select_field" => array("company:company_name[A]","company:short_name[A]","contact:last_name[A]","contact:first_name"),
     															"result_format"=> "[%company:company_name%] [%company:short_name%] [%contact:last_name%] [%contact:first_name%]"));
     		*/
     Utils_RecordBrowserCommon::add_access($recordsetName, 'view', 'ACCESS:employee', array('(!permission' => 2, '|employees' => 'USER'));
     Utils_RecordBrowserCommon::add_access($recordsetName, 'add', 'ACCESS:employee');
     Utils_RecordBrowserCommon::add_access($recordsetName, 'edit', 'ACCESS:employee', array('(permission' => 0, '|employees' => 'USER', '|customers' => 'USER'));
     Utils_RecordBrowserCommon::add_access($recordsetName, 'delete', 'ACCESS:employee', array(':Created_by' => 'USER_ID'));
     Utils_RecordBrowserCommon::add_access($recordsetName, 'delete', array('ACCESS:employee', 'ACCESS:manager'));
     //array('"~last_name'=>DB::Concat(DB::qstr('%'), DB::qstr('foo'), DB::qstr('%')))
     return $ret;
 }
开发者ID:62BRAINS,项目名称:EPESI,代码行数:23,代码来源:QuickSearchInstall.php

示例5: array

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) {
    Utils_RecordBrowserCommon::field_deny_access('premium_warehouse_items', 'Quantity on Hand', 'edit');
}
Utils_RecordBrowserCommon::add_access('premium_warehouse_items_orders', 'view', 'ACCESS:employee');
Utils_RecordBrowserCommon::add_access('premium_warehouse_items_orders', 'view', 'ALL', array('contact' => 'USER'));
Utils_RecordBrowserCommon::add_access('premium_warehouse_items_orders', 'view', array('ALL', 'ACCESS:manager'), array('company' => 'USER_COMPANY'));
Utils_RecordBrowserCommon::add_access('premium_warehouse_items_orders', 'add', 'ACCESS:employee', array(), array('transaction_type'));
Utils_RecordBrowserCommon::add_access('premium_warehouse_items_orders', 'edit', 'ACCESS:employee', array('employee' => 'USER', '(>=transaction_date' => '-1 week', '|<status' => 20), array('transaction_type', 'warehouse'));
Utils_RecordBrowserCommon::add_access('premium_warehouse_items_orders', 'edit', 'ACCESS:employee', array('employee' => 'USER', 'warehouse' => ''), array('transaction_type'));
Utils_RecordBrowserCommon::add_access('premium_warehouse_items_orders', 'edit', array('ACCESS:employee', 'ACCESS:manager'), array(), array('transaction_type', 'warehouse'));
Utils_RecordBrowserCommon::add_access('premium_warehouse_items_orders', 'delete', 'ACCESS:employee', array(':Created_by' => 'USER_ID'));
Utils_RecordBrowserCommon::add_access('premium_warehouse_items_orders', 'delete', array('ACCESS:employee', 'ACCESS:manager'));
Utils_RecordBrowserCommon::add_access('premium_warehouse_items_orders_details', 'view', 'ACCESS:employee');
Utils_RecordBrowserCommon::add_access('premium_warehouse_items_orders_details', 'view', 'ALL', array('transaction_id[contact]' => 'USER'));
Utils_RecordBrowserCommon::add_access('premium_warehouse_items_orders_details', 'view', array('ALL', 'ACCESS:manager'), array('transaction_id[company]' => 'USER_COMPANY'));
Utils_RecordBrowserCommon::add_access('premium_warehouse_items_orders_details', 'add', 'ACCESS:employee', array('transaction_id[employee]' => 'USER', '(>=transaction_id[transaction_date]' => '-1 week', '|<transaction_id[status]' => 20), array('transaction_id'));
Utils_RecordBrowserCommon::add_access('premium_warehouse_items_orders_details', 'add', array('ACCESS:employee', 'ACCESS:manager'), array(), array('transaction_id'));
Utils_RecordBrowserCommon::add_access('premium_warehouse_items_orders_details', 'edit', 'ACCESS:employee', array('transaction_id[employee]' => 'USER', '(>=transaction_id[transaction_date]' => '-1 week', '|<transaction_id[status]' => 20), array('transaction_id'));
Utils_RecordBrowserCommon::add_access('premium_warehouse_items_orders_details', 'edit', array('ACCESS:employee', 'ACCESS:manager'), array(), array('transaction_id'));
Utils_RecordBrowserCommon::add_access('premium_warehouse_items_orders_details', 'delete', 'ACCESS:employee', array(':Created_by' => 'USER_ID'));
Utils_RecordBrowserCommon::add_access('premium_warehouse_items_orders_details', 'delete', array('ACCESS:employee', 'ACCESS:manager'));
开发者ID:cretzu89,项目名称:EPESI,代码行数:30,代码来源:RB_permissions2.php

示例6: defined

<?php

defined("_VALID_ACCESS") || die('Direct access forbidden');
$tables = DB::GetAssoc('SELECT tab, tab FROM recordbrowser_table_properties');
foreach ($tables as $tab) {
    Utils_RecordBrowserCommon::add_access($tab, 'print', 'SUPERADMIN');
    Utils_RecordBrowserCommon::add_access($tab, 'export', 'SUPERADMIN');
}
开发者ID:cretzu89,项目名称:EPESI,代码行数:8,代码来源:20120813_print_permissions.php

示例7: edit_permissions_rule


//.........这里部分代码省略.........
					else {
						$current_or[$i] += $j;
						$j = 0;
						$i++;
					}
				} else {
					$first = false;
				}
				$sub_value = null;
				if (!isset($r[$k]) && $k[strlen($k)-1]==']') {
					$sub_value = $v;
					list($k, $v) = explode('[', trim($k, ']'));
				}
				$defaults['crits_'.$i.'_'.$j.'_field'] = $k;
				$defaults['crits_'.$i.'_'.$j.'_op'] = $operator;
				$js .= '$("crits_'.$i.'_'.$j.'_value").value = "'.$v.'";';
				if ($sub_value!==null) $sub_values['crits_'.$i.'_'.$j.'_sub_value'] = $sub_value;
			}
			$current_or[$i] += $j;
			$current_and += $i;
			
			$i = 0;
			$tmp = DB::GetAll('SELECT * FROM '.$this->tab.'_access_clearance AS acs WHERE rule_id=%d', array($id));
			foreach ($tmp as $t) {
				$defaults['clearance_'.$i] = $t['clearance'];
				$i++;
			}
			$current_clearance += $i-1;
			
			$tmp = DB::GetAll('SELECT * FROM '.$this->tab.'_access_fields AS acs WHERE rule_id=%d', array($id));
			foreach ($tmp as $t) {
				unset($defaults['field_'.$t['block_field']]);
			}
		}
		for ($i=0; $i<$counts['ands']; $i++)
			for ($j=0; $j<$counts['ors']; $j++)
				$js .= 'utils_recordbrowser__update_field_sub_values('.$i.', '.$j.');';
		foreach ($sub_values as $k=>$v)
			$js .= '$("'.$k.'").value = "'.$v.'";';

		$form->setDefaults($defaults);
		
		if ($form->validate()) {
			$vals = $form->exportValues();
			$action = $vals['action'];

			$clearance = array();
			for ($i=0; $i<$counts['clearance']; $i++)
				if ($vals['clearance_'.$i]) $clearance[] = $vals['clearance_'.$i];
			
			$crits = array();
			for ($i=0; $i<$counts['ands']; $i++) {
				$or = '(';
				for ($j=0; $j<$counts['ors']; $j++) {
					if ($vals['crits_'.$i.'_'.$j.'_field'] && $vals['crits_'.$i.'_'.$j.'_op']) {
						if (!isset($operators[$vals['crits_'.$i.'_'.$j.'_op']])) trigger_error('Fatal error',E_USER_ERROR);
						if (!isset($all_fields[$vals['crits_'.$i.'_'.$j.'_field']])) trigger_error('Fatal error',E_USER_ERROR);
						$op = $vals['crits_'.$i.'_'.$j.'_op'];
						if ($op=='=') $op = '';
						if (isset($vals['crits_'.$i.'_'.$j.'_sub_value'])) {
							$vals['crits_'.$i.'_'.$j.'_field'] = $vals['crits_'.$i.'_'.$j.'_field'].'['.$vals['crits_'.$i.'_'.$j.'_value'].']';
							$vals['crits_'.$i.'_'.$j.'_value'] = $vals['crits_'.$i.'_'.$j.'_sub_value'];
						}
						$next = array($or.$op.$vals['crits_'.$i.'_'.$j.'_field'] => $vals['crits_'.$i.'_'.$j.'_value']);
						$crits = Utils_RecordBrowserCommon::merge_crits($crits, $next);
					}
					$or = '|';
				}
			}

			$blocked_fields = array();
			foreach ($fields_permissions as $k=>$v) {
				if (isset($vals['field_'.$k])) continue;
				$blocked_fields[] = $k;
			}
			
			if ($id===null || $clone)
				Utils_RecordBrowserCommon::add_access($this->tab, $action, $clearance, $crits, $blocked_fields);
			else
				Utils_RecordBrowserCommon::update_access($this->tab, $id, $action, $clearance, $crits, $blocked_fields);
			return false;
		}
		
		eval_js($js);

		eval_js('utils_recordbrowser__init_clearance('.$current_clearance.', '.$counts['clearance'].')');
		eval_js('utils_recordbrowser__init_crits_and('.$current_and.', '.$counts['ands'].')');
		for ($i=0; $i<$counts['ands']; $i++)
				eval_js('utils_recordbrowser__init_crits_or('.$i.', '.$current_or[$i].', '.$counts['ors'].')');
		eval_js('utils_recordbrowser__crits_initialized = true;');
		
		$form->assign_theme('form', $theme);
		$theme->assign('fields', $fields_permissions);
		$theme->assign('counts', $counts);
		
		$theme->display('edit_permissions');
		Base_ActionBarCommon::add('save', __('Save'), $form->get_submit_form_href());
		Base_ActionBarCommon::add('delete', __('Cancel'), $this->create_back_href());
		return true;
	}
开发者ID:62BRAINS,项目名称:EPESI,代码行数:101,代码来源:RecordBrowser_0.php

示例8: defined

<?php

defined("_VALID_ACCESS") || die('Direct access forbidden');
//addons table
$fields = array(array('name' => _M('Recordset'), 'type' => 'text', 'param' => 64, 'display_callback' => array('CRM_TasksCommon', 'display_recordset'), 'QFfield_callback' => array('CRM_TasksCommon', 'QFfield_recordset'), 'required' => true, 'extra' => false, 'visible' => true));
Utils_RecordBrowserCommon::install_new_recordset('task_related', $fields);
Utils_RecordBrowserCommon::set_caption('task_related', _M('Meeting Related Recordsets'));
Utils_RecordBrowserCommon::register_processing_callback('task_related', array('CRM_TasksCommon', 'processing_related'));
Utils_RecordBrowserCommon::add_access('task_related', 'view', 'ACCESS:employee');
Utils_RecordBrowserCommon::add_access('task_related', 'add', 'ADMIN');
Utils_RecordBrowserCommon::add_access('task_related', 'edit', 'SUPERADMIN');
Utils_RecordBrowserCommon::add_access('task_related', 'delete', 'SUPERADMIN');
Utils_RecordBrowserCommon::new_record_field('task', array('name' => _M('Related'), 'type' => 'multiselect', 'param' => '__RECORDSETS__::;CRM_TasksCommon::related_crits', 'QFfield_callback' => array('CRM_TasksCommon', 'QFfield_related'), 'extra' => false, 'required' => false, 'visible' => true));
开发者ID:cretzu89,项目名称:EPESI,代码行数:13,代码来源:20141218_related.php

示例9: add_access

 public function add_access($action, $clearance, $crits = array(), $blocked_fields = array())
 {
     return Utils_RecordBrowserCommon::add_access($this->tab, $action, $clearance, $crits, $blocked_fields);
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:4,代码来源:Recordset.php

示例10: defined

<?php

defined("_VALID_ACCESS") || die('Direct access forbidden');
if (DB::GetOne('SELECT 1 FROM utils_attachment_field WHERE field=%s', array('Date'))) {
    Utils_RecordBrowserCommon::new_record_field('utils_attachment', array('name' => _M('Edited on'), 'type' => 'timestamp', 'extra' => false, 'visible' => true, 'required' => false, 'display_callback' => array('Utils_AttachmentCommon', 'display_date'), 'QFfield_callback' => array('Utils_AttachmentCommon', 'QFfield_date'), 'position' => 'Date'));
    DB::Execute('UPDATE utils_attachment_data_1 SET f_edited_on=f_date');
    Utils_RecordBrowserCommon::delete_record_field('utils_attachment', 'Date');
    Utils_RecordBrowserCommon::wipe_access('utils_attachment');
    Utils_RecordBrowserCommon::add_access('utils_attachment', 'view', 'ACCESS:employee', array('(!permission' => 2, '|:Created_by' => 'USER_ID'));
    Utils_RecordBrowserCommon::add_access('utils_attachment', 'delete', 'ACCESS:employee', array(':Created_by' => 'USER_ID'));
    Utils_RecordBrowserCommon::add_access('utils_attachment', 'delete', array('ACCESS:employee', 'ACCESS:manager'));
    Utils_RecordBrowserCommon::add_access('utils_attachment', 'add', 'ACCESS:employee', array(), array('edited_on'));
    Utils_RecordBrowserCommon::add_access('utils_attachment', 'edit', 'ACCESS:employee', array('(permission' => 0, '|:Created_by' => 'USER_ID'), array('edited_on'));
}
开发者ID:cretzu89,项目名称:EPESI,代码行数:14,代码来源:20140621_date_to_timestamp.php

示例11: add_default_access

 public static function add_default_access($tab)
 {
     Utils_RecordBrowserCommon::add_access($tab, 'view', 'ACCESS:employee');
     Utils_RecordBrowserCommon::add_access($tab, 'add', 'ACCESS:employee');
     Utils_RecordBrowserCommon::add_access($tab, 'edit', 'ACCESS:employee');
     Utils_RecordBrowserCommon::add_access($tab, 'delete', 'ACCESS:employee');
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:7,代码来源:RecordBrowserCommon_0.php

示例12: install

 public function install()
 {
     $this->create_data_dir();
     // create htaccess to prevent logs to be available on the internet
     $htaccess = $this->get_data_dir() . '.htaccess';
     $f = fopen($htaccess, 'w');
     if ($f === false) {
         print "Cannot create .htaccess file ({$htaccess}). " . "Your Roundcube logs may be available on the internet!";
     } else {
         fwrite($f, "deny from all\n");
         fclose($f);
     }
     Base_ThemeCommon::install_default_theme($this->get_type());
     $this->drop_all_rc_tables();
     if (DB::is_mysql()) {
         $f = file_get_contents('modules/CRM/Roundcube/RC/SQL/mysql.initial.sql');
     } else {
         $f = file_get_contents('modules/CRM/Roundcube/RC/SQL/postgres.initial.sql');
     }
     foreach (explode(';', $f) as $q) {
         $q = trim($q);
         if (!$q) {
             continue;
         }
         DB::Execute($q);
     }
     Utils_CommonDataCommon::new_array('CRM/Roundcube/Security', array('tls' => _M('TLS'), 'ssl' => _M('SSL')), true, true);
     //addons table
     $fields = array(array('name' => _M('Recordset'), 'type' => 'text', 'param' => 64, 'display_callback' => array($this->get_type() . 'Common', 'display_recordset'), 'QFfield_callback' => array($this->get_type() . 'Common', 'QFfield_recordset'), 'required' => true, 'extra' => false, 'visible' => true));
     Utils_RecordBrowserCommon::install_new_recordset('rc_related', $fields);
     Utils_RecordBrowserCommon::set_caption('rc_related', _M('Mail Related Recordsets'));
     Utils_RecordBrowserCommon::register_processing_callback('rc_related', array('CRM_RoundcubeCommon', 'processing_related'));
     Utils_RecordBrowserCommon::add_access('rc_related', 'view', 'ACCESS:employee');
     Utils_RecordBrowserCommon::add_access('rc_related', 'add', 'ADMIN');
     Utils_RecordBrowserCommon::add_access('rc_related', 'edit', 'SUPERADMIN');
     Utils_RecordBrowserCommon::add_access('rc_related', 'delete', 'SUPERADMIN');
     Utils_RecordBrowserCommon::new_record('rc_related', array('recordset' => 'company'));
     Utils_RecordBrowserCommon::new_record('rc_related', array('recordset' => 'contact'));
     //accounts table
     $fields = array(array('name' => _M('EPESI User'), 'type' => 'integer', 'extra' => false, 'visible' => true, 'required' => true, 'display_callback' => array('CRM_RoundcubeCommon', 'display_epesi_user'), 'QFfield_callback' => array('CRM_RoundcubeCommon', 'QFfield_epesi_user')), array('name' => _M('Email'), 'type' => 'text', 'extra' => false, 'visible' => true, 'required' => true, 'param' => 128), array('name' => _M('Account Name'), 'type' => 'text', 'extra' => false, 'visible' => true, 'required' => true, 'param' => 32, 'QFfield_callback' => array('CRM_RoundcubeCommon', 'QFfield_account_name')), array('name' => _M('Server'), 'type' => 'text', 'extra' => false, 'visible' => true, 'param' => '255', 'required' => true), array('name' => _M('Login'), 'type' => 'text', 'required' => true, 'param' => '255', 'extra' => false, 'visible' => true), array('name' => _M('Password'), 'type' => 'text', 'required' => true, 'extra' => false, 'param' => '255', 'visible' => false, 'QFfield_callback' => array('CRM_RoundcubeCommon', 'QFfield_password'), 'display_callback' => array('CRM_RoundcubeCommon', 'display_password')), array('name' => _M('Security'), 'type' => 'commondata', 'param' => array('CRM/Roundcube/Security'), 'extra' => false, 'visible' => false, 'QFfield_callback' => array('CRM_RoundcubeCommon', 'QFfield_security')), array('name' => _M('SMTP Server'), 'type' => 'text', 'extra' => false, 'visible' => false, 'param' => '255', 'required' => true), array('name' => _M('SMTP Auth'), 'type' => 'checkbox', 'extra' => false, 'visible' => false, 'QFfield_callback' => array('CRM_RoundcubeCommon', 'QFfield_smtp_auth')), array('name' => _M('SMTP Login'), 'type' => 'text', 'required' => false, 'param' => '255', 'extra' => false, 'visible' => false, 'QFfield_callback' => array('CRM_RoundcubeCommon', 'QFfield_smtp_login')), array('name' => _M('SMTP Password'), 'type' => 'text', 'extra' => false, 'param' => '255', 'visible' => false, 'QFfield_callback' => array('CRM_RoundcubeCommon', 'QFfield_smtp_password'), 'display_callback' => array('CRM_RoundcubeCommon', 'display_password')), array('name' => _M('SMTP Security'), 'type' => 'commondata', 'param' => array('CRM/Roundcube/Security'), 'extra' => false, 'visible' => false, 'QFfield_callback' => array('CRM_RoundcubeCommon', 'QFfield_smtp_security')), array('name' => _M('Default Account'), 'type' => 'checkbox', 'extra' => false, 'visible' => true, 'QFfield_callback' => array('CRM_RoundcubeCommon', 'QFfield_default_account')), array('name' => _M('Advanced'), 'type' => 'page_split'), array('name' => _M('Archive on sending'), 'type' => 'checkbox', 'extra' => true, 'visible' => false), array('name' => _M('Use EPESI Archive directories'), 'type' => 'checkbox', 'extra' => true, 'visible' => false), array('name' => _M('IMAP Root'), 'type' => 'text', 'param' => 32, 'extra' => true, 'visible' => false), array('name' => _M('IMAP Delimiter'), 'type' => 'text', 'param' => 8, 'extra' => true, 'visible' => false));
     Utils_RecordBrowserCommon::install_new_recordset('rc_accounts', $fields);
     Utils_RecordBrowserCommon::set_caption('rc_accounts', _M('Mail accounts'));
     Utils_RecordBrowserCommon::register_processing_callback('rc_accounts', array('CRM_RoundcubeCommon', 'submit_account'));
     $fields = array(array('name' => _M('Subject'), 'type' => 'text', 'param' => '256', 'extra' => false, 'visible' => true, 'required' => false, 'display_callback' => array('CRM_RoundcubeCommon', 'display_subject')), array('name' => _M('Count'), 'type' => 'calculated', 'extra' => false, 'visible' => true, 'required' => false, 'display_callback' => array('CRM_RoundcubeCommon', 'display_thread_count'), 'QFfield_callback' => array('CRM_RoundcubeCommon', 'QFfield_thread_count')), array('name' => _M('Contacts'), 'type' => 'crm_company_contact', 'param' => array('field_type' => 'multiselect'), 'required' => false, 'extra' => false, 'visible' => true), array('name' => _M('First Date'), 'type' => 'timestamp', 'extra' => false, 'visible' => true, 'required' => false), array('name' => _M('Last Date'), 'type' => 'timestamp', 'extra' => false, 'visible' => true, 'required' => false), array('name' => _M('Attachments'), 'type' => 'calculated', 'extra' => false, 'visible' => true, 'display_callback' => array('CRM_RoundcubeCommon', 'display_thread_attachments'), 'QFfield_callback' => array('CRM_RoundcubeCommon', 'QFfield_thread_attachments')));
     Utils_RecordBrowserCommon::install_new_recordset('rc_mail_threads', $fields);
     Utils_RecordBrowserCommon::set_caption('rc_mail_threads', _M('Mail Thread'));
     Utils_RecordBrowserCommon::new_addon('rc_mail_threads', 'CRM/Roundcube', 'thread_addon', _M('E-mails'));
     Utils_RecordBrowserCommon::set_search('rc_mail_threads', 2, -1);
     $fields = array(array('name' => _M('Subject'), 'type' => 'text', 'param' => '256', 'extra' => false, 'visible' => true, 'required' => false, 'display_callback' => array('CRM_RoundcubeCommon', 'display_subject')), array('name' => _M('Contacts'), 'type' => 'crm_company_contact', 'param' => array('field_type' => 'multiselect'), 'required' => false, 'extra' => false, 'visible' => true), array('name' => _M('Employee'), 'type' => 'crm_contact', 'param' => array('field_type' => 'select'), 'extra' => false, 'visible' => true, 'required' => false), array('name' => _M('Related'), 'type' => 'multiselect', 'QFfield_callback' => array('CRM_RoundcubeCommon', 'QFfield_related'), 'param' => '__RECORDSETS__::;CRM_RoundcubeCommon::related_crits', 'extra' => false, 'required' => false, 'visible' => true), array('name' => _M('Date'), 'type' => 'timestamp', 'extra' => false, 'visible' => true, 'required' => false), array('name' => _M('Attachments'), 'type' => 'calculated', 'extra' => false, 'visible' => true, 'display_callback' => array('CRM_RoundcubeCommon', 'display_attachments'), 'QFfield_callback' => array('CRM_RoundcubeCommon', 'QFfield_attachments')), array('name' => _M('Headers Data'), 'type' => 'long text', 'extra' => false, 'visible' => false, 'required' => false), array('name' => _M('Body'), 'type' => 'long text', 'extra' => false, 'visible' => false, 'required' => false, 'QFfield_callback' => array('CRM_RoundcubeCommon', 'QFfield_body')), array('name' => _M('From'), 'type' => 'text', 'param' => 128, 'extra' => false, 'visible' => false, 'required' => false), array('name' => _M('To'), 'type' => 'text', 'param' => 4096, 'extra' => false, 'visible' => false, 'required' => false), array('name' => _M('Thread'), 'type' => 'select', 'param' => 'rc_mail_threads::Count', 'extra' => false, 'visible' => false, 'required' => false, 'display_callback' => array('CRM_RoundcubeCommon', 'display_mail_thread'), 'QFfield_callback' => array('CRM_RoundcubeCommon', 'QFfield_mail_thread')), array('name' => _M('Message ID'), 'type' => 'text', 'param' => 128, 'extra' => false, 'visible' => false, 'required' => false, 'QFfield_callback' => array('CRM_RoundcubeCommon', 'QFfield_hidden')), array('name' => _M('References'), 'type' => 'text', 'param' => 4096 * 4, 'extra' => false, 'visible' => false, 'required' => false, 'QFfield_callback' => array('CRM_RoundcubeCommon', 'QFfield_hidden')));
     Utils_RecordBrowserCommon::install_new_recordset('rc_mails', $fields);
     Utils_RecordBrowserCommon::set_caption('rc_mails', _M('Mails'));
     Utils_RecordBrowserCommon::set_tpl('rc_mails', Base_ThemeCommon::get_template_filename('CRM/Roundcube', 'mails'));
     Utils_RecordBrowserCommon::register_processing_callback('rc_mails', array('CRM_RoundcubeCommon', 'submit_mail'));
     Utils_RecordBrowserCommon::set_search('rc_mails', 2, -1);
     DB::CreateIndex('rc_mails_thread_idx', 'rc_mails_data_1', 'f_thread');
     DB::CreateIndex('rc_mails_msgid_idx', 'rc_mails_data_1', 'f_message_id');
     Utils_RecordBrowserCommon::new_addon('rc_mails', 'CRM/Roundcube', 'mail_body_addon', _M('Body'));
     Utils_RecordBrowserCommon::new_addon('rc_mails', 'CRM/Roundcube', 'attachments_addon', _M('Attachments'));
     Utils_RecordBrowserCommon::new_addon('rc_mails', 'CRM/Roundcube', 'mail_headers_addon', _M('Headers'));
     @DB::DropTable('rc_mails_attachments');
     DB::CreateTable('rc_mails_attachments', '
         mail_id I4 NOTNULL,
         type C(32),
         name C(255),
         mime_id C(32),
         attachment I1 DEFAULT 1', array('constraints' => ', FOREIGN KEY (mail_id) REFERENCES rc_mails_data_1(ID)'));
     DB::CreateTable('rc_mails_attachments_download', '
         mail_id I4 NOTNULL,
         hash C(32),
         created_on T DEFTIMESTAMP', array('constraints' => ', FOREIGN KEY (mail_id) REFERENCES rc_mails_data_1(ID)'));
     Utils_RecordBrowserCommon::new_addon('contact', 'CRM/Roundcube', 'addon', _M('E-mails'));
     Utils_RecordBrowserCommon::new_addon('company', 'CRM/Roundcube', 'addon', _M('E-mails'));
     $fields = array(array('name' => _M('Record Type'), 'type' => 'hidden', 'param' => Utils_RecordBrowserCommon::actual_db_type('text', 64), 'required' => false, 'visible' => false, 'filter' => true, 'extra' => false), array('name' => _M('Record ID'), 'type' => 'hidden', 'param' => Utils_RecordBrowserCommon::actual_db_type('integer'), 'filter' => false, 'required' => false, 'extra' => false, 'visible' => false), array('name' => _M('Nickname'), 'type' => 'text', 'required' => true, 'param' => '64', 'extra' => false, 'visible' => true, 'QFfield_callback' => array('CRM_RoundcubeCommon', 'QFfield_nickname')), array('name' => _M('Email'), 'type' => 'email', 'required' => true, 'param' => array('unique' => true), 'extra' => false, 'visible' => true));
     Utils_RecordBrowserCommon::install_new_recordset('rc_multiple_emails', $fields);
     Utils_RecordBrowserCommon::set_favorites('rc_multiple_emails', true);
     Utils_RecordBrowserCommon::set_caption('rc_multiple_emails', _M('Mail addresses'));
     Utils_RecordBrowserCommon::set_icon('rc_multiple_emails', Base_ThemeCommon::get_template_filename('CRM/Roundcube', 'icon.png'));
     Utils_RecordBrowserCommon::set_search('rc_multiple_emails', 2, 0);
     Utils_RecordBrowserCommon::new_addon('contact', 'CRM/Roundcube', 'mail_addresses_addon', _M('E-mail addresses'));
     Utils_RecordBrowserCommon::new_addon('company', 'CRM/Roundcube', 'mail_addresses_addon', _M('E-mail addresses'));
     Variable::set('crm_roundcube_global_signature', "Message sent with EPESI - managing business your way!<br /><a href=\"http://epe.si\">http://epe.si</a>");
     Utils_RecordBrowserCommon::add_access('rc_accounts', 'view', 'ACCESS:employee', array('epesi_user' => 'USER_ID'));
     Utils_RecordBrowserCommon::add_access('rc_accounts', 'add', 'ACCESS:employee');
     Utils_RecordBrowserCommon::add_access('rc_accounts', 'edit', 'ACCESS:employee', array(), array('epesi_user'));
     Utils_RecordBrowserCommon::add_access('rc_accounts', 'delete', 'ACCESS:employee', array('epesi_user' => 'USER_ID'));
     Utils_RecordBrowserCommon::add_access('rc_mails', 'view', 'ACCESS:employee', array(), array('headers_data'));
     Utils_RecordBrowserCommon::add_access('rc_mails', 'delete', 'ACCESS:employee');
     Utils_RecordBrowserCommon::add_access('rc_mails', 'edit', 'ACCESS:employee', array(), array('subject', 'employee', 'date', 'headers_data', 'body', 'from', 'to', 'thread', 'message_id', 'references'));
     Utils_RecordBrowserCommon::add_access('rc_mail_threads', 'view', 'ACCESS:employee');
     Utils_RecordBrowserCommon::add_access('rc_mail_threads', 'delete', 'ACCESS:employee');
     Utils_RecordBrowserCommon::add_access('rc_multiple_emails', 'view', 'ACCESS:employee');
     Utils_RecordBrowserCommon::add_access('rc_multiple_emails', 'add', 'ACCESS:employee');
     Utils_RecordBrowserCommon::add_access('rc_multiple_emails', 'edit', 'ACCESS:employee');
     Utils_RecordBrowserCommon::add_access('rc_multiple_emails', 'delete', 'ACCESS:employee');
     return true;
 }
开发者ID:62BRAINS,项目名称:EPESI,代码行数:96,代码来源:RoundcubeInstall.php

示例13: defined

<?php

defined("_VALID_ACCESS") || die('Direct access forbidden');
//addons table
$fields = array(array('name' => _M('Recordset'), 'type' => 'text', 'param' => 64, 'display_callback' => array('CRM_PhoneCallCommon', 'display_recordset'), 'QFfield_callback' => array('CRM_PhoneCallCommon', 'QFfield_recordset'), 'required' => true, 'extra' => false, 'visible' => true));
Utils_RecordBrowserCommon::install_new_recordset('phonecall_related', $fields);
Utils_RecordBrowserCommon::set_caption('phonecall_related', _M('Meeting Related Recordsets'));
Utils_RecordBrowserCommon::register_processing_callback('phonecall_related', array('CRM_PhoneCallCommon', 'processing_related'));
Utils_RecordBrowserCommon::add_access('phonecall_related', 'view', 'ACCESS:employee');
Utils_RecordBrowserCommon::add_access('phonecall_related', 'add', 'ADMIN');
Utils_RecordBrowserCommon::add_access('phonecall_related', 'edit', 'SUPERADMIN');
Utils_RecordBrowserCommon::add_access('phonecall_related', 'delete', 'SUPERADMIN');
Utils_RecordBrowserCommon::new_record_field('phonecall', array('name' => _M('Related'), 'type' => 'multiselect', 'param' => '__RECORDSETS__::;CRM_PhoneCallCommon::related_crits', 'QFfield_callback' => array('CRM_PhoneCallCommon', 'QFfield_related'), 'extra' => false, 'required' => false, 'visible' => true));
$rel = Utils_RecordBrowserCommon::get_records('phonecall', array('!related_to' => ''));
foreach ($rel as $r) {
    $rr = array();
    foreach ($r['related_to'] as $id) {
        $rr[] = 'contact/' . $id;
    }
    Utils_RecordBrowserCommon::update_record('phonecall', $r['id'], array('related' => $rr), false, null, true);
}
Utils_RecordBrowserCommon::delete_record_field('phonecall', 'Related to');
开发者ID:cretzu89,项目名称:EPESI,代码行数:22,代码来源:20141218_related.php

示例14: prepare_permissions

 function prepare_permissions()
 {
     $fields = array('autonumber', 'text_required', 'text', 'long_text_required', 'long_text', 'integer_required', 'integer', 'float_required', 'float', 'checkbox', 'calculated', 'currency_required', 'currency', 'date_required', 'date', 'timestamp_required', 'timestamp', 'time_required', 'time', 'select_required', 'select', 'select_commondata_required', 'select_commondata', 'multiselect_required', 'multiselect', 'multiselect_commondata_required', 'multiselect_commondata');
     //view
     Utils_RecordBrowserCommon::add_access('tests_record_set', 'view', 'ADMIN', array('permission' => 1), $fields);
     Utils_RecordBrowserCommon::add_access('tests_record_set', 'view', 'ADMIN', array('>permission' => 1));
     //edit
     Utils_RecordBrowserCommon::add_access('tests_record_set', 'edit', 'ADMIN', array('permission' => 3), $fields);
     Utils_RecordBrowserCommon::add_access('tests_record_set', 'edit', 'ADMIN', array('>permission' => 3));
     //delete
     Utils_RecordBrowserCommon::add_access('tests_record_set', 'delete', 'ADMIN', array('permission' => 5));
     Utils_RecordBrowserCommon::add_access('tests_record_set', 'add', 'ADMIN');
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:13,代码来源:RecordBrowserInstall.php

示例15: defined

defined("_VALID_ACCESS") || die('Direct access forbidden');
@ini_set('memory_limit', '256M');
@ini_set('memory_limit', '512M');
Utils_WatchdogCommon::dont_notify();
$rs_checkpoint = Patch::checkpoint('recordset');
if (!$rs_checkpoint->is_done()) {
    Patch::require_time(5);
    Utils_RecordBrowserCommon::uninstall_recordset('utils_attachment');
    $fields = array(array('name' => _M('Edited on'), 'type' => 'timestamp', 'extra' => false, 'visible' => true, 'required' => false, 'display_callback' => array('Utils_AttachmentCommon', 'display_date'), 'QFfield_callback' => array('Utils_AttachmentCommon', 'QFfield_date')), array('name' => _M('Title'), 'type' => 'text', 'param' => 255, 'required' => false, 'extra' => false, 'visible' => true), array('name' => _M('Note'), 'type' => 'long text', 'required' => false, 'extra' => false, 'visible' => true, 'display_callback' => array('Utils_AttachmentCommon', 'display_note'), 'QFfield_callback' => array('Utils_AttachmentCommon', 'QFfield_note')), array('name' => _M('Permission'), 'type' => 'commondata', 'required' => true, 'param' => array('order_by_key' => true, 'CRM/Access'), 'extra' => false), array('name' => _M('Sticky'), 'type' => 'checkbox', 'visible' => true, 'extra' => false), array('name' => _M('Crypted'), 'type' => 'checkbox', 'extra' => false, 'QFfield_callback' => array('Utils_AttachmentCommon', 'QFfield_crypted')), array('name' => _M('Func'), 'type' => 'text', 'param' => 255, 'required' => true, 'extra' => false, 'visible' => false), array('name' => _M('Args'), 'type' => 'text', 'param' => 255, 'required' => true, 'extra' => false, 'visible' => false));
    Utils_RecordBrowserCommon::install_new_recordset('utils_attachment', $fields);
    Utils_RecordBrowserCommon::add_access('utils_attachment', 'view', 'ACCESS:employee', array('(!permission' => 2, '|employees' => 'USER'), array('func', 'args'));
    Utils_RecordBrowserCommon::add_access('utils_attachment', 'delete', 'ACCESS:employee', array(':Created_by' => 'USER_ID'));
    Utils_RecordBrowserCommon::add_access('utils_attachment', 'delete', array('ACCESS:employee', 'ACCESS:manager'));
    Utils_RecordBrowserCommon::add_access('utils_attachment', 'add', 'ACCESS:employee');
    Utils_RecordBrowserCommon::add_access('utils_attachment', 'edit', 'ACCESS:employee', array('(permission' => 0, '|employees' => 'USER', '|customer' => 'USER'), array('edited_on'));
    Utils_RecordBrowserCommon::register_processing_callback('utils_attachment', array('Utils_AttachmentCommon', 'submit_attachment'));
    Utils_RecordBrowserCommon::set_tpl('utils_attachment', Base_ThemeCommon::get_template_filename(Utils_Attachment::module_name(), 'View_entry'));
    $ret = DB::CreateTable('utils_attachment_local', '
			local C(255) NOTNULL,
			attachment I4 NOTNULL,
			func C(255),
			args C(255)', array('constraints' => ', FOREIGN KEY (attachment) REFERENCES utils_attachment_data_1(ID)'));
    if (!$ret) {
        print 'Unable to create table utils_attachment_link.<br>';
        return false;
    }
    DB::CreateIndex('utils_attachment_local__idx', 'utils_attachment_local', 'local');
    $rs_checkpoint->done();
}
//parse old notes
开发者ID:cretzu89,项目名称:EPESI,代码行数:30,代码来源:20140205_rb_rewrite.php


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