<commit_before><?php
/**
 * Created by PhpStorm.
 * User: davis
 * Date: 06/11/13
 * Time: 15:41
 */

class ShippingMatrixConfig extends DataExtension{
	private static $db = array(
		'DomesticCountry' => 'Varchar',
		'LocalCity' => 'Varchar(100)',
		'ShippingMargin' => 'Percentage',
		'ShippingMessage' => 'HTMLText',
		'AllowPickup' => 'Boolean',
		'FreeShippingQuantity' => 'Int',
		'InternationalShippingWarningMessage' => 'HTMLText',

		//shipping option text
		'FreeShippingText' => 'Varchar(200)',
		'DomesticShippingText' => 'Varchar(200)',
		'InternationalShippingText' => 'Varchar(200)',
		'PickupText' => 'Varchar(200)',
	);

	public function updateCMSFields(FieldList $fields) {
		$countries = SiteConfig::current_site_config()->getCountriesList();
		$fields->addFieldToTab('Root.Shop.ShopTabs.Main',
			DropdownField::create("DomesticCountry",_t('Address.COUNTRY','Dometstic Country'), $countries, 'NZ')
		);
		$shippingTab = new TabSet("ShippingTabs",
			$main = new Tab("Main",
				TextField::create('FreeShippingQuantity', 'Free Shipping Quantity'),
				TextField::create('FreeShippingText', 'Free Shipping Text'),
				TextField::create('DomesticShippingText', 'Domestic Shipping Text'),
				TextField::create('InternationalShippingText', 'International Shipping Text'),
				TextField::create('PickupText', 'Pickup Text'),
				CheckboxField::create('AllowPickup', 'Allow Pickup'),
				HtmlEditorField::create('ShippingMessage', 'Shipping Message')->setRows(20),
				HtmlEditorField::create('InternationalShippingWarningMessage', 'International Shipping Warning Message')->setRows(20)
			),
			$internationalCarriers = new Tab("InternationalCarriers",
				GridField::create(
					'InternationalShippingCarrier',
					'International Shipping Carrier',
					InternationalShippingCarrier::get(),
					GridFieldConfig_RecordEditor::create()->addComponent(GridFieldOrderableRows::create('Sort'))
				)
			),
			$domesticCarriers = new Tab("DomesticCarriers",
				GridField::create(
					'DomesticShippingCarrier',
					'Domestic Shipping Carrier',
					DomesticShippingCarrier::get(),
					GridFieldConfig_RecordEditor::create()->addComponent(GridFieldOrderableRows::create('Sort'))
				)
			),<commit_msg>GV-614 International shipping text is now a editor field where they can add a link<commit_after><?php
/**
 * Created by PhpStorm.
 * User: davis
 * Date: 06/11/13
 * Time: 15:41
 */

class ShippingMatrixConfig extends DataExtension{
	private static $db = array(
		'DomesticCountry' => 'Varchar',
		'LocalCity' => 'Varchar(100)',
		'ShippingMargin' => 'Percentage',
		'ShippingMessage' => 'HTMLText',
		'AllowPickup' => 'Boolean',
		'FreeShippingQuantity' => 'Int',
		'InternationalShippingWarningMessage' => 'HTMLText',

		//shipping option text
		'FreeShippingText' => 'Varchar(200)',
		'DomesticShippingText' => 'Varchar(200)',
		'InternationalShippingText' => 'HTMLText',
		'PickupText' => 'Varchar(200)',
	);

	public function updateCMSFields(FieldList $fields) {
		$countries = SiteConfig::current_site_config()->getCountriesList();
		$fields->addFieldToTab('Root.Shop.ShopTabs.Main',
			DropdownField::create("DomesticCountry",_t('Address.COUNTRY','Domestic Country'), $countries, 'NZ')
		);
		$shippingTab = new TabSet("ShippingTabs",
			$main = new Tab("Main",
				TextField::create('FreeShippingQuantity', 'Free Shipping Quantity'),
				TextField::create('FreeShippingText', 'Free Shipping Text'),
				TextField::create('DomesticShippingText', 'Domestic Shipping Text'),
				TextField::create('PickupText', 'Pickup Text'),
                                HtmlEditorField::create('InternationalShippingText', 'International Shipping Text'),
                                CheckboxField::create('AllowPickup', 'Allow Pickup'),
				HtmlEditorField::create('ShippingMessage', 'Shipping Message')->setRows(20),
				HtmlEditorField::create('InternationalShippingWarningMessage', 'International Shipping Warning Message')->setRows(20)
			),
			$internationalCarriers = new Tab("InternationalCarriers",
				GridField::create(
					'InternationalShippingCarrier',
					'International Shipping Carrier',
					InternationalShippingCarrier::get(),
					GridFieldConfig_RecordEditor::create()->addComponent(GridFieldOrderableRows::create('Sort'))
				)
			),
			$domesticCarriers = new Tab("DomesticCarriers",
				GridField::create(
					'DomesticShippingCarrier',
					'Domestic Shipping Carrier',
					DomesticShippingCarrier::get(),
					GridFieldConfig_RecordEditor::create()->addComponent(GridFieldOrderableRows::create('Sort'))
				)
			),
{'fraction_non_alphanumeric': 0.1480912681000439, 'fraction_numerical': 0.012724879333040808, 'mean_word_length': 5.607246376811594, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 37, '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': '6619359', 'n_tokens_mistral': 1614, 'n_tokens_neox': 1324, 'n_words': 234}