<commit_before><?php
defined("_VALID_ACCESS") || die();
 
class Custom_RMAInstall extends ModuleInstall {

	public function install() {
		
	/*	Base_ThemeCommon::install_default_theme($this->get_type());  
		$fields = new Custom_RMA_Recordset();
		$success = $fields->install();
		$fields->add_default_access();
		$fields->set_caption(_M('RMA'));
		return true;
		
		JJ's Notes:  This is for RBO which I feel is is poorly documented compared to the RB Utility (and of course, I studied RB more than RBO)
					This is how it's done in RB:  
	*/
		Utils_CommonDataCommon::new_array('custom/rma/package_status', array( '0'=>_M('Complete'), '1'=>_M('Incomplete'), '2'=>_M('No Package'), '3'=>_M('Damaged')), true, true);  //This creates the common data for the Package Status Field
		Utils_CommonDataCommon::new_array('custom/rma/status', array( '0'=>_M('Received Request'), '1'=>_M('Incomplete'), '2'=>_M('RMA Accepted'), '3'=>_M('Item Received'), '4'=>_M('Item sent to Manufacturer'), '5'=>_M('Item Repaired'), '6'=>_M('Item Returned') ), true, true); //This created the Common Data for the Status Field
		Utils_CommonDataCommon::new_array('custom/rma/Priority', array( '0'=>_M('Low'), '1'=>_M('Medium'), '2'=>_M('High')), true, true); //This created the Common Data for the Priority Field
		//JJ Now that the Common_Data DB is complete, lets go and create those fields.
		
		Utils_RecordBrowserCommon::install_new_recordset('custom_rma', array(
				array(	
						'name' => 'RMA ID',				//Name of the Field
						'type' => 'calculated',			//Type of Field
						'visible' => true,			//shows on the Table View
						'filter' => false,			//Can you Filter it?
						'param' => Utils_RecordBrowserCommon::actual_db_type('text', '20')	//if Calculated, this creates a DB field
	
				 ),
				array(	
						'name' => 'Customer',				//Name of the Field
						'type' => 'select',			//Type of Field
						'visible' => true,			//shows on the Table View
						'filter' => false,			//Can you Filter it?
						'param'=>"contact::Customer;",
						'required' => true
				 ),
				array(	
						'name' => 'Manufacturer',				//Name of the Field
						'type' => 'select',			//Type of Field
						'visible' => true,			//shows on the Table View
						'filter' => false,			//Can you Filter it?
						'param' => "company::Company Name;",	//if Select Field, What do we Select?
						'required' => true
				 ),
				 array(	
						'name' => 'Device SKU',				//Name of the Field
						'type' => 'text',			//Type of Field
						'visible' => true,			//shows on the Table View
						'filter' => true,			//Can you Filter it?
						'param' => 64,	//ifText Field, how long?
						'required' => true
				 ),
				 array(	
						'name' => 'Device Model',				//Name of the Field
						'type' => 'text',			//Type of Field
						'visible' => true,			//shows on the Table View
						'filter' => true,			//Can you Filter it?
						'param' => 64,	//ifText Field, how long?
						'required' => true
				 ),
				 array(	
						'name' => 'Device Serial Number',				//Name of the Field
						'type' => 'text',			//Type of Field
						'visible' => true,			//shows on the Table View
						'filter' => false,			//Can you Filter it?
						'param' => 64,	//ifText Field, how long?
						'required' => true
				 ),
				 array(	
						'name' => 'Request Date',				//Name of the Field
						'type' => 'date',			//Type of Field
						'visible' => true,			//shows on the Table View
						'filter' => false,			//Can you Filter it?
						'required' => true
				 ),
				 array(	
						'name' => 'Package Status',				//Name of the Field
						'type' => 'commondata',			//Type of Field
						'visible' => true,			//shows on the Table View
						'filter' => false,			//Can you Filter it?
						'param' => array('order_by_key'=>false, 'custom/rma/package_status'),  //Order by Name and which common data to access?
						'required ' => true
				 ),
				 array(	
						'name' => 'Package Description',				//Name of the Field
						'type' => 'text',			//Type of Field
						'visible' => false,			//shows on the Table View
						'filter' => false,			//Can you Filter it?
						'param' => 64
				 ),
				 array(	
						'name' => 'Fault Declared from Customer',				//Name of the Field
						'type' => 'long text',			//Type of Field
						'visible' => false,			//shows on the Table View
						'filter' => false			//Can you Filter it?
	
				 ),
				 array(	
						'name' => 'Fault Revealed',				//Name of the Field
						'type' => 'long text',			//Type of Field
						'visible' => false,			//shows on the Table View
						'filter' => false			//Can you Filter it?
	
				 ),
				 array(	
						'name' => 'Status',				//Name of the Field
						'type' => 'commondata',			//Type of Field
						'visible' => true,			//shows on the Table View
						'filter' => false,			//Can you Filter it?
						'param' => array('order_by_key'=>true, 'custom/rma/status'),
						'required' => true
				 ),
				 array(	
						'name' => 'Priority',				//Name of the Field
						'type' => 'commondata',			//Type of Field
						'visible' => true,			//shows on the Table View
						'filter' => true,			//Can you Filter it?
						'param' => array('order_by_key'=>true, 'custom/rma/priority')
						
				 ),
				 array(	
						'name' => 'Limit Date',				//Name of the Field<commit_msg>Update fields<commit_after><?php
defined("_VALID_ACCESS") || die();
 
class Custom_RMAInstall extends ModuleInstall {

	public function install() {
		
	/*	Base_ThemeCommon::install_default_theme($this->get_type());  
		$fields = new Custom_RMA_Recordset();
		$success = $fields->install();
		$fields->add_default_access();
		$fields->set_caption(_M('RMA'));
		return true;
		
		JJ's Notes:  This is for RBO which I feel is is poorly documented compared to the RB Utility (and of course, I studied RB more than RBO)
					This is how it's done in RB:  
	*/
		Utils_CommonDataCommon::new_array('custom/rma/package_status', array( '0'=>_M('Complete'), '1'=>_M('Incomplete'), '2'=>_M('No Package'), '3'=>_M('Damaged')), true, true);  //This creates the common data for the Package Status Field
		Utils_CommonDataCommon::new_array('custom/rma/status', array( '0'=>_M('Received Request'), '1'=>_M('Incomplete'), '2'=>_M('RMA Accepted'), '3'=>_M('Item Received'), '4'=>_M('Item sent to Manufacturer'), '5'=>_M('Item Repaired'), '6'=>_M('Item Returned') ), true, true); //This created the Common Data for the Status Field
		Utils_CommonDataCommon::new_array('custom/rma/Priority', array( '0'=>_M('Low'), '1'=>_M('Medium'), '2'=>_M('High')), true, true); //This created the Common Data for the Priority Field
		//JJ Now that the Common_Data DB is complete, lets go and create those fields.
		
		Utils_RecordBrowserCommon::install_new_recordset('custom_rma', array(
				array(	
						'name' => '<NAME>',				//Name of the Field
						'type' => 'calculated',			//Type of Field
						'visible' => true,			//shows on the Table View
						'filter' => false,			//Can you Filter it?
						'param' => Utils_RecordBrowserCommon::actual_db_type('text', '20')	//if Calculated, this creates a DB field
	
				 ),
				array(	
						'name' => _M('Customer'),				//Name of the Field
						'type' => 'crm_company_contact', //Type of Field
						'visible' => true,			//shows on the Table View
						'filter' => false,			//Can you Filter it?
						'param'=>array('field_type'=>'select'),
						'required' => true
				 ),
				array(	
						'name' => _M('Manufacturer'),				//Name of the Field
						'type' => 'crm_company',			//Type of Field
						'visible' => true,			//shows on the Table View
						'filter' => false,			//Can you Filter it?
						'param' => array('field_type'=>'select'),	//if Select Field, What do we Select?
						'required' => true
				 ),
				 array(	
						'name' => _M('Device SKU'),				//Name of the Field
						'type' => 'text',			//Type of Field
						'visible' => true,			//shows on the Table View
						'filter' => true,			//Can you Filter it?
						'param' => 64,	//ifText Field, how long?
						'required' => true
				 ),
				 array(	
						'name' => _M('Device Model'),				//Name of the Field
						'type' => 'text',			//Type of Field
						'visible' => true,			//shows on the Table View
						'filter' => true,			//Can you Filter it?
						'param' => 64,	//ifText Field, how long?
						'required' => true
				 ),
				 array(	
						'name' => _M('Device Serial Number'),				//Name of the Field
						'type' => 'text',			//Type of Field
						'visible' => true,			//shows on the Table View
						'filter' => false,			//Can you Filter it?
						'param' => 64,	//ifText Field, how long?
						'required' => true
				 ),
				 array(	
						'name' => _M('Request Date'),				//Name of the Field
						'type' => 'date',			//Type of Field
						'visible' => false,			//shows on the Table View
						'filter' => false,			//Can you Filter it?
						'required' => true
				 ),
				 array(	
						'name' => _M('Package Status'),				//Name of the Field
						'type' => 'commondata',			//Type of Field
						'visible' => false,			//shows on the Table View
						'filter' => false,			//Can you Filter it?
						'param' => array('order_by_key'=>false, 'custom/rma/package_status'),  //Order by Name and which common data to access?
						'required ' => true
				 ),
				 array(	
						'name' => _M('Package Description'),				//Name of the Field
						'type' => 'text',			//Type of Field
						'visible' => false,			//shows on the Table View
						'filter' => false,			//Can you Filter it?
						'param' => 64
				 ),
				 array(	
						'name' => _M('Fault Declared from Customer'),				//Name of the Field
						'type' => 'long text',			//Type of Field
						'visible' => false,			//shows on the Table View
						'filter' => false			//Can you Filter it?
	
				 ),
				 array(	
						'name' => _M('Fault Revealed'),				//Name of the Field
						'type' => 'long text',			//Type of Field
						'visible' => false,			//shows on the Table View
						'filter' => false			//Can you Filter it?
	
				 ),
				 array(	
						'name' => _M('Status'),				//Name of the Field
						'type' => 'commondata',			//Type of Field
						'visible' => true,			//shows on the Table View
						'filter' => false,			//Can you Filter it?
						'param' => array('order_by_key'=>true, 'custom/rma/status'),
						'required' => true
				 ),
				 array(	
						'name' => _M('Priority'),				//Name of the Field
						'type' => 'commondata',			//Type of Field
						'visible' => true,			//shows on the Table View
						'filter' => true,			//Can you Filter it?
						'param' => array('order_by_key'=>true, 'custom/rma/priority')
						
				 ),
				 array(	
						'name' => _M('Limit Date'),				//Name of the Field
{'fraction_non_alphanumeric': 0.1685139958669923, 'fraction_numerical': 0.0045087356753710315, 'mean_word_length': 2.447862694300518, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 190, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4407115', 'n_tokens_mistral': 4570, 'n_tokens_neox': 3415, 'n_words': 1108}